rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
error_accumulator.h
Go to the documentation of this file.
1#pragma once
2
4public:
5 void init(float ignoreError, float dt) {
6 m_ignoreError = ignoreError;
7 m_dt = dt;
8 }
9
10 // Accumulate the current error, returning the total integrated error
11 float accumulate(float error);
12
13 // Get the current accumulator value
14 float getAccumulator() const {
15 return m_errorIntegral;
16 }
17
18 // Reset the integrator to 0 error.
19 void reset();
20
21private:
22 // more or less threshold parameter
23 float m_ignoreError = 0;
24 // time parameter
25 float m_dt = 0;
26 // current state
27 float m_errorIntegral = 0;
28};
float getAccumulator() const
float accumulate(float error)
void init(float ignoreError, float dt)