Hello Guest it is March 28, 2024, 04:24:58 AM

Author Topic: Mach4 Spindle Control Issue - PEBCAK?  (Read 1056 times)

0 Members and 1 Guest are viewing this topic.

Mach4 Spindle Control Issue - PEBCAK?
« on: July 19, 2018, 03:53:39 PM »
So I am building a controller for a lathe I am going to convert to CNC. The brains of the operation is Mach 4 and an Ethernet SmoothStepper.

I have the axis steppers working fine and now I'm working on spindle control.

I have a CNC4PC C41S PWM-Analog speed control board and a KBIC 125 DC motor driver connected to a 1.5HP DC motor.

I have the C41S connected to the KBIC per the wiring diagram and I have fiddled with the trim pots to get voltages matched up.

If I start the spindle manually, it works. I can move the spindle override up and down and the motor speed follows. "M03 S200" is slow, "M03 S3600" is fast. So far, so good.

I don't have the spindle RPM encoder connected yet so I can't read RPM to know if I'm getting the RPM I'm commanding... but that's fine for now. I'm still prototyping. And I unchecked the box in Mach that has it wait for the spindle to come to speed.

Now, here is the weirdness:

I wrote a quick test GCode program, like this:

M03 S200
G0 X0 Z0
G1 Z3.0
M05
G04 P5
M03 S3600
G0 X0 Z0
G1 Z3.0
M05
%

This works as expected, except for one detail - on the second spindle command (M03 S3600) the spindle turns on, speeds up, then shuts off *before* executing the G0 and G1 moves. And the lights on the SmoothStepper outputs show that, yes, it is actually shutting off the PWM signal to the C41S. The PWM light goes out after the second spindle command, whereas it stays on (as expected) following the first.

What gives?