Skip to content

Commit ab90dba

Browse files
committed
some init issues
1 parent bec6406 commit ab90dba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/encoders/calibrated/CalibratedSensor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ float CalibratedSensor::getSensorAngle()
5858
// This filter has zero gain at electrical frequency and all integer multiples
5959
// So cogging effects should be completely filtered out
6060
void CalibratedSensor::filter_error(float* error, float &error_mean, int n_ticks, int window){
61-
float window_buffer[window] = {0};
61+
float window_buffer[window] = {0.0};
6262
float window_sum = 0;
6363
int buffer_index = 0;
6464
// fill the inital window buffer
@@ -106,7 +106,7 @@ void CalibratedSensor::calibrate(FOCMotor &motor)
106106
const int n_ticks = n_pos * _NPP; // number of positions to be sampled per mechanical rotation. Multiple of NPP for filtering reasons (see later)
107107
const int n2_ticks = 5; // increments between saved samples (for smoothing motion)
108108
float deltaElectricalAngle = _2PI * _NPP / (n_ticks * n2_ticks); // Electrical Angle increments for calibration steps
109-
float error[n_ticks] = {0}; // pointer to error array (average of forward & backward)
109+
float error[n_ticks] = {0.0}; // pointer to error array (average of forward & backward)
110110
const int window = 5; // window size for moving average filter of raw error
111111
// set the electric angle to 0
112112
float elec_angle = 0.0;

0 commit comments

Comments
 (0)