Motor current controller

Fork of CURRENT_CONTROL by LDSC_Robotics_TAs

Revision:
19:24605ba48462
Parent:
18:76383af914dc
Child:
20:559db13dc85a
--- a/CURRENT_CONTROL.cpp	Fri Jan 20 15:45:51 2017 +0000
+++ b/CURRENT_CONTROL.cpp	Tue Feb 07 09:52:56 2017 +0000
@@ -52,7 +52,8 @@
     MotorMinus(PwmChannel2),
     wheelSpeed(QEI_A, QEI_B, NC, pulsesPerRev, arraysize, samplingTime, QEI::X4_ENCODING), //(pin1, pin2, pin3, pulsesPerRev, arraysize, sampletime, pulses)
     pid(0.0,0.0,0.0,samplingTime),
-    lpFilter(samplingTime, 400.0) // 1.5915 Hz = 10 rad/s
+    lpf_current(samplingTime, 400.0), // 1.5915 Hz = 10 rad/s
+    lpf_wheelSpeed(samplingTime, 200.0, 2) // 2nd-order LPF, fc = 200.0 Hz
 
 
 {
@@ -326,7 +327,7 @@
     //
 
     // Low-pass filter
-    curFeedBack_filter = lpFilter.filter(curFeedBack);
+    curFeedBack_filter = lpf_current.filter(curFeedBack);
 
     return  curFeedBack_filter; //curFeedBack;
 }