Hello Guest it is August 03, 2020, 06:02:43 AM

Author Topic: Soft Start for Spindle Motor G Code Routine  (Read 26979 times)

0 Members and 1 Guest are viewing this topic.

Soft Start for Spindle Motor G Code Routine
« on: September 09, 2008, 08:34:07 PM »
Hi,

I have a Syil SX3 Mill fitted with the original Seig Spindle Control Boards.

Later boards have a "soft start" feature for the spindle speed. I personally don't like the later boards because of the slow accelation rate to spindle speed. The soft start feature appears to emulate pushing of the front panel up arrow buttons and is set in firmware. It is far too slow for the spindle to come up to full speed of say, 3000rpm.

The original boards do not have a soft start feature and this places a lot of stress on the spindle motor and belt when a speed of 3000+rpm is selected under G Code Control.

When is issue S3000 from 0 RPM, my machine instantly overshoots the requested set speed and settles back to 300RPM.

I have a soft start G Code solution which meets my requirements which I tested this arvo as follows:

(Soft Spindle Start Template)
(This routine brings the spindle up to 3000 rpm in small steps)

(CJH 27Jun08)

G00 G17 G21 G40 G49 G50 G64 G80 G90 G94
M6 T6 (5mm Drill)
M3 S750
G04 P100
S1000
G04 P100
S1500
G04 P100
S2000
G04 P100
S2500
G04 P100
S2800
G04 P100
S3000
M8 (Coolant on)
F2000
G00 Z10
G00 X0 Y0 Z3

G00 Z15 F2000

M5 M9 (Spindle and Coolant Off)

G00 X0 Y0 (Return to start position)
M30
%

The "G04 Dwell in ms" config settings under "General Config" in Mach 3 or Quantum must be selected for this code to work. I am using Quantum at the moment.

What the code does is to start the spindle at 750rpm, then waits (dwells)for 100ms (0.1 seconds), then increases to 1000rpm, then waits for another 100ms, and repeats this in 500rpm increments until 3000rpm is acheived. The speed ramp up to 3000rpm happens very quickly and smoothly without the stress on the motor and belt.

You can experiment with G04 P********* dwell times and the speed start speed and increase increments to suit your machine.

Hope is is useful to others.

Regards

Chrisjh
Re: Soft Start for Spindle Motor G Code Routine
« Reply #1 on: August 28, 2009, 05:41:37 PM »
Very useful and undoubtedly would allow for less current surge, less strain on motors etc - Not something I'd thought of using Gcode for :)

I don't have variable speed spindle drives but you could do it like this (I think) as apart from anything else I've become a most beastly evangelist for parametrics.

I've written in some thoroughly verbose comments for each line as I'm well aware there are those who haven't used parametrics much (and those who are just starting out, hopefully this will help)


#1=0                     (sets variable "1" to zero, creating it first if it does not already exist)
M98 P111 L56         (calls subroutine "O111", 56 times)


                             (place this at the end of the code with other subroutines)

O111
#1=[#1+100]        (100 is the acceleration incriment)
                            (this line raises variable 1's value by 100)
M03 S #1              (starts spindle if not already running, sets spindle speed to the value of variable 1)
G04 P2                 (waits 10ms)
M99                     (exit subroutine and go back to main code)
%


All this does is save you typing really, but it does mean you can just put your subroutine at the end then call

#1=0
M98 P111 L25

Which resets variable "1" and then ramps up the spindle speed to 2,500 RPM. you must put #1=0 before calling the subroutine because variables are persistent within the program, and if you don't zero "1" then the spindle will just hard-start at whatever value it had previously and accelerate from there! Otherwise, two lines of code to start the spindle and set its final speed according to the predefined acceleration ramp you've set in the subroutine - in this case 1,000 RPM per second.

It simulates ok for me on my laptop with no machine attached, I'd be interested to know how it goes on someone else's machine with a variable drive. As usual - own risk, no warranties etc..

Offline Graham Waterworth

*
  • *
  •  2,113 2,113
  • Yorkshire Dales, England
    • View Profile
Re: Soft Start for Spindle Motor G Code Routine
« Reply #2 on: August 31, 2009, 06:58:02 AM »
Your other option is to write it into your M3.m1s macro, then its done with the M3 call every time with no extra code in your program.

Graham
Without engineers the world stops
Re: Soft Start for Spindle Motor G Code Routine
« Reply #3 on: August 31, 2009, 04:51:43 PM »
^Also good, and more practical in use :)

Offline Vogavt

*
  •  258 258
    • View Profile
Re: Soft Start for Spindle Motor G Code Routine
« Reply #4 on: February 01, 2015, 05:26:06 PM »
Yeah this is old but I need some help with the syntax.

Code: [Select]
DoSpinCW()


#1=0                     (sets variable "1" to zero, creating it first if it does not already exist)
M98 P111 L37         (calls subroutine "O111", 37 times)


 (place this at the end of the code with other subroutines)

O111
#1=[#1+100]                      (100 is the acceleration increment - this line raises variable 1's value by 100)
 S #1              (starts spindle if not already running, sets spindle speed to the value of variable 1)

G04 P2                 (waits 10ms)

M99                     (exit subroutine and go back to main code)
%

I'm saving this as my m3.m1s file but I'm getting a "Scripter Compile Error in M3.m1s" message.

Offline Vogavt

*
  •  258 258
    • View Profile
(No subject)
« Reply #5 on: February 04, 2015, 01:09:02 PM »
DoSpinCW()

#1=0
M98 P111 L37
O111
#1=[#1+100]
 S #1
G04 P2

M99
%

I'm tried this as my m3.m1s file too but I'm still getting a "Scripter Compile Error in M3.m1s" message.

Anybody?

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: Soft Start for Spindle Motor G Code Routine
« Reply #6 on: February 04, 2015, 06:57:34 PM »
Give This a try it is a 3 second softstart. Place the code inside your M3 macro.

Message"Spindle Starting"
SpeedMax = GetDRO(17)
Speedstep = (Speedmax/3)
Code"S"& SpeedStep
Code"M3"
Code"G4P1"
Code"S" & (SpeedStep *2)
Code"G4P1"
Code"S"& (SpeedStep *3)
Code"G4P1"
Message"Spindle Up To Speed"

End        


Just a thought, (;-) TP

Offline Vogavt

*
  •  258 258
    • View Profile
(No subject)
« Reply #7 on: February 04, 2015, 10:02:41 PM »
Will definitely try first thing in the morning. I'd have thought that having Code "M3" within the M3 macro would be a problem.
 We shall see...

Offline Vogavt

*
  •  258 258
    • View Profile
(No subject)
« Reply #8 on: February 04, 2015, 10:04:59 PM »
Also shouldn't there be a "DoSpinCW ()" somewhere?

Offline Vogavt

*
  •  258 258
    • View Profile
(No subject)
« Reply #9 on: February 04, 2015, 10:15:18 PM »
Maybe this would work:

Message"Spindle Starting"
SpeedMax = GetDRO(17)
Speedstep = (Speedmax/3)
Code"S"& SpeedStep
Code"DoSpinCW()"
Code"G4P1"
Code"S" & (SpeedStep *2)
Code"G4P1"
Code"S"& (SpeedStep *3)
Code"G4P1"
Message"Spindle Up To Speed"

End       


I'll try them both if the first one doesn't work.

 Thanks for the help!