A Teensy -> Python Interface Manualmatic MPG/pendant
27 Jan 2022 18:08 #233292
by sagreen
Scott...
Replied by sagreen on topic A Teensy -> Python Interface Manualmatic MPG/pendant
Awesome! I just got the teensy reading the encoder, sending via serial and Pathpilot reading the stream and stepping X/Y. Was gonna put a button on it to switch axis's then saw you uploaded a schematic! Thank you.I have uploaded the schematic used by the code base and a small Arduino sketch to test the wiring is as expected: github.com/Stutchbury/Manualmatic-Pendan...main/Hardware/wiring
Scott...
Please Log in or Create an account to join the conversation.
27 Jan 2022 19:45 #233305
by sagreen
Replied by sagreen on topic A Teensy -> Python Interface Manualmatic MPG/pendant
Making a bit more progress. Your library is helping a lot!
Scott...
Scott...
The following user(s) said Thank You: fletch
Please Log in or Create an account to join the conversation.
28 Jan 2022 14:33 #233378
by fletch
Replied by fletch on topic A Teensy -> Python Interface Manualmatic MPG/pendant
That's really good to hear. I've uploaded the knobs stl for the prototype cradle. Cleaning & documenting the code now
How did you get the YT video to embed?
How did you get the YT video to embed?
Please Log in or Create an account to join the conversation.
29 Jan 2022 17:48 - 29 Jan 2022 18:03 #233458
by fletch
Replied by fletch on topic A Teensy -> Python Interface Manualmatic MPG/pendant
THERE'S CODE!!
Saturday Night's alright for fighting, but it's also quite a good night for quietly releasing code...
I've uploaded the Arduino sketch here and the actual component here on github. All the required libraries are available via the Arduino Library Manager. You will need Teensyduino installed to compile & upload.
This is a 'mock' linuxcnc interface so the pendant can be run attached to a PC that does not have LinuxCNC installed. Used primarily for UI dev. To run, from a command line in the mock directory: $ ./mock_cnc_machine.py mock.ini and it'll wake the pendant up.
I will add some documentation in the next few days but to add to LinuxCNC:
EStop reset your machine - you can then turn it on with the 'On/Off' button on the pendant. Unfortunately you still have to home the machine on the main UI because I haven't worked out how to do that yet...
Once homed, you will have almost complete manual and auto control (all except loading the file) from the pendant. I haven't even looked at MDI.
I would really appreciate feedback - on both the C++ and Python (neither are my first language) and on my understanding of how LinuxCNC works (I only started late last year)... Please be gentle.
Can I do the happy dance now?
Saturday Night's alright for fighting, but it's also quite a good night for quietly releasing code...
I've uploaded the Arduino sketch here and the actual component here on github. All the required libraries are available via the Arduino Library Manager. You will need Teensyduino installed to compile & upload.
This is a 'mock' linuxcnc interface so the pendant can be run attached to a PC that does not have LinuxCNC installed. Used primarily for UI dev. To run, from a command line in the mock directory: $ ./mock_cnc_machine.py mock.ini and it'll wake the pendant up.
I will add some documentation in the next few days but to add to LinuxCNC:
- Copy both Manualmatic.py (the class def) and manualmatic (the component) to your config directory (I know I said it would be only one file but keeping the class separate from the component allows me to mock it)
- Add the following line to custom.hal (replace gmoccapy.ini with your ini file name):
loadusr -W ./manualmatic gmoccapy.ini - Start LinuxCNC, preferably from the command line (to see any errors).
- That's it!
EStop reset your machine - you can then turn it on with the 'On/Off' button on the pendant. Unfortunately you still have to home the machine on the main UI because I haven't worked out how to do that yet...
Once homed, you will have almost complete manual and auto control (all except loading the file) from the pendant. I haven't even looked at MDI.
I would really appreciate feedback - on both the C++ and Python (neither are my first language) and on my understanding of how LinuxCNC works (I only started late last year)... Please be gentle.
Can I do the happy dance now?
Last edit: 29 Jan 2022 18:03 by fletch. Reason: back ticks don't work as inline code blocks as expected!
Please Log in or Create an account to join the conversation.
29 Jan 2022 18:59 #233464
by sagreen
Replied by sagreen on topic A Teensy -> Python Interface Manualmatic MPG/pendant
To link the youtube video, I just copied the URL and pasted it into the inline message. Nothing special...
I'm working on the attached model. I am doing it in fusion 360. Pretty close to done. The buttons will be here tomorrow. I'm leveraging a bunch of work that was done by the guy in this video on the pathpilot side, so all I have to do is the hardware side and pathpilot is picking it up nicely. The thumbstick is an amazing addition!
Scott...
I'm working on the attached model. I am doing it in fusion 360. Pretty close to done. The buttons will be here tomorrow. I'm leveraging a bunch of work that was done by the guy in this video on the pathpilot side, so all I have to do is the hardware side and pathpilot is picking it up nicely. The thumbstick is an amazing addition!
Scott...
Please Log in or Create an account to join the conversation.
30 Jan 2022 12:24 #233533
by fletch
Replied by fletch on topic A Teensy -> Python Interface Manualmatic MPG/pendant
That's an interesting pendant I hadn't found - is it tightly coupled to PathPilot? I can't find any source other than the shop front to buy a complete one.
In early messing around I did look at the thumb slide from Sparkfun or this xbox one to sit between the two rotary encoders. I may revisit - it seemed like a good idea but doesn't appear to be implemented on 'regular' pendants.
In early messing around I did look at the thumb slide from Sparkfun or this xbox one to sit between the two rotary encoders. I may revisit - it seemed like a good idea but doesn't appear to be implemented on 'regular' pendants.
Please Log in or Create an account to join the conversation.
30 Jan 2022 12:43 #233534
by sagreen
Yes and no. The process he uses to communicate with the pendant is exactly the same as you have done. He sends a serial packet with a command and data that is read in a python script and sent to Pathpilot (linuxcnc). But after that he is tightly coupled with pathpilot. All of his server side code is imbedded into Tormach provide python scripts.
Scott...
Replied by sagreen on topic A Teensy -> Python Interface Manualmatic MPG/pendant
That's an interesting pendant I hadn't found - is it tightly coupled to PathPilot? I can't find any source other than the shop front to buy a complete one.
In early messing around I did look at the thumb slide from Sparkfun or this xbox one to sit between the two rotary encoders. I may revisit - it seemed like a good idea but doesn't appear to be implemented on 'regular' pendants.
Yes and no. The process he uses to communicate with the pendant is exactly the same as you have done. He sends a serial packet with a command and data that is read in a python script and sent to Pathpilot (linuxcnc). But after that he is tightly coupled with pathpilot. All of his server side code is imbedded into Tormach provide python scripts.
Scott...
Please Log in or Create an account to join the conversation.
30 Jan 2022 13:05 - 30 Jan 2022 13:09 #233538
by fletch
Replied by fletch on topic A Teensy -> Python Interface Manualmatic MPG/pendant
Thanks - do you have a link to the code? I'm always interested in how other people have done it! The beauty of Open Source, eh?
In principal, it would only be a (my) server side Python class that would need to be customised to use with PathPilot? It's not the principal objective, but I'd like to think the manualmatic is at least slightly agnostic...
In principal, it would only be a (my) server side Python class that would need to be customised to use with PathPilot? It's not the principal objective, but I'd like to think the manualmatic is at least slightly agnostic...
Last edit: 30 Jan 2022 13:09 by fletch.
Please Log in or Create an account to join the conversation.
31 Jan 2022 03:42 #233602
by sagreen
This is his patches link from his home page. Pretty difficult to install without first having pathpilot installed. The install first looks for pathpilot, then does a diff against the files to build the current version.
Scott...
Replied by sagreen on topic A Teensy -> Python Interface Manualmatic MPG/pendant
Thanks - do you have a link to the code? I'm always interested in how other people have done it! The beauty of Open Source, eh?
In principal, it would only be a (my) server side Python class that would need to be customised to use with PathPilot? It's not the principal objective, but I'd like to think the manualmatic is at least slightly agnostic...
This is his patches link from his home page. Pretty difficult to install without first having pathpilot installed. The install first looks for pathpilot, then does a diff against the files to build the current version.
Scott...
The following user(s) said Thank You: fletch
Please Log in or Create an account to join the conversation.
31 Jan 2022 11:56 #233623
by fletch
Replied by fletch on topic A Teensy -> Python Interface Manualmatic MPG/pendant
Now the initial code release is done, I've added a quick/temporary bezel STL file to github - I kept catching the display ribbon cable... github.com/Stutchbury/Manualmatic-Pendant
Attachments:
Please Log in or Create an account to join the conversation.
Time to create page: 0.174 seconds