A Teensy based pendant using the user space Python LinuxCNC interface.Theoretically will require copying just two files to config directory (or globally?) and adding a single line to custom.hal.
Will one day optionally use an ini file for config and read options from machine config ini file.
Why?
Once I convert my mill to CNC, I want to continue to be able to use it manually – replicating some of the functionality of a DRO and having a pseudo power feed.So, slightly inspired by the rotary button reset on RotarySMP’s Maho
control panel
(the reset is mentioned elsewhere) and partly by This Old Tony’s ‘manual cnc’ comment at the end of one of his
Maho videos
, I thought I’d make a pendant my 2021 Christmas project.
Unfortunately, thanks to my location it has recently become much more expensive to get MESA cards (or anything) shipped from the EU - my $119 7i96 card cost me €194.58, so while the $49.00 7i73 pendant/control panel interface card is well priced, it would cost €113.91 to get it in my hands...
A bit of digging in the forums led me to ArcEye’s
Arduino pendant
- very good for almost a decade ago but microcontrollers have moved on somewhat since then. I also wanted to build something that is easy for anyone to install and flexible to use without tying it to a particular UI.
None of the solutions I found (and there are many, some of which I don’t understand) appear to make full use of the user space Python interface, so I thought I’d give that a try.
This pendant uses a touch screen primarily because there seems to be a dearth of non-touch screen SPI displays – and I like to support Adafruit as they contribute massively to the makerspace. I wouldn’t mind a screen that wasn’t offset though (I’m tempted to use it portrait for soley that reason). All primary operations will be button or encoder based (I prefer tactile Uis) – the touch screen will only be used for entering zero offset values and minor functions.
Huge credit also to
PJRC
, not just for the Teensy but also for the interrupt based fast encoder library that enabled me to wrap an callback based encoder/button library around it – 100% lossless encoder steps FTW!The schematic is designed to work with a Teensy 4.1 – it will also work with a 4.0 but you will lose the pins for the 5 physical buttons under the screen (so they would have to be operated via the touchscreen).All the button switches and rotary encoders are easily obtainable from eBay, including the MPG. It is intended to have a hard wired Estop but the backlight control pin can be traded for a soft estop.
Obviously this is a work in progress/proof of concept but here is a quick and some pictures and my notes (anything maked with a '~' is not even looked at!):
Thank you - still a long way to go, but I think the concept is proven. I will release it all once the embarrassment factor is reduced in my code (neither Python or C++ are my first language)
Making good progress on this now (although a bit more than a Christmas project).
The first part of releasing the source code is the EncoderButton library that underpins the MPG and spindle/feed controlsand button callbacks - I've cleaned it up, documented and published it here
on github
.
It is also available in the Arduino IDE Library Manager if anyone is playing with Arduinos and encoder buttons (they really are an excellent interface for microcontrollers).
Feel free to nudge me if you're interested in testing or playing with this project.
Does the mpg have a delay? I see that the mpg and the PC are not synchronized. When the mpg stops rotating, the value on the PC is still changing. Is this the real situation.