From 7f69d8951059fd2105652110b77fe62d98e7b637 Mon Sep 17 00:00:00 2001 From: Thefeli73 Date: Wed, 14 Apr 2021 02:57:38 +0200 Subject: [PATCH] whitespace and change var --- EENX15_LQR/EENX15_LQR.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EENX15_LQR/EENX15_LQR.ino b/EENX15_LQR/EENX15_LQR.ino index 6469b6f..3508e9c 100644 --- a/EENX15_LQR/EENX15_LQR.ino +++ b/EENX15_LQR/EENX15_LQR.ino @@ -119,8 +119,9 @@ void loop() { printInfo(); } } + void getSpeed() { - float alpha = 2.0 / (5.0 + 1.0); //alfa aka EMA length. 3 length = 3*80ms=0.24s + float alpha = 2.0 / (3.0 + 1.0); //Alpha aka EMA length. 3 length = 3*80ms=0.24s float rpm_const = 1071.43/fastTimer; //60000ms(1min) / ticks per rotation / fasttimer float rps_const = 112.23/fastTimer; //1000ms(1s) / ticks per rotation / fasttimer @@ -131,6 +132,7 @@ void getSpeed() { rps = rps * (1-alpha) + rps_new * alpha; countAold = countA; } + void printInfo(){ Serial.println(""); Serial.print("pitch Angle = "); Serial.println(angle_pitch_output);