by ArtF » Fri Dec 30, 2016 2:27 am
Hi Dan:
Well, I took a look. Turns out I roughed in a bit on Spindles as I built Auggie. I dont use spindle as I use a slider for my
laser power. However, the code is there to help setup the spindle. Ill add what we may need.
So, the way it works is the GCode library has hooks in it for SetSpindleSpeed and such, and those hooks call whatever global is available.
For example, on a Gcode S word S3000, the Gcode library function SetSpindleSpeed is called with 3000 as the parameter. It then calls
SetSpindleSpeed(3000). That function at present occurs in 3 libraries, The LaserSpindle, FreqSpindle, and RelaySpindle libs. As I only use LaserSpindle, if you look at that library youll see I ignore S calls. Id advise you to turn off laser spindle, turn on SpindleFreq and modify that library.
Now there is an internal global called "SpindleSpeed". If you set a DRO on the screen and name it "SpindleSpeed", youll notice it starts up
with 1000 in its value. In your library SpindleFreq, you can modify the SetSpindleSpeed call to do a
GlobalSet("SpindleSpeed", value); so that the new Gcode word sets the internal variable, and the DRo. You can also put a slider on the screen, name it "SpindleSpeed" as well. That slider will now work just like a Gcode call and vary the speed. If Gcode calls for S to change, both the DRO and the slider will change together. Change one and the others will follow. Use the script to set the PWM as you wish for the various speeds.
There is also an internal variable named "SpindleOn" that you shoudl set if you wish in the M3/M5 calls. A LED dropped on the screen will then show its condition.
Thats how its all supposed to work.
Art
Hi Dan:
Well, I took a look. Turns out I roughed in a bit on Spindles as I built Auggie. I dont use spindle as I use a slider for my
laser power. However, the code is there to help setup the spindle. Ill add what we may need.
So, the way it works is the GCode library has hooks in it for SetSpindleSpeed and such, and those hooks call whatever global is available.
For example, on a Gcode S word S3000, the Gcode library function SetSpindleSpeed is called with 3000 as the parameter. It then calls
SetSpindleSpeed(3000). That function at present occurs in 3 libraries, The LaserSpindle, FreqSpindle, and RelaySpindle libs. As I only use LaserSpindle, if you look at that library youll see I ignore S calls. Id advise you to turn off laser spindle, turn on SpindleFreq and modify that library.
Now there is an internal global called "SpindleSpeed". If you set a DRO on the screen and name it "SpindleSpeed", youll notice it starts up
with 1000 in its value. In your library SpindleFreq, you can modify the SetSpindleSpeed call to do a
GlobalSet("SpindleSpeed", value); so that the new Gcode word sets the internal variable, and the DRo. You can also put a slider on the screen, name it "SpindleSpeed" as well. That slider will now work just like a Gcode call and vary the speed. If Gcode calls for S to change, both the DRO and the slider will change together. Change one and the others will follow. Use the script to set the PWM as you wish for the various speeds.
There is also an internal variable named "SpindleOn" that you shoudl set if you wish in the M3/M5 calls. A LED dropped on the screen will then show its condition.
Thats how its all supposed to work.
Art