PID motor controll for the biorobotics project.

Dependencies:   FastPWM QEI

Dependents:   PID_example Motor_calibration Demo_mode Demo_mode ... more

Revision:
7:eb8787e7a5f5
Parent:
5:5537072b0e2e
Child:
10:d50c4957a193
--- a/motor.h	Wed Oct 31 08:01:35 2018 +0000
+++ b/motor.h	Wed Oct 31 08:47:16 2018 +0000
@@ -26,6 +26,10 @@
     QEI encoder;
     PID pid;
     
+    // Reduction ratio of an extra gear box.
+    // On top of the gear box in the motor.
+    double extra_reduction_ratio;
+    
     double target_angle;
     
     // For debugging purposes;
@@ -41,6 +45,9 @@
     // Set the angle the motor needs to rotate to. In radians.
     void set_target_angle(double angle);
     void set_pid_k_values(double k_p, double k_i, double k_d);
+    // Reduction ratio of an extra gear box.
+    // On top of the gear box in the motor.
+    void set_extra_reduction_ratio(double ratio);
     
     // Starts the motor controller with the specified update period.
     void start(float period);