motion.digital-out-00 problem
15 Oct 2023 09:22 #283045
by SOLD
Replied by SOLD on topic motion.digital-out-00 problem
Please Log in or Create an account to join the conversation.
15 Oct 2023 12:16 #283061
by andypugh
Replied by andypugh on topic motion.digital-out-00 problem
I have my eye on this, see github.com/LinuxCNC/linuxcnc/issues/2532
Until that change is implemented, you can do what you need (probably) in HAL.
The simplest approach is just to "and2" the digital output with the machine.is-on HAL pin before sending it to the destination.
This probably needs to be combined with a startup G-code which turns off the output, or it will go live at moment the machine comes back on again.
A more complex interaction could be set up with combinations of the flipflop, toggle and edge HAL components.
Or it might be best to construct a custom HAL component with the following behaviour:
If the machine is turned off the pin takes a settable default state
if the machine is turned on, the pins retain the default state (or take a different default state?)
If the input toggles from low to high and the machine is on - the output goes high
if the input toggles from high to low and the machine is on - the output goes low.
This is not entirely the same as the desired behaviour, as I think that if the output was set high before the machine-off it needs to be set off before setting on to trigger a change to the output described above.
Until that change is implemented, you can do what you need (probably) in HAL.
The simplest approach is just to "and2" the digital output with the machine.is-on HAL pin before sending it to the destination.
This probably needs to be combined with a startup G-code which turns off the output, or it will go live at moment the machine comes back on again.
A more complex interaction could be set up with combinations of the flipflop, toggle and edge HAL components.
Or it might be best to construct a custom HAL component with the following behaviour:
If the machine is turned off the pin takes a settable default state
if the machine is turned on, the pins retain the default state (or take a different default state?)
If the input toggles from low to high and the machine is on - the output goes high
if the input toggles from high to low and the machine is on - the output goes low.
This is not entirely the same as the desired behaviour, as I think that if the output was set high before the machine-off it needs to be set off before setting on to trigger a change to the output described above.
The following user(s) said Thank You: SOLD
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19202
- Thank you received: 6436
15 Oct 2023 12:24 #283063
by tommylight
Replied by tommylight on topic motion.digital-out-00 problem
Attached if the full config i use for digital out control, it does turn off the PWM output always, except on pause.
Used the "logic" function as AND with 3 inputs, i think.
Used the "logic" function as AND with 3 inputs, i think.
The following user(s) said Thank You: SOLD
Please Log in or Create an account to join the conversation.
15 Oct 2023 14:39 #283077
by PCW
Replied by PCW on topic motion.digital-out-00 problem
As suggested earlier in the thread, one way is to
'and' the digital output with say motion.motion-enabled
(you would still need to manually clear (MDI) the digital out before
getting out of estop unless you just restart LinuxCNC)
'and' the digital output with say motion.motion-enabled
(you would still need to manually clear (MDI) the digital out before
getting out of estop unless you just restart LinuxCNC)
The following user(s) said Thank You: SOLD
Please Log in or Create an account to join the conversation.
15 Nov 2023 20:55 #285541
by spumco
That sounds really useful Andy.
I've got a bunch of IO to control conditionally in my current build and could use something like you've described.
Example: multiple lathe spindles. I'd like the main and sub spindle servos to be enabled at machine-on, but also have a momentary button toggle to disable (not bus power) so I can rotate by hand for indicating or swapping a collet. Same thing for the live-tool VFD, but I want it to be default-off as it won't always be installed.
I cant just tie the drive enable to machine-on, as I will want to jog the axes with the spindles free during tool setups. Nor do I want to have them default-off... it gets irritating to manually enable the drives every time I start the machine.
Similar situation with both drawbars, as well as some (future) part-loader air cylinders. It'd be nice to have a machine-on default state, and a machine-off default state, and both states can be set via a setp or INI value.
Problem I'm running in to is that once I connect pins, I can't set them high or low with a setp or sets without a lot of HAL gymnastics.
You can see why your description caught my attention...
Replied by spumco on topic motion.digital-out-00 problem
Or it might be best to construct a custom HAL component with the following behaviour:
If the machine is turned off the pin takes a settable default state
if the machine is turned on, the pins retain the default state (or take a different default state?)
If the input toggles from low to high and the machine is on - the output goes high
if the input toggles from high to low and the machine is on - the output goes low.
That sounds really useful Andy.
I've got a bunch of IO to control conditionally in my current build and could use something like you've described.
Example: multiple lathe spindles. I'd like the main and sub spindle servos to be enabled at machine-on, but also have a momentary button toggle to disable (not bus power) so I can rotate by hand for indicating or swapping a collet. Same thing for the live-tool VFD, but I want it to be default-off as it won't always be installed.
I cant just tie the drive enable to machine-on, as I will want to jog the axes with the spindles free during tool setups. Nor do I want to have them default-off... it gets irritating to manually enable the drives every time I start the machine.
Similar situation with both drawbars, as well as some (future) part-loader air cylinders. It'd be nice to have a machine-on default state, and a machine-off default state, and both states can be set via a setp or INI value.
Problem I'm running in to is that once I connect pins, I can't set them high or low with a setp or sets without a lot of HAL gymnastics.
You can see why your description caught my attention...
Please Log in or Create an account to join the conversation.
17 Nov 2023 06:07 - 17 Nov 2023 06:10 #285694
by blazini36
Replied by blazini36 on topic motion.digital-out-00 problem
You just need some resettable latch, the only one I know of is "Estop_latch" which is a bit overkill. Personally I'd just cut down the code from Estop_latch, get rid of the watchdog and call it something else. You'd also need a oneshot or edge component.
The M64 goes to the input of an and2 plus feeds the oneshot/edge input and that output also goes to Estop_latch.N.reset input. Tie the Estop_latch.N.ok-in pin true in hal (or just leave it float).
Your actual Estop output goes to Estop_latch.N.fault-in pin assuming your Estop output is normally open or false when not-Estop. Estop_latch.ok-out goes to the other and2 input. The and2 output is goes to wherever your M64 output originally went.
In my head the way this works is that your Estop button will trip the Estop_latch and kill the final M64 output (after the and2). If you reset your actual Estop the latch will still be tripped and the final M64 output will not turn on again until it is turned off and on again which will pulse the oneshot output and reset the Estop latch.
Slightly convoluted approach but unless there's another latch component I think it's the best bet if the fix doesn't come soon enough.
The M64 goes to the input of an and2 plus feeds the oneshot/edge input and that output also goes to Estop_latch.N.reset input. Tie the Estop_latch.N.ok-in pin true in hal (or just leave it float).
Your actual Estop output goes to Estop_latch.N.fault-in pin assuming your Estop output is normally open or false when not-Estop. Estop_latch.ok-out goes to the other and2 input. The and2 output is goes to wherever your M64 output originally went.
In my head the way this works is that your Estop button will trip the Estop_latch and kill the final M64 output (after the and2). If you reset your actual Estop the latch will still be tripped and the final M64 output will not turn on again until it is turned off and on again which will pulse the oneshot output and reset the Estop latch.
Slightly convoluted approach but unless there's another latch component I think it's the best bet if the fix doesn't come soon enough.
Last edit: 17 Nov 2023 06:10 by blazini36.
Please Log in or Create an account to join the conversation.
07 Dec 2023 03:16 #287410
by rodw
Replied by rodw on topic motion.digital-out-00 problem
Digital I/O pins have never worked the way are asking them to work. Well not in the 7 years or so I have been using Linuxcnc. Right at the beginning we learnt the hard way when we had a plasma torch spewing fire while we were the opposite side of the machine to the estop button. We found a different algorithm after that!
Please Log in or Create an account to join the conversation.
08 Dec 2023 19:15 #287579
by spumco
Replied by spumco on topic motion.digital-out-00 problem
I have - tentatively - solved my particular issues (described earlier) in Classic Ladder.
Based on feedback from some process controls guys at work, I created a ladder section with some machine state rungs and some bits to be used in other sections. Specifically:
These bits allow me to set default/startup states for functions like drive enable, drawbars, etc. But it also lets me override (or interlock) various functions through AND & OR circuits.
Using ladder seemed more intuitive (to me) than trying to sort out everything in HAL.
Everything seems to be working as desired but I've not tested this arrangement extensively.
Based on feedback from some process controls guys at work, I created a ladder section with some machine state rungs and some bits to be used in other sections. Specifically:
- estop-on
- machine-on
- mode (man/mdi/auto)
- spindle-on
- spindle-rotating (comparison w/actual feedback)
These bits allow me to set default/startup states for functions like drive enable, drawbars, etc. But it also lets me override (or interlock) various functions through AND & OR circuits.
Using ladder seemed more intuitive (to me) than trying to sort out everything in HAL.
Everything seems to be working as desired but I've not tested this arrangement extensively.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19202
- Thank you received: 6436
08 Dec 2023 20:20 #287585
by tommylight
Replied by tommylight on topic motion.digital-out-00 problem
I am the opposite, i can do anything in hal with a little fiddling, but ladder seemed like martian to me! And yes i know ladder is much easier and simpler, but i have a miss-wired brain so i enjoy complicated stuff.Using ladder seemed more intuitive (to me) than trying to sort out everything in HAL.
Please Log in or Create an account to join the conversation.
13 Dec 2023 05:02 #288001
by blazini36
HAL is pretty underrated, it's basically a programming API for electrical engineers. You certainly don't have to be one but it doesn't require knowledge of coding or any specific jargon. Spend an hour reading a tutorial and you know 90% of what you need to know.
IIRC there used to be some project that was like a graphical HAL configurator. I wonder what ever happened to that.
Replied by blazini36 on topic motion.digital-out-00 problem
Nah I'm the same way. PLC guys get ladder, if you never bothered to mess with PLCs you really have no reason to have learned ladder.
Using ladder seemed more intuitive (to me) than trying to sort out everything in HAL.
I am the opposite, i can do anything in hal with a little fiddling, but ladder seemed like martian to me! And yes i know ladder is much easier and simpler, but i have a miss-wired brain so i enjoy complicated stuff.
HAL is pretty underrated, it's basically a programming API for electrical engineers. You certainly don't have to be one but it doesn't require knowledge of coding or any specific jargon. Spend an hour reading a tutorial and you know 90% of what you need to know.
IIRC there used to be some project that was like a graphical HAL configurator. I wonder what ever happened to that.
Please Log in or Create an account to join the conversation.
Time to create page: 0.085 seconds