A Teensy -> Python Interface Manualmatic MPG/pendant

More
4 years 9 months ago #233223 by fletch
I hadn't even heard of PathPilot before you mentioned it! Sooo much too learn!
And I'll definitely be looking forward to your feedback on my C++ & Python code.... I think...image missing /media/kunena/emoticons/ermm.png

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago - 4 years 9 months ago #233283 by fletch
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
 
Last edit: 4 years 9 months ago by fletch.

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #233292 by sagreen

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

 
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.

Scott...

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #233305 by sagreen
Making a bit more progress. Your library is helping a lot!



Scott...
The following user(s) said Thank You: fletch

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #233378 by fletch
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?

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago - 4 years 9 months ago #233458 by fletch
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:
  • 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!
The first time it runs, there will be a delay "Waiting for component 'manualmatic' to become ready" but it will connect eventually. After that it will always connect immediately. This might just be my Pi's USB...

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: 4 years 9 months ago 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.

Time to create page: 0.250 seconds
Powered by Kunena Forum