Feature: Add Laser Inline Power control#153
Conversation
a23795f to
9996449
Compare
|
This patch was developed primarily on firmware v1.10.1. ~6 people have been testing this with me without issue for the past year.
Testers have reported speedups of jobs generated in Lightburn with inline power of up to 4x compared to Luban jobs due to the elimination of pauses. This pull request maintains full compatibility with Luban. However, additional value would be added in the future by enabling inline power gcode generation within Luban to reduce job completion times. |
|
Hi @brent113, Best Regards |
9996449 to
c7f5a57
Compare
|
Rebased onto latest Snapmaker commits |
|
@scotthsl is there any update how the testing is going and an ETA when we can expect this to be released into the firmware? |
c7f5a57 to
e4009bc
Compare
|
Hi @brent113, |
|
Any update on this? When it's gonna be available for us? |
This pull request adds a new feature: Laser Inline Power. This greatly enhances job completion time and quality for many types of jobs.
This pull request implements a feature from Marlin that was added to Marlin after Snapmaker forked. This addition is based on the work contained in this pull: MarlinFirmware/Marlin#15335. Inline laser power is also a standard feature on GRBL firmware, another common laser cutter firmware.
Summary of New Features
M3-M5in the form ofM3 Pxx I(https://marlinfw.org/docs/gcode/M003.html)M3 SxxSxxandPxxtoG0-G3movement commands to move with inline laser power specified in the form ofG1 Yxx Pxx. (https://marlinfw.org/docs/gcode/G000-G001.html)G28home command disables the laser for enhanced safety.M3 SxxAdditional Changes
G28home command disables the laser for enhanced safety.toolhead_laser.cppto accommodate calls from within the stepper ISR by not triggering CAN communications within the ISR.When not enabling laser inline power the machine behaves the same as previous firmware, with the exception of the change made to
G28.Description of Laser Inline Power Behavior
When enabled by using the
Iparameter laser control is moved into the planner and motion control modules to allow for smooth power changes.First a review of previous laser power control:
The
M3command first callsplanner.synchronize();which waits for all motion to complete. The machine decelerates and comes to a stop, then the laser power is changes, and then the machine accelerates to continue. Each deceleration/acceleration results in additional dwell that affects the accuracy of dwell timing, resulting in a slightly darker than intended laser burn. This is most pronounced when using continuously variable power in software like Lightburn (Lightburn calls this 'grayscale' mode, which is not dithered).New behavior of laser inline power

Control of the laser power has been moved into the planner and stepper ISR. The planner adds the requested power onto the motion block. As the blocks are executed in the stepper ISR the laser power is scaled with acceleration trapezoid to eliminate darkening caused by the machine moving at less than the commanded speed with the full laser power.
As the laser power is being controlled via the planner the
planner.synchronize();is not necessary which allows the machine to use optimized exit and entry velocities similar to 3D printing.Comparison between old and new behavior

Here is a sample from a job using grayscale mode from Lightburn without laser inline power. Each concentric circle on the left and vertical line on the right is where the laser power changed, resulting in a pause as the motion came to a stop and resumed.
By enabling laser inline power and eliminating harmful motion pauses the job completes approximately 2x faster and is of higher quality.

When Lightburn or other software is configured to use inline power it generates gcode similar to the following: