Werkende PID regelaar met PC input, nieuwe constanten (Kp etc) nog niet toegevoegd.

Dependencies:   HIDScope MODSERIAL QEI biquadFilter mbed

Fork of frdm_Motor_V2_4 by BMT M9 groep 7

Revision:
29:c1f4467bfd19
Parent:
28:d0b26cfe5d80
--- a/main.cpp	Mon Oct 26 10:18:05 2015 +0000
+++ b/main.cpp	Mon Oct 26 19:55:11 2015 +0000
@@ -39,7 +39,7 @@
     double m2_ref = 0, m1_ref = 0;
     int count = 0;
     double Grens2 = 90, Grens1 = 90;
-    double Stapgrootte = 5;
+    double Stapgrootte = 1;
 
 //Sample time (motor-step)
     const double m2_Ts = 0.001, m1_Ts = 0.01;
@@ -199,8 +199,8 @@
                     m1_ref = m1_ref - Stapgrootte;
                     if (m2_ref < -1*Grens2)
                     {
-                        m2_ref = Grens2;
-                        m1_ref = Grens1;
+                        m2_ref = -1*Grens2;
+                        m1_ref = -1*Grens1;
                     }
                 }
         }