Making the laser "fail safer" on exit

More
20 Feb 2023 03:54 #264847 by djdelorie
I have a 7i76e-based machine with both a spindle and laser.  The 7i76e has the 7i76e_7i76x1pD config, with PWM on TB3.  The laser takes an active LOW enable (i.e. if the mesa board has no power, the laser is ON, except that the laser is powered from the same rail as the mesa board) (i.e.2. so it's connected to pin 3).  custom.hal has:

net aout-00 <= motion.analog-out-00
net aout-00 => hm2_7i76e.0.pwmgen.00.value
net dout-01 <= motion.digital-out-01
net dout-01 => hm2_7i76e.0.pwmgen.00.enable

This configuration works just fine with lightburn, using M67/M62 (but no M63? This might be the first time I'd exited linuxcnc with the laser still powered).  However, today, at the end of the day, after running a successful laser job, I did File->Exit from linuxcnc and the laser came on at full power!  I slammed the main power switch and rubbed the yellow spots out of my eyes, but the laser had already burned a hole in the paper coating of some gypsum we were using as a heat shield, despite being 5-6 inches away.  It made me think a bit about safety...

So, any tips on changes to HAL or my 7i76e setup  that will force an output pin to stay in a known state when linuxcnc exits?  Or do I need some external stuff to, say, cut power when the laser shouldn't be running?  Assuming *those* devices are connected to pins that can be trusted...

Normally I'd just try things to see what works, but in this case I'd rather not ;-)
 

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

More
20 Feb 2023 12:24 #264861 by rmu
Use a relay, powered from the same source as the mesa card.

Ideally, you have a separate external ESTOP circuit that needs explicit enabling via physical button that is also in the loop (and is disabled when linuxcnc powers down).

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

More
20 Feb 2023 15:18 - 20 Feb 2023 15:18 #264870 by PCW
Yes, as rmu said, you should have an independent ESTOP controlled safety device for a laser.

That said, if you are using a step/dir pin for the PWM output, you should choose
the output polarity that disables the laser at power on and watchdog bites.
(it should go off if you disconnect the Ethernet cable while running)

This likely means you will need to invert the PWM output and or PWM enable output
in the hal file
Last edit: 20 Feb 2023 15:18 by PCW.

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

More
20 Feb 2023 17:59 #264888 by djdelorie
Ah, this was the trick I was hoping for. Thanks!
(my electronics are still spread across a table, so no official estop yet other than the power strip switch ;)

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

More
18 Mar 2023 22:03 #267034 by djdelorie
After some testing, I found out (much to my dismay) that the PWM output pins on the 7i76e are set one way for "watchdog timeout" and the other way for "pwm disabled" - i.e. a watchdog timeout effectively sets the pwm to 100%! This is independent of the pwm value. Is this a bug, or a way to intentionally force people to honor a separate on/off signal? ;-)

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

More
19 Mar 2023 00:49 - 19 Mar 2023 00:50 #267038 by PCW
If you want active high PWM you can do it this way:

Chose the inverting outputs (Like STEP- = low at power up or watchdog bite)
and invert the PWM output:

setp hm2_7i76e.0.pwmgen.00.out0.invert_output true
Last edit: 19 Mar 2023 00:50 by PCW.

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

More
19 Mar 2023 03:35 #267054 by djdelorie
That did the trick, the laser seems to be off all the time except when I expect it to be on. Thanks!

(and yes, I added a manual switch on the laser power so I could "safe" it manually, too)

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

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