-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling LASER_POWER_INLINE breaks M3 S gcodes #22152
Comments
Checking deeper, unitPower is not the reason for this issue. M3 S80 planner.cpp Planner::_populate_block |
This feature #define LASER_POWER_INLINE_TRAPEZOID is what sets the laser to 0 on any subsequent G1 move. Digging further. |
This issue has been brought up in #18965. The main problem is that inline is set to always on in the planner code by doing a laser_inline.status.isPlanned=true in every loop. The isPlanned flag grants control with planner movement and laser power. The second issue is the set_inline_enabled(bool) function does not set the isPlanned flag which appears to be the correct way to set it. Digging further. |
One can certainly see why there are issues here: The function set_inline_enabled(false) enables inline mode? This is so misleading! I will fix this madness :-/ |
Ok, I have a solution, needs more testing, I will gen a PR and link it to this issue. Basically by setting planner.laser_inline.status.isPlanned as true or false within the M3,M4 and M5 gcodes it resolved the G1..G5 moves disabling the basic M3-5 mode. There are two redundant inline disable functions, will remove the duplicate and setup set_inline_enabled(bool) as the control call. |
There are clearly incomplete functions within the inline laser power features as M4 does not appear to be implemented. Yet it is commented in the headers: /**
* Laser:
* M3 - Laser ON/Power (Ramped power)
* M4 - Laser ON/Power (Continuous power) <- This is not functional in the current code.
* It would greatly benefit Marlin to implement M4 as a dynamic mode like the more popular GRBL 1.1 laser mode code. Also I see no real benefit to the use of M3 Onnn I to activate PWM on the output and based on the available software e.g. Lightburn, LaserWEB, LaserGRBL etc. it is not supported by any of them. PWM is actually set with Snnn so why the extra function was created is not clear to me. The M3 Onnn code also does not work with CUTTER_POWER_UNIT display functions of PERCENT or RPM. It only functions for PWM255 and requires work arounds to display a non PWM value. Does any one have an issue with deprecation of the M3 Onnn SCODE? |
@thinkyhead do you have any info/positioning on the laser inline functions? |
Do you think fixing this issue should fix mine, too? Eventually just calling |
Yes it will. That change is in the soon to be issued in a PR which will address the inline and standard mode conflicts. This will not address the pause problem, that's more involved as there are too many ways one can pause the system. I may possibly use the marlin state function global to address the pause problem. I have not decided yet. |
Our friend @shitcreek may have some insights and some familiarity with recent laser code updates, plus may even have a laser to test with. I do not feel confident about my qualifications to touch this code. |
@descipher @Fusseldieb - take a look at my PR: #20202 |
I have read that PR, it will not merge without some conflict updates. Could move some of the trap improvement functions over to a PR that addresses the incompatibility and flow safety control with inline vs standard mode. However I don’t agree with the M3 delay work around though. |
I am looking at a way to define a relative power factor based on current stepper movement speed. This would allow dynamic power and a different way to handle the acceleration to power relation. |
Should I try to turn off the chiller and see if it turns off the laser, using this PR? |
This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Did you test the latest
bugfix-2.0.x
code?Yes, and the problem still exists.
Bug Description
When setting #define LASER_POWER_INLINE any cutter M3 S command no longer sets laser power.
Specifically when the INLINE code does not parse moves with an inline parameter the cutter.unitPower global is set to 0. This action prevents any M3 standard power settings.
M3-M5.cpp
calls inline_disable() when no I or O parameter is matched.
Bug Timeline
Unknown, likely since the INLINE feature was added.
Expected behavior
Power control should be available for non inline laser/cutter gcodes.
Actual behavior
Laser does not power on with any basic M3 gcode e.g. M3 S80.
Steps to Reproduce
#define LASER_POWER_INLINE
issue any M3 Snn
Version of Marlin Firmware
bugfix-2.0.x (2.0.9.0)
Printer model
Custom
Electronics
Mega2560/Ramps1.4
Add-ons
No response
Your Slicer
No response
Host Software
No response
Additional information & file uploads
No response
The text was updated successfully, but these errors were encountered: