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);
156 chThdSleepMilliseconds(periodMs);
161 efiPrintf(
"%s settings: offset=%f P=%.5f I=%.5f D=%.5f period=%dms",
169 efiPrintf(
"%s status: value=%.2f input=%.2f/target=%.2f iTerm=%.5f dTerm=%.5f",
192 if (iTerm < -parameters->maxValue * 100)
214 for (
int i = 0; i < PID_AVG_BUF_SIZE; i++)
226 int localBufPos = (
totalItermCnt >> PID_AVG_BUF_SIZE_SHIFT) % PID_AVG_BUF_SIZE;
227 int localPrevBufPos = ((
totalItermCnt - 1) >> PID_AVG_BUF_SIZE_SHIFT) % PID_AVG_BUF_SIZE;
230 if (localPrevBufPos != localBufPos)
237 for (
int i = 0; i < PID_AVG_BUF_SIZE; i++) {
285 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