Skip to content

Stepper voltage bemf with negative velocity #219

Closed
@safarir

Description

@safarir

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions