MPGSmooth.c


Results 1 to 12 of 12

Thread: MPGSmooth.c

  1. #1
    Registered
    Join Date
    Aug 2004
    Location
    USA
    Posts
    241
    Downloads
    0
    Uploads
    0

    Default MPGSmooth.c

    I have used the MPGSmooth.c example to get my pendant up and running and have a couple questions. To disable the pendant I have the code set to change the movement factor to 0, this seems to work ok but was wondering if there is a better way to do this. Also I don't understand what the code below is doing for the pendant.


    #define COUNTS_PER_MM 200.0
    for (;
    {
    if (ch0->Position < 10.0 * COUNTS_PER_MM)
    SetBit(150);
    else
    ClearBit(150);

    if (ch0->Position > 300.0 * COUNTS_PER_MM)
    SetBit(151);
    else
    ClearBit(151);


    BTW the movement from the pendant is fantastic now, I have used both USB and hardwired pendants in Mach3 and this is by far the smoothest motion of any of them.

    Everything in moderation, including moderation.


  2. #2
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2474
    Downloads
    0
    Uploads
    0

    Default Re: MPGSmooth.c

    Hi eman5oh,
    To disable the pendant I have the code set to change the movement factor to 0, this seems to work ok but was wondering if there is a better way to do this.
    Setting the Factor to 0 is a good way to disable pendant movement. You might also make use of the new JOB_ACTIVE flag available in KFLOP to disable the pendant movement when a Job is running.

    Also I don't understand what the code below is doing for the pendant.


    #define COUNTS_PER_MM 200.0
    for (;
    {
    if (ch0->Position < 10.0 * COUNTS_PER_MM)
    SetBit(150);
    else
    ClearBit(150);

    if (ch0->Position > 300.0 * COUNTS_PER_MM)
    SetBit(151);
    else
    ClearBit(151);
    That is some example code to set Output Bits based on Axis position to simulate something like negative and positive limit switches. Not sure how that got in there. You can remove it. Of course you still need the "for" statement to form the loop.

    BTW the movement from the pendant is fantastic now, I have used both USB and hardwired pendants in Mach3 and this is by far the smoothest motion of any of them.
    Great to hear. You might also try the MPGSmoothAccelerate.c example. It changes the MPG Response rate based on how fast the MPG is turning. I was told it works very well.

    Regards

    TK
    http://dynomotion.com


  3. #3
    Registered
    Join Date
    Aug 2004
    Location
    USA
    Posts
    241
    Downloads
    0
    Uploads
    0

    Default Re: MPGSmooth.c

    I am running 4.32 at the moment and did not see the MPGSmoothAccelerate so I downloaded 4.33q and found the sample. I assume 4.33q is a test build, what is the latest stable build?

    Thanks

    Everything in moderation, including moderation.


  4. #4
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2474
    Downloads
    0
    Uploads
    0

    Default Re: MPGSmooth.c

    Hi eman5oh,

    Please use 4.33q. Its been in testing by us and some users for 2 months with no significant issues reported. We are expecting it to be the next Release.

    Regards

    TK
    http://dynomotion.com


  5. #5
    Registered
    Join Date
    Oct 2012
    Location
    Australia
    Posts
    69
    Downloads
    0
    Uploads
    0

    Default Re: MPGSmooth.c

    Are you able to share how you wired your pendant up?

    I'd like to connect mine but I'd like to see how others have done it - I would definitely appreciate you showing me how yours is done.


    Thanks



  6. #6
    Registered
    Join Date
    Aug 2004
    Location
    USA
    Posts
    241
    Downloads
    0
    Uploads
    0

    Default Re: MPGSmooth.c

    Sure, below is a spread sheet and some pictures of how I have it wired up. Not shown is a 82ohm resistor that is connected to the led to limit the current. Please note that I have connected to both J7 and J4 headers mixed 5volt and 3.3 volt logic. My pendent has a 5 volt Encoder conneced to P7 and all the switches are connected to J4 using 3.3volts. The io on J4 is 3.3 volts only and will be damaged with 5 volts, so triple check your wiring before powering anything up. The picture is from my testing, I still need to mill a cutout in the back panel of my box for the new DB25 penedent connector.



    https://docs.google.com/spreadsheets...b7wHJ8/pubhtml
    https://goo.gl/photos/HCjomJRTo2my9aXKA
    https://goo.gl/photos/bMR3ASmTg5BdPM1E9
    https://goo.gl/photos/czNhB8SQhYbLCGzn8

    Everything in moderation, including moderation.


  7. #7
    Registered
    Join Date
    Oct 2012
    Location
    Australia
    Posts
    69
    Downloads
    0
    Uploads
    0

    Default Re: MPGSmooth.c

    Thanks for that.

    Looks like we've got a similar pendant too - although mine doesn't have a nice terminal block like yours - just a mess of hand-soldered connections inside

    I will be connecting the switches to a Konnect though, as i'm running 24V to limit the potential for noise to trigger thing (i've had quite an issue with this in the past).



  8. #8
    Registered
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    3
    Downloads
    0
    Uploads
    0

    Default Re: MPGSmooth.c

    I've also used a similar pendant. I'd made a level shifting stage with three discrete 5V/3.3V modules from Ebay (I could have purchased the individual components and made a proper unit, but was crazy busy at the time and it was a simpler solution) as an interface to KFLOP/KSTEP.

    The pendant has been in use for about a year now, and has performed flawlessly with the above .C. I also ran into that code block, and took a while to figure out what it's intended purpose was, and that it didn't belong in there The pendant is directly wired to the controller box with the supplied curly cable; I've had no signal related issues as yet.

    Glad to know that JOB_ACTIVE is in there now; I'll have to take advantage of it, as well as SmoothAccelerate.

    Edit: Here are examples of the modules (ET-Mini brand, various sources), the chip is of course the crucial component:

    Futurlec
    Logic Level Converter Mini Board

    Mouser Electronics
    MR-MINI-LEVEL-SHIFTER Gravitech | Mouser

    Ebay
    Mini Logic Level Shifter 3 3 V 5 V With IC 74LCX245 Inboard | eBay

    Amazon.com
    Amazon.com: 1 pc of Mini Logic Level Shifter 3.3 V - 5 V with IC 74LCX245 Inboard FREE SHIPPING: Electronics

    Manual
    http://www.es-supply.com/are8-depart.../MINILOGIC.pdf

    Pendant:
    http://www.ebay.ca/itm/CNC-MPG-Penda...-/131308016781

    Last edited by Al-Hala; 11-13-2015 at 02:33 AM. Reason: Added Links


  9. #9
    Registered Epicycloid's Avatar
    Join Date
    Nov 2013
    Location
    United States
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default Re: MPGSmooth.c

    I know this is an old thread, but I'm about to get my CNC router and I'd like to add a more traditional pendant as described in this thread.

    1) Has anyone drawn up a schematic / wiring diagram with the level shifters? I'm not 100% clear on where they were added. (The resistor for the LED is obvious, but a complete diagram including it would probably be useful for others going down this path too.)

    2) eman5oh doesn't look like he connected the 4th axis. Any gotchas on just adding the axis, step, dir, and wire for the switch on J4?

    3) Since this is an old thread, is there any newer, better way people are adding pendants now?

    Thanks.



  10. #10
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2474
    Downloads
    0
    Uploads
    0

    Default Re: MPGSmooth.c

    Hi Epicyclooid,

    I'm not sure level shifters are really needed. Just avoid driving KFLOP pins above 3.8V. What MPG are you considering?

    Here is an example wiring diagram from our wiki

    http://www.dynomotion.com/wiki/index...apBrushMPG.pdf

    Here is more info. Please add any solution to our wiki as well.

    http://www.dynomotion.com/wiki/index..._and_Interface

    HTH
    Regards

    TK
    http://dynomotion.com


  11. #11
    Registered Epicycloid's Avatar
    Join Date
    Nov 2013
    Location
    United States
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default Re: MPGSmooth.c

    Thanks for the reply Tom.

    I'm still weighing the options and was trying to figure out if there was an MPG that people were using that was "plug-and-play" much like the Logitech Gamepad is. So, I haven't picked any specific MPG.

    Clearly none of the current USB-type MPG's are useable (like the XHC HB04, or its wireless counterpart WHB04). And understanding the overhead (delays) with USB, that's probably ok anyway.

    I thought maybe one of the off-the-shelf MPG's, already terminated with a DB-25 might be nearly plug-and-play, like this 4 axis one from CNC4PC. It is similar to the one pictured on the wiki, which looks like their 6 axis version (also DB-25 terminated). But as I dug further into understanding this, the pins used and number of axes are going to be unique to every machine, so not very easy to have a single, universal solution as I was initially (naively) assuming it was.

    Carl Bruce is building a 4 axis machine for me as we speak, and I don't know which pins I'll still have available to use until closer to pickup time. I may just start out with the (simple) Gamepad route and then re-visit an MPG once I'm more comfortable with the overall system. Right now it feels a bit like drinking from a firehose. Lots to learn and I don't even have my machine yet.



  12. #12
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2474
    Downloads
    0
    Uploads
    0

    Default Re: MPGSmooth.c

    Hi Epicycloid,

    Thanks for posting back. Carl makes good machines and stands behind his work. You won't be disappointed.

    Regards

    TK
    http://dynomotion.com


Tags for this Thread

Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

MPGSmooth.c
MPGSmooth.c