Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: DVanditmars on February 28, 2011, 07:09:08 PM

Title: Spindle speed control when changing direction
Post by: DVanditmars on February 28, 2011, 07:09:08 PM
Looked around and searched the forum...

The spindle motor controller in my machine requires that the motor is stopped before changing direction.
Ideally before changing the spindle direction;
1) Spindle speed is set to 0
2) Wait for the shaft index pulse to read 0 RPM
3) Change the spindle direction
4) Spindle speed back to what it was...

Is there a way to do this with G-Code, or is this something that needs to be done in Mach3?
If in Mach3 any help with that?

Thanks
Derek Vanditmars
Title: Re: Spindle speed control when changing direction
Post by: ostie01 on February 28, 2011, 07:39:20 PM
I'm not sure if I understand correctly your question.

Normally, M3 will spin motor CW
             M4 will spin motor CCW
             M5 will Stop motor

So  you could use M3 S10000 , M5 to stop spindle and M4 S10000 to reverse it at 10000 RPM CCW.


Jeff
Title: Re: Spindle speed control when changing direction
Post by: DVanditmars on February 28, 2011, 07:49:03 PM
In the example, between the M5 (stop) and the M4 S10000, (reverse at 10000 RPM).
There would not be enough time for the spindle motor to come to a complete stop, before starting up again.


Title: Re: Spindle speed control when changing direction
Post by: ostie01 on February 28, 2011, 07:55:16 PM
I think you could use a delay in the spindle tab configuration

But again, never used it myself.

Jeff
Title: Re: Spindle speed control when changing direction
Post by: DVanditmars on March 01, 2011, 09:57:21 AM
Thanks, Jeff.
I think that will work.
Title: Re: Spindle speed control when changing direction
Post by: BR549 on March 01, 2011, 06:48:01 PM
yOu can also modify the M3/M4 macros to allow the spindle to WAIT for it to stop before continueing.

(;-) TP