PID motor controll for the biorobotics project.

Dependencies:   FastPWM QEI

Dependents:   PID_example Motor_calibration Demo_mode Demo_mode ... more

Revision:
5:5537072b0e2e
Parent:
4:5353c5d0d2ed
Child:
6:d83c79716ea1
diff -r 5353c5d0d2ed -r 5537072b0e2e motor.cpp
--- a/motor.cpp	Wed Oct 31 06:13:15 2018 +0000
+++ b/motor.cpp	Wed Oct 31 06:41:39 2018 +0000
@@ -53,6 +53,11 @@
     printcount = 0;
 }
 
+void Motor::set_current_angle_as_zero() {
+    encoder.reset();
+    target_angle = 0;
+}
+
 void Motor::set_pid_k_values(double k_p, double k_i, double k_d) {
     pid.set_k_values(k_p, k_i, k_d);
 }