586,655 active members*
3,313 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2009
    Posts
    25

    New here, question on Joypad for jogging

    Hi everyone, as I near completion on my first CNC machine (building a 25x25 Solsylva) I have decided to spend a bit of time getting the software configured. I am trying to add a Logitech F310 gamepad to the system for manual jogging and have run into 2 problems I was hoping to get some assistance with.

    1) Without posting TONS of config info, hopefully there is enough relevant here to get some help, I have (as root) added the file:
    /etc/udev/rules.d/emc_joy.rules file. It contains one line:
    SUBSYSTEM="input", mode="0660", group="plugdev"

    Here is the HAL section of Solsylva.ini (my main ini)
    [HAL]
    HALUI = halui
    HALFILE = Solsylva.hal
    HALFILE = custom.hal
    HALFILE = joypad.hal
    HALUI = halui
    POSTGUI_HALFILE = custom_postgui.hal

    Here is the contents of my joypad.hal file:
    loadusr -W hal_input -KRAL X-Box


    Here is the (relevant) section of:
    more /proc/bus/input/devices:

    I: Bus=0003 Vendor=046d Product=c21d Version=4013
    N: Name="Generic X-Box pad"
    P: Phys=usb-0000:00:1f.4-1/input0
    S: Sysfs=/devices/pci0000:00/0000:00:1f.4/usb2/2-1/2-1:1.0/input/input6
    U: Uniq=
    H: Handlers=event6 js0
    B: EV=20000b
    B: KEY=78db0000 400000 0 0 0 0 0 0 0 0
    B: ABS=3003f
    B: FF=1 7030000 0 0

    Now, if I run:

    halrun
    loadusr -W hal_input -KRAL X-Box
    showpin

    I get the entire listing of pins.

    I can now start EMC2 and AXIS, go to machine, and "Show hal configuration"
    I can click the "watch" tab, select pins, and hit buttons on the controller.
    I see the little circles change colors with each button press and I see the values change with joystick movement.

    Now, If I reboot the box, nothing works. I get:
    halcmd: loadusr -W hal_input -KRAL X-Box
    No input devices could be opened. This usually indicates a misconfigured
    system. Please read the section 'PERMISSIONS AND UDEV' in the hal_input
    manpage
    :1: hal_input exited without becoming ready

    (btw- I read the manpage, everythign it suggests is already done!!)

    I have tried rebooting with joypad plugged in, and unplugged, plugging it in after booting. The proc/bus/input/devices output still shows the device exactly correct, but hal can't load it.

    If I wipe the entire config out and start again, it works fine ..... until reboot...

    Any suggestions for me?

    and
    2) I also have this in my custom_postgui.hal file:

    loadrt or2 count=2
    loadrt mux4 count=1

    addf or2.0 servo-thread
    addf or2.1 servo-thread
    addf mux4.0 servo-thread

    setp mux4.0.in0 0
    setp mux4.0.in1 25
    setp mux4.0.in2 100
    setp mux4.0.in3 200


    net remote-speed-slow or2.0.in0 input.0.btn-x
    net remote-speed-medium or2.1.in0 input.0.btn-y
    net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-b

    net joy-speed-1 mux4.0.sel0 <= or2.0.out
    net joy-speed-2 mux4.0.sel1 <= or2.1.out
    net joy-speed-final halui.jog-speed <= mux4.0.out


    net joy-x-jog halui.jog.0.analog <= input.0.abs-x-position
    net joy-y-jog halui.jog.1.analog <= input.0.abs-y-position
    net joy-z-jog halui.jog.2.analog <= input.0.abs-ry-position


    EMC2 and AXIS both load just fine (indicating no syntax errors I assume, as when i had syntax errors, it wouldn't load!!)

    but the joypad doesn't do anything


    Any help from the experts here would be SO appreciated!! I have been banging the head against the wall for a few days!!

    Thanks very much. -James

  2. #2
    Join Date
    Nov 2005
    Posts
    496
    run EMC from a terminal, after the error message type 'dmesg'
    hopefully somewhere near the end, it will give a little more info/

    Have you confirmed that the file does have root permission?
    right click the file and check the properties.

    Chris M

  3. #3
    Join Date
    May 2009
    Posts
    25
    well, of course, this would happen... I went back to check the dmesg and I can't duplicate problem #1

    I have shutdown and restarted several times now and it works every time!


    so until I can replicate, I'll defer problem 1.

    I still can't get any axis to move (problem #2 in my original post)
    Anyone have any suggestions on that one? Is my syntax proper?
    Am I doing it right? (holding down the x, y, or b button while moving the joystick)?

    THanks for the dmesg suggestion, I'll keep an eye on that for more details if see the first problem crop up again!
    -James

  4. #4
    Join Date
    Nov 2005
    Posts
    496
    I would load EMC and then load a halmeter and starting from the joystick button pin check that the pin / signals actually changes when the button is pressed.
    same for the analog signals, same for the muxed jog speed signals.
    eventually you will find what is not getting through then we can work on that.

  5. #5
    Join Date
    May 2009
    Posts
    25
    Thanks Chester!! That was all I needed to find my (stupid) error! All the signals were working in the halmeter except the jogs, I went back and found that the custom_postgui.hal file was empty.... There was a backup file that had everything in it, but the main file was empty. I don't know what I did to screw that up, but as soon as I put the data back in the ACTUAL postgui, all worked just right!

    Sorry to be such a dummy, but your help was everything I needed to help myself!! Thanks again! Have a great weekend!
    This forum is GREAT!

    -James

Similar Threads

  1. Joypad problems. HELP
    By flash319 in forum LinuxCNC (formerly EMC2)
    Replies: 5
    Last Post: 09-09-2010, 05:28 PM
  2. Controlling pan/tilt with joypad control
    By f-x in forum LinuxCNC (formerly EMC2)
    Replies: 0
    Last Post: 01-19-2010, 06:02 PM
  3. Jogging question
    By br1 in forum Mach Mill
    Replies: 7
    Last Post: 02-25-2009, 03:07 AM
  4. HELP to Setup - Mesa 5I20 + Joypad.hal -
    By TZak in forum LinuxCNC (formerly EMC2)
    Replies: 0
    Last Post: 02-02-2008, 11:43 PM
  5. Latest BDI with Joypad?
    By benedict in forum LinuxCNC (formerly EMC2)
    Replies: 4
    Last Post: 11-06-2007, 06:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •