Welcome! Log In Create A New Profile


Can't understand how laser mode is supposed to work

Posted by jabbarider 
Can't understand how laser mode is supposed to work
September 09, 2022 09:34AM
I converted ender 3 to control my diy laser module, it uses XYENABLE pin to control it with pwm. Original X and Y steppers enable have been pulled down to ground with 100k resistor so it works now.
The problem I'm having is marlin doesn't understand the gcode sent from lasergrbl. I got it to the point where I can do "G1 X10 Y10 F1000 S100" and it will move correctly. I can then do "X5 Y5" and it will still move (remembers G1 code) so that's good. The issue is as follows
Expected behavior - marlin gets G1 move command with S parameter, moves with laser ON, receives next move command WITHOUT S PARAMETER (e.g X5 Y5) so it continues to move to new location with the S power still the same as with the last move, since it was never changed.
Observed behavior - marlin gets first move command with S parameter, goes there with laser ON, on conpletion of said move command it turns the laser OFF and all the next moves are WITHOUT the laser. It seems that moves without S parameter turn the S power to zero.
I want it to not change S parameter if it wasn't specifically told to do so.
Can anyone help with this?
Re: Can't understand how laser mode is supposed to work
September 09, 2022 02:25PM
... I'm using my lasers with marlin (marlin4due) in a different way -- I'm pulsing the laser with the extruder-steps - so it's moving without laser in G0-moves and laser pulsing with the "extruder-rate" in G1 moves with E-numbers for extruder steps per mm.

Power is set before the move with an analogue pin for 0V to +3,3V (or 0-5V) for 0% to 100% laser power (with my "discrete" drivers its 5µs puls length for 1% and 300µs pulse length for 100%).

Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Sorry, only registered users may post in this forum.

Click here to login