I cloned ohmic.comp and made an ohmic_dev.comp with a few changes.
Code:
FUNCTION(_) {
double thcad_vel_scale = 1/((thcad_max_volt_freq - thcad_0_volt_freq)/thcad_fullscale/thcad_divide);
double thcad_scale_offset = thcad_0_volt_freq/thcad_divide;
thcad_volts = (velocity_in - thcad_scale_offset) * thcad_vel_scale;
ohmic_volts = thcad_volts * volt_divider; // Calculated torch volts from THCAD
arc_on = (thcad_volts >= thcad_fullscale ? 1 : 0);
if(!arc_on)
ohmic_on = (ohmic_volts > ohmic_threshold ? 1 : 0);
else
if( ohmic_volts < ohmic_low)
ohmic_on = 0;
}
Mainly, moving the arc_on calculation before the ohmic_on logic, and then using the arc_on signal to tell us whether we should turn the ohmic signal on; still looking at the voltage to determine on/off.
While cutting, the arc_on signal ensures that ohmic_on is never set, so no interruptions due to nozzle shorting material while cutting. However, THC should prevent that anyway!
With my dry run (plasma cutter off) testing, it allows the ohmic_on signal to interrupt (pause) during typical cut motion. However, when the arc_on pin is true due to cutting voltages this will not matter.
The problem is that even though ohmic_on is true while jogging && arc_on is false, plasmac does not check for ohmic state outside of probing and cutting states. The torch jogs (with ohmicsense.ohmic-on TRUE), and then when it's finished its jog THEN it throws the ohmic triggered error because it has changed state to PROBE and we haven't reached the probe Z height yet. This would require plasmac to add ohmic sensing during typical jogging, preferably toggleable with a checkbox if the user wants this feature or not.
Hope this is clear. Can make a video if you need...