Catio-a Spindle control with modbus over ethercat

  • rodw
  • rodw's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
04 Sep 2026 07:11 #349302 by rodw
 

The CATIO-A Ethercat I/O module is a well priced I/O module available on AliExpress. A config and documents for it is on the forum elsewhere. One of the interesting features is that it includes MODBUS RTU built in so you can use it to control your spindle. I am using it with a EV210 VFD that came with a single phase 2.2 kW spindle. Its a bit tricky though because:
  1. The serial port is slow by its very nature. The servo-thread so the lcec.write-all command tends to flood the serial port causing overruns.
  2. The fastest I could reliably communicate to my cheap Chinese EV210 is 38400 baud
  3. The SDO's are kind of read only so once you write to them, you can't write to them again without power cycling.
To deal with the SDO issue and the resulting flood of errors if done in the xml file, I decided to set them in a separate bash script that only needs running once per power cycle before you run LinuxCNC. This could be improved.

I've had a couple of goes at cracking this over the last 12 months or so and I finally got it working today!
A complete working config is attached. The HAL stuff is actually very similar to using the  Mb2Hal driver. Some hal features may be specific to my VFD as I found it that the scaling of the feedback changed once it reached 100 Hz. The other difference  is that Mb2Hal has some float pins but here I needed to convert some values to and from floats and unsigned integers to get a properly scaled Spindle at speed.

People worry about using modbus to control their spindle because its not real time. Well that does not matter because if you look at the LinuxCNC architecture, spindle control is not real time anyway.

What about rigid tapping they say? Well it also does not matter either because LinuxCNC synchronises Z axis motion with the spindle motion so the Z follows the lead from the Spindle!

There is also a lot of feedback data provided by modbus on speeds, torque current and the like which help you gain better control of your machining and it does not consume any pins. (A fully configured 0-10 volt spindle consumes 4 pins, forward relay, reverse relay, PWM pin for 0-10 volt control and a spindle at speed signal back from the VFD if its correctly configured. So all f those pins can be released if using modbus control.

Finally, Modbus gives you much greater immunity to electrical noise due to twisted pair and error checking in the protocol. Not only that, the speed is much more accurate and it will respond to torque spikes.

 
Attachments:
The following user(s) said Thank You: tommylight

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

Time to create page: 0.415 seconds
Powered by Kunena Forum