Laser powering controle

More
14 Oct 2021 18:40 #223104 by julien83
One week ago i installed a laser module on my CNC and I see that when there is an S0 in the G-Code the relay of the laser module turn off like execute M5.

I think is no good for the laser module and relay trun off and on many many time during execute one G-code file.

Is it possible too execute S0 without turn off the laser module ?

Thanks
julien

Please Log in or Create an account to join the conversation.

More
14 Oct 2021 19:43 #223110 by chris@cnc
Replied by chris@cnc on topic Laser powering controle
How did you wire up the laser.  If your laser has pwm input, you can use this to switch on and off.

Please Log in or Create an account to join the conversation.

More
14 Oct 2021 20:45 #223116 by julien83
Replied by julien83 on topic Laser powering controle
Yes the laser has pwm input wired on spindel pwm (parport 1), 12v wired on a relay drived by spindel on (parport 17) and fixed GND.

but when the i execute S0 on G-code the spindel pwm (parport 1)is low (i like that) and spindel on (parport 17) is low to (i dont like that).

Please Log in or Create an account to join the conversation.

More
14 Oct 2021 21:11 #223120 by tommylight
Replied by tommylight on topic Laser powering controle
You can invert parallel port pins in HAL,
setp parport.0.pin-04-out-invert TRUE
If the laser has an enable pin and a PWM pin, then it should be set
spindle forward = laser enable
speindle PWM = laser PWM

Please Log in or Create an account to join the conversation.

More
15 Oct 2021 13:34 #223202 by julien83
Replied by julien83 on topic Laser powering controle
sorry, I may have explained incorrectly,
for example
if i execute M3 S100 the spindle.0.on = true and PMW is on at any frequency and duty cycle.
and i execute M5 the spindle.0.on = false
that is good for me.

but i execute M3 S100 the spindle.0.on = true and PMW is on at any frequency and duty cycle.
and i execute S0 the spindle.0.on = false.(not good for me).

can i change this ?

Please Log in or Create an account to join the conversation.

More
15 Oct 2021 19:43 #223221 by chris@cnc
Replied by chris@cnc on topic Laser powering controle
I think no.  M5 and S0 is the same. Did you use spindle and laser at same time? I made a second configuration and start up laser or spindle mode. Other way is M3 spindle.0 on and M4 laser on.

Please Log in or Create an account to join the conversation.

More
16 Oct 2021 23:03 #223337 by andypugh
Replied by andypugh on topic Laser powering controle
It is a long-standing behaviour that S0 turns off spindle.on
I am not sure that it is the best arrangement, but it has been that way for a very long time, and changing it would possibly break existing machines.

You could consider using some other output to turn the laser on and off. flood-coolant for example.

Or, possibly, remap the S command to send S0.000000000001 for S0. I think that is enough to leave spindle-on set.

Please Log in or Create an account to join the conversation.

More
17 Oct 2021 01:35 #223355 by julien83
Replied by julien83 on topic Laser powering controle
for now I am using M7 to turn on the laser and M3 Sxxx to drive the power. but the idea of ​​remapping S0 to S0.000001 seems interesting to me. can you tell me how to do it? thank you

Please Log in or Create an account to join the conversation.

More
18 Oct 2021 23:44 #223511 by andypugh
Replied by andypugh on topic Laser powering controle
Look at the minimal remap example here:

linuxcnc.org/docs/2.8/html/remap/remap.h...xample_remapped_code

You would (probably) have
[RS274NGC]
REMAP=S  modalgroup=10 argspec= ngc=laser_s

Then an .ngc file called "laser_s.ngc" containing something like
O100 IF [#<S> EQ 0]
    S 0.0000001
O100 ELS~E
    S #<S>
O100 ENDIF

But, I can't see an example of an S-remap there, and the section that should describe it is absent, so I am not sure how you get the commanded S into the ngc routine.

Maybe you actually remap M3?

Sorry, but I think that experimentation is likely to be needed.

Please Log in or Create an account to join the conversation.

Moderators: snowgoer540
Time to create page: 0.088 seconds
Powered by Kunena Forum