PES2_mbed_os_6

Dependencies:   Servo

Revision:
3:a292bdaf03f6
Parent:
0:5d4d21d56334
diff -r 87ca9b0c9992 -r a292bdaf03f6 Controller.cpp
--- a/Controller.cpp	Sat Mar 13 11:06:23 2021 +0100
+++ b/Controller.cpp	Tue Mar 16 17:28:04 2021 +0100
@@ -6,7 +6,7 @@
 const float Controller::COUNTS_PER_TURN = 1200.0f;         // encoder resolution
 const float Controller::LOWPASS_FILTER_FREQUENCY = 300.0f;  // given in [rad/s]
 const float Controller::KN = 40.0f;                         // speed constant in [rpm/V]
-const float Controller::KP = 0.2f;                          // speed control parameter
+const float Controller::KP = 0.15f;                          // speed control parameter
 const float Controller::MAX_VOLTAGE = 12.0f;                // battery voltage in [V]
 const float Controller::MIN_DUTY_CYCLE = 0.02f;             // minimum duty-cycle
 const float Controller::MAX_DUTY_CYCLE = 0.98f;             // maximum duty-cycle
@@ -14,7 +14,7 @@
 Controller::Controller(PwmOut& pwmLeft, PwmOut& pwmRight,
                         EncoderCounter& counterLeft, EncoderCounter& counterRight) :
                         pwmLeft(pwmLeft), pwmRight(pwmRight),
-                        counterLeft(counterLeft), counterRight(counterRight) {
+                        counterLeft(counterLeft), counterRight(counterRight), thread(osPriorityHigh, STACK_SIZE) {
 
     // Initialisieren der PWM Ausgaenge