This is with minumum of 10 milliseconds threshold delay 00:53

Dependencies:   biquadFilter MODSERIAL QEI Servo mbed

Fork of StateMachine_EMg_RKI_PID_MOTOR_metklikenalles by Gaston Gabriël

Committer:
gastongab
Date:
Thu Nov 01 15:08:05 2018 +0000
Revision:
4:c7be673eb4a1
Parent:
2:0a8622662f6d
16:08

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gastongab 2:0a8622662f6d 1 #include "mbed.h"
gastongab 2:0a8622662f6d 2
gastongab 2:0a8622662f6d 3 //BiQuad Chains for each EMG, total 4 chains
gastongab 2:0a8622662f6d 4 //EMG1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
gastongab 4:c7be673eb4a1 5 //Highpass
gastongab 2:0a8622662f6d 6 BiQuadChain highp1;
gastongab 2:0a8622662f6d 7 BiQuad highp1_1( 9.21171e-01, -1.84234e+00, 9.21171e-01, -1.88661e+00, 8.90340e-01 );
gastongab 2:0a8622662f6d 8 BiQuad highp1_2( 1.00000e+00, -2.00000e+00, 1.00000e+00, -1.94922e+00, 9.53070e-01 );
gastongab 2:0a8622662f6d 9
gastongab 2:0a8622662f6d 10 //Notch
gastongab 2:0a8622662f6d 11 BiQuadChain notch1;
gastongab 2:0a8622662f6d 12 BiQuad notch1_1( 9.56543e-01, -1.82035e+00, 9.56543e-01, -1.84459e+00, 9.53626e-01 );
gastongab 2:0a8622662f6d 13 BiQuad notch1_2( 1.00000e+00, -1.90305e+00, 1.00000e+00, -1.87702e+00, 9.59471e-01 );
gastongab 2:0a8622662f6d 14
gastongab 2:0a8622662f6d 15 //Lowpass 4th order cutoff 3Hz
gastongab 2:0a8622662f6d 16 BiQuadChain lowp1;
gastongab 2:0a8622662f6d 17 BiQuad lowp1_1( 7.69910e-09, 1.53982e-08, 7.69910e-09, -1.96542e+00, 9.65769e-01 );
gastongab 2:0a8622662f6d 18 BiQuad lowp1_2( 1.00000e+00, 2.00000e+00, 1.00000e+00, -1.98532e+00, 9.85677e-01 );
gastongab 2:0a8622662f6d 19
gastongab 2:0a8622662f6d 20 //EMG2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
gastongab 2:0a8622662f6d 21 //Highpass
gastongab 2:0a8622662f6d 22 BiQuadChain highp2;
gastongab 2:0a8622662f6d 23 BiQuad highp2_1( 9.21171e-01, -1.84234e+00, 9.21171e-01, -1.88661e+00, 8.90340e-01 );
gastongab 2:0a8622662f6d 24 BiQuad highp2_2( 1.00000e+00, -2.00000e+00, 1.00000e+00, -1.94922e+00, 9.53070e-01 );
gastongab 2:0a8622662f6d 25
gastongab 2:0a8622662f6d 26 //Notch
gastongab 2:0a8622662f6d 27 BiQuadChain notch2;
gastongab 2:0a8622662f6d 28 BiQuad notch2_1( 9.56543e-01, -1.82035e+00, 9.56543e-01, -1.84459e+00, 9.53626e-01 );
gastongab 2:0a8622662f6d 29 BiQuad notch2_2( 1.00000e+00, -1.90305e+00, 1.00000e+00, -1.87702e+00, 9.59471e-01 );
gastongab 2:0a8622662f6d 30
gastongab 2:0a8622662f6d 31 //Lowpass 4th order cutoff 3Hz
gastongab 2:0a8622662f6d 32 BiQuadChain lowp2;
gastongab 2:0a8622662f6d 33 BiQuad lowp2_1( 7.69910e-09, 1.53982e-08, 7.69910e-09, -1.96542e+00, 9.65769e-01 );
gastongab 2:0a8622662f6d 34 BiQuad lowp2_2( 1.00000e+00, 2.00000e+00, 1.00000e+00, -1.98532e+00, 9.85677e-01 );
gastongab 2:0a8622662f6d 35
gastongab 2:0a8622662f6d 36 //EMG3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
gastongab 2:0a8622662f6d 37 //Highpass
gastongab 2:0a8622662f6d 38 BiQuadChain highp3;
gastongab 2:0a8622662f6d 39 BiQuad highp3_1( 9.21171e-01, -1.84234e+00, 9.21171e-01, -1.88661e+00, 8.90340e-01 );
gastongab 2:0a8622662f6d 40 BiQuad highp3_2( 1.00000e+00, -2.00000e+00, 1.00000e+00, -1.94922e+00, 9.53070e-01 );
gastongab 2:0a8622662f6d 41
gastongab 2:0a8622662f6d 42 //Notch
gastongab 2:0a8622662f6d 43 BiQuadChain notch3;
gastongab 2:0a8622662f6d 44 BiQuad notch3_1( 9.56543e-01, -1.82035e+00, 9.56543e-01, -1.84459e+00, 9.53626e-01 );
gastongab 2:0a8622662f6d 45 BiQuad notch3_2( 1.00000e+00, -1.90305e+00, 1.00000e+00, -1.87702e+00, 9.59471e-01 );
gastongab 2:0a8622662f6d 46
gastongab 2:0a8622662f6d 47 //Lowpass 4th order cutoff 3Hz
gastongab 2:0a8622662f6d 48 BiQuadChain lowp3;
gastongab 2:0a8622662f6d 49 BiQuad lowp3_1( 7.69910e-09, 1.53982e-08, 7.69910e-09, -1.96542e+00, 9.65769e-01 );
gastongab 2:0a8622662f6d 50 BiQuad lowp3_2( 1.00000e+00, 2.00000e+00, 1.00000e+00, -1.98532e+00, 9.85677e-01 );
gastongab 2:0a8622662f6d 51
gastongab 2:0a8622662f6d 52 //EMG4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
gastongab 2:0a8622662f6d 53 //Highpass
gastongab 2:0a8622662f6d 54 BiQuadChain highp4;
gastongab 2:0a8622662f6d 55 BiQuad highp4_1( 9.21171e-01, -1.84234e+00, 9.21171e-01, -1.88661e+00, 8.90340e-01 );
gastongab 2:0a8622662f6d 56 BiQuad highp4_2( 1.00000e+00, -2.00000e+00, 1.00000e+00, -1.94922e+00, 9.53070e-01 );
gastongab 2:0a8622662f6d 57
gastongab 2:0a8622662f6d 58 //Notch
gastongab 2:0a8622662f6d 59 BiQuadChain notch4;
gastongab 2:0a8622662f6d 60 BiQuad notch4_1( 9.56543e-01, -1.82035e+00, 9.56543e-01, -1.84459e+00, 9.53626e-01 );
gastongab 2:0a8622662f6d 61 BiQuad notch4_2( 1.00000e+00, -1.90305e+00, 1.00000e+00, -1.87702e+00, 9.59471e-01 );
gastongab 2:0a8622662f6d 62
gastongab 2:0a8622662f6d 63 //Lowpass 4th order cutoff 3Hz
gastongab 2:0a8622662f6d 64 BiQuadChain lowp4;
gastongab 2:0a8622662f6d 65 BiQuad lowp4_1( 7.69910e-09, 1.53982e-08, 7.69910e-09, -1.96542e+00, 9.65769e-01 );
gastongab 2:0a8622662f6d 66 BiQuad lowp4_2( 1.00000e+00, 2.00000e+00, 1.00000e+00, -1.98532e+00, 9.85677e-01 );