PWM Tuning for Smoothie Firmware
Every laser is unique and it is important to tune your PWM settings for best performance. For more information about PWM control and digital vs. analog setups: PWM Control
The best way to go about testing PWM levels using GCode is:
- Set your max laser output to 10mA
- Send the command
G1 X10 S0.1 F600
from your laser control software console. - Vary the X value – new target coordinate (to get a new burn location) and S value – power level between 0 and 1 (to vary the burn power via PWM)
Here is an example set of commands you can run that will move the head and fire at a number of power levels
- G21
- G0 X0 Z0
- G0 X0 Y10
- G1 X10 S0.1 F600
- G0 X0 Y15
- G1 X10 S0.2 F600
- G0 X0 Y20
- G1 X10 S0.3 F600
- G0 X0 Y25
- G1 X10 S0.4 F600
- G0 X0 Y30
- G1 X10 S0.5 F600
- G0 X0 Y35
- G1 X10 S0.6 F600
- G0 X0 Y40
- G1 X10 S0.7 F600
- G0 X0 Y45
- G1 X10 S0.8 F600
- G0 X0 Y50
- G1 X10 S0.9 F600
- G0 X0 Y55
- G1 X10 S1 F600
- G0 X0 Y0 Z0
You may be able to see different amounts of burn, but you should definitely see the mA gauge needle go to a somewhat different value each time. For example, S1 is 100% and with the pot at 10mA, I would expect to see the needle close to 10mA. S0.4 is 40% and I would expect to see the needle somewhere around 4mA. Laser power is not linear, so it won’t be exact, but you should be in roughly this range.
If your laser is not behaving as expected (a common occurrence would be it is firing at full power regardless of the S value) try tuning the PWM period in the config file on the MicroSD Card in the Cohesion3D Mini / LaserBoard. The default value for the pwm period is 200 and this works for quite a few machines. However, you may need to set it to 400 for your machine to start responding to pwm and outputting proper “gray” burns. In the SD card config file look for:
laser_module_pwm_period 200
After you have changed the 200 to 400, you must save the config file, close it, safely eject the drive in Computer (another term for this is unmount) and reset the Cohesion3D Mini / LaserBoard.
Repeat the burn lines procedure and observe whether the machine is now burning at the proper power levels.