Open
Description
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.