Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Encoder MODSERIAL mbed
Diff: main.cpp
- Revision:
 - 8:e3e972c4e249
 - Parent:
 - 7:422b8ec97278
 - Child:
 - 9:ca6c6295b5f1
 
diff -r 422b8ec97278 -r e3e972c4e249 main.cpp
--- a/main.cpp	Mon Nov 04 20:29:01 2013 +0000
+++ b/main.cpp	Mon Nov 04 21:05:55 2013 +0000
@@ -55,7 +55,7 @@
     looptimer.attach(setlooptimerflag,Ts);
 
     motor1.setPosition(200.0);
-    motor2.setPosition(16.32);
+    motor2.setPosition(597.15);
     
     x=0;
     y=0;
@@ -78,7 +78,7 @@
 
         inputsinus  =   inputsinus + (Ts*0.1)*pi;
 
-        //Binnen berijk blijven
+        //Binnen bereik blijven
 
         if (y>210.0) {
             y=210.0;
@@ -98,11 +98,11 @@
         //r       = (sqrt(x*x+y*y)) ;// *   (2577/461.335);
         
         theta = atan((y+69.80)/(x+69.80)); 
-        r = (sqrt(x*x+y*y+139.60*x + 139.6*y+784.0));
+        r = sqrt( ((x + 69.8)*(x + 69.8))+ ((y + 69.8)*(y + 69.8)) ); 
 
 
         theta_pen   = motor1.getPosition()  *   ((.5*pi)/400.0);
-        r_pen       = motor2.getPosition()  *   (363.0/2196.0);
+        r_pen       = motor2.getPosition()  *   (461.34/2790.13);
 
 
         dtheta  = (theta - theta_pen);