Version for EMG Threshold finding

Dependencies:   HIDScope MODSERIAL QEI biquadFilter mbed

Fork of prog_BioRobotics_Group9_StampRobot by Gerhard Berman

Revision:
30:676ecd59467a
Parent:
29:caf3dd699617
Child:
31:880ebd2e8145
Child:
32:3b00eafcf168
diff -r caf3dd699617 -r 676ecd59467a main.cpp
--- a/main.cpp	Fri Oct 28 09:17:12 2016 +0000
+++ b/main.cpp	Fri Oct 28 09:31:08 2016 +0000
@@ -98,6 +98,7 @@
 float EMGgain = 1.0;
 float dy_stampdown = 2.0; //0.05; //5 cm movement downward to stamp
 float MotorGain = 8.4; // rad/s for PWM, is max motor speed (motor value of 1)
+float MotorSpeedGain = 5.0; //to give the motor higher speeds
 float t_sample = 0.01; //seconds
 const float maxStampDistance = 1.5;
 
@@ -327,8 +328,11 @@
     motorValue2Out = DerTotalError2/MotorGain;       
     */
     
-    motorValue1Out = TotalError1/MotorGain;       
-    motorValue2Out = TotalError2/MotorGain;       
+    float motorValue1Small = TotalError1/MotorGain;       
+    float motorValue2Small = TotalError2/MotorGain;       
+    
+    motorValue1Out = MotorSpeedGain*motorValue1Small;
+    motorValue2Out = MotorSpeedGain*motorValue2Small;
     
     TotalError1_prev = TotalError1;
     TotalError2_prev = TotalError2;