587,597 active members*
4,149 visitors online*
Register for free
Login
Results 1 to 19 of 19
  1. #1
    Join Date
    Mar 2008
    Posts
    267

    Adding a pendant to EMC2

    Despite most clear and uncomplicated instructions in EMC wiki on adding a simple pendant using halui and hal_input by Big John, I am stuck.

    The joypad is recognised as per point one and identified as per point two of the article.

    And thats as far as I get.

    I am told that Logitech ( name I had given it) is not recognised also that sum2.0 is not recognised.

    I had tried identifying the activity on pins as per point four of the article but have hot been able to identify anything that even vaguely looks like the expected "input.0.btn-trigger" .

    Hoping its only a bit of low level ignorance on my behalf I look forward to any advice on how to get it going.


    Zig

  2. #2
    Join Date
    Feb 2007
    Posts
    514
    I think there is a line missing from the wiki article. Let me check it when I get home.

    What did the N: Name= line report from step 2?

    John

  3. #3
    Join Date
    Mar 2008
    Posts
    267
    John,

    Thanks for the prompt response.

    I looked at the photo of the joypad You had used and went about locating the same unit with the view to minimising any potential problems( you know monkey see monkey do kind of logic).

    Anyway here is the information on joypad.



    I: Bus=0003 Vendor=046d Product=c216 Version=0110
    N: Name="Logitech Logitech Dual Action"
    P: Phys=usb-0000:00:13.0-2/input0
    S: Sysfs=/devices/pci0000:00/0000:00:13.0/usb1/1-2/1-2:1.0/input/input2
    U: Uniq=
    H: Handlers=event2 js0
    B: EV=1b
    B: KEY=fff 0 0 0 0 0 0 0 0 0
    B: ABS=30027
    B: MSC=10

    I had a look at the work which inspired You and came to the conclusion that:

    I dont understand much...

    Something was missing since the original work contained a line

    loadusr hal_joystick -d /dev/input/js0 -p joypad


    I have tried to locate additional info on hal components ( listing of components and how to use the component ) but so far no joy.. i guess iwill have to spend a bit more time searching for info


    Anyway .. I look forward to Your advice

  4. #4
    Join Date
    Feb 2007
    Posts
    514
    I didn't get home till late and forgot to check the wiki. I just sent myself an email to remind me to to that this evening.

    The joystick is a different component. I used halui and didn't need the joystick.

    I don't see where I loaded the mux4 or the sum2's that I used and that will give you an error for sure...


    John

  5. #5
    Join Date
    Mar 2008
    Posts
    267
    John,

    Yes Sum2 comes up in the error report.

    I did find the description of components and hope to get to understand the black boxes somewhat better although the language used in the definitions is a bit too specific for a first time user.

    May be small examples of applications might be instructional in their use.

  6. #6
    Join Date
    Feb 2007
    Posts
    514
    Zig, I got the corrections made to the wiki site. I left out a few lines when I was copying my .hal file. Sorry for the omission.

    Let me know how you make out.

    John

  7. #7
    Join Date
    Feb 2007
    Posts
    514
    I had quite a time with the descriptions at first and have taken on the job of working on the manuals. I hope to improve them. I also learn better by small examples

    John


    Quote Originally Posted by Zig View Post
    John,

    Yes Sum2 comes up in the error report.

    I did find the description of components and hope to get to understand the black boxes somewhat better although the language used in the definitions is a bit too specific for a first time user.

    May be small examples of applications might be instructional in their use.

  8. #8
    Join Date
    Mar 2008
    Posts
    267
    John,

    This response started with "...Still no joy..." however...

    I had a closer look at hal_input description and it struck me that perhaps i had to modify the permissions to access the device.

    So i prepared a one line file as per the description


    SUBSYSTEM=="input", mode="0660", group="plugdev"


    named the file 51-plugdev.rules and saved it in /etc/udev/rules.d

    Joy of joy.. the pins became visible and availble in the hal configuration display.


    Pressing the buttons indicates the joypad is connected as follows

    BUTTON
    1 input.0.btn-trigger
    2 -thumb
    3 -thumb2
    4 -top
    5 -top2
    6 -pinkie
    7 -base
    8 -base2
    9 -base3
    10 -base4
    left stick vertical -Y axis minimum value away from operator's body
    left stick horisontal -X axis minimum value to the left
    right stick horisontal -Z axis minimum to the left

    So far so good. At east the joypad is recognised and I/O identified.

    Thats where the joy ceases.

    Using the stepper configuration with the machine running ( simple steppr config supplied with EMC2 outputs step & direction without end of travel switches or any other interlocks which makes for a handy test platform) i could get no physical interaction between the joy stick and position of XYZ axies .


    All in all progress to be rounded off with success.

  9. #9
    Join Date
    Feb 2007
    Posts
    514
    A couple of things.

    You must be in the manual control window not the MDI window for the jog to work.

    You must press and hold the number button then move the joy stick.

    Thanks for sharing the info, I added it to the wiki page.

    John

  10. #10
    Join Date
    Feb 2007
    Posts
    514
    CanSir has found one more thing missing so check the wiki page again...

    John

  11. #11
    Join Date
    Mar 2008
    Posts
    267
    Sigh....

    Still no Joy.

    I see how it might work...I appreciate the OR blocks generating the seleclines for the one of four multiplexor... I appreciate the analogue signals for the three axis providing variable jog speed signals

    But the computer still says NO...


    Again from the top...

    Ubuntu 8.04 EMC2.2.5 running Axis .

    For ease of trying out the joypad I am using supplied stepper configuration file in metric mode.

    Here are changes to various files as i understand them.



    stepper_mm.ini



    ################################################## #############################
    # Hardware Abstraction Layer section
    ################################################## #############################
    [HAL]

    HALUI = halui

    # The run script first uses halcmd to execute any HALFILE
    # files, and then to execute any individual HALCMD commands.
    #

    # list of hal config files to run through halcmd
    #+ files are executed in the order in which they appear
    HALFILE = core_stepper.hal
    #HALFILE = xylotex_pinout.hal
    HALFILE = standard_pinout.hal
    POSTGUI_HALFILE = custom_postgui.hal

    #- list of halcmd commands to execute
    # commands are executed in the order in which they appear
    #HALCMD = save neta




    core_stepper.hal


    #appended to the end of the file

    loadusr hal_input -W -KRAL Dual



    custom_postgui.hal



    loadrt or2 count=2
    loadrt mux4 count=1

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

    # set the jog speed for the joypad again use numbers that make sense for your machine
    setp mux4.0.in0 0 # this one must be 0 to prevent motion unless a button is pressed
    setp mux4.0.in1 25
    setp mux4.0.in2 100
    setp mux4.0.in3 200

    # the following does the magic of setting the jog speeds
    net remote-speed-slow or2.0.in0 <= input.0.btn-trigger # <= sign of desperation to try out something that might cause it to spring into life
    net remote-speed-medium or2.1.in0 <= input.0.btn-thumb
    net remote-speed-fast or2.0.in1 or2.1.in1 <= input.0.btn-thumb2

    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-z-position





    Thus endeth the changes.

    And still success evades me. Obviously I have done something which prevents the joypad from working.

    Anybody.. feel free to poke me in the eye, call me names... but please provide the solution to this issue.

  12. #12
    Join Date
    Mar 2008
    Posts
    267
    On a related note


    Going through EMC documentation oh halui ( downloaded in pdf format from the linuxcnc website under all documentation subheadingi observed that under joggin pins definitions the halui jog speed pin was defined as

    halui.jog.speed...


    EUREKA I jumped for joy ( happyness not pad); quickly changed the line containing reference to halui.jog-speed to the newly discovered format only to end up with an error message "... pin halui.jog.speed does not exist..."

    Not quite sure where to report the typo in documentation.

  13. #13
    Join Date
    Jul 2003
    Posts
    1759

  14. #14
    Join Date
    Feb 2007
    Posts
    514
    Quote Originally Posted by Zig View Post
    On a related note


    Going through EMC documentation oh halui ( downloaded in pdf format from the linuxcnc website under all documentation subheadingi observed that under joggin pins definitions the halui jog speed pin was defined as

    halui.jog.speed...


    EUREKA I jumped for joy ( happyness not pad); quickly changed the line containing reference to halui.jog-speed to the newly discovered format only to end up with an error message "... pin halui.jog.speed does not exist..."

    Not quite sure where to report the typo in documentation.
    Zig,

    You just did... I do a lot of work on the docs... now

    John

  15. #15
    Join Date
    Feb 2007
    Posts
    514
    I don't understand what you mean by the "computer says no". Please tell me what you do and what you expect and what you get.

    Also, in Axis you can view the hal pins while you press the buttons and move the sticks. Have you done this?

    Just when we thought we had it all figured out...

    John

  16. #16
    Join Date
    Mar 2008
    Posts
    267
    Sam,

    Thanks, yes I had had a look at the document. Somehow John's approach seemed simpler and more attractive for the first time foray into the world of HAL.


    John,

    Ok a small explanation; "...computer says no..." is a line form a british comedy series little britain in which a trevel agent uses the expression to regulate the relationship with the travelling public ( clientele) by speaking through thethird person , the booking computer.

    Never mind, its just british humour.

    Back to joypad.


    upon starting AXIS I switch machine on and enable it to run

    I check that it can and does jog via arrow and page up/down keys by observing the tool move on screen and xyz coordinate redaout change with movement.

    I then try pressing buttons 1, 2, or 3 and apply input via joysticks.

    Yes I had discovered that I can observe the state of joypad pins and other nets within the hal script.

    MUX output changes value as the three buttons are pressed.

    The three analogue values change as the joysticks are excersised.

    I also note that AXIS seems to have enable jog flags for the X,Y and Z axes.

    EDIT: But there is no jogging taking place --- computer still says NO.

    I just wonder whether there needs to be some kind of jog axis enable flag to enable the actual jogging to take place.

    QUESTION:

    1) where would I find the actual signal that is supposed to cause jogging to happen ( whether it is a float or a bit value )?

    and

    2) would i be able to manually input data through the monitoring screen ( ie execute a hal command) to make it jog the machine a certain distance?


    John could You please post your functioning set up that is mods to .ini, mods to main .hal and contents of postgui.hal so that i may compare and analyse what i have done as opposed to a working set up.

  17. #17
    Join Date
    Mar 2008
    Posts
    267
    John,

    Its working... and I'll be buttered on both sides if I know why


    EDITED 10 minutes later.

    I wonder whether the fact that i had cut and pasted hal content had anything to do with the fact that the script misbehaved since it started to work correctly after i had done some editing on <= symbols. The hal file is back to as per Your format and things are working.

    So.. the question is.. has cut/paste from webpage to a note pad file to postgui.hal file imported nonprintable characters not normally found in a gedit generated document which caused things to malfunction?


    Edited 3 minutes after last editing...

    POST SCRIPTUM... John Thank You

  18. #18
    Join Date
    Feb 2007
    Posts
    514
    Quote Originally Posted by Zig View Post
    John,

    Ok a small explanation; "...computer says no..." is a line form a british comedy series little britain in which a trevel agent uses the expression to regulate the relationship with the travelling public ( clientele) by speaking through thethird person , the booking computer.

    Never mind, its just british humour.
    The only british humor I have seen is Faulty Towers... I used to love watching that.

    Quote Originally Posted by Zig View Post
    Back to joypad.


    upon starting AXIS I switch machine on and enable it to run

    I check that it can and does jog via arrow and page up/down keys by observing the tool move on screen and xyz coordinate redaout change with movement.

    I then try pressing buttons 1, 2, or 3 and apply input via joysticks.

    Yes I had discovered that I can observe the state of joypad pins and other nets within the hal script.

    MUX output changes value as the three buttons are pressed.

    The three analogue values change as the joysticks are excersised.

    I also note that AXIS seems to have enable jog flags for the X,Y and Z axes.

    EDIT: But there is no jogging taking place --- computer still says NO.

    I just wonder whether there needs to be some kind of jog axis enable flag to enable the actual jogging to take place.

    QUESTION:

    1) where would I find the actual signal that is supposed to cause jogging to happen ( whether it is a float or a bit value )?
    I use the HAL interface from the Machine Menu. I forget the exact name... Anyhow you can pick what you want to watch in the watch window and as you move things see the results...



    Quote Originally Posted by Zig View Post
    2) would i be able to manually input data through the monitoring screen ( ie execute a hal command) to make it jog the machine a certain distance?
    In the same HAL interface you can put in HAL commands and test them.

    Quote Originally Posted by Zig View Post
    John could You please post your functioning set up that is mods to .ini, mods to main .hal and contents of postgui.hal so that i may compare and analyse what i have done as opposed to a working set up.
    John

  19. #19
    Join Date
    Feb 2007
    Posts
    514
    Quote Originally Posted by Zig View Post
    John,

    Its working... and I'll be buttered on both sides if I know why


    EDITED 10 minutes later.

    I wonder whether the fact that i had cut and pasted hal content had anything to do with the fact that the script misbehaved since it started to work correctly after i had done some editing on <= symbols. The hal file is back to as per Your format and things are working.

    So.. the question is.. has cut/paste from webpage to a note pad file to postgui.hal file imported nonprintable characters not normally found in a gedit generated document which caused things to malfunction?


    Edited 3 minutes after last editing...

    POST SCRIPTUM... John Thank You
    I'm glad we got all the bugs worked out, now I can include the example in the manual.

    John

Similar Threads

  1. Replies: 0
    Last Post: 05-28-2008, 04:37 PM
  2. Adding a fan to the X3
    By Antonyong in forum Benchtop Machines
    Replies: 2
    Last Post: 04-26-2007, 05:19 AM
  3. Anyone using this pendant?
    By trevorhinze in forum Mach Mill
    Replies: 3
    Last Post: 09-10-2005, 01:45 PM
  4. Pendant?
    By cncadmin in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 2
    Last Post: 01-10-2005, 04:32 PM
  5. Pendant?
    By cncadmin in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 0
    Last Post: 05-07-2004, 03:10 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
  •