This post was last edited by my student number on 2018-7-3 22:44 Task 2 and Task 3 of this activity are as follows: Task 2: Get the key variables during FOC control: Ia, Ib, Ic, Ialpha, Ibeta, Id, Iq, Vd, Vq, and take screenshots Task 3: Monitor any data variables and take screenshots I personally think that these two tasks can be regarded as parallel in a sense. While monitoring the data, the value of the variable can also be obtained. Many netizens used the tool STMStudio to complete this task. They had struggled to obtain real-time data during project development. After experiencing it firsthand, they found that it is really a development tool. For the nine variables to be monitored, first of all, I would like to thank Brother Jianze for pointing out the location. The following code can be found in the generated project file /src/mc_tasks.c:
Anyone who has tinkered with motors can see that this code is the essential content of the FOC control algorithm. Borrowing from ST's training materials, it can be divided into the following steps:
1. Obtain the two-phase current of the motor through ADC sampling. There is a relationship of Ia+Ib+Ic = 0 between the three-phase currents; 2. Stationary coordinate transformation, the three-phase 120-degree abc coordinates are converted to the two-phase 90-degree alpha, beta coordinates. The ST formula is as follows:
3. Rotating coordinate transformation, add the electrical angle read by the encoder, and map the coordinates from the stator to the rotor, that is, the alpha, beta coordinates are converted to d, q coordinates. The ST formula is as follows:
4. The obtained Id, Iq are used as feedback and target Id, Iq for PI adjustment to obtain Vd, Vq variables 5. Inverse park transformation to convert the two-phase voltage value back to three-phase
6. Use the SVPWM algorithm to realize output modulation, and convert it into three-phase current through hardware inversion to enter the motor. A careful observation can reveal that there is also a Circle_Limitation function in the middle. It is introduced in the MCSDK firmware description document as follows:
The function to be realized is also mentioned in the training document:
This is the end of the introduction. Try to capture data with STMStudio. The acquisition of software and related documentation can be obtained directly on the ST official website. The following is a brief explanation of the steps: 1. Open the software and import the .axf file in the project directory
2. Select the variable you want to view and import it into the observation table [attach]362155 [/attach] 3. Right-click and select the variable you want to observe and send the data to the display chart [attach]362161 [/attach] 4. The following is the clarke change [attach]362154 [/attach] 5. The following is the park change [attach]362157 [/attach] 6. The following is the PI adjustment [attach]362158 [/attach] 7. The following is the inverse PARK transformation [attach]362159 [/attach] 8. Variables can also be recorded to generate .txt documents, great [attach]362156 [/attach]
This content is originally created by EEWORLD forum user my student number. If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source