Het complete motorscript met alle gewenste functies

Dependencies:   HIDScope MODSERIAL QEI biquadFilter mbed

Fork of Motor_EMG_Definitief by Margreeth de Breij

Files at this revision

API Documentation at this revision

Comitter:
Margreeth95
Date:
Fri Oct 30 11:51:16 2015 +0000
Parent:
11:65d053a1b511
Commit message:
Final commit, definitieve motorconstanten

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 65d053a1b511 -r 95d57057d622 main.cpp
--- a/main.cpp	Fri Oct 30 11:24:44 2015 +0000
+++ b/main.cpp	Fri Oct 30 11:51:16 2015 +0000
@@ -79,8 +79,8 @@
     const double m2_Ts = 0.001, m1_Ts = 0.001;
 
 //Controller gain Motor 2 & 1
-    const double m2_Kp = 0.1523/5,m2_Ki = 0.08585/5, m2_Kd = 0.004534/5;
-    const double m1_Kp = 0.1523/5,m1_Ki = 0.08585/5, m1_Kd = 0.004534/5;
+    const double m2_Kp = 0.02686,m2_Ki = 0.01854, m2_Kd = 0.001172;
+    const double m1_Kp = 0.02686,m1_Ki = 0.01854, m1_Kd = 0.001172;
     double m2_err_int = 0, m2_prev_err = 0;
     double m1_err_int = 0, m1_prev_err = 0;
     
@@ -279,7 +279,7 @@
         LedR.write(1);    
 //--------------------------------------------------------------------------------------------------------------------------//
 // Control Program
-//--------------------------------------------------------------------------------------------------------------------------//
+//--------------------------------------k------------------------------------------------------------------------------------//
     while(true)
     {
                                             //char c = pc.getc();
@@ -291,7 +291,7 @@
                 {
                     count = 2;
                 }
-            wait(0.5);
+            wait(1);
         }
      // 1 Program DOWN
      //   if(c == 'd') // Hoe gaat dit aangestuurd worden?
@@ -383,7 +383,7 @@
         if(count == 2) 
         {
                 LedG = LedR = 1;
-                pc.printf("Please press the button to shoot the disc\n");
+                pc.printf("Please press the button to shoot the disc/n");
                 BlinkLed(LedB, 25, 0.1);
                 
                 //VUUUUR!! (To Do)