Category Archives: CNC Mill

Teknic Clearpath Servo motors installed on a G0704 CNC mill

I recently upgraded my mill to use Clearpath Servo motors. The motors I used are the CPM-SDSK-2341S-RLN which are 828 oz-in of torque.

The motors run really well. They are powerful enough for the mill, and are absolutely silent when they run – this was really surprising. I’d never realized how much noise the steppers made.

I swapped out 400 oz-in steppers for these servos. Interestingly, when I first installed the servos, they had trouble moving the table. This was before calibration, and also before I adjusted the power supply to output the full voltage (there’s a selector switch in the power supply for various input voltage levels). Once I adjusted the ways, lubricated the ways, and tuned the motors, the mill ran really well. I’ve been able to do heavy cuts and have never noticed an issue. I’ve been able to speed up the “rapid” speed of the mill to 100 inches/minute, from the previous setting of 40.

Teknic states that the servos can be one-half the rated torque of a stepper motor, but I’m skeptical, based on my experience.

The servos each have a USB port, and come with a windows application for tuning the motors. When the application runs, you can see the torque, maximum torque, speed, direction, etc. In the tuning mode, you first define a range of motion for the motors – say a 20 to 50 turn range where the motor can run safely. Then it enters a tuning mode where it applies different levels of torque, moves the mill slowly and quickly in each direction, and does loud jarring movements where the motor slams the shaft. It does this to analyse the resonance of the machine. It is scary to watch. It’s like your mill is being hammered with a sledge hammer! In fact, it loosened the set screws on the Lovejoy connectors (which were too small anyway).  The tuning takes about 20 minutes per axis.

Custom Keyboard for G0704 CNC Mill, controlled by PlanetCNC software

I recently updated my G0704 CNC mill to add an external keyboard for commonly used functions. My reason for doing this was that some of the functions I use most are really buried in the menu structure of the control software I use on the mill.

For example, I use the Zero X Offset and Zero Y Offset all the time, yet these are in a menu 3 levels deep in the software. Also, I find that having dedicated buttons is a bit safer for functions like Start, Stop, and Measure Z Offset. In particular, the Measure Z Offset button on screen is right beside the Measure Tool Offset – which does really long tool measurement sequence, involving a fixed tool location measurement – really easy to select this by mistake.

My solution was to create an external box, with the 7 buttons I use most, and connect this box to the Control PC using USB.

CNC Custom Keyboard

Here’s a video about this project:

More Details:

The control software has keyboard codes for each menu item. You can simply type the keyboard code when the program is running, and that menu item will be executed. For example, the keyboard code for Zero X Offset is “/45211” These keyboard codes are visible when you drop down a menu in the software.

I used a Teensy 2.0 Arduino controller, which is perfect for this application as it can be configured to emulate a USB keyboard. I connected the 7 buttons to pins 0-6 on the Teensy, and connected the other side of all the buttons to the Ground pin.

  • Pin 0 – Zero X Offset (Sends keycode /45211)
  • Pin 1 – Home (Sends keycode /470)
  • Pin 2 – Zero Y Offset (Sends keycode /45212)
  • Pin 3 – Zero Z Offset (Sends keycode /45213)
  • Pin 4 – Measure Z Offset (Sends keycode /459)
  • Pin 5 – RUN (Sends keycode /401)
  • Pin 6 – STOP (Sends keycode /406)

Here’s the Arduino Sketch (the program) that I used for this project.

The software scans the pins, looking for a pin to be “Zero”, which means a key is pressed. When it finds a pressed key, it uses the println function to send the Planet-CNC keycode to the software.

Note: The keypad sends the keycode to whatever program is running in the foreground on the PC. You shouldn’t rely on this for critical keypresses like ESTOP. The ESTOP key should be hard-wired to the appropriate pin on the Planet CNC control board.