Arduino-FOC icon indicating copy to clipboard operation
Arduino-FOC copied to clipboard

Stepper voltage bemf with negative velocity

Open safarir opened this issue 2 years ago • 0 comments

I am using a stepper motor in open loop mode with a KV value. When the shaft velocity is negative, the voltage.q is dropping with velocity while is should be rising which cause the torque to be limited.

I think the problem is here

// calculate the back-emf voltage if KV_rating available U_bemf = vel*(1/KV)
  if (_isset(KV_rating)) voltage_bemf = shaft_velocity/KV_rating/_RPM_TO_RADS;

It should be

// calculate the back-emf voltage if KV_rating available U_bemf = vel*(1/KV)
  if (_isset(KV_rating)) voltage_bemf = abs(shaft_velocity)/KV_rating/_RPM_TO_RADS;

safarir avatar Sep 21 '22 00:09 safarir