New reference frame: y=0 is now at table height.
Dependencies: HIDScope MODSERIAL QEI biquadFilter mbed
Fork of prog_forwardkin_feedback_copy by
Diff: main.cpp
- Revision:
- 43:2b2e0bff0b39
- Parent:
- 41:68b170829965
- Child:
- 44:43f200e04903
--- a/main.cpp Thu Nov 03 18:56:09 2016 +0000 +++ b/main.cpp Sat Nov 05 13:54:09 2016 +0000 @@ -73,9 +73,9 @@ //set initial conditions float biceps_l = 0; float biceps_r = 0; -float ReferencePosition_x = 0.4; //L2; +float ReferencePosition_x = 0.35; //L2; float ReferencePosition_y = L1 + TowerHeight - StampHeight; -float ReferencePosition_xnew = 0.4; //L2; +float ReferencePosition_xnew = 0.35; //L2; float ReferencePosition_ynew = L1 + TowerHeight - StampHeight; float Position_x = 0.0; float Position_y = 0.0; @@ -109,7 +109,7 @@ //set constant or variable values (VALUES HAVE TO BE EDITED) int T=0; //EMG 'switch' variable -double threshold_l=0.1; //left arm EMG threshold +double threshold_l=0.09; //left arm EMG threshold double threshold_r = 0.08; //right arm EMG threshold float EMGgain = 1.0; @@ -119,9 +119,9 @@ float MotorMaxSpeed = 0.1; //define a maximum PWM speed for the motor float t_sample = 0.01; //seconds const float maxStampDistance = 0.7; //0.66; -const float minStampDistance = 0.35; +const float minStampDistance = 0.3; float Kp = 4.0;//potMeter2.read(); -float Ki = 0.02; //0.01*Kp; //potMeter2.read(); +float Ki = 0.04; //0.01*Kp; //potMeter2.read(); float Kd = 0.02; //0.1;(unstable!) //0.05; //0.02; //0.04*Kp; //potMeter2.read(); float N = 25; //N=1/Tf, Higher N is faster derivative action but more sensitive to noise.