External laser modulator with Arduino Nano
Posted: Mon Feb 05, 2024 9:59 pm
So I've made workaround solution to the old problem of adjusting laser output by realtime speed of the head to make uniform engraving/cutting of varying size elements.
To make this set-up you will only need Arduino Nano, a few wires and USB cable.
Nano reads data in short timeframes of about 4ms, counting pulses from X and Y outputs of the controller and reads PWM from the laser output. Nano is also receiving Fset value though the serial port from macro loop on startup and upon any change.
Based on calculated head speed and predefined Fset it modifies PWM signal to match speed of laser head travel.
How to make it work:
Results for my application are very good, I'm now able to cut vector text and graphics with same parameters and 2x-3x faster as I'm now using most of the power of my laser. Before I hade to use low Fset with low laser power to get quality results.
I did not test it with raster engraving yet, there may be issues with higher speeds and 4ms approximation cycle though, but this may be adjusted to as low as PWM cycle allows, however short cycles result in higher errors on XY counters as well.
To make this set-up you will only need Arduino Nano, a few wires and USB cable.
Nano reads data in short timeframes of about 4ms, counting pulses from X and Y outputs of the controller and reads PWM from the laser output. Nano is also receiving Fset value though the serial port from macro loop on startup and upon any change.
Based on calculated head speed and predefined Fset it modifies PWM signal to match speed of laser head travel.
How to make it work:
- Edit Arduino code and set your IO pin numbers and your actual pulse per mm. Note that X and Y pins need to support interrupts and output pin needs to support PWM. Compile and upload.
- Make sure you have USB-Serial drivers on the machine where UCCNC is running.
- Connect inputs/outputs, check that you have common ground. Connect Arduino to USB port.
- Add macro file, edit COM port number to match your set-up. Set-up macro loop to run automatically.
Results for my application are very good, I'm now able to cut vector text and graphics with same parameters and 2x-3x faster as I'm now using most of the power of my laser. Before I hade to use low Fset with low laser power to get quality results.
I did not test it with raster engraving yet, there may be issues with higher speeds and 4ms approximation cycle though, but this may be adjusted to as low as PWM cycle allows, however short cycles result in higher errors on XY counters as well.