Teensy Manualmatic MPG/Pendant for LinuxCNC (or any other 4D system)
My Christmas project for 2021 - the aim being to be able to perform the majority of routine LinuxCNC setup, manual and automatic functions without having to step away to a PC monitor.
Kicked off here on the LinuxCNC forum.
This still a work in progress but has already resulted in me releasing a few Arduino libraries that will hopefully help in other projects too.
The currently released code implements almost all the functionality for both manual and auto control.
Auto mode screen (uses the DisplayUtils library):
Setting offsets (uses the TouckKeypad library):
There is now a complete 3D printable case and a PCB
- contact me for details.
The pendant software has now been migrated to PlatformIO - using Teensyduino via the Arduino IDE did end up too knarly.
Communication beween the Teensy 4.1 and the LinuxCNC Python Interface is over USB using a very simple protocol.
While the pendant prioritises working with LinuxCNC, in principle it is a fairly agnostic UI to control anything that you'd like to move in 4D that can read from & write to the serial port over USB.
Getting Started
This was always intended to be "Almost Plug'n'Play"™ but does require the PlatformIO to upload to the Teensy and two files copied to your LinuxCNC config directory.
- Clone or download this repository and extract somewhere convenient (not usually on your LinuxCNC machine).
PlatformIO Install
-
Follow the install instructions here: https://platformio.org/platformio-ide
-
Required libraries will be automatically downloaded based on the
platformio.ini
file. -
There are two folders of interest:
- The main codebase for the pendant:
Software/PlatformIO/pendant/ManualmaticPendant
or - A wiring check 'sketch':
Software/PlatformIO/pendant/ManualmaticWiringCheck
- The main codebase for the pendant:
Open either of these folders and PlatformIO will allow you to compile and upload.
LinuxCNC Install
- Copy both
Manualmatic.py
(the class def) andmanualmatic
(the component, lowercase, no file extension) to your LinuxCNC config directory. - Add the following line to custom.hal (replace
gmoccapy.ini
with your ini file name):
loadusr -W ./manualmatic gmoccapy.ini
- Plug your manualmatic pendant into a USB port - make sure appears as
/dev/ttyACM0
- Start LinuxCNC, preferably from the command line (to see any errors).