- Posts: 3
- Thank you received: 0
Automatic tool change via serial interface
8 years 3 months ago #115236
by lsteele
Automatic tool change via serial interface was created by lsteele
Hi there,
I'm just getting started with moving over to linuxcnc from Mach3, using it to control a Denford Orac lathe with a custom toolchanger I built myself. The toolchanger has a simple serial interface. I need to send an ascii string to the serial port, wait for a reply indicating success or failure, and proceed accordingly. I'd like to be able to reflect the status back to the user via the gmoccapy messages box.
I'd appreciate some pointers where to start - linuxcnc is a bit overwhelming to the uninitiated! I'm happy programming in Python, C, scripting languages etc, if necessary.
Thanks,
Luke
I'm just getting started with moving over to linuxcnc from Mach3, using it to control a Denford Orac lathe with a custom toolchanger I built myself. The toolchanger has a simple serial interface. I need to send an ascii string to the serial port, wait for a reply indicating success or failure, and proceed accordingly. I'd like to be able to reflect the status back to the user via the gmoccapy messages box.
I'd appreciate some pointers where to start - linuxcnc is a bit overwhelming to the uninitiated! I'm happy programming in Python, C, scripting languages etc, if necessary.
Thanks,
Luke
Please Log in to join the conversation.
8 years 3 months ago #115255
by cmorley
Replied by cmorley on topic Automatic tool change via serial interface
mitsub_vfd.py is a relatively simple python program that sends ASCII commands through serial to a VFD.
There are other serial VFD drivers written in C too.
Chris M
There are other serial VFD drivers written in C too.
Chris M
Please Log in to join the conversation.
8 years 3 months ago #115271
by andypugh
Do you need to use the serial interface?
I configured an Orac toolchanger 2 weekends ago using all standard LinuxCNC components and the parallel port.
The only special hardware was an off-the-shelf H-bridge driver to run the DC motor.
Replied by andypugh on topic Automatic tool change via serial interface
lsteele wrote: I'm just getting started with moving over to linuxcnc from Mach3, using it to control a Denford Orac lathe with a custom toolchanger I built myself.
Do you need to use the serial interface?
I configured an Orac toolchanger 2 weekends ago using all standard LinuxCNC components and the parallel port.
The only special hardware was an off-the-shelf H-bridge driver to run the DC motor.
Please Log in to join the conversation.
- Mike_Eitel
- Offline
- Platinum Member
-
Less
More
- Posts: 1018
- Thank you received: 0
8 years 2 months ago #115288
by Mike_Eitel
Replied by Mike_Eitel on topic Automatic tool change via serial interface
Hi Luke
Can publish modbus RTU code.
Written for AVR in BASCOM..
Decoding sequenz should be easy transferable in any languague.
Mike
Can publish modbus RTU code.
Written for AVR in BASCOM..
Decoding sequenz should be easy transferable in any languague.
Mike
Please Log in to join the conversation.
8 years 2 months ago #115302
by lsteele
Replied by lsteele on topic Automatic tool change via serial interface
I do need the serial interface, unless I want to rebuild the electronics.
Chris M - that code looks fairly straightforward. Can you give me any pointers to info explaining how this 'interfaces' or is integrated into linuxcnc? Writing a python script to interface to the toolchanger is the easy bit, what I don't understand is how I get linuxcnc to drive that code and exchange info.
Mike, I'd be interested to see the modbus RTU code.
Thanks,
Luke
Chris M - that code looks fairly straightforward. Can you give me any pointers to info explaining how this 'interfaces' or is integrated into linuxcnc? Writing a python script to interface to the toolchanger is the easy bit, what I don't understand is how I get linuxcnc to drive that code and exchange info.
Mike, I'd be interested to see the modbus RTU code.
Thanks,
Luke
Please Log in to join the conversation.
- Mike_Eitel
- Offline
- Platinum Member
-
Less
More
- Posts: 1018
- Thank you received: 0
8 years 2 months ago #115305
by Mike_Eitel
Replied by Mike_Eitel on topic Automatic tool change via serial interface
Don't get shocked when you see the code.
Some of the main tricks are a bit complicated interuppt and pointer games plus also something like a "small multitasking part" for the micro..
The decoding part itself is quite short and handled in the "_com_z" to "_com_4"
Have fun
Mike
Some of the main tricks are a bit complicated interuppt and pointer games plus also something like a "small multitasking part" for the micro..
The decoding part itself is quite short and handled in the "_com_z" to "_com_4"
Have fun
Mike
Attachment not found
Attachment not found
Please Log in to join the conversation.
8 years 2 months ago #115306
by andypugh
Have a look at hal_manualtoochange.py
That gets automatically added to configs without another toolchanger, and is a Python component that monitors the tool-change HAL pins.
You can probably just edit and rename that to do what you want.
But I still think there might be value in using the (realtime) carousel component, if only because I spent some time the the weekend making changes specifically for the Denford Orac
Replied by andypugh on topic Automatic tool change via serial interface
lsteele wrote: what I don't understand is how I get linuxcnc to drive that code and exchange info.
Have a look at hal_manualtoochange.py
That gets automatically added to configs without another toolchanger, and is a Python component that monitors the tool-change HAL pins.
You can probably just edit and rename that to do what you want.
But I still think there might be value in using the (realtime) carousel component, if only because I spent some time the the weekend making changes specifically for the Denford Orac
Please Log in to join the conversation.
Time to create page: 0.096 seconds
