Automatic tool change via serial interface

More
8 years 3 months ago #115236 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

Please Log in to join the conversation.

More
8 years 3 months ago #115255 by cmorley
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

Please Log in to join the conversation.

More
8 years 3 months ago #115271 by andypugh

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.

More
8 years 2 months ago #115288 by Mike_Eitel
Hi Luke
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.

More
8 years 2 months ago #115302 by lsteele
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

Please Log in to join the conversation.

More
8 years 2 months ago #115305 by Mike_Eitel
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

Attachment not found


Attachment not found

Please Log in to join the conversation.

More
8 years 2 months ago #115306 by andypugh

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.

More
8 years 2 months ago #115328 by lsteele
Hi Andy,

That sounds promising - I'll check it out.

Cheers

Please Log in to join the conversation.

Time to create page: 0.096 seconds
Powered by Kunena Forum