-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
This forum thread confirms this is a rare issue but it has been around for a long time when I reported it here recently.
https://forum.linuxcnc.org/plasmac/55687-2-9-3-stuck-in-wrong-state-and-stops#324665
I thought the bug report should move to the official issues register for broader consideration.
ISSUE: Sometimes, Plasmac freezes. Moving the float switch by hand seems to clear the error and the cut proceeds.
The customer has an IT Savvy brother who investigated this in depth and reports:
I added a whole bunch of debugging logs to my plasmac code and recreated the situation.
I thought there was an issue in qtplasmac_handler but all this happens in plasmac.comp
the simulator isn't super fast like the machine, so I could be creating timing issues etc, but the fact that it's mirroring your machine exactly makes me feel better about that.
On my simulator I have a control panel that I made that injects inputs, because I have no hardware (obviously!).
Obviously these voltages need conversion, but that's not important to me so I just leave them as raw!
Actions on the simulator:
Homed the machine and enabled the torch
Started a job
While the thing was moving to start the cut, I set the ohmic volts right up
When it tried to do the ohmic sensing it failed with the message "pierce height would exceed Z axis maximum limit". This stopped the machine
Pressed the pulse button. The button shows the countdown timer, but the torch does not fire
Triggered the float switch
Pressed the pulse button. The countdown timer shows and the torch fires
Diagnostics:
The IDLE state code has a whole bunch of conditional statements at the start of it.
- If stuff...
- ...else if((tool == CUTTING || tool == SPOTTING || probe_test) && (stop_type == NONE || stop_type == WAIT) && homed)
- ...else if(!program_is_paused && stop_type == PAUSE)
- ...else if(torch_pulse_start && torch_enable && !breakaway && !float_switch && !ohmic_probe)
On face value, it should be able to pulse the torch
However, when it stops in this way (and apparently other ways too), the state is going:
PROBE_HEIGHT (to find the plate to start cutting)
program_pause = TRUE;
stop_type = PAUSE
MAX_HEIGHT (because I mucked with the ohmic sensing)
END_CUT
IDLE
Then when it comes around in the idle loop, it's hitting "else if(!program_is_paused && stop_type == PAUSE)". This is then setting the stop_type back to NONE
Is there a Timing issue here? program_is_paused is a signal coming in, presumably in response to the out pin program_pause
THEN, when you push pulse, it ends up hitting condition No. 2 from my list above and therefore will not pulse.
The values used in condition 2 at this time are
tool: 1, probe_test: 0, stop_type: 0, homed: 1
Float switch hack:
If you trigger the float switch after all this, the stop type changes to 3 (PAUSE).
Ultimately that means that condition No. 2 from the above doesn't get triggered and it's free to run the pulse.
The values for condition 2 this time around are:
tool: 1, probe_test: 0, stop_type: 3, homed: 1
Ideas:
If you just wanted to hack the pulsing, that would be easy enough to bodge up by adding "!torch_pulse_start" to condition 2 or re-ordering the conditions
Maybe alter condition 3 or the handling therein to consider program_pause to cater for this weirdness - dunno, you'd have to be super careful mucking with that! Or even add a flag that stays for a few iterations to buy some time
Rod's thoughts (me)
I wondered if my ohmic3.comp used for Ohmic sensing had anything to do with this issue and I reviewed it and concluded it was bug free.
Ref: https://github.com/rodw-au/showstopper/blob/master/components/ohmic3.comp
Whilst not in the Linuxcnc collection, a lot of people have used this component for a number of years without issue.
The customer confirmed this with: I agree with Rod that this isn't anything to do with his ohmic stuff. He went on to say:
I just grab the ohmic slider and ramp it all the way up because I know it triggers the fault.
Rod's Further Evaluation
Both ohmic3.comp and plasmac.comp use motion.motion.type. I wondered if it were possible that a bug in the core code generated spurious data here. However when I reviewed both ohmic3.comp and plasmac.comp neither component uses this value for anything to do with probing. plasmac.comp just uses this value to deterimine if the machine is traversing (eg. rapids G0)
It would be great if this detailed information would help nail this bug.
