Oud verslag voor Biquad.
Dependencies: Biquad HIDScope QEI angleandposition controlandadjust mbed
Fork of includeair by
Diff: main.cpp
- Revision:
- 46:c03f2c576630
- Parent:
- 45:653370fa8b67
- Child:
- 47:29ea2915b811
--- a/main.cpp Mon Nov 02 13:14:59 2015 +0000 +++ b/main.cpp Mon Nov 02 14:39:26 2015 +0000 @@ -180,10 +180,10 @@ //gather data and send to scope void scopedata(double wanted_y) { - scope.set(0,desired_position); // desired x position - scope.set(1,wanted_y); // desired y position - scope.set(2,filteredsignal1); // filterded emg signal rigth arm - scope.set(3,filteredsignal2); // filtered emg signal left arm + scope.set(0,desired_position-anglepos.angletoposition(counttorad*encoder1.getPulses(),counttorad*encoder2.getPulses())); // desired x position + scope.set(1,wanted_y-anglepos.angletoposition_y(counttorad*encoder1.getPulses(),counttorad*encoder2.getPulses())); // desired y position + scope.set(2,error1*radtodeg); // filterded emg signal rigth arm + scope.set(3,error2*radtodeg); // filtered emg signal left arm scope.set(4,threshold_value); // threshold value scope.set(5,mycontroller.motor1pwm()); //pwm signal send to motor 1 scope.send(); // send info to HIDScope server @@ -294,7 +294,7 @@ error2=(desired_angle2-counttorad*encoder2.getPulses()); mycontroller.PID(error1,error2,Kp_shoot,Ki_shoot,Kd_shoot);;// send errors to controller - scopedata(y_during_punch);//send data to hidscope WARING lower freqyency than normal + scopedata(y_during_punch);//send data to hidscope WARING higher freqyency than normal time+=(Ts_control);// add time it should take to calculated time filtereverything(true);//set al filter variables to 0 @@ -328,7 +328,7 @@ error2=(desired_angle2-counttorad*encoder2.getPulses()); mycontroller.PID(error1,error2,Kp_shoot,Ki_shoot,Kd_shoot);;// send errors to controller - scopedata(y_during_punch);//send data to hidscope WARING lower freqyency than normal + scopedata(y_during_punch);//send data to hidscope WARING higher freqyency than normal time+=(Ts_control);// add time it should take to calculated time filtereverything(false);//start filtering the signal (lower frewquency than normal)