Oud verslag voor Biquad.

Dependencies:   Biquad HIDScope QEI angleandposition controlandadjust mbed

Fork of includeair by Jasper Gerth

Revision:
29:cd47a5a772db
Parent:
28:71a90073e482
Child:
30:cd4d9754a357
--- a/main.cpp	Tue Oct 27 13:05:36 2015 +0000
+++ b/main.cpp	Tue Oct 27 16:16:36 2015 +0000
@@ -248,6 +248,7 @@
     float stepsize=(y_punch-y_start)/(timetoshoot*control_frequency);
     float y_during_punch=y_start;// set initial y position to start position
 
+float x_punch=anglepos.angletoposition(counttorad*encoder1.getPulses(),counttorad*encoder2.getPulses());
     Timer shoottimer;
     shoottimer.reset();
     shoottimer.start();
@@ -262,8 +263,8 @@
             y_during_punch=y_during_punch;
         }
 
-        desired_angle1=anglepos.positiontoangle1(desired_position,y_during_punch);// calculate desired angles
-        desired_angle2=anglepos.positiontoangle2(desired_position,y_during_punch);
+        desired_angle1=anglepos.positiontoangle1(x_punch,y_during_punch);// calculate desired angles
+        desired_angle2=anglepos.positiontoangle2(x_punch,y_during_punch);
 
         error1=(desired_angle1-counttorad*encoder1.getPulses());//calculate errors
         error2=(desired_angle2-counttorad*encoder2.getPulses());
@@ -290,8 +291,8 @@
             y_during_punch=y_during_punch;
         }
 
-        desired_angle1=anglepos.positiontoangle1(desired_position,y_during_punch);// calculate desired angles
-        desired_angle2=anglepos.positiontoangle2(desired_position,y_during_punch);
+        desired_angle1=anglepos.positiontoangle1(x_punch,y_during_punch);// calculate desired angles
+        desired_angle2=anglepos.positiontoangle2(x_punch,y_during_punch);
 
         error1=(desired_angle1-counttorad*encoder1.getPulses());//calculate errors
         error2=(desired_angle2-counttorad*encoder2.getPulses());