State machine

Dependencies:   mbed Adafruit_GFX BioroboticsMotorControl MODSERIAL BioroboticsEMGFilter

Revision:
33:543debddb3a9
Parent:
27:b247e78a4380
Child:
39:f119ca6fc821
--- a/constants.h	Thu Nov 01 14:11:30 2018 +0000
+++ b/constants.h	Thu Nov 01 14:39:55 2018 +0000
@@ -18,6 +18,8 @@
 const float main_gear_ratio = 25.0/60.0;
 const float sec_gear_ratio = 25.0/50.0;
 
+const double main_motor_calibration_angle = 0.785398; // 45 degrees.
+const double sec_motor_calibration_angle = -0.733038; // -42 degrees.
 
 const float L0 = 0.15;                      // Length between two motors [meter]
 const float L1 = 0.10;                      // Length first beam from right motor2 [meter]
@@ -30,7 +32,7 @@
 // For inverse kinematics, maximum values for angles.
 const float max_r_angle = 2.96706; // If delta is larger than 175 degrees r is larger than this
 // Maximum and minimum angles of the main and secondary arm.
-const float main_arm_max_angle = 1.22173;
-const float main_arm_min_angle = 0.785398;
+const float main_arm_max_angle = 2.79253;
+const float main_arm_min_angle = main_motor_calibration_angle - 0.05;
 const float sec_arm_max_angle = 1.48353;
-const float sec_arm_min_angle = -0.733038;
\ No newline at end of file
+const float sec_arm_min_angle = sec_motor_calibration_angle + 0.05;
\ No newline at end of file