Skip to content
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

MCU 'mcu' shutdown: Scheduled pwm event will exceed max_duration laser pwm issues #5515

Closed
bihailantian655 opened this issue May 18, 2022 · 6 comments

Comments

@bihailantian655
Copy link

I'm using an lightburn exported marlin gcode file(m3 m4 ), After running for about 5 seconds, an error is reported

MCU 'mcu' shutdown: Scheduled pwm event will exceed max_duration

@jakep82
Copy link

jakep82 commented May 19, 2022

Lasers are not supported by Klipper.

#4128

@bihailantian655
Copy link
Author

The issue is solved
Just turn this parameter up cycle_Time

[output_pin TOOL]
pin: PH6 # use your fan's pin number
pwm: True
hardware_pwm: True
cycle_time: 0.1
shutdown_value: 0
maximum_mcu_duration: 5

@Cirromulus
Copy link
Contributor

Just for clarity, modifying the cycle_time should not affect the max_duration setting... If so, there is some bug worth investigating.
You should have to increase the maximum_mcu_duration value.
In master, it should be handled by klipper anyways, so I wonder how this came about. Long running moves should not affect this anymore. Only in the laser-update fork it is needed to break long-running moves into slightly-less-than-max_mcu_duration-moves.

@bihailantian655
Copy link
Author

bihailantian655 commented May 23, 2022

1 machine cpu mega2560 .

2 my firmware is compiled with the master branch, these seetings are added in the print.cfg

                      [output_pin TOOL]
                      pin: PH6    # use your fan's pin number
                      pwm: True
                      hardware_pwm: True
                      cycle_time: 0.1
                      shutdown_value: 0
                      maximum_mcu_duration: 5
                      # Default: 0 (disabled)
                      # Amount of time in which the host has to acknowledge
                      # a non-shutdown output value.
                      # Suggested value is around 5 seconds.
                      # Use a value that does not burn up your stock.
                      # Please note that during homing, your tool
                      # needs to be in default speed.
                      
                      [gcode_macro M3]
                      gcode:
                          {% set S = params.S|default(0.0)|float %}
                          SET_PIN PIN=TOOL VALUE={S / 255.0}
                      
                      [gcode_macro M4]
                      gcode:
                          {% set S = params.S|default(0.0)|float %}
                          SET_PIN PIN=TOOL VALUE={S / 255.0}
                      
                      [gcode_macro M5]
                      gcode:
                          SET_PIN PIN=TOOL VALUE=0

3 Some gcode will no longer reporte error If set cycle_time: to 0.1 (not all )

4 the maximum value of maximum_mcu_duratio can only be set to 5

@Cirromulus
Copy link
Contributor

You can disable the maximum_mcu_duration if you leave out this config element. But be aware that this disables this safety feature.
What was your cycle_time previously, before setting it to the default value of 0.1?

@bihailantian655
Copy link
Author

thaks for your advice
the previous cycle_time: 0.001 ,

@github-actions github-actions bot locked and limited conversation to collaborators Nov 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants