Removed states after probe started. Once probig, continue probe
This commit is contained in:
@@ -52,9 +52,7 @@ class OhmicSensing {
|
|||||||
enum OhmicStates {
|
enum OhmicStates {
|
||||||
OHMIC_IDLE,
|
OHMIC_IDLE,
|
||||||
OHMIC_SETUP,
|
OHMIC_SETUP,
|
||||||
OHMIC_PROBE,
|
OHMIC_PROBE
|
||||||
OHMIC_PROBED_ON,
|
|
||||||
OHMIC_PROBE_DONE
|
|
||||||
};
|
};
|
||||||
OhmicStates ohmicState = OHMIC_IDLE;
|
OhmicStates ohmicState = OHMIC_IDLE;
|
||||||
uint64_t startTime;
|
uint64_t startTime;
|
||||||
@@ -142,6 +140,8 @@ void cb_get_inputs(void) // Set Master inputs, slave outputs, last operation
|
|||||||
Obj.In_Unit2.OhmicSensingVoltageLimit,
|
Obj.In_Unit2.OhmicSensingVoltageLimit,
|
||||||
Obj.In_Unit2.OhmicSensingVoltageDrop, Obj.In_Unit2.OhmicSensingSetupTime,
|
Obj.In_Unit2.OhmicSensingVoltageDrop, Obj.In_Unit2.OhmicSensingSetupTime,
|
||||||
Obj.In_Unit2.EnableOhmicSensing, Obj.Out_Unit2.OhmicSensingSensed);
|
Obj.In_Unit2.EnableOhmicSensing, Obj.Out_Unit2.OhmicSensingSensed);
|
||||||
|
Obj.Out_Unit1.RawData = validVoltage0_2;
|
||||||
|
Obj.Out_Unit2.RawData = Ohm2.ohmicState;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t dc_checker(void);
|
uint16_t dc_checker(void);
|
||||||
@@ -414,26 +414,10 @@ void OhmicSensing::handle(uint8_t voltageState, float inVoltage,
|
|||||||
(fabs(voltageDropLimit) > 1e-3 && // Drop over 3 cycles
|
(fabs(voltageDropLimit) > 1e-3 && // Drop over 3 cycles
|
||||||
voltages.front() - voltages.back() > voltageDropLimit)) {
|
voltages.front() - voltages.back() > voltageDropLimit)) {
|
||||||
sensed = 1;
|
sensed = 1;
|
||||||
startTime = longTime.extendTime(micros());
|
|
||||||
ohmicState = OHMIC_PROBED_ON;
|
|
||||||
}
|
}
|
||||||
oldVoltage = inVoltage;
|
oldVoltage = inVoltage;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ohmicState == OHMIC_PROBED_ON) {
|
|
||||||
sensed = 1;
|
|
||||||
dTime = longTime.extendTime(micros()) - startTime;
|
|
||||||
Obj.Out_Unit2.RawData = dTime;
|
|
||||||
if (dTime > 100000) {
|
|
||||||
sensed = 0;
|
|
||||||
ohmicState = OHMIC_PROBE_DONE;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (ohmicState == OHMIC_PROBE_DONE) {
|
|
||||||
sensed = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
ohmicState = OHMIC_IDLE;
|
ohmicState = OHMIC_IDLE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user