The final program for the #include AIR robot

Dependencies:   Biquad HIDScope controlandadjust mbed QEI angleandposition

Files at this revision

API Documentation at this revision

Comitter:
Gerth
Date:
Tue Oct 20 15:14:40 2015 +0000
Parent:
23:1c4a18799464
Child:
25:21dcd3f9eac2
Commit message:
increased controller frequency and decreased hidscope frequency

Changed in this revision

controlandadjust.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/controlandadjust.lib	Tue Oct 20 14:45:02 2015 +0000
+++ b/controlandadjust.lib	Tue Oct 20 15:14:40 2015 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/Gerth/code/controlandadjust/#2b4378bfe07a
+http://developer.mbed.org/users/Gerth/code/controlandadjust/#a1a29db96f4f
--- a/main.cpp	Tue Oct 20 14:45:02 2015 +0000
+++ b/main.cpp	Tue Oct 20 15:14:40 2015 +0000
@@ -26,6 +26,7 @@
 const double PIE=3.14159265359;
 const float counttorad=((2*PIE)/cpr_shaft);// counts per rotation of the shaft
 
+
 /////////////////////////////////CALIBRATION (MODE)
 const double radpersec_calibrate=0.1*PIE;// speed of arms when in calibration mode
 int modecounter=1;//counter in which mode the robot is
@@ -40,13 +41,13 @@
 DigitalIn buttonL(D3);//left button on biorobotics shield
 
 //////////////////////////////////CONTROLLER
-const double control_frequency=25;// frequency at which the controller is called
+const double control_frequency=50;// frequency at which the controller is called
 //controller constants
 float Kp=1;
 float Ki=0.1;
 float Kd=0.001;
+controlandadjust mycontroller(6); // make a controller, value in brackets is errorband
 
-controlandadjust mycontroller; // make a controller
 Ticker control_ticker;
 
 const double Ts_control=1.0/control_frequency;
@@ -95,7 +96,7 @@
 
 //////////////////////////////// POSITION AND ANGLE SHIZZLE
 const float safetymarginfield=0.075; //adjustable, tweak for maximum but safe range
-const float mm_per_sec_emg=0.050;// move the pod 50 mm per sec if muscle is flexed
+const float mm_per_sec_emg=0.1;// move the pod 100 mm per sec if muscle is flexed
 const float y_start=0.155;//starting y position of the pod
 const float y_punch=0.473;// position to where there is punched
 const float timetoshoot=0.25;// time it can take to shoot