Skip to content

Commit 7382429

Browse files
committed
FEAT due to the low memory of the Arduino UNO remove the per phase filtering for now
1 parent 1a6269d commit 7382429

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/current_sense/InlineCurrentSense.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ void InlineCurrentSense::calibrateOffsets(){
5050
// read all three phase currents (if possible 2 or 3)
5151
PhaseCurrent_s InlineCurrentSense::getPhaseCurrents(){
5252
PhaseCurrent_s current;
53-
current.a = lpf_a(_readADCVoltageInline(pinA) - offset_ia)*gain_a;// amps
54-
current.b = lpf_b(_readADCVoltageInline(pinB) - offset_ib)*gain_b;// amps
55-
current.c = (!_isset(pinC)) ? 0 : lpf_c(_readADCVoltageInline(pinC) - offset_ic)*gain_c; // amps
53+
current.a = (_readADCVoltageInline(pinA) - offset_ia)*gain_a;// amps
54+
current.b = (_readADCVoltageInline(pinB) - offset_ib)*gain_b;// amps
55+
current.c = (!_isset(pinC)) ? 0 : (_readADCVoltageInline(pinC) - offset_ic)*gain_c; // amps
5656
return current;
5757
}
5858
// Function synchronizing current sense with motor driver.

src/current_sense/InlineCurrentSense.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ class InlineCurrentSense: public CurrentSense{
3535
float gain_b; //!< phase B gain
3636
float gain_c; //!< phase C gain
3737

38-
// per phase low pass fileters
39-
LowPassFilter lpf_a{DEF_LPF_PER_PHASE_CURRENT_SENSE_Tf}; //!< current A low pass filter
40-
LowPassFilter lpf_b{DEF_LPF_PER_PHASE_CURRENT_SENSE_Tf}; //!< current B low pass filter
41-
LowPassFilter lpf_c{DEF_LPF_PER_PHASE_CURRENT_SENSE_Tf}; //!< current C low pass filter
38+
// // per phase low pass fileters
39+
// LowPassFilter lpf_a{DEF_LPF_PER_PHASE_CURRENT_SENSE_Tf}; //!< current A low pass filter
40+
// LowPassFilter lpf_b{DEF_LPF_PER_PHASE_CURRENT_SENSE_Tf}; //!< current B low pass filter
41+
// LowPassFilter lpf_c{DEF_LPF_PER_PHASE_CURRENT_SENSE_Tf}; //!< current C low pass filter
4242

4343
private:
4444

src/current_sense/LowsideCurrentSense.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ void LowsideCurrentSense::calibrateOffsets(){
5252
PhaseCurrent_s LowsideCurrentSense::getPhaseCurrents(){
5353
PhaseCurrent_s current;
5454
_startADC3PinConversionLowSide();
55-
current.a = lpf_a(_readADCVoltageLowSide(pinA) - offset_ia)*gain_a;// amps
56-
current.b = lpf_b(_readADCVoltageLowSide(pinB) - offset_ib)*gain_b;// amps
57-
current.c = (!_isset(pinC)) ? 0 : lpf_b(_readADCVoltageLowSide(pinC) - offset_ic)*gain_c; // amps
55+
current.a = (_readADCVoltageLowSide(pinA) - offset_ia)*gain_a;// amps
56+
current.b = (_readADCVoltageLowSide(pinB) - offset_ib)*gain_b;// amps
57+
current.c = (!_isset(pinC)) ? 0 : (_readADCVoltageLowSide(pinC) - offset_ic)*gain_c; // amps
5858
return current;
5959
}
6060
// Function synchronizing current sense with motor driver.

src/current_sense/LowsideCurrentSense.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ class LowsideCurrentSense: public CurrentSense{
3636
float gain_b; //!< phase B gain
3737
float gain_c; //!< phase C gain
3838

39-
// per phase low pass fileters
40-
LowPassFilter lpf_a{DEF_LPF_PER_PHASE_CURRENT_SENSE_Tf}; //!< current A low pass filter
41-
LowPassFilter lpf_b{DEF_LPF_PER_PHASE_CURRENT_SENSE_Tf}; //!< current B low pass filter
42-
LowPassFilter lpf_c{DEF_LPF_PER_PHASE_CURRENT_SENSE_Tf}; //!< current C low pass filter
39+
// // per phase low pass fileters
40+
// LowPassFilter lpf_a{DEF_LPF_PER_PHASE_CURRENT_SENSE_Tf}; //!< current A low pass filter
41+
// LowPassFilter lpf_b{DEF_LPF_PER_PHASE_CURRENT_SENSE_Tf}; //!< current B low pass filter
42+
// LowPassFilter lpf_c{DEF_LPF_PER_PHASE_CURRENT_SENSE_Tf}; //!< current C low pass filter
4343

4444
private:
4545

0 commit comments

Comments
 (0)