BUG FIX - E-01 fired upon reboots with premature low volt detection
Improvement - /update and /reboot now have a post event status sequence during reboot.
This commit is contained in:
parent
db3343d362
commit
cb79fd5dd0
6 changed files with 40 additions and 29 deletions
|
@ -903,7 +903,7 @@ bool validateFrame(const CProtocol& frame, const char* name)
|
||||||
|
|
||||||
void requestOn()
|
void requestOn()
|
||||||
{
|
{
|
||||||
if(SmartError.checkVolts(FilteredSamples.FastipVolts.getValue(), FilteredSamples.FastGlowAmps.getValue())) {
|
if(bHasHtrData && SmartError.checkVolts(FilteredSamples.FastipVolts.getValue(), FilteredSamples.FastGlowAmps.getValue())) {
|
||||||
heaterOn();
|
heaterOn();
|
||||||
RTC_Store.setCyclicEngaged(true); // for cyclic mode
|
RTC_Store.setCyclicEngaged(true); // for cyclic mode
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ CScreenHeader::animate()
|
||||||
showTimers();
|
showTimers();
|
||||||
switch(_batteryCount) {
|
switch(_batteryCount) {
|
||||||
case 3:
|
case 3:
|
||||||
if(SmartError.checkVolts(FilteredSamples.FastipVolts.getValue(), FilteredSamples.FastGlowAmps.getValue())) {
|
if(SmartError.checkVolts(FilteredSamples.FastipVolts.getValue(), FilteredSamples.FastGlowAmps.getValue(), false)) { // check but do not fault
|
||||||
showBatteryIcon(getBatteryVoltage(true));
|
showBatteryIcon(getBatteryVoltage(true));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -34,9 +34,9 @@ CSmartError::CSmartError()
|
||||||
void
|
void
|
||||||
CSmartError::reset()
|
CSmartError::reset()
|
||||||
{
|
{
|
||||||
m_prevRunState = 0;
|
_prevRunState = 0;
|
||||||
m_Error = 0;
|
_Error = 0;
|
||||||
m_bInhibit = false;
|
_bInhibit = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we use inhibit when we manually command the heater off during preheat
|
// we use inhibit when we manually command the heater off during preheat
|
||||||
|
@ -44,7 +44,7 @@ CSmartError::reset()
|
||||||
void
|
void
|
||||||
CSmartError::inhibit()
|
CSmartError::inhibit()
|
||||||
{
|
{
|
||||||
m_bInhibit = true;
|
_bInhibit = true;
|
||||||
// m_Error = 0;
|
// m_Error = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,33 +71,33 @@ CSmartError::monitor(uint8_t newRunState)
|
||||||
{
|
{
|
||||||
// check if moving away from heater Idle state (S0)
|
// check if moving away from heater Idle state (S0)
|
||||||
// especially useful if an OEM controller exists
|
// especially useful if an OEM controller exists
|
||||||
if((m_prevRunState == 0) && newRunState) {
|
if((_prevRunState == 0) && newRunState) {
|
||||||
// reset the smart error
|
// reset the smart error
|
||||||
m_Error = 0;
|
_Error = 0;
|
||||||
m_bInhibit = false;
|
_bInhibit = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!m_bInhibit) {
|
if(!_bInhibit) {
|
||||||
if(m_prevRunState == 2) { // preheat state (S2)
|
if(_prevRunState == 2) { // preheat state (S2)
|
||||||
if(newRunState == 4) {
|
if(newRunState == 4) {
|
||||||
// transitioned from preheat to ignited
|
// transitioned from preheat to ignited
|
||||||
// - all good!
|
// - all good!
|
||||||
m_Error = 0;
|
_Error = 0;
|
||||||
}
|
}
|
||||||
else if(newRunState > 5) {
|
else if(newRunState > 5) {
|
||||||
// transitioned from preheat to post glow
|
// transitioned from preheat to post glow
|
||||||
// - second ignition attempt failed, heater is shutting down
|
// - second ignition attempt failed, heater is shutting down
|
||||||
m_Error = 11; // +1 over displayed error code
|
_Error = 11; // +1 over displayed error code
|
||||||
}
|
}
|
||||||
else if(newRunState == 3) {
|
else if(newRunState == 3) {
|
||||||
// transitioned from preheat to retry
|
// transitioned from preheat to retry
|
||||||
// - first ignition attempt failed, heater will retry
|
// - first ignition attempt failed, heater will retry
|
||||||
m_Error = 12; // +1 over displayed error code
|
_Error = 12; // +1 over displayed error code
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_prevRunState != newRunState) {
|
if(_prevRunState != newRunState) {
|
||||||
// check for transition to startup
|
// check for transition to startup
|
||||||
// - force cancellation of an on request if we generated it
|
// - force cancellation of an on request if we generated it
|
||||||
if(newRunState >= 2) {
|
if(newRunState >= 2) {
|
||||||
|
@ -110,11 +110,11 @@ CSmartError::monitor(uint8_t newRunState)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_prevRunState = newRunState;
|
_prevRunState = newRunState;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CSmartError::checkVolts(float ipVolts, float glowI)
|
CSmartError::checkVolts(float ipVolts, float glowI, bool throwfault)
|
||||||
{
|
{
|
||||||
// check for low voltage
|
// check for low voltage
|
||||||
// values here are x10 integers
|
// values here are x10 integers
|
||||||
|
@ -122,20 +122,23 @@ CSmartError::checkVolts(float ipVolts, float glowI)
|
||||||
float cableComp = glowI * 0.1; // allow 1V drop for 10A current (bit naive but better than no compensation)
|
float cableComp = glowI * 0.1; // allow 1V drop for 10A current (bit naive but better than no compensation)
|
||||||
float Thresh = NVstore.getHeaterTuning().getLVC() - cableComp; // NVstore
|
float Thresh = NVstore.getHeaterTuning().getLVC() - cableComp; // NVstore
|
||||||
if(ipVolts < Thresh) {
|
if(ipVolts < Thresh) {
|
||||||
m_Error = 2; // +1 over displayed error code
|
if(throwfault) {
|
||||||
|
_Error = 2; // +1 over displayed error code
|
||||||
requestOff();
|
requestOff();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// return our smart error, if it exists, as the registered code
|
// return our smart error, if it exists, as the registered code
|
||||||
uint8_t
|
uint8_t
|
||||||
CSmartError::getError()
|
CSmartError::getError()
|
||||||
{
|
{
|
||||||
if(m_Error) {
|
if(_Error) {
|
||||||
return m_Error;
|
return _Error;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
|
@ -22,16 +22,16 @@
|
||||||
#include "Protocol.h"
|
#include "Protocol.h"
|
||||||
|
|
||||||
class CSmartError {
|
class CSmartError {
|
||||||
uint8_t m_prevRunState;
|
uint8_t _prevRunState;
|
||||||
uint8_t m_Error;
|
uint8_t _Error;
|
||||||
bool m_bInhibit;
|
bool _bInhibit;
|
||||||
public:
|
public:
|
||||||
CSmartError();
|
CSmartError();
|
||||||
void reset();
|
void reset();
|
||||||
void inhibit();
|
void inhibit();
|
||||||
void monitor(const CProtocol& heaterFrame);
|
void monitor(const CProtocol& heaterFrame);
|
||||||
void monitor(uint8_t runstate);
|
void monitor(uint8_t runstate);
|
||||||
bool checkVolts(float volts, float plugI);
|
bool checkVolts(float volts, float plugI, bool throwfault=true);
|
||||||
uint8_t getError();
|
uint8_t getError();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -55,9 +55,9 @@ struct sHeaterTuning : public CESP32_NVStorage {
|
||||||
retval &= INBOUNDS(glowDrive, 1, 6);
|
retval &= INBOUNDS(glowDrive, 1, 6);
|
||||||
retval &= INBOUNDS(pumpCal, 0.001, 1.0);
|
retval &= INBOUNDS(pumpCal, 0.001, 1.0);
|
||||||
if(sysVoltage == 120)
|
if(sysVoltage == 120)
|
||||||
retval &= INBOUNDS(lowVolts, 100, 125);
|
retval &= INBOUNDS(lowVolts, 100, 125) || (lowVolts == 0);
|
||||||
else
|
else
|
||||||
retval &= INBOUNDS(lowVolts, 200, 250);
|
retval &= INBOUNDS(lowVolts, 200, 250 || (lowVolts == 0));
|
||||||
retval &= INBOUNDS(tempOfs, -10, +10);
|
retval &= INBOUNDS(tempOfs, -10, +10);
|
||||||
return retval;
|
return retval;
|
||||||
};
|
};
|
||||||
|
|
|
@ -351,7 +351,11 @@ function completeHandler(event) {
|
||||||
_('loaded_n_total').innerHTML = 'Uploaded ' + sendSize + ' bytes of ' + sendSize;
|
_('loaded_n_total').innerHTML = 'Uploaded ' + sendSize + ' bytes of ' + sendSize;
|
||||||
var file = _('file1').files[0];
|
var file = _('file1').files[0];
|
||||||
if(file.name.endsWith('.bin')) {
|
if(file.name.endsWith('.bin')) {
|
||||||
setTimeout( function() { location.assign('/'); }, 5000);
|
_('status').innerHTML='Rebooting NOW';
|
||||||
|
setTimeout(function () { _('status').innerHTML='Rebooted'; }, 2000);
|
||||||
|
setTimeout(function () { _('status').innerHTML='Initialising...'; }, 4000);
|
||||||
|
setTimeout(function () { _('status').innerHTML='Loading /Index.html...'; }, 6000);
|
||||||
|
setTimeout(function () { location.assign('/'); }, 6500);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setTimeout( function() { location.assign('/update'); }, 500);
|
setTimeout( function() { location.assign('/update'); }, 500);
|
||||||
|
@ -943,7 +947,11 @@ body {
|
||||||
<script>
|
<script>
|
||||||
function onReboot() {
|
function onReboot() {
|
||||||
if(confirm('Do you really want to reboot the Afterburner ?')) {
|
if(confirm('Do you really want to reboot the Afterburner ?')) {
|
||||||
setTimeout(function () { location.assign('/'); }, 2000);
|
_('info').innerHTML='Rebooting NOW';
|
||||||
|
setTimeout(function () { _('info').innerHTML='Rebooted'; }, 2000);
|
||||||
|
setTimeout(function () { _('info').innerHTML='Initialising...'; }, 4000);
|
||||||
|
setTimeout(function () { _('info').innerHTML='Loading /Index.html...'; }, 6000);
|
||||||
|
setTimeout(function () { location.assign('/'); }, 6500);
|
||||||
var formdata = new FormData();
|
var formdata = new FormData();
|
||||||
formdata.append('reboot', 'yes');
|
formdata.append('reboot', 'yes');
|
||||||
var ajax = new XMLHttpRequest();
|
var ajax = new XMLHttpRequest();
|
||||||
|
|
Loading…
Reference in a new issue