Closed Candas1 closed 7 months ago
Hey, you didn't include speed comparison, but I assume you compared it? Is there a performance impact?
Looks great to me!
It is very similar:
Before: RAM: [= ] 9.0% (used 4428 bytes from 49152 bytes) Flash: [=== ] 26.8% (used 70280 bytes from 262144 bytes) loopfoc=280us
After: RAM: [= ] 9.0% (used 4428 bytes from 49152 bytes) Flash: [=== ] 26.8% (used 70224 bytes from 262144 bytes) loopfoc=280us
This is the refactoring I mentioned about here. It prevents the code duplication in getDCcurrents and getfoccurrents, this will make future changes in the Clarke transform easier (e.g. using the best 2 phases) getDQCurrents could be used when implementing FOC for stepper motors.
This shouldn't change how FOC works.