32 bool result = (a == b);
34 efiPrintf(
"PID: not same %f %f", a, b);
58 float dTime = MS2SEC(GET_PERIOD_LIMITED(
parameters));
59 return getOutput(p_target, p_input, dTime);
157 chThdSleepMilliseconds(periodMs);
162 efiPrintf(
"%s settings: offset=%f P=%.5f I=%.5f D=%.5f period=%dms",
170 efiPrintf(
"%s status: value=%.2f input=%.2f/target=%.2f iTerm=%.5f dTerm=%.5f",
193 if (iTerm < -parameters->maxValue * 100)
215 for (
int i = 0; i < PID_AVG_BUF_SIZE; i++)
227 int localBufPos = (
totalItermCnt >> PID_AVG_BUF_SIZE_SHIFT) % PID_AVG_BUF_SIZE;
228 int localPrevBufPos = ((
totalItermCnt - 1) >> PID_AVG_BUF_SIZE_SHIFT) % PID_AVG_BUF_SIZE;
231 if (localPrevBufPos != localBufPos)
238 for (
int i = 0; i < PID_AVG_BUF_SIZE; i++) {
286 return limitedOutput;
float getOutput(float target, float input, float dTime) override
float iTermBuf[PID_AVG_BUF_SIZE]
void reset(void) override
void updateITerm(float value) override
void updateFactors(float pFactor, float iFactor, float dFactor)
bool isSame(const pid_s *parameters) const
virtual void updateITerm(float value)
void setErrorAmplification(float coef)
void postState(pid_status_s &pidStatus) const
void showPidStatus(const char *msg) const
float getUnclampedOutput(float target, float input, float dTime)
float getPrevError(void) const
void initPidClass(pid_s *parameters)
float getIntegration(void) const
float getMinValue() const
float getOutput(float target, float input)
float getOutput(float target, float input, float dTime) override
float derivativeFilterLoss
float limitOutput(float v) const
static bool isClose(float a, float b)
bool warning(ObdCode code, const char *fmt,...)
@ OBD_PCM_Processor_Fault
float errorAmplificationCoef
scaled_channel< int16_t, 100, 1 > dTerm
scaled_channel< int16_t, 100, 1 > error
scaled_channel< int16_t, 100, 1 > output
scaled_channel< int16_t, 100, 1 > iTerm