Control up to two motors using filtered EMG signals and a PID controller
Dependencies: FastPWM HIDScope MODSERIAL QEI Matrix biquadFilter controller errorFetch mbed motorConfig refGen MatrixMath inverseKinematics
Fork of Minor_test_serial by
Diff: main.cpp
- Revision:
- 35:99bf23b34ee3
- Parent:
- 34:1a70aa045c8f
- Child:
- 36:f3f3327d1d5a
diff -r 1a70aa045c8f -r 99bf23b34ee3 main.cpp --- a/main.cpp Sun Oct 22 08:01:59 2017 +0000 +++ b/main.cpp Sun Oct 22 08:07:06 2017 +0000 @@ -105,7 +105,9 @@ void measureAndControl(){ m1counts = Encoder1.getPulses(); m2counts = Encoder2.getPulses(); - float r1 = ref1.getFilteredReference; + float r1 = ref1.getReference(); + r1 = HPbqc.applyFilter(r1); + r1 = LPbqc.applyFilter(r1); e1.fetchError(m1counts, r1); float motorValue = motorController1.control(e1.e_pos, e1.e_int, e1.e_der); float r1_unfiltered = ref1.getReference();