hysteresis for GPPWM #3222
This commit is contained in:
parent
22a0c6650b
commit
0d1b6f3490
|
@ -46,6 +46,11 @@ void GppwmChannel::setOutput(float result) {
|
||||||
m_pwm->setSimplePwmDutyCycle(clampF(0, result / 100.0f, 1));
|
m_pwm->setSimplePwmDutyCycle(clampF(0, result / 100.0f, 1));
|
||||||
} else {
|
} else {
|
||||||
efiAssertVoid(OBD_PCM_Processor_Fault, m_output, "m_output null");
|
efiAssertVoid(OBD_PCM_Processor_Fault, m_output, "m_output null");
|
||||||
|
if (m_config->offBelowDuty > m_config->onAboveDuty) {
|
||||||
|
firmwareError(CUSTOM_ERR_6122, "You can't have off below %f greater than on above %f",
|
||||||
|
m_config->offBelowDuty,
|
||||||
|
m_config->onBelowDuty);
|
||||||
|
}
|
||||||
// Apply hysteresis with provided values
|
// Apply hysteresis with provided values
|
||||||
if (m_state && result < m_config->offBelowDuty) {
|
if (m_state && result < m_config->offBelowDuty) {
|
||||||
m_state = false;
|
m_state = false;
|
||||||
|
|
|
@ -346,8 +346,8 @@ struct gppwm_channel
|
||||||
uint8_t dutyIfError;+If an error (with a sensor, etc) is detected, this value is used instead of reading from the table.\nThis should be a safe value for whatever hardware is connected to prevent damage.;"%", 1, 0, 0, 100, 0
|
uint8_t dutyIfError;+If an error (with a sensor, etc) is detected, this value is used instead of reading from the table.\nThis should be a safe value for whatever hardware is connected to prevent damage.;"%", 1, 0, 0, 100, 0
|
||||||
uint16_t pwmFrequency;+Select a frequency to run PWM at.\nSet this to 0hz to enable on-off mode.;"hz", 1, 0, 0, 500, 0
|
uint16_t pwmFrequency;+Select a frequency to run PWM at.\nSet this to 0hz to enable on-off mode.;"hz", 1, 0, 0, 500, 0
|
||||||
|
|
||||||
uint8_t onAboveDuty;+In on-off mode, turn the output on when the table value is above this duty.;"%", 1, 0, 0, 100, 0
|
uint8_t onAboveDuty;+Hysteresis: in on-off mode, turn the output on when the table value is above this duty.;"%", 1, 0, 0, 100, 0
|
||||||
uint8_t offBelowDuty;+In on-off mode, turn the output off when the table value is below this duty.;"%", 1, 0, 0, 100, 0
|
uint8_t offBelowDuty;+Hysteresis: in on-off mode, turn the output off when the table value is below this duty.;"%", 1, 0, 0, 100, 0
|
||||||
|
|
||||||
gppwm_channel_e loadAxis;+Selects the load axis to use for the table.;
|
gppwm_channel_e loadAxis;+Selects the load axis to use for the table.;
|
||||||
uint8_t alignmentFill_map;;"unit", 1, 0, 0, 100, 0
|
uint8_t alignmentFill_map;;"unit", 1, 0, 0, 100, 0
|
||||||
|
|
Loading…
Reference in New Issue