586,005 active members*
4,946 visitors online*
Register for free
Login
Results 1 to 14 of 14
  1. #1
    AMTB Guest

    EMC + Pendant

    How to install pendant to EMC2 machine?
    Machine based on EMC working http://www.conceptmachinery.com/
    it be interesting to install pendant to it

  2. #2
    Join Date
    Dec 2005
    Posts
    594
    What kind of pendant, and what kind of interface? Joystick, MPG? USB, parallel port? How many pins required to interface the functions of the pendant to the controller?

    Mark

  3. #3
    AMTB Guest

    Pendant

    I am using MPG type pendant. My machine based on EMC2 software and it is working as you can see on web AMTB
    base information here EMC Documentation Wiki: EmcKnowledgeBase
    and here
    EMC Documentation Wiki: Hooking Up A MPG Pendant
    also here
    Jogging EMC2 | anderswallin.net

    i do not know very good coding so i can not install my mpg pendant to my emc2 machine.
    i couldn't get help from EMC2 list that i can use so , pendant is not joint to my machine
    Thanks
    Aram

  4. #4
    Join Date
    Dec 2005
    Posts
    594
    Okay, so it's an MPG. is it a home-made MPG, or one commercially available? I've got both an MPG pendant and a joypad hooked up to my machine (likewise running EMC2). I bought my MPG and adapter from Keling the MPG3 and C22 adapter:

    Services - look down towards the bottom of the page.

    I didn't need to do any coding to make the MPG work, other than enabling the second parallel port and editing the ini file so that it recognized the custom.hal file. I used the code from this site (slightly edited because I only have a two axis machine, X and Z) and cut and pasted into the custom.hal file:

    MPG2 Jog Pendant | chembal.com

    Mark

  5. #5
    AMTB Guest
    hi
    I bought my MPG from PC for CNC Autol Dunkan. It is similar business to Kelling.
    MPG home made or manufactured is same. MPG is a box where JOG wheel with A-A B-B and +5 and ground. Also switches XYZ ans increment switch.
    I am using EMC2 machine and i think to plug in MPG to EMC2 machine need code.
    Do you use EMC2 software to run your machine?
    LinuxCNC.org - Home ???

  6. #6
    Join Date
    Dec 2005
    Posts
    594
    Aram,

    Did you read any of what I wrote or click on the links I gave? It pretty much spells out everything you need to do to connect the pendant to the PC and it gives you all the code you need to make the pendant work with EMC2. Not sure what other help I can give you. And I even said in the reply that I use EMC2.

    Mark

  7. #7
    AMTB Guest
    Hi Mark.
    Thanks for helping me.

    I have pendant MPG-3 and I think that you using MPG-2 pendant. My pendant MPG-3 also came with C22 PENDANT interface card. My C22 looks different that on photo that you referring, my C22 card has cord with USB connector on the end and no terminals with screw. I think those deferens should make any problem.
    When I bought my pendant, that is MPG4 , I found that some wires aren’t connected to switch – XYZ - or Increment selectors -0.0001- 0.001-0.01.
    So I rewired my pendant. Actually rewiring of pendant did John Elson on CNC work shop Cardinal Engineering in year 2007.

    Here these a pins from my pendant

    1. VCC
    2. ---------
    3. A (jog wheel)
    4. B (jog wheel)
    5. x1 (increment)
    6. x10 (increment)
    7. x100 (increment)
    8. Z axis
    9. Y axis
    10. X axis
    11. 4(Aaxis)
    12. 5(Baxis)
    13. -------
    14. COM (ground) for switches and + for OV on JOG wheel.
    15. Estop
    16. Estop
    17. ---
    18. ---
    19. ----
    20. ----
    21. ----
    22. ----
    23. ---
    24. B -- (jog wheel)
    25. A – (jog wheel)
    //////////////////////////////////////////////////////////////////////////////////////////
    How pins on my pendant will effect code that you using?



    //////////////////////////////////////////////////////////////////////

    # Jog Pendant
    loadrt encoder num_chan=1
    loadrt mux4 count=1
    loadrt mult2 count=1
    loadrt lut5 count=1

    addf encoder.capture-position servo-thread
    addf encoder.update-counters base-thread
    addf mux4.0 servo-thread
    addf mult2.0 servo-thread
    addf lut5.0 servo-thread

    # If your MPG outputs a quadture signal per click set x4 to 1
    # If your MPG puts out 1 pulse per click set x4 to 0
    setp encoder.0.x4-mode 0

    # For velocity mode, set n to 1
    # In velocity mode the axis stops when dial is stopped even if that means
    # the commanded motion is not completed,
    # For position mode (the default), set n to 0
    # In position mode the axis will move exactly jog-scale
    # units for each count, regardless of how long that might take,
    # This must be set for each axis you want to behave other than default
    setp axis.0.jog-vel-mode 0
    setp axis.1.jog-vel-mode 0
    setp axis.2.jog-vel-mode 0
    setp axis.3.jog-vel-mode 0
    setp mux4.0.in0 0.01
    setp mux4.0.in1 0.001
    setp mux4.0.in2 0.0001
    setp mult2.0.in0 100


    net scale1 mux4.0.sel0 <= parport.1.pin-09-in
    net scale2 mux4.0.sel1 <= parport.1.pin-08-in


    net pend-scale axis.0.jog-scale <= mux4.0.out
    net pend-scale axis.1.jog-scale
    net pend-scale axis.2.jog-scale
    net pend-scale mult2.0.in1
    net rot-scale axis.3.jog-scale <= mult2.0.out



    net mpg-a encoder.0.phase-A <= parport.1.pin-02-in
    net mpg-b encoder.0.phase-B <= parport.1.pin-03-in


    net mpg-x axis.0.jog-enable <= parport.1.pin-04-in
    net mpg-y axis.1.jog-enable <= parport.1.pin-05-in
    net mpg-z axis.2.jog-enable <= parport.1.pin-06-in
    net mpg-4 axis.3.jog-enable <= parport.1.pin-07-in



    net pend-counts axis.0.jog-counts <= encoder.0.counts
    net pend-counts axis.1.jog-counts
    net pend-counts axis.2.jog-counts
    net pend-counts axis.3.jog-counts

    # Turn on the jog led if any jog axis is enabled
    setp lut5.0.function 0x116
    net mpg-x lut5.0.in-0
    net mpg-y lut5.0.in-1
    net mpg-z lut5.0.in-2
    net mpg-4 lut5.0.in-3
    setp lut5.0.in-4 0
    net jog-on parport.1.pin-01-out <= lut5.0.out




    ////////////////////////////////////////////////////////////////////////////
    My jog wheel from MPG-3 has A A- B B- and +5 V and ground. I know that some
    MPG-2 comes with jog wheel that only has A B +5 and Ground.
    How your code should change to accommodate extra 2 pins from jog wheel?
    Is it --- quadture signal per click set x4 to 1-----?
    But I need physical 2 more pins to join A- and B-. Am I right?




    When you said -----“other than enabling the second parallel port and editing the ini file so that it recognized the custom.hal file.” -----
    1. How you do enable second parallel port? Did you write some code? How to do that?
    2. What you put into INI file to it can recognize custom.hal file?


    Thank you, for helping me out
    Aram

  8. #8
    Join Date
    Dec 2005
    Posts
    594
    Aram,

    I have the MP3 pendant from keling. I don't have my files here at work and since you've changed the wiring pinouts on the pendant, it'll take me a little more work at figuring out how yours needs to be set up.

    As for enabling the second parport, that's posted in the wiki:

    1. Figure out the address of your parallel port card

    To find the address of your parallel port card in a terminal window

    lspci -v

    You will see something similar to this

    0000:00:10.0 Communication controller: NetMos Technology PCI 1 port parallel adapter (rev 01)
    Subsystem: LSI Logic / Symbios Logic: Unknown device 0010
    Flags: medium devsel, IRQ 11
    I/O ports at a800 [size=8]
    I/O ports at ac00 [size=8]
    I/O ports at b000 [size=8]
    I/O ports at b400 [size=8]
    I/O ports at b800 [size=8]
    I/O ports at bc00 [size=16]

    In my case the address was the first one so I changed my .hal file from

    loadrt hal_parport cfg=0x378

    to

    loadrt hal_parport cfg="0x378 0xa800 in"

    note the double quotes surrounding the addresses.

    and added

    addf parport.1.read base-thread
    addf parport.1.write base-thread

    so the parport will get read and written to.

    Your second parport address may not be the same as listed in the example above, so you need to find out what it is.

    By the way, if you look at the first line of the wiki page, it is for hooking up an MPG3 with the C22 interface.

    As for the entry in your ini file so it recognizes the custom.hal file, or whatever you want to call the file, it goes under the [HAL] section:

    [HAL]
    HALFILE = custom.hal


    Mark

  9. #9
    AMTB Guest
    Hi
    Mark
    I did edit code. What do you think about it?
    Do you know where i can get help with code for C22 card?

    I still can not see in your code how you connect increment switch 0.01 0.001 0.0001 ? there should be pin-??-in something similar.

    //////////////////////////////////

    # Jog Pendant
    loadrt encoder num_chan=1
    loadrt mux4 count=1
    loadrt mult2 count=1
    loadrt lut5 count=1

    addf encoder.capture-position servo-thread
    addf encoder.update-counters base-thread
    addf mux4.0 servo-thread
    addf mult2.0 servo-thread
    addf lut5.0 servo-thread

    # If your MPG outputs a quadture signal per click set x4 to 1
    # If your MPG puts out 1 pulse per click set x4 to 0
    setp encoder.0.x4-mode 1

    # For velocity mode, set n to 1
    # In velocity mode the axis stops when dial is stopped even if that means
    # the commanded motion is not completed,
    # For position mode (the default), set n to 0
    # In position mode the axis will move exactly jog-scale
    # units for each count, regardless of how long that might take,
    # This must be set for each axis you want to behave other than default
    setp axis.0.jog-vel-mode 0
    setp axis.1.jog-vel-mode 0
    setp axis.2.jog-vel-mode 0
    setp axis.3.jog-vel-mode 0
    setp mux4.0.in0 0.01
    setp mux4.0.in1 0.001
    setp mux4.0.in2 0.0001
    setp mult2.0.in0 100


    net scale1 mux4.0.sel0 <= parport.1.pin-11-in
    net scale2 mux4.0.sel1 <= parport.1.pin-12-in


    net pend-scale axis.0.jog-scale <= mux4.0.out
    net pend-scale axis.1.jog-scale
    net pend-scale axis.2.jog-scale
    net pend-scale mult2.0.in1
    net rot-scale axis.3.jog-scale <= mult2.0.out



    net mpg-a encoder.0.phase-A <= parport.1.pin-02-in
    net mpg-b encoder.0.phase-B <= parport.1.pin-03-in

    ?net mpg-a encoder.0.phase-A+ <= parport.1.pin-04-in
    ?net mpg-b encoder.0.phase-B+ <= parport.1.pin-05-in





    net mpg-x axis.0.jog-enable <= parport.1.pin-10-in
    net mpg-y axis.1.jog-enable <= parport.1.pin-09-in
    net mpg-z axis.2.jog-enable <= parport.1.pin-08-in
    net mpg-4 axis.3.jog-enable <= parport.1.pin-11-in



    net pend-counts axis.0.jog-counts <= encoder.0.counts
    net pend-counts axis.1.jog-counts
    net pend-counts axis.2.jog-counts
    net pend-counts axis.3.jog-counts


    I do not need that
    /# Turn on the jog led if any jog axis is enabled
    /setp lut5.0.function 0x116
    /net mpg-x lut5.0.in-0
    /net mpg-y lut5.0.in-1
    /net mpg-z lut5.0.in-2
    /net mpg-4 lut5.0.in-3
    /setp lut5.0.in-4 0
    /net jog-on parport.1.pin-01-out <= lut5.0.out

  10. #10
    AMTB Guest
    hi

    i found this wiring of mpg3 pendant -http://www.markusmechatronics.com/HandradAnschluss.jpg

    diagram shows that increment switch should have 3 pins for 0.01 0.001 and 0.0001
    it described not for emc2 but i think wiring should be same
    Am i right?

    Thanks
    Aram

  11. #11
    Join Date
    Dec 2005
    Posts
    594
    That's the wiring diagram I used when I added my MPG to the machine. Looking at my hal file, the A- and B- are not used and according to the wiring diagrams (both yours and mine) they are only used for line driver output. Here's my custom_postgui_pendant.hal file:

    # Jog Pendant
    loadrt encoder num_chan=1
    loadrt mux4 count=1
    loadrt mult2 count=1
    loadrt lut5 count=1

    addf encoder.capture-position servo-thread
    addf encoder.update-counters base-thread
    addf mux4.0 servo-thread
    addf mult2.0 servo-thread
    addf lut5.0 servo-thread

    # If your MPG outputs a quadture signal per click set x4 to 1
    # If your MPG puts out 1 pulse per click set x4 to 0
    setp encoder.0.x4-mode 0

    # For velocity mode, set n to 1
    # In velocity mode the axis stops when dial is stopped even if that means
    # the commanded motion is not completed,
    # For position mode (the default), set n to 0
    # In position mode the axis will move exactly jog-scale
    # units for each count, regardless of how long that might take,
    # This must be set for each axis you want to behave other than default
    setp axis.0.jog-vel-mode 1
    setp axis.1.jog-vel-mode 1
    setp axis.2.jog-vel-mode 1
    #setp axis.3.jog-vel-mode 0
    setp mux4.0.in0 0.01
    setp mux4.0.in1 0.001
    setp mux4.0.in2 0.0001
    setp mult2.0.in0 100
    net scale1 mux4.0.sel0 <= parport.1.pin-09-in
    net scale2 mux4.0.sel1 <= parport.1.pin-08-in
    net pend-scale axis.0.jog-scale <= mux4.0.out
    net pend-scale axis.1.jog-scale
    net pend-scale axis.2.jog-scale
    net pend-scale mult2.0.in1
    #net rot-scale axis.3.jog-scale <= mult2.0.out
    net mpg-a encoder.0.phase-A <= parport.1.pin-02-in
    net mpg-b encoder.0.phase-B <= parport.1.pin-03-in
    net mpg-x axis.0.jog-enable <= parport.1.pin-04-in
    net mpg-y axis.1.jog-enable <= parport.1.pin-05-in
    net mpg-z axis.2.jog-enable <= parport.1.pin-06-in
    #net mpg-4 axis.3.jog-enable <= parport.1.pin-07-in
    net pend-counts axis.0.jog-counts <= encoder.0.counts
    net pend-counts axis.1.jog-counts
    net pend-counts axis.2.jog-counts
    #net pend-counts axis.3.jog-counts

    # Turn on the jog led if any jog axis is enabled
    setp lut5.0.function 0x116
    net mpg-x lut5.0.in-0
    net mpg-y lut5.0.in-1
    net mpg-z lut5.0.in-2
    net mpg-4 lut5.0.in-3
    setp lut5.0.in-4 0
    net jog-on parport.1.pin-01-out <= lut5.0.out


    Note: I've turned off any pins that go higher than XYZ on my pendant, since I don't use them. And I'm not using the quadrature type signaling, but rather the pulse signaling. Also, some pins may not agree with yours, since you re-wired your pendant. You'll have open up the halshow in Axis to find out exactly what pins are being read.

    Mark

  12. #12
    AMTB Guest
    Hi Mark
    In PIN i can see that you using Pin for X Y Z A axis -4 5 6 7- and for jog wheel pin 2 and 3.
    Question: how increment switch communicate to computer if it (switch) doesn't have any pin?

    Is there OEM address for manufacture of C22 adapter to ask question about pins?
    Who sold C22 - distributor.

    thanks
    Aram

  13. #13
    Join Date
    Dec 2005
    Posts
    594
    Quote Originally Posted by AMTB View Post
    Hi Mark
    In PIN i can see that you using Pin for X Y Z A axis -4 5 6 7- and for jog wheel pin 2 and 3.
    Question: how increment switch communicate to computer if it (switch) doesn't have any pin?

    Is there OEM address for manufacture of C22 adapter to ask question about pins?
    Who sold C22 - distributor.

    thanks
    Aram

    Remember, you're using the C22 adapter to actually make your connection to the parport. If you look at the CNC4PC manual for the adapter, you'll see that this code uses pins 8 and 9 and the magic of mult to come up with the increment switch settings. Here's a link to the CNC4PC manual for the C22.
    http://cnc4pc.com/Tech_Docs/C22-Pend...Board_Rev2.pdf

    Note: You're going to have to translate some pins on the C22 because you re-wired your pendant.

    Mark

  14. #14
    Join Date
    Jan 2005
    Posts
    7

    Port tester for MPG-6+C-22

    Hi,

    I made some modifications to the file EMC Documentation Wiki: Parallel Port Tester

    Zip file attachment, containing the hal and xml, plus a pdf with the explanation.
    With this test I added at the end of file hal.
    the contents of the file "Adding_to_end_hal_file.txt"
    and works perfectly

    best regards
    Narciso
    Attached Files Attached Files

Similar Threads

  1. mpg pendant
    By BAM in forum CNC Machine Related Electronics
    Replies: 1
    Last Post: 08-26-2008, 02:23 AM
  2. Pendant for under $10
    By teamtexas in forum DIY CNC Router Table Machines
    Replies: 2
    Last Post: 04-24-2008, 06:21 PM
  3. MPG pendant
    By troy676zsj in forum Fadal
    Replies: 0
    Last Post: 07-31-2006, 03:15 AM
  4. Anyone using this pendant?
    By trevorhinze in forum Mach Mill
    Replies: 3
    Last Post: 09-10-2005, 01:45 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
  •