2 #include "../foc_utils.h"
3 #include "../time_utils.h"
18 unsigned long now_us =
_micros();
19 float Ts = (now_us - velocity_calc_timestamp)*1e-6;
21 if(Ts <= 0 || Ts > 0.5) Ts = 1e-3;
26 float vel = (angle_c - angle_prev)/Ts;
30 velocity_calc_timestamp = now_us;