MazakSpindleGearChange - rmu75/linuxcnc-wiki GitHub Wiki
date: '2005-09-13T06:28:05' title: MazakSpindleGearChange
Spindle Gear Change Logic Flowchart
-
if commanded_speed = 0, go to 17 (no change needed)
-
if abs(commanded_speed) > XXX, go to 5 (need high gear)
-
if abs(commanded_speed) < YYY, go to 12 (need low gear)
-
go to 17 (in overlap region, can use either gear) (note - this is used to implement some hystersis... if the shift point was a single speed, for example 2500 rpm, then a command that changes from 2499 to 2501 and back would result in multiple shifts - having an overlap of some tens or even a few hundred RPM avoids unneccessary shifts)
-
if "HIGH_GEAR" input is active, go to 17 (already in high gear, no change needed)
-
send (zero) to spindle drive, wait until spindle stops
-
de-energise "LOW_GEAR" output, energize "HIGH_GEAR" output (this attempts to mesh the gears)
-
send (slow) to spindle drive (helps the gears to engage)
-
wait for "HIGH GEAR" input (this means the gears are engaged)
-
go to 17
-
if "LOW_GEAR" input is active, go to 17 (already in low gear, no changed needed)
-
send (zero) to spindle drive, wait until spindle stops
-
de-energise "HIGH_GEAR" output, energize "LOW_GEAR" output (this attempts to mesh the gears)
-
send (slow) to spindle drive (helps the gears to engage)
-
wait for "LOW GEAR" input (this means the gears are engaged)
-
go to 17
-
if HIGH_GEAR input is active, set GEAR_RATIO to XXXX
-
if LOW_GEAR input is active, set GEAR_RATIO to YYYY
-
send (commanded_speed * GEAR_RATIO) to spindle drive
-
wait until drive indicates AT_SPEED
-
done