3287 views|4 replies

1305

Posts

0

Resources
The OP
 

[Evaluation of Motor Kit P-NUCLEO-IHM]-3.1. Task check-in (basic tasks and self-assessment tasks) [Copy link]

This post was last edited by yang_alex on 2018-7-4 13:53 Having said so much before, let me quickly summarize the tasks I have completed: Task 1: When the motor is running, use P-NUCLEO-IHM002 to measure the three-resistance current sampling waveform, and output this waveform through DA, and take a screenshot Use Motor Workbench to set the current Ia to output from DAC1, and then use an oscilloscope to measure the DAC output. Task 2: Get the key variables during FOC control: Ia, Ib, Ic, Ialpha, Ibeta, Id, Iq, Vd, Vq, and take screenshotsTask 3: Monitor any data variables and take screenshots These two tasks feel that Task 2 can represent Task 3 (the special case must meet the requirements of the general situation). Of course, Task 3 can also monitor other data, and the means are the same. The key variables for FOC control, Ia, Ib, Ic, Ialpha, Ibeta, Id, Iq, Vd, Vq, are located in the project file mc_tasks.c automatically generated by MotorControl Workbench. The relevant code is as follows:
  1. inline uint16_t FOC_CurrController(uint8_t bMotor) { Curr_Components Iab, Ialphabeta, Iqd; Volt_Components Valphabeta, Vqd; int16_t hElAngledpp; uint16_t hCodeError; hElAngledpp = SPD_GetElAngle(STC_GetSpeedSensor(pSTC[bMotor])); PWMC_GetPhaseCurrents(pwmcHandle[bMotor], &Iab); Ialphabeta = MCM_Clarke(Iab); Iqd = MCM_Park(Ialphabeta, hElAngledpp); Vqd.qV_Component1 = PI_Controller(pPIDIq[bMotor], (int32_t)(FOCVars[bMotor].Iqdref.qI_Component1) - Iqd.qI_Component1); Vqd.qV_Component2 = PI_Controller(pPIDId[bMotor], (int32_t)(FOCVars[bMotor].Iqdref.qI_Component2) - Iqd.qI_Component2); FOCVars[bMotor].Vqd = Vqd; Vqd = Circle_Limitation(pCLM[bMotor], Vqd); Valphabeta = MCM_Rev_Park(Vqd, hElAngledpp); hCodeError = PWMC_SetPhaseVoltage(pwmcHandle[bMotor], Valphabeta); FOCVars[bMotor].Iab = Iab; FOCVars[bMotor].Ialphabeta = Ialphabeta; FOCVars[bMotor].Iqd = Iqd; FOCVars[bMotor].Valphabeta = Valphabeta; FOCVars[bMotor].hElAngle = hElAngledpp; return(hCodeError); }
复制代码
We know that the sum of the three-phase current is 0: Ia+Ib+Ic = 0, so Ic can be calculated by sampling only Ia and Ib. Then through continuous coordinate transformation, Ia, Ib, Ic ----> Ialpha, Ibeta -----> Id, Iq Then PI adjustment is performed on Id and Iq to obtain Vd and Vq, and finally an inverse park transformation is performed to convert the two-phase voltage into a three-phase voltage. Therefore, the most convenient way is to import the variables into STM-STUDIO and use the functions of STM-STUDIO to view the relevant variables. It can also be expressed in the form of a table: Another way is what I said in my previous post 2.4, Software Analysis--Code Compilation and Debugging, which introduced the Motor Workbench function. In the motor debugging function interface, many data and key variables can be monitored and even changed. (Dashboard form, register table form, space form). But it is a bit strange that the values of Ia, Ib, Ic, Ialpha, Ibeta, Id, Iq, Vd, and Vq can be seen in the register tab, but there is no output. I have studied it for a long time and still have no clue. I will study it later when I have time. But many other variables can be monitored and changed (some can be changed, some cannot be changed). This can be regarded as completing Task 3. Self-designed evaluation task: Test the low-speed performance and stall protection of the 5.0 library Use the motor debugging function of Motor Workbench to complete it. Use this function to adjust the motor speed. In the current test, the motor protects when it detects that the speed is lower than 200. This is probably not a problem with the algorithm, but a problem with the relevant parameter settings. If there is enough time to debug the parameters, the effect will be better. This content is originally created by EEWORLD forum user yang_alex. If you need to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source














This post is from stm32/stm8

Latest reply

Yes  Details Published on 2018-7-4 13:48
 

47

Posts

0

Resources
2
 
Damn
This post is from stm32/stm8
 
Personal signatureCCC、CQC、质检报告、EMC等检测认证  联系人:龙凤祥17796079776
 

1903

Posts

0

Resources
3
 
Good stuff
This post is from stm32/stm8

Comments

It's a good thing! ST still has a lot of fun and useful things.  Details Published on 2018-7-4 12:29
 
 

1305

Posts

0

Resources
4
 
It's a good stuff! ST still has a lot of fun and useful things.
This post is from stm32/stm8
 
 
 

1903

Posts

0

Resources
5
 
Yes
This post is from stm32/stm8
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list