Interfacing to smart driver modules, where do I start?

More
13 Sep 2018 21:26 #117488 by Oliver Sedlacek
I'm a newbie on LinuxCNC but I'm looking to control a three axis CNC mill that includes smart stepper drives. The interface to the stepper drives is through serial commands that allow you to control speed and position. I'm an experienced C/C++ coder, so I'm comfortable with low level interfacing, but I don't know what I need to do. Where do I start?
More
13 Sep 2018 21:29 #117489 by PCW
What type of interface do the step motor drives have?
More
14 Sep 2018 07:37 #117509 by Oliver Sedlacek
ASCII commands,VE????? sets speed, FP???? sets position, stuff like that. The interfaces are Ethernet and RS485, so reasonably quick.
More
14 Sep 2018 12:56 #117525 by andypugh
Sounds like fun...

Ideally you would want to remain in the realtime layer. I think that this might be easiest using a Mesa FPGA card with UART firmware.
Here is a simple Mesa UART driver written in the LinuxCNC comp preprocessing language. github.com/LinuxCNC/linuxcnc/blob/master...ivers/mesa_uart.comp

It _might_ be possible to send serial data out of the PC serial port, do you know if that is possible with simple inb() and outb() commands?
linuxcnc.org/docs/2.7/html/man/man3/rtapi_inb.3rtapi.html

With either approach you would create HAL input pins for your driver component that would be linked to the joint.N.motor-pos-cmd HAL pins from the motion controller.
More
14 Sep 2018 13:38 #117528 by Oliver Sedlacek
Thanks for that, I don't understand it all but it does look really useful (and interesting). I'm sure I'll have some supplemental questions.
Time to create page: 0.073 seconds
Powered by Kunena Forum