Delancy7
1 mW
I'm working on FOC motor control for an electric go-cart. I've inherited some code in C for this from my dad, who had worked on this several years ago. I want to complete the code and get it working on a motor I bought for use in a go-cart. The code is written for an STM32F7 MCU.
There's something in the FOC code that I don't understand. When dad reads the rotor position in the motor control inner loop (triggered from the timer that does PWM on the motor phases), he calculates the rotor position by reading the position from the quadrature encoder (the motor he used has a QE with 2000 counts per revolution). This motor (according to the specs) has 8 poles, hence 4 pole-pairs.
What I don't understand is why dad's code to calculate the rotor position (in radians from 0 to 2*pi) doesn't use the number of motor poles in the calculation. Is this correct? I would have thought that the number of pole-pairs would figure into the calculation because this motor makes 4 electrical revolutions for every mechanical revolution. What am I missing here?
There's something in the FOC code that I don't understand. When dad reads the rotor position in the motor control inner loop (triggered from the timer that does PWM on the motor phases), he calculates the rotor position by reading the position from the quadrature encoder (the motor he used has a QE with 2000 counts per revolution). This motor (according to the specs) has 8 poles, hence 4 pole-pairs.
What I don't understand is why dad's code to calculate the rotor position (in radians from 0 to 2*pi) doesn't use the number of motor poles in the calculation. Is this correct? I would have thought that the number of pole-pairs would figure into the calculation because this motor makes 4 electrical revolutions for every mechanical revolution. What am I missing here?