motion.digital-out-00 problem

More
3 years 2 weeks ago #283063 by tommylight
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.

ASUS ROG Crosshair VIII Impact - AMD X570
The following user(s) said Thank You: SOLD

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

More
3 years 2 weeks ago #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)
The following user(s) said Thank You: SOLD

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

More
2 years 11 months ago #285541 by spumco

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.

More
2 years 11 months ago - 2 years 11 months ago #285694 by blazini36
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.
Last edit: 2 years 11 months ago by blazini36.

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

More
2 years 10 months ago #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.

More
2 years 10 months ago #287579 by spumco
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:
  • estop-on
  • machine-on
  • mode (man/mdi/auto)
  • spindle-on
  • spindle-rotating (comparison w/actual feedback)
Each one of those is sent to ladder, and each has a NO, NC, rising-edge, and falling-edge signal with a bit for each one.

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.

Time to create page: 0.510 seconds
Powered by Kunena Forum