#linuxcnc Logs
Dec 07 2022
#linuxcnc Calendar
08:10 PM Tom_L: yeah it reverted to the index page
08:19 PM skunkworks: Hi dad!
08:19 PM Tom_L: ping
08:19 PM skunkworks: nope
08:19 PM skunkworks: lol
08:19 PM Tom_L: http://tom-itx.no-ip.biz:81/~tom-itx/irc/logs/%23linuxcnc/2022-12-07.html
08:19 PM Tom_L: it built the page but it's blank
08:19 PM skunkworks: that is the link dad sent me..
08:19 PM skunkworks: :)
08:19 PM Tom_L: i've no idea...
08:19 PM Tom_L: give it a bit i guess
08:19 PM skunkworks: Thanks!
08:21 PM Tom_L: skunkworks,
08:21 PM Tom_L: refresh
08:22 PM Tom_L: lost a couple days
08:24 PM -!- #linuxcnc mode set to +v by ChanServ
08:42 PM Plaid: fdarling: I really can't do a bunch of rewiring, I'm tryiing not to totally overhaul it. Though I came up with a solution. The HAL component is pretty simple. I can just write my own that starts in the other state. But if I do what you're saying, it'll still trip the e-stop on power-up, which I don't want it doing. The breaker-switch I have only opens via signal, it can only be closed manually.
08:50 PM fdarling: Plaid: all right, I am just telling you the best practices. Given that you want LinuxCNC to start initialized a certain way, you can probably invert the signal in HAL or on the Mesa card (you are using a Mesa card, right?) so that it defaults/failsafes the way you want
08:50 PM fdarling: on Mesa cards, if the "watchdog" bites from lack of communication, it will shut off the outputs and they will default to off
08:51 PM fdarling: so if you need the output to be ON to trigger an e-stop (which you don't want on startup), that should be fine already
08:51 PM fdarling: so the issue is one of software, you need to make E-stop not asserted by default
08:52 PM fdarling: one way to do it would be to use some timedelays and oneshots to AND the "assert E-stop" signal that goes out to the control card so that it is forced low for say 10 milliseconds
08:53 PM fdarling: and also have a "reset E-stop" signal that pulses for say 3 milliseconds, so that E-stop will be cleared before it can get a chance to effect the control card's real output
08:53 PM fdarling: there might be some other schemes, I'd have to look at those E-stop signals again
08:53 PM fdarling: Plaid: does that make sense?
08:55 PM Plaid: Yeah, and I'm having reality collide with things. I'm just trying to find a good solution, I didn't know if the e-stop being asserted at startup was critical for safety or something
08:55 PM fdarling: Plaid: I believe in some countries, there are rules about industrial equipment being default off after a power outage, and you must have a physical button to press to get it to power back up
08:56 PM norias: yeah
08:56 PM fdarling: Plaid: at any rate, this is a personal DIY machine so you have no such restrictions I presume ;-)
08:56 PM norias: even if there isn't a rule
08:56 PM norias: you run against liability
08:56 PM fdarling: agreed
08:56 PM Plaid: Yeah, it's just a diy I'm rebuilding a commerical router. But I still don't want to end up killing myself.
08:56 PM norias: ( i've been an expert witness for injury cases )
08:57 PM fdarling: Plaid: if I were you, I'd just get a $40 contactor (big relay) and "do it right" if you are worried about safety
08:57 PM norias: eyah
08:57 PM norias: i wouldn't do e-stop through software
08:57 PM fdarling: Plaid: did you understand what I meant about timedelaying and suppressing signals?
08:57 PM Plaid: the e-stop is totally physical, but can be triggered via software
08:58 PM fdarling: Plaid: can the E-stop also be triggered by a physical button?
08:58 PM Plaid: fdarling: mostly. I need to read what you wrote what you said severall times
08:59 PM Plaid: And yes, it has 3 estop buttons that aren't tied to software. plus the machine can e-stop itself.
08:59 PM norias: sh
08:59 PM norias: ah
08:59 PM fdarling: Plaid: so normally the E-stop is wired such that if a cable is cut, it will automatically E-stop
09:00 PM fdarling: this is why you use a closed electrical current loop keeping E-stop from happening (holding a relay closed), and break that circuit to trigger the E-stop
09:00 PM Plaid: Yep, setup to do that as well. estop fault generates an estop
09:00 PM fdarling: okay, so the real issue is that the E-stop can only be cleared physically
09:01 PM Plaid: Yeah, so I don't want the computer thinking it should be e-stopped on startup :P
09:01 PM fdarling: given that limitation, I understand why you want to make E-stop only asserted from the controls "when needed"
09:01 PM fdarling: so anyways
09:01 PM fdarling: "iocontrol.0.emc-enable-in" is a signal that makes the E-stop button show as pressed or not in LinuxCNC
09:01 PM fdarling: in other words, feedback on the actual E-stop state
09:02 PM fdarling: "iocontrol.0.user-enable-out" is the signal that goes to FALSE when an LinuxCNC instigated E-stop happens
09:03 PM fdarling: "iocontrol.0.user-request-enable" is the signal that goes to TRUE when you click the "pressed in" E-stop button to attempt to clear the E-stop condition
09:03 PM fdarling: (I believe that signal goes back to FALSE after the E-stop signal is successfully cleared, maybe it stays high though while the machine is on, not sure)
09:04 PM fdarling: so if you invert "user-enable-out" so that it goes TRUE instead of FALSE during a fault, that can be used to trigger your E-stop breaker
09:05 PM fdarling: however, it defaults to on in the beginning, which is your current problem
09:07 PM fdarling: so use HAL to either OR the uninverted signal with a "oneshot" HAL component uninverted "out" output, or AND the inverted signal with the oneshot's inverted ("out-not") output
09:08 PM fdarling: "oneshot" is a HAL component that generates a finite length pulse based off a trigger on the "in" pin. If you want it to immediately trigger, set the "in" pin to "true" so it will immediately trigger (and only once)
09:08 PM Plaid: Hence the name one-shot :P
09:09 PM fdarling: you can play with oneshot by setting the pulse length really long and looking at it with HALscope
09:10 PM fdarling: also tie that oneshot output to "halui.estop.reset" so that it effectively instantly clicks the E-stop clear button on startup
09:10 PM fdarling: honestly, that alone might do it, so I would try it first
09:10 PM fdarling: you just need to make sure the HAL is set up to evaluate the components in the right order
09:11 PM fdarling: if it does mesa.read, evaluate halui then motion and friends, then mesa.write, it will probably just work
09:11 PM Plaid: do I even need the e-stop latch in this case then?
09:11 PM skunkworks: Tom_L: thank you!
09:11 PM Plaid: or just loopback?
09:11 PM fdarling: sorry, I meant: mesa.read, oneshot, halui, motion & friends, then mesa.write
09:11 PM fdarling: you would not need the latch, no
09:12 PM fdarling: you have a real life latch apparently ;-)
09:12 PM fdarling: good ole SR latch
09:12 PM Plaid: Me switching the breaker on in S...
09:14 PM fdarling: you will have this visual glitch (sort of) that you must click the depressed E-stop button when you are E-stopped, and it will not "unclick" visually until you also press the physical reset button
09:14 PM fdarling: if you don't click it though, pressing reset won't work because it's still asserting the "software initiated" E-stop
09:14 PM fdarling: this is why you should observe the signals in HALscope
09:15 PM Plaid: I don't see the halui.estop.reset listed in the HAL configuration in LCNC
09:15 PM fdarling: http://linuxcnc.org/docs/html/man/man1/halui.1.html
09:15 PM fdarling: http://linuxcnc.org/docs/2.4/html/man/man1/iocontrol.1.html
09:16 PM Plaid: *learns another new thing*
09:16 PM fdarling: clearing E-stop is not normally a HAL thing but an NML message or whatever done from C/C++/Python code
09:16 PM fdarling: so the halui stuff makes it triggerable from HAL
09:26 PM Plaid: so if I remove the estop loopback, running "setp iocontrol.0.emc-enable-in TRUE" clears e-stop. So now I just need to re-enable the loopback, and make it do an OR with the oneshot, right?
09:59 PM fdarling: Plaid: you will have to experiment, it's possible having emc-enable-in set to true doesn't clear the emc-enable-out status where it is "trying" to e-stop
10:48 PM Plaid: fdarling: Yeah, I'm fighting that. I can't seem to clear the e-stop inside of lcnc.
10:56 PM Plaid: I can't seem to figure out how to get it started up not-estopped