Welcome to Our Community

Some features disabled for guests. Register Today.

USB MPG/Pendant

Discussion in 'General Talk' started by phil from seattle, Mar 20, 2020.

  1. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    312
    Likes Received:
    137
    I see a lot of these for sale and would like to experiment with one. Does anyone have info on how they interface to a PC? Does it show up as an HID device or is it more like a simple async terminal ending text data?

    Ultimately, I want to use a microcontroller to read the pendant.

    Any help or pointers greatly appreciated.
     
  2. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,753
    Likes Received:
    4,070
  3. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    312
    Likes Received:
    137
    Thanks. That means I'll need USB OTG capable micro. Probably a teensy 4.
     
  4. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,753
    Likes Received:
    4,070
    Wouldn't a Pi be easier?
     
  5. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    312
    Likes Received:
    137
    Not for my needs. I want to be able to plug pendants into a grblHAL breakout board like the one I made here.
     
  6. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    746
    Would it be easier to get a non-USB one if you're just gonna have a micro read it anyway? Most of the non-MPG wires are settings or LEDs or something, nothing that needs an interrupt. I have mine plugged into a Mesa 7i85 at the minute, though I still haven't set it up in LinuxCNC yet, but it would be fairly trivial to interface with a micro board.
     
  7. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    312
    Likes Received:
    137
    Do you a link to one (or 5)?
     
  8. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    746
    phil from seattle likes this.
  9. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    312
    Likes Received:
    137
    Thanks. I like that. May well get it. However, I still want to support the USB versions as I am working with others to help make grblHAL a "plug-and-play" replacement for the current 8-bit GRBL. Each piece should be simple to assemble and use.
     
  10. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    312
    Likes Received:
    137
    After looking at it a bit more, it looks pretty usable. On the pulse generator, I assume that A and B are quadrature encoded. Not sure why bar A and bar B are needed unless there is some sort of anti-glitch work that needs to be done.

    grblHAL can take I2C input so my micro (probably a teensy LC or maybe even an arduino nano) would be a slave and interpret the pendant switches and quad output. The master I2C side would feed grbl commands.
     
  11. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    746
    Yeah, that sounds eminently doable. It's been a very long time since I scoped its outputs, but I believe it was quadrature, yeah. It may just break out the inverts because some controllers demand it- I can't say I've ever interfaced with a Fanuc or Siemens controller, but I wouldn't be surprised if they want differential inputs.

    Just looking at grblHAL over here, looks pretty cool. Would be nice to get a system as simple as grbl and physically plugging components together with the power and capability of linuxCNC. Sounds like what that new thread in Concepts and Ideas is talking about, really!
     
    phil from seattle likes this.
  12. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    312
    Likes Received:
    137
    one other questions, the ad shows a card that mentions 5V. I assume that since it's just switches, 3.3V would be ok too. Is that right?
     
  13. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    312
    Likes Received:
    137
    Yes, Terje, the guy behind grblHAL, is using LinuxCNC as his model. Already he has a number of G and M codes that go beyond - like M62-65, pin control. Super easy to support random hardware. I have it working on my breakout board to control extra relay drivers.
     
  14. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    746
    On the switches, that would be fine. On the encoder, I'm not sure, it'd depend how the photodiodes are set up?

    Photo Mar 23, 14 22 58.jpg

    Plastic body, apparently I misremembered. But a pretty thick, reinforced casting. Could even be glass fibered, hard to tell.

    Yeah, might have to look into it for my next machine. I'll need extra codes and hardware, but if I can avoid dealing with HAL and Mesa electronics, I'll be a little happier! :p
     
    phil from seattle likes this.
  15. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    312
    Likes Received:
    137
    Big thanks! Yeah, probably needs a test. A 5V tolerant micro might be needed.
     
  16. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    312
    Likes Received:
    137
    A quick follow up on this. I got the pendant that Rob suggested and have it hooked up to a Teensy. Got all the switches and encoder working. Everything runs just fine on 3.3V. Even the power indicator LED lights up just fine on 3.3V (docs say 24V!). Next step is I2C to the grbl/HAL board and integrating into grbl/HAL. I'm still going to investigate USB based solutions but this gets me going with one less variable to deal with.
     
    #16 phil from seattle, Mar 28, 2020
    Last edited: Mar 28, 2020
  17. Troy E Davis

    Builder

    Joined:
    Apr 30, 2021
    Messages:
    1
    Likes Received:
    0
    Phil, any update on this? I just bought one of your kits on Tindie and would love to plug one of these in
     
  18. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    312
    Likes Received:
    137
    Wow, that was a year ago... Thanks for buying the kit.

    I did get it working with a micro - actually several iterations: a Teensy LC based one and one using an Atmel ATTiny. Both plug into the I2C header on my board. Sadly, there is no plugin for grblHAL. After playing with it and some thinking, I decided that the right direction was to be able to use the USB based MPGs out there. The current board doesn't support it but a new Pro board I am working on has a host USB socket so you can plug one into it. There is still the matter of a grblHAL plugin. You can find details on that board on github at terjrio/grblHAL/discussions/breakout boards.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice