Laser Manual: Difference between revisions

Jump to navigation Jump to search
3,362 bytes added ,  3 November 2018
Speed-independent power, Spindle Override slider
(→‎LinuxCNC operation: formula for laser output with M3 S#)
(Speed-independent power, Spindle Override slider)
Line 334: Line 334:
=== Control laser power from G-code ===
=== Control laser power from G-code ===


The power of the laser can be controlled from G-code by setting the spindle speed with S#, where the number is between 0 and 1. This will effectively be multiplied by the power level set with the hardware switches. Power level set with the S command is fairly detailed, with at least 50 distinguishable levels. The power can be set so low that it only leaves a faint mark on paper.
The power of the laser can be controlled from G-code by setting the spindle speed with S#, where the number is between 0 and 1. This will effectively be multiplied by the power level set with the hardware switches. Power level set with the S command is fairly detailed, with at least 50 distinguishable levels. The power can be set so low that it only leaves a faint mark on paper. Additionally, the S number can be modified with the Spindle Override slider next to the Feed Override slider.


  total output power = 25 watts * S_value * (switches_value / 15)
  total output power = 25 watts * S_value * (switches_value / 15) * spindle_override


example: switches set to 1+2+3 = 6, S0.5, total output power = 25 watts * 0.5 * (6/15) = 5 watts
example: switches set to 1+2+3 = 6, S0.5, spindle override = 100%, total output power = 25 watts * 0.5 * (6/15) * 1.0 = 5 watts
 
Setting S * spindle override > 1 does not output more than 25W of power :(


A G-code program for our laser should look something like this:
A G-code program for our laser should look something like this:


G20                (units are inches)
  M63 P0            (start with laser off)
  M63 P0            (start with laser off)
  G0 Z0.002          (ditto)
  G0 Z0.002          (ditto)
  G0 X2.5 Y3        (move to start position)
  G0 X2.5 Y3        (move to start position)
  F60                (set feed rate)
  F60                (set feed rate)
  M3 S0.5            (enable laser and set to 50% power)
  M3 '''S0.5'''           (enable laser and set to 50% power)
G1 X7.5 Y3 M62 P0  (turn laser on and start controlled movement)
...
G0 X0 Y17.5 M63 P0 (turn laser off and move gantry out of the way)
M5                (disable laser)
'''S1'''                (always set power scale back to 100% for the next job)
M2                (end program)
 
Since LinuxCNC automatically turns off the spindle when a program stops, there should be no danger of the laser ever being on unexpectedly. However, just to be safe, you should turn off all laser related signals at the beginning and end of every program.
 
=== Speed-independent power ===
 
The laser cuts corners slower than straight lines because of finite acceleration. This results in the cut being uneven, deeper and wider in the corners, and straights not cutting all the way through. To compensate for this, the laser now has an additional mode: Speed-independent power. The laser will scale the power output based on actual cutting speed, and you should get exactly the same depth of cut and kerf everywhere.
 
Power settings become more complicated in this mode because of quirks in LinuxCNC's motion planner.
S# is still used to set it, but the value is not just fractional power between 0.0 and 1.0, but is fractional power per inch per second.
Because the power and speed are tied together in this mode, the F number now does not set the feed directly, but sets the maximum feed, and actual feed is set using [http://linuxcnc.org/docs/html/gcode/m-code.html#mcode:m52 Adaptive feed control]. Since F is a maximum, you can set it to F3000 for any file and let adaptive feed will run the job as fast as possible while delivering the requested power.
 
G-code to use this mode:
 
G20                (units are inches)
M63 P0            (start with laser off)
G0 Z0.002          (ditto)
G0 X2.5 Y3        (move to start position)
(set manual power switches to all on, 15/15)
'''F3000'''              (set '''MAX''' feed rate)
'''M4''' S0.5            (enable laser in speed-independent power, 12.5 W/inch/second output)
'''M52 P1'''            (enable adaptive feed control)
  G1 X7.5 Y3 M62 P0  (turn laser on and start controlled movement)
  G1 X7.5 Y3 M62 P0  (turn laser on and start controlled movement)
  ...
  ...
Line 352: Line 382:
  M5                (disable laser)
  M5                (disable laser)
  S1                (always set power scale back to 100% for the next job)
  S1                (always set power scale back to 100% for the next job)
'''M52 P0'''            (disable adaptive feed control)
  M2                (end program)
  M2                (end program)


Since LinuxCNC automatically turns off the spindle when a program stops, there should be no danger of the laser ever being on unexpectedly. However, just to be safe, you should turn off all laser related signals at the beginning and end of every program.
This example ends up setting the adaptive feed to 120 in/min (2 in/s), and outputting 25W when the laser is at speed.
* <code>S0.25</code> would be full power at 240 in/min
* <code>S4</code> - full power at 15 in/min
 
In theory, this means there's an S# number that will cut through a specific material, then S#*2 will cut through double the thickness of the same material.
In practice, this works with cutting acrylic, but etching wood seems to be more sensitive to the speed rather than total power applied. This is why the F value is still useful.
 
* <code>S1 F60</code> will apply full power at 60in/min
* <code>S1 F30</code> will apply half power at 30in/min (the same total power, but over a longer period of time)
 
The Spindle Override slider can modify the S valued at run time, and with the adaptive feed enabled, will modify the feed rate to maintain maximum cutting speed. The Feed Override slider will behave counter-intuitively, setting it to >100% will not do anything unless your F is low enough for adaptive feed to not engage. Setting it <100% will make the feed slower, but since this is the speed-independent power mode, the output power will adjust to maintain the same W/in/s.


== Troubleshooting ==
== Troubleshooting ==

Navigation menu