hello I have a PWM laser I’m trying to controll it using lightburn, the only solution that i found is to controll it like a servo using pin D11 on ramps 1.4 please to wich pin should i plug my laser to on ramps 1.4 in order to be controlled by the COMMAND M106.
Thanks.
Are you married to using Marlin on the controller? If not, I’d suggest that you consider a GRBL based solution.
I prefer to use Marlin cause i have an H-bot robot and it’s easier for me to configure it in marlin as COREXY.
JTech recommends using D9 (extra fan) for laser PWM control.
RAMPS1.4 Laser Upgrade from J Tech Photonics, Inc.
The problem with most Marlin solutions that use either the fan or bed heater pins is that PWM frequency is typically quite low.
The Arduino Mega should be able to be configured for a reasonable PWM. You want 1000Hz minimum for a diode laser. You should be able to configure Marlin at compile time to enable faster PWM but may not come that way by default.
Note that while M106 will work ideally you’d want to be using one of the more advanced control schemes like Inline.
Hello thanks for the information that fact that I have a laser with three wires which are 12 Volts,GND,PWM so when I use D10 pin it gives different voltage according to the signal PWM sent so D10,D9,D8 won’t work for me. I’m trying right now to see how to use the command M03 i found that’s related with the pin D11 which should work fine for me as PWM pin But i don’t yet to wuich pin this command is connected to.
From the article they are using PWM with D9. In that case I assume it’s only providing PWM and GND on the + and - terminals. You will need to get power from another source.
You can test this easily with a meter. D9 should give you 0V at 0% power and 5V at 100% power.
Probelm is that the voltage goes up till 12V for at 100% power.
Is that on D9? What is voltage at 0%?
I can see comments about how D9 outputs up to 12V.
There are some laser modules that are 12V tolerant for PWM but you would need to confirm for your particular laser module.
Here’s another article that talks about remapping D9 to pin 44 to get 5V.
Laser intensity control - RAMPS 1.4 and TTL (5V) diode laser how to - Repetier-Forum
at 0% the voltage is 0V.
I did the remapping D9 to pin 44 and it worked but i noticed that i couldn’t get to the maximum power of the laser even if i did use s255 command.
Thanks
If that’s the case then something else wrong. What is voltage at 100% power? If it’s 5V then it’s likely working correctly.
How are you determining that it’s not at maximum power?
I used my laser with the pwm wire and without it i noticed that the power when the PWM is not wired is higher than when the pwm is attached.
What is voltage on pin 44 at S255?
Do you have a scope or logic analyzer? Are you able to test duty cycle of pin 44?
How are you using the laser without the PWM wire?
Hello sorry but I wasn’t able to test the voltage the last time but now I did and at s255 it’s 5V and the laser functions at full capacity.But when i want to excute a gcode the laser don’t fonction and it gives me echo:Unknown command: “G21”
echo:Unknown command: “M8”
echo:Unknown command: “M9”
Flux terminé en 0 :00
Do you have any idea on where the problem might be ?
Can you show the full context of the message? Those should all be valid commands so something in the specific context may be incorrect.
Actually I’m facing a problem with my motors so i tried to know if light burn would execute the gcode i wanted to check if laser would function. so i had this problem.
Can you copy/paste the full text from Console?
Also, did you enter these commands manually or some other way?
well now the motors they are functioning but laser won’t execute knowing that laser fonction well with command M106.
You’re losing me and I feel like we’re having 2 separate conversations.
What’s changed since your first post today? You’ve indicated change in behavior but not explained how that was achieved.
And why is laser not working now but it did earlier? What’s put you in this position?
I’m sorry First I had problem with marlin i couldn’t control the steppers but know i solved it, the problem I’m facing is that the laser cuts only two times while it should do three.i get the
is message : echo:Unknown command: “G21”
echo:Unknown command: “M8”
echo:Unknown command: “M9”
and my g code is this :
; LightBurn 1.2.01
; Marlin device profile, absolute coords
; Bounds: X48 Y46 to X962 Y935
G21
G90
; Cut @ 50 mm/sec, 100% power
M8
M106 S0
G0 X48 Y46 F0
; Layer C00
M106 S255
G1 Y312 F3000
G1 X396
G1 Y46
G1 X48
M106 S0
G0 X639.418 Y134.946 F0
M106 S255
G1 Y467.946 F3000
G1 X879.418
G1 Y134.946
G1 X639.418
M106 S0
G0 X668 Y578 F0
M106 S255
G1 Y935 F3000
G1 X962
G1 Y578
G1 X668
M9
M106 S0
G90
; return to user-defined finish pos
G0 X0 Y0 F0
How are you running this? Are you connected to the printer through USB or is this through an SD card?
If you’re connected through USB can you copy/paste all the output from Console even before the error message?
G21, M8, and M9 should all be supported in Marlin without issue.