Hello Guest it is July 12, 2020, 04:47:30 PM

Author Topic: Mach4 Serial Pendant  (Read 210 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonRafferty

*
  •  22 22
  • Movie SFX Design Engineer
    • View Profile
Mach4 Serial Pendant
« on: May 25, 2020, 05:50:20 PM »
I had wondered how to make a more functional Pendant controller than the ones that you can buy off the shelf.  By more functional, I mean including DROs that are updated from Mach4 and confirmation lights on buttons, again controlled by Mach4 - so you know it has received and understood the instruction.

In place of Buttons, I've used a Capacitive Touch LCD (which works with wet fingers, unlike Resistive screens).

It uses an Arduino Nano as a USB Serial Device.  When a button is pressed, it sends a (short) Serial Message to Mach4.  When Mach4 receives it, it enacts it and sends back the state of the thing it changed (Coolant for example) which in turn causes the button to Illuminate.

The MPG Wheel Sends "I" for Increment & "D" for Decrement.  If the DRO value for an axis changes, it's sent back to the Pendant for display.  With the short messages and fast serial (115200bps) the lag is minimal making the pendant very responsive.

While this is not just a 'script', the scripts it contains may well be useful, particularly for anybody wanting to communicate externally using Serial.  Most of the heavy lifting with the serial was done by Mike https://www.machsupport.com/forum/index.php?topic=42084.msg274487#msg274487

I used a variant of his code to talk to my Servo Drive - then adapted it for this. 
DanTheGaz's posts & particularly videos were invaluable discovering what's under the covers of Mach4

I'm sure I've done some of it the 'wrong' way - but life is for learning!

I've uploaded all the code, including Arduino to GitHub:
https://github.com/SimonRafferty/Mach4-Serial-Pendant

Offline Tweakie.CNC

*
  • *
  •  8,356 8,356
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Mach4 Serial Pendant
« Reply #1 on: May 26, 2020, 03:57:21 AM »
Excellent work SimonRafferty and thank you for sharing the information.

Tweakie.
KEEP SAFE !