Skip to content

[FEATURE] Always run current sense and persist current values #419

Open
@Candas1

Description

@Candas1

Always run current sense in loopfoc() if it's available/linked to the motor.
Save phase currents, alpha beta currents, unfiltered d/q currents as motor members.

Benefits:

  • if user declared current sense but is not using FOC modes, he has to run his own code to check current sense returns proper values. With this change, he can always see the currents without additional code.
  • this could allow overcurrent protection even if not in FOC mode
  • the different currents are available for sensors like Flux observers or HFI

In loopfoc:

  • if current sense is available, get phase currents and save phase currents
  • run clarke transform and save alpha/beta currents (useful for flux observers)
  • run park transform and save unfiltered d/q currents (useful for HFI)
  • filter d/q currents

This will impact the performance when not using FOC, but will not run if the user doesn't link the current sense to the motor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions