Skip to content

Commit f927db2

Browse files
committed
remove the initial glitch simplefoc#111 and simplefoc#110
1 parent 461ed57 commit f927db2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/base_classes/Sensor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ float Sensor::getVelocity() {
1919
// calculate sample time
2020
float Ts = (angle_prev_ts - vel_angle_prev_ts)*1e-6;
2121
// quick fix for strange cases (micros overflow)
22-
if(Ts <= 0 || Ts > 0.5f) Ts = 1e-3f;
22+
if(Ts <= 0) Ts = 1e-3f;
2323
// velocity calculation
2424
float vel = ( (float)(full_rotations - vel_full_rotations)*_2PI + (angle_prev - vel_angle_prev) ) / Ts;
2525
// save variables for future pass

0 commit comments

Comments
 (0)