Laser Manual: Difference between revisions

Jump to navigation Jump to search
→‎LinuxCNC operation: formula for laser output with M3 S#
m (→‎How Our Laser Uses G-code: update resolution, link to linuxcnc gcode documentation)
(→‎LinuxCNC operation: formula for laser output with M3 S#)
Line 316: Line 316:


There is a small white plastic post near the laser that can be used to measure the height. Place the fat end on the surface of your workpiece and the flat part of the notch against the side of the lens. If the post doesn't reach the lens or the lens is below the notch, make a coarse adjustment as necessary. '''Be careful not to bring the lens down on top of the post.''' When the lens is in the notch, raise the table in small steps while looking straight down at the post through the window. As soon as it moves away from the lens, back up one step.  For cutting through thicker material, you want the laser's focus point to be 'inside' the material, so once you have the focus dialed in using the post, move the table up by half the thickness of the material.
There is a small white plastic post near the laser that can be used to measure the height. Place the fat end on the surface of your workpiece and the flat part of the notch against the side of the lens. If the post doesn't reach the lens or the lens is below the notch, make a coarse adjustment as necessary. '''Be careful not to bring the lens down on top of the post.''' When the lens is in the notch, raise the table in small steps while looking straight down at the post through the window. As soon as it moves away from the lens, back up one step.  For cutting through thicker material, you want the laser's focus point to be 'inside' the material, so once you have the focus dialed in using the post, move the table up by half the thickness of the material.
=== G-code ===


=== How Our Laser Uses G-code ===
=== How Our Laser Uses G-code ===
Line 334: Line 332:
Controlling the laser with the Z axis can be tricky because LinuxCNC thinks that there is a moving physical object attached to the axis and tries to constrain its motion. The M62/M63 commands are realtime and instantaneous, meaning that they can be used to turn the laser on/off without affecting X/Y motion, at least in theory. You can put these commands on the same line as a motion command, in which case the laser will be turned on/off at the *beginning* of the motion.
Controlling the laser with the Z axis can be tricky because LinuxCNC thinks that there is a moving physical object attached to the axis and tries to constrain its motion. The M62/M63 commands are realtime and instantaneous, meaning that they can be used to turn the laser on/off without affecting X/Y motion, at least in theory. You can put these commands on the same line as a motion command, in which case the laser will be turned on/off at the *beginning* of the motion.


'''''The following feature still needs a bit of tweaking. Don't use it for anything serious yet:''''' 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.
=== 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.
 
total output power = 25 watts * S_value * (switches_value / 15)
 
example: switches set to 1+2+3 = 6, S0.5, total output power = 25 watts * 0.5 * (6/15) = 5 watts


A G-code program for our laser should look something like this:
A G-code program for our laser should look something like this:
Line 342: Line 346:
  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 S1              (enable laser and set to full power)
  M3 S0.5            (enable laser and set to 50% power)
  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)
  ...
  ...
  G0 X0 Y17.5 M63 P0 (turn laser off and move gantry out of the way)
  G0 X0 Y17.5 M63 P0 (turn laser off and move gantry out of the way)
  M5                (disable laser)
  M5                (disable laser)
S1                (always set power scale back to 100% for the next job)
  M2                (end program)
  M2                (end program)


Navigation menu