CNC gets Smart(er) Servos… not
Recently, while milling aluminum on my OX CNC, I had a frustrating number of bad runs because of the stepper motors missing steps. I think this was due to overheating of the 8825 stepper chips on the xPro CNC grbl board. In a fit of pique, I ordered up MKS SERVO57A closed loop stepper boards from AliExpress. These are based on the nano_stepper open source project developed by misfittech. These add a dedicated STM32 controller with to each stepper motor with feedback from a magnet on the shaft. It also provides an optional direct LCD display and menu to setup the servo. It moves the high current driver from the grbl board to the servo board.
The feed from the grbl board to the servo board has to now be logic level: STEP, DIRECTION and ENABLE rather than the high current connections directly to the stepper. I had planned this around my memory that I had an xPro CNC v3 which has a breakout connector for logic level STEP, DIR and ENABLE, however when I pulled the board from the CNC, it was a v2 which has no breakout! DOH!
Hack time… The v2 has solder pads used to select which mirror one of the axes (by default Y) to a second stepper motor. This exposes the XYZ(and E not used) axis STEP and DIR. Enable is not directly exposed, but is directly driven from the microcontroller, so I can grab it directly from one of the pins. A bit of delicate soldering of some wire-wrap.
I soldered up a connector board to match the supplied cables for 4 axes (X,Y1,Y2,Z (unused)) and fed power (24v and 5v) and ground. The ENABLE signal is common to all the motors. Some 3D-printed brackets fix the connector board to the xPRO CNC.
CAUTIONARY TALE!
After feeling pretty good about the daughterboard for the servos. I reassembled the electronics into the CNC chassis. Hooked up the first y-axis servo and powered up. NOTHING! No display or LED on the servo (there is an OLED that plugs into the SDA connector visible on the top of the board). Perhaps my wiring to that plug is incorrect. Hook the y-axis servo to the z-axis connector. NOTHING! Perhaps the servo is ignoring me. Hook up the second y-axis servo to the y-axis connector. NOTHING! Fall back to testing the z-axis which was to remain a stepper. STEPPER DOESN’T WORK! Start to ring out the supply voltages, 24v is OK. 5v is at 2.25v across the entire xPro board! Check the voltages on the plugboard and they are OK. Check the voltages at the servos and…. CRAP! the cables supplied with the servos swap the pins. 24v was fed into the STEP and ENABLE pins and 5v fed to the DIR pin of the Servos and the xPro board. PZZZZZT!
Tore the whole thing down and tested. Casualties:
- Fried the xPro CNC drivers on the MEGA328P for pins 1,2,10,11 (YSTEP, ZSTEP, XDIR, YDIR). They now are shorted partially to ground. I did finally get the 5v supply back on the board, but only the un-buggered x-axis works.
- Fried two of the MKS SERVO57A boards. One won’t power up at all and the other won’t accept steps. The third one was not involved in the incident and works fine.
LESSON LEARNED
Bench test everything incrementally including cables!
No hacking around this ugly, I ordered a new CNC controller (Tom’s Robotics F13) which runs GRBL32 (a 1.1f fork) running on a 32 bit ARM Cortex “Blue Pill” controller. Everything is pluggable on this board vs the xPro which was all SMD. I re-ordered 3 more MKS SERVO57A boards (one spare) and a MKS SERVO43A board (for NEMA17). I may switchout the z-axis for NEMA34). Unfortunately this sets me back a few weeks as the servo boards are shipping from AliExpress China.