Element Green
Computer
- Dec 17, 2016
- 3
Hello,
I hope this question concerning implementing an FOC motor controller is appropriate for this forum.
I'm currently working on an open source 3 phase synchronous AC motor controller (hardware and software) using the STM32F303 microcontroller platform. In the interest of having the firmware also be open source, I am creating it from scratch, rather than leveraging existing proprietary motor control libraries.
I think I finally understand Field Oriented Control and have implemented a good bit of the firmware for this. However, I've decided to first do some simulations prior to hooking it up to a real motor. For this purpose I'm utilizing the D3.js Javascript library to plot the various variables involved in FOC in a web browser. However, I'm having difficulty conceptualizing how to simulate a motor. This is the subject of my question.
In the Field Oriented Control algorithm, there are the following measured motor inputs:
Phase A, B, and C instantaneous current measurements (only 2 actually need to be measured, 3rd is inferred from the fact that A + B + C = 0).
Absolute rotor position
In torque control mode there are Torque (q) and Flux (d) reference values, which are utilized by independent PI controllers to maintain the Torque and Flux of the motor.
The final output is 3 phase sine waves with 120 degree phase shifts. This will get fed to an SVPWM stage in the actual firmware, but is omitted in the simulation.
Feeding back the 3 phase output to the measured 3 phase motor current is straightforward enough (just copying the values). I'm stumped on how to simulate the rotation of the motor though. This would seem to require at least the following parameters: motor pole pair count, motor load, current speed of motor.
Given this information, how would I update the motor rotor position input? I would think this would involve calculating the torque, from the amount of current which is being supplied to the motor and the load which must be overcome. The number of pole pairs would determine the degree of rotation for a full cycle.
Any thoughts on this would be greatly appreciated. I can host the simulation on my website, if it would help to have some code to look at, though it is still lacking interactive controls currently.
Best regards,
Element Green
I hope this question concerning implementing an FOC motor controller is appropriate for this forum.
I'm currently working on an open source 3 phase synchronous AC motor controller (hardware and software) using the STM32F303 microcontroller platform. In the interest of having the firmware also be open source, I am creating it from scratch, rather than leveraging existing proprietary motor control libraries.
I think I finally understand Field Oriented Control and have implemented a good bit of the firmware for this. However, I've decided to first do some simulations prior to hooking it up to a real motor. For this purpose I'm utilizing the D3.js Javascript library to plot the various variables involved in FOC in a web browser. However, I'm having difficulty conceptualizing how to simulate a motor. This is the subject of my question.
In the Field Oriented Control algorithm, there are the following measured motor inputs:
Phase A, B, and C instantaneous current measurements (only 2 actually need to be measured, 3rd is inferred from the fact that A + B + C = 0).
Absolute rotor position
In torque control mode there are Torque (q) and Flux (d) reference values, which are utilized by independent PI controllers to maintain the Torque and Flux of the motor.
The final output is 3 phase sine waves with 120 degree phase shifts. This will get fed to an SVPWM stage in the actual firmware, but is omitted in the simulation.
Feeding back the 3 phase output to the measured 3 phase motor current is straightforward enough (just copying the values). I'm stumped on how to simulate the rotation of the motor though. This would seem to require at least the following parameters: motor pole pair count, motor load, current speed of motor.
Given this information, how would I update the motor rotor position input? I would think this would involve calculating the torque, from the amount of current which is being supplied to the motor and the load which must be overcome. The number of pole pairs would determine the degree of rotation for a full cycle.
Any thoughts on this would be greatly appreciated. I can host the simulation on my website, if it would help to have some code to look at, though it is still lacking interactive controls currently.
Best regards,
Element Green