-
-
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
[BUG] Laser control output does not match set value #18848
Comments
Config files need to be in a zip archive. then you just drop the zip in the boy of a reply. |
Thanks for your reply. I know a multimeter is not optimal for measuring pwm duty cycle, but I have no osciloscope. |
Still need config files.So we can replicate settings, see version, determine motherboard type etc. |
Configurations, please RTFT |
Well first thing I notice is you have Dual X and Dual Y stepper motors and 1 extruder... so you seem to have modified the pins file to add in an extra stepper driver, and perhaps the laser pin... |
First of all, thanks for checking! That's correct. I am using a CNC machine with two steppers and two endstops on both the x and y axis. I am not using a extruder, but since marlin (at least according to the cnc documentation) needs at least one extruder, I changed the pins according to the CNC documentation. Here is the pins file. I am using the servo pins to control relays, so I am using pin 44 as the laser pwm pin. |
you can set extruders to 0 in marlin... |
It does look like something is wrong I just have LED on pin 44. If I use pin 44 just as a PWM with M42 P44 S240 I see the following in M43 and the led is quite bright. PIN: 44 Port: L5 <unused/unknown>PWM: 240 TIMER5C PWM: 240 WGM: 1 COM5C: 0 CS: 3 TCCR5A: 9 TCCR5B: 3 TIMSK5: 0 But if enable laser and use M3 S240 the led is dull and m43 gives the following. PIN: 44 Port: L5 SPINDLE_LASER_PWM_PIN PWM: 240 TIMER5C PWM: 240 WGM: 14 COM5C: 0 CS: 1 TCCR5A: 10 TCCR5B: 25 TIMSK5: 0 This is something to do with setting SPINDLE_LASER_FREQUENCY So that might be a short term fix while I look further. |
Thanks! For the time being I will disable SPINDLE_LASER_FREQUENCY. Where can I find updates on when this bug is fixed? |
I have it working on test machine.. just checking it doesn't break anything else! |
The above PR fixes it. |
This has been merged into bugfix.. now it needs retested. |
Thanks! I added the changed code to my firmware and now the M3 command works as expected. I have one question however. I am using inline laser control. The inline laser control workds as expected, but now the laser is turned of when I do a G1 or G0 movement without a S?? parameter. Is this normal? I attached a gcode file. On every M3 S60 command, the laser turns on, but it turns off directly after that on the next G1 movement. When I set the laser power with an inline command, it does stay on on the next move without a S?? parameter. For example: G1 X5 S60 // laser turns on But: M3 S60 // turns the laser on In configuration_adv.h, I have disabled #define LASER_MOVE_G0_OFF |
That doesn't seem correct. The way I read things when M3 is used Laser/spindle should stay on till M5 is given. @jediminer543 and @shitcreek can you guys confirm or deny? (need someone who actually uses a laser!) |
Thanks! I hope the other people you tagged can verify it and confirm it or tell me what I am doing wrong |
Since you opened this as a new issue, closing this one as finished. |
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. |
Sorry, just saw this now. With I hope it clears it up. |
Bug Description
Laser output does not match the set value. When I set the laser to full power, I get the (correct) output of 5V, but when the value is just 1 unit lower, it immediately drops to 0.18V. For values from 0 to 254, the output scales from 0V to 0.19V.
My Configurations
Marlin.zip
Steps to Reproduce
Expected behavior:
The laser pwm output should match the set value
Actual behavior:
When I set the laser to full power, I get the (correct) output of 5V, but when the value is just 1 unit lower, it immediately drops to 0.19V. For values from 0 to 254, the output scales from 0V to 0.19V. I measured everything with a multimeter because I don't have a osciloscope, but when I connect the laser, it it barely turns on when the power is set to anything below 255.
Additional Information
The text was updated successfully, but these errors were encountered: