mirror of https://github.com/FOME-Tech/fome-fw.git
use timer instead of home spun time math
This commit is contained in:
parent
9ebdc88bb4
commit
378b37f29c
|
@ -383,8 +383,7 @@ expected<percent_t> EtbController::getClosedLoopAutotune(percent_t target, perce
|
|||
efitick_t now = getTimeNowNt();
|
||||
|
||||
// Determine period
|
||||
float tu = NT2US((float)(now - m_cycleStartTime)) / 1e6;
|
||||
m_cycleStartTime = now;
|
||||
float tu = m_autotuneCycleStart.getElapsedSecondsAndReset(now);
|
||||
|
||||
// Determine amplitude
|
||||
float a = m_maxCycleTps - m_minCycleTps;
|
||||
|
|
|
@ -116,7 +116,7 @@ private:
|
|||
|
||||
// Autotune helpers
|
||||
bool m_lastIsPositive = false;
|
||||
efitick_t m_cycleStartTime = 0;
|
||||
Timer m_autotuneCycleStart;
|
||||
float m_minCycleTps = 0;
|
||||
float m_maxCycleTps = 0;
|
||||
// Autotune measured parameters: gain and ultimate period
|
||||
|
|
Loading…
Reference in New Issue