Het complete motorscript met alle gewenste functies
Dependencies: HIDScope MODSERIAL QEI biquadFilter mbed
Fork of Motor_EMG_Definitief by
Diff: main.cpp
- Revision:
- 2:7873c44b0568
- Parent:
- 1:3f49c8818619
- Child:
- 3:86ca263a83dc
--- a/main.cpp Thu Oct 22 10:46:10 2015 +0000 +++ b/main.cpp Thu Oct 22 10:57:12 2015 +0000 @@ -78,7 +78,7 @@ //Sample time (motor-step) - const double m2_Ts = 0.01, m1_Ts = 0.01; + const double m2_Ts = 0.001, m1_Ts = 0.001; //Controller gain Motor 2 & 1 const double m2_Kp = 2.1/57,m2_Ki = 3.9/57, m2_Kd = 0.1/57; @@ -238,8 +238,8 @@ // Tickers ScopeTime.attach(&ScopeSend, 0.01f); // 100 Hz, Scope - myControllerTicker2.attach(&motor2_Controller, 0.01f ); // 100 Hz, Motor 2 - myControllerTicker1.attach(&motor1_Controller, 0.01f ); // 100 Hz, Motor 1 + myControllerTicker2.attach(&motor2_Controller, m2_Ts ); // 100 Hz, Motor 2 + myControllerTicker1.attach(&motor1_Controller, m1_Ts ); // 100 Hz, Motor 1 SampleEMGLeft.attach(&EMGfilterLeft, 0.01f); SampleEMGRight.attach(&EMGfilterRight, 0.01f); MovingAverageLeft.attach(&MovingAverageFilterLeft, 0.01f);