mirror of https://github.com/rusefi/rusefi-1.git
PID - fix dTime usages #776
This commit is contained in:
parent
3c09b8f1f5
commit
05d43db76f
|
@ -49,7 +49,7 @@ public:
|
|||
private:
|
||||
void PeriodicTask(efitime_t nowNt) override {
|
||||
UNUSED(nowNt);
|
||||
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->alternatorControl.periodMs));
|
||||
setPeriod(GET_PERIOD_LIMITED(&engineConfiguration->alternatorControl));
|
||||
|
||||
#if ! EFI_UNIT_TEST
|
||||
if (shouldResetPid) {
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
private:
|
||||
void PeriodicTask(efitime_t nowNt) override {
|
||||
UNUSED(nowNt);
|
||||
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->auxPid[0].periodMs));
|
||||
setPeriod(GET_PERIOD_LIMITED(&engineConfiguration->auxPid[0]));
|
||||
|
||||
if (engine->auxParametersVersion.isOld(engine->getGlobalConfigurationVersion())) {
|
||||
pidReset();
|
||||
|
|
|
@ -167,7 +167,7 @@ private:
|
|||
|
||||
void PeriodicTask(efitime_t nowNt) override {
|
||||
UNUSED(nowNt);
|
||||
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->etb.periodMs));
|
||||
setPeriod(GET_PERIOD_LIMITED(&engineConfiguration->etb));
|
||||
|
||||
|
||||
// set debug_mode 17
|
||||
|
|
|
@ -265,7 +265,7 @@ public:
|
|||
private:
|
||||
void PeriodicTask(efitime_t nowNt) override {
|
||||
UNUSED(nowNt);
|
||||
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->idleRpmPid.periodMs));
|
||||
setPeriod(GET_PERIOD_LIMITED(&engineConfiguration->idleRpmPid));
|
||||
|
||||
/*
|
||||
* Here we have idle logic thread - actual stepper movement is implemented in a separate
|
||||
|
|
|
@ -222,7 +222,7 @@ public:
|
|||
private:
|
||||
void PeriodicTask(efitime_t nowNt) override {
|
||||
UNUSED(nowNt);
|
||||
setPeriod(NOT_TOO_OFTEN(10 /* ms */, engineConfiguration->auxPid[0].periodMs));
|
||||
setPeriod(50 /* ms */);
|
||||
|
||||
// naive inter-thread communication - waiting for a flag
|
||||
if (isBenchTestPending) {
|
||||
|
|
|
@ -19,6 +19,13 @@
|
|||
#define PID_AVG_BUF_SIZE_SHIFT 5
|
||||
#define PID_AVG_BUF_SIZE (1<<PID_AVG_BUF_SIZE_SHIFT) // 32*sizeof(float)
|
||||
|
||||
// minimal period 5m meaning maximum control frequency 200Hz
|
||||
#define PID_MINIMAL_PERIOD_MS 5
|
||||
|
||||
#define GET_PERIOD_LIMITED(pid_s_ptr) maxI(PID_MINIMAL_PERIOD_MS, ((pid_s_ptr)->periodMs))
|
||||
|
||||
#define MS2SEC(x) (x * 0.001)
|
||||
|
||||
class Pid {
|
||||
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue