test with PID control to screen on your computer
Dependencies: Motor_with_encoder MODSERIAL QEI mbed
Fork of Project_motor by
Diff: main.cpp
- Revision:
- 5:05d09e921b5d
- Parent:
- 4:abdc2d24d0bc
- Child:
- 6:b89ca8add6ee
- Child:
- 8:aff2a7d5861a
--- a/main.cpp Mon Oct 09 14:47:16 2017 +0000 +++ b/main.cpp Mon Oct 09 14:52:21 2017 +0000 @@ -17,6 +17,7 @@ float PwmPeriod = 0.0001f; + /*const double M1_TS = 0.01f; // timestep const double M1_KP = 2.5, M1_KI = 1.0, M1_KD = 0.5; // controller gains for motor 1 double m1_err_int = 0, m1_prev_err = 0; // initiallize errors