Lasers and 5v outputs

The 5v outputs can be used for spindle and laser circuits, laser PWM signals and other functions.

Each FluidBoard comes with 4x 5v outputs. Out1 is a simple on-off output, while Out2-4 are PWM capable outputs. Most spindles and lasers use PWM outputs.

How it works

A PWM output switches between 0V and 5V at a fixed frequency (pwm_hz). The fraction of the time the signal is high, the duty cycle, sets the power: 0% is off, 50% is half power and 100% is full power. Most diode laser modules and laser drivers accept this 5V signal directly on their PWM or TTL input. The same signal can drive PWM spindle controllers that expect a 5V control input.

The enable output (Out1) is a plain on/off signal. Some laser drivers have a separate enable or "laser on" input in addition to the PWM input. That is what Out1 is for.

The speed_map translates the S-word in your G-code into a duty cycle. With 0=0.0% 1000=100.0%, S1000 is full power and S500 is half power. Make sure your CAM software uses the same maximum S value (in LightBurn, for example, this is the "S-value max" device setting), otherwise every job runs at the wrong power.

Wiring

Wiring diagram not available. View SVG

  • If your laser has a separate enable pin, connect it to Out1. If not, you can skip this.
  • Connect the PWM pin of the laser or laser driver to Out2.
  • Make sure that the GND is common between the laser or -driver and the FluidBoard.

Check the input of your laser driver before you connect it. Most diode modules use a 5V TTL/PWM input, but some drivers expect a different signal level or an analog voltage. Their datasheet also tells you which PWM frequencies they accept; set pwm_hz accordingly.

The laser itself usually needs much more current than the board can supply, so power it from its own supply and only take the control signals from the FluidBoard. Keep the PWM wire short, and run it together with its GND wire, away from stepper motor cables.

Before powering on, make sure that the environment is safe. Lasers can instantly blind a person. Never point a laser to a person. Always wear protective glasses and check if the environment is safe when working with lasers!

Controller pin Gpio Description
Out1 i2so.31 On-off 5v pin
Out2 gpio.45 PWM capable pin; shared with Mosfet output
Out3 gpio.46 PWM capable pin; shared with Mosfet output
Out4 gpio.3 PWM capable pin; shared with Mosfet output

Out1 (i2so.31) is shared with relay 1. Out2, Out3 and Out4 are the same pins as mosfet outputs 2, 1 and 3, and Out4 is also the pin used for the LED strip. Use each pin for one function only.

Configuration

laser:
  tool_num: 0
  speed_map: 0=0.0% 1000=100.0%
  output_pin: gpio.45 # Connect to Out2
  enable_pin: i2so.31 # Optional; connect to Out1
  disable_with_s0: false
  s0_with_disable: false
  pwm_hz: 5000

If you don't use the enable output, set enable_pin: NO_PIN.

All PWM capable pins are shared with the mosfet outputs.

M3 or M4

With a laser spindle, the difference between M3 and M4 matters:

  • M3, constant power. The laser runs at the commanded S value regardless of the actual speed. When the machine slows down for corners and at the start and end of a move, the same power hits the material for longer, which gives darker or deeper spots there.
  • M4, dynamic power. The power is scaled with the actual speed relative to the programmed feed rate. When the machine slows down, the power goes down with it, and when the machine stands still, the laser is off. This gives an even result and is what you want for most engraving and cutting.

M5 turns the laser off. Most laser CAM software can be set to use M4; we recommend doing so.

Testing it

  1. Put on goggles rated for the wavelength of your laser, close the enclosure and make sure nobody else can look into the beam.
  2. Put a piece of scrap material (cardboard or plywood) under the laser and focus it.
  3. Send a short, low power move, for example M4 S50 followed by G1 X10 F1000, and then M5.
  4. Check that you get a faint, even line. Increase the power in steps and verify that the burn gets darker.
  5. If you use the enable pin, also check that the laser is off after M5 and after a reset.

Laser safety

  • Wear safety goggles rated for the exact wavelength of your laser, with a sufficient optical density. Goggles for a 445 nm diode laser offer no protection against a 10.6 µm CO2 laser, and the other way around. Tinted sunglasses are not protection.
  • Use an enclosure that blocks the wavelength, and an interlock on the lid. The interlock can be wired to an input as a safety door pin, see user inputs. Never bypass an interlock to "just quickly" check something.
  • Never leave a running laser unattended. Cutting and engraving can set the material on fire, and air assist makes a small flame grow quickly. Keep a fire extinguisher nearby.
  • Extract the smoke to the outside. Some materials, such as PVC and other plastics containing chlorine, release corrosive and toxic gases and should never be lasered.

Troubleshooting

Symptom Likely cause Fix
Laser doesn't fire at all GND not common between driver and FluidBoard Connect the driver GND to the FluidBoard GND
Laser doesn't fire at all Enable input of the driver not connected or not active Wire it to Out1 and configure enable_pin, or tie it as the driver manual describes
Laser fires only at full power, or not at all pwm_hz outside what the driver accepts Check the datasheet of the driver and adjust pwm_hz
Jobs come out far too light or too dark CAM maximum S value doesn't match the speed_map Set the CAM maximum to 1000, or change the speed_map
Dark spots at corners and line ends Job uses M3 Use M4 for dynamic power
Laser or other output acts strangely The pin is also used as a mosfet output or LED strip Use each shared pin for one function only
Copyright (c) 2024 by NubiloSoft, all rights reserved.
Accepted payment methods