PID Controller
Dependencies: HIDScope MODSERIAL PinDetect QEI biquadFilter
main.h@1:fe23126b0389, 2015-10-19 (annotated)
- Committer:
- AeroKev
- Date:
- Mon Oct 19 11:43:21 2015 +0000
- Revision:
- 1:fe23126b0389
- Parent:
- 0:d38eb4622914
a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AeroKev | 0:d38eb4622914 | 1 | PinName m1_enc_a = D12; |
AeroKev | 0:d38eb4622914 | 2 | PinName m1_enc_b = D13; |
AeroKev | 0:d38eb4622914 | 3 | PinName m1_pwm = D6; |
AeroKev | 0:d38eb4622914 | 4 | PinName m1_dir = D7; |
AeroKev | 0:d38eb4622914 | 5 | |
AeroKev | 0:d38eb4622914 | 6 | PinName m2_enc_a = D11; |
AeroKev | 0:d38eb4622914 | 7 | PinName m2_enc_b = D10; |
AeroKev | 0:d38eb4622914 | 8 | PinName m2_pwm = D5; |
AeroKev | 0:d38eb4622914 | 9 | PinName m2_dir = D4; |
AeroKev | 0:d38eb4622914 | 10 | |
AeroKev | 0:d38eb4622914 | 11 | PinName m2_pot = A0; |
AeroKev | 0:d38eb4622914 | 12 | PinName m1_pot = A1; |
AeroKev | 0:d38eb4622914 | 13 | |
AeroKev | 0:d38eb4622914 | 14 | const double pid_upper_limit = 1, pid_lower_limit = 0; |
AeroKev | 0:d38eb4622914 | 15 | |
AeroKev | 0:d38eb4622914 | 16 | const double motor1_kp = 0.75f, motor1_ki = 0.001f, motor1_kd = 0.005f; |
AeroKev | 1:fe23126b0389 | 17 | const double motor2_kp = 0.75f, motor2_ki = 0.001f, motor2_kd = 0.005f; |
AeroKev | 0:d38eb4622914 | 18 | |
AeroKev | 0:d38eb4622914 | 19 | const double m1_f_a1 = 1.0, m1_f_a2 = 2.0, m1_f_b0 = 1.0, m1_f_b1 = 3.0, m1_f_b2 = 4.0; |
AeroKev | 0:d38eb4622914 | 20 | const double m2_f_a1 = 1.0, m2_f_a2 = 2.0, m2_f_b0 = 1.0, m2_f_b1 = 3.0, m2_f_b2 = 4.0; |
AeroKev | 0:d38eb4622914 | 21 | |
AeroKev | 0:d38eb4622914 | 22 | int sigPerRev = 4192; |
AeroKev | 0:d38eb4622914 | 23 | float tickRate = 0.01f; |
AeroKev | 0:d38eb4622914 | 24 | float graphTickRate = 0.01f; |
AeroKev | 0:d38eb4622914 | 25 | |
AeroKev | 0:d38eb4622914 | 26 | float toRadians(int pulses); |