Broncode projectgroep 2 Belinda Brandwacht s1226290 Esther Keulers s1255444 Maaike Schotman s1274104 Gerjan Wolterink s1197797 Roelof van Zwol s1240811

Dependencies:   Encoder MODSERIAL mbed

Fork of Begintotaalscript by Esther Keulers

Revision:
4:c79922420b70
Parent:
3:a3e4580af271
Child:
5:4adfd729a291
--- a/begintotaalscript.cpp	Tue Nov 05 08:42:42 2013 +0000
+++ b/begintotaalscript.cpp	Tue Nov 05 09:30:32 2013 +0000
@@ -107,10 +107,10 @@
     ybegin=0; //beginpositie
     qbegin=5.50;  //beginhoek (in rad) vanaf de y-as, rechtsom gedraaid is positief
     MaxsnelheidV=150.0;     //in mm/s
-    MaxsnelheidD=0.26;    //in rad/s
+    MaxsnelheidD=0.5*pi;    //in rad/s eerst 0.26 rad/s (15 deg/sec)
 //constanten regelaar
     kp_r = 0.006;
-    ki_r = 0.005;
+    ki_r = 0.005; 
     
     Ticker looptimer;
     looptimer.attach(setlooptimerflag,Ts);
@@ -387,7 +387,7 @@
             ybegin=y;    // y zal ybgin worden in de volgende loop  oftewel:(y(n) will be y(n-1) on next loop)
             qbegin=q;   // q zal qbegin worden in de volgende loop oftewel:(q(n) will be q(n-1) on next loop)
 
-            pc.printf("bV=%f, bD=%f, sV=%f, sD=%f, x=%f, y=%f, hoek=%f\n",BereikV,BereikD,SnelheidV,SnelheidD,x,y,(d*57.3));
+            pc.printf("bV=%f, bD=%f, sV=%f, sD=%f, x=%f, y=%f, hoek=%f\n",BereikV,BereikD,SnelheidV,SnelheidD,x,y,(q*57.3));
 
 
 // motoren
@@ -467,7 +467,7 @@
             // terug naar state 1 knop
             if (knop3 == false ) {  // terug naar state 1
                 state=1;
-                
+                meting=false; 
                 wait(0.05);
 
                 while(knop3 == false) {}