focstm32f pmsm singledual foc sdk v4 2使用手册_W_第1页
focstm32f pmsm singledual foc sdk v4 2使用手册_W_第2页
focstm32f pmsm singledual foc sdk v4 2使用手册_W_第3页
focstm32f pmsm singledual foc sdk v4 2使用手册_W_第4页
focstm32f pmsm singledual foc sdk v4 2使用手册_W_第5页
已阅读5页,还剩171页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、UM1052User manualSTM32F PMSM single/dual FOC SDK v4.2IntroductionThis manual describes the Motor Control Software Development Kit (STSW-STM32100) designed for and to be used with STM32F MCUs microcontrollers. The software library implements the Field Oriented Control (FOC) drive of 3-phase Permanent

2、 Magnet Synchronous Motors (PMSM), both Surface Mounted (SM-PMSM) and Internal (I-PMSM). The library exploit a new sensorless technique that, in conjunction with an I-PMSM motor, is able to extend the range of allowed speed to zero. This newest sensorless algorithm take benefit of the motor structur

3、e in order to detect the rotor angular position even when the motor is at low speed or still. In this user manual we will refer to this technique as High Frequency Injection also called HFI. This new algorithm take benefit of the floating point unit of STM32F30x and STM32F4 series.The STM32F family

4、of 32-bit Flash microcontrollers is based on the breakthrough ARM Cortex-M cores: the Cortex-M0 for STM32F0, the Cortex-M3 for STM32F1 and STM32F2, and the Cortex-M4 for STM32F3 and STM32F4, specifically developed for embedded applications. These microcontrollers combine high performance with first-

5、class peripherals that make them suitable for performing three-phase motors FOC.The PMSM FOC library can be used to quickly evaluate ST microcontrollers and complete ST application platforms, and to save time when developing Motor Control algorithms to be run on ST microcontrollers. It is written in

6、 C language, and implements the core Motor Control algorithms as well as sensor reading/decoding algorithms and a sensorless algorithm for rotor position reconstruction. The library can be easily configured to make use of STM32F30xs embedded advanced analog peripheral set (fast comparators and Progr

7、ammable Gain Amplifiers, PGA) for current sensing and protection, thus simplifying application board.When deployed with STM32F103 (Flash memory from 256KBytes to 1MByte), STM32F2, STM32F303 or STM32F4 devices, the library allows simultaneous dual FOC of two different motors. The library can be custo

8、mized to suit user application parameters (motor, sensors, power stage, control stage, pin-out assignment) and provides a ready-to-use Application Programming Interface (API). A user project has been implemented to demonstrate how to interact with the Motor Control API.This project provides LCD and

9、UART User Interface, thus representing a convenient real- time fine-tuning and remote control tool. A PC Graphical User Interface (GUI), the ST MC Workbench, allows a complete and easy customization of the PMSM FOC library. In a very short time the user can run a PMSM motor. A set of ready-to-use ex

10、amples are provided to explain the usage of the motor control API and its most common features.Supported microcontrollers are listed in release note RN0085.September 2015DocID18458 Rev 81/176ContentsUM1052Contents1Motor control library features102MC software development kit architecture133

11、Documentation architecture163.13.2Where to find the information you need16Related documents174Overview of the FOC and other implemented algorithms184.1Motor profiler and One Touch Tuning184.1.1Restrictions4.5On-the-fly Sensorless startup . . . . . . . . . . . . . . . . . . . . . . . . . .

12、 . . . . . . . .Introduction to the PMSM FOC drive . . . . . . . . . . . . . . . . . . . . . . . . . . . .PM motor structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .PMSM fundamental equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2

13、22426274.5.1SM-PMSM field-oriented control (FOC)24.9PMSM maximum torque per ampere (MTPA) control . . . . . . . . . . . . . . .Feed-forward current regulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Flux-weakening control . . . . . . . . . . . . . . . . . . . . . . .

14、 . . . . . . . . . . . . . . .PID regulator theoretical background . . . . . . . . . . . . . . . . . . . . . . . . . . . .293132334.9.1Regulator sampling time setting32A priori determination of flux and torque current PI gains . . . . . . . . . . . .Space vector PWM implementation . . .

15、. . . . . . . . . . . . . . . . . . . . . . . . . .Detailed explanation about reference frame transformations . . . . . . . . . .3537394.12.1Circle limitation405Current sampling425.1Current sampling in three-shunt topology425.1.1Tuning delay parameters and sampling stator currents in shunt resistor

16、4Current sampling in three-shunt topology using one A/D converter . . . . .Current sampling in three-shunt topology using one A/D converter . . . . .Current sampling in single-shunt topology . . . . . . . . . . . . . . . . . . . . . . . .4850565.4.1Definition of the noise parameter and bou

17、ndary zone602/176DocID18458 Rev 8UM1052Contents5.5Current sampling in isolated current sensor topology636Current sensing and protection on embedded PGA66.4Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Current sensing . . . . . . .

18、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Overcurrent protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Resources allocation - single drive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66666970.2Single shunt

19、topology70Three shunts topology716.5Resources allocation - dual drive7..4Single shunt topology72Three shunts topology mixed with Single shunt topology72Dual Three shunts topology, not shared resources73Dual Three shunts topology, shared resources737Overvoltage protection with embed

20、ded analog (STM32F3x only) . . . 748Rotor position/speed feedback768.1Sensorless algorithm (BEMF reconstruction)768.1.1A priori determination of state observer gains778.28.3Sensorless algorithm: High frequency injection(HFI)79Hall sensor feedback processing8.28.3.3Speed measurement implemen

21、tation83Electrical angle extrapolation implementation85Setting up the system when using Hall-effect sensors868.4Encoder sensor feedback processing888.4.1Setting up the system when using an encoder899Working environment9Motor control workspace . . . . . . . . . . . . . . . . . . .

22、. . . . . . . . . . . . . . . . . .MC SDK customization process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Motor control library project (confidential distribution) . . . . . . . . . . . . . . .User project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

23、 . . . . . . . . .Full LCD UI project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Light LCD UI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .939697100102106DocID18458 Rev 83/176ContentsUM105210MC application programmin

24、g interface (API)10710.1MCInterfaceClass107.2User commands108Buffered commands10910.210.310.4MCTuningClass110How to create a user project that interacts with the MC API111Measurement units117.210.4.310.4.4Rotor angle117Rotor speed117Current measurement118Voltage measurement11811F

25、ull LCD user interface11911.1Running the motor control firmware using the fullLCD interface119LCD User interface structure120.311.2.411.2.511.2.611.2.711.2.8Motor control application layer configuration (speed sensor)121Welcome message122Configuration and debug page122Dual contro

26、l panel page127Speed controller page129Current controller page131Sensorless tuning STO & PLL page134Sensorless tuning STO & CORDIC page13612Light LCD user interface13912.412.512.612.712.8Torque control mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Sp

27、eed control mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Currents and speed regulator tuning . . . . . . . . . . . . . . . . . . . . . . . . . . .Flux-weakening PI controller tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . .Observer and PLL gain tu

28、ning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .DAC functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Power stage feedbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Fault messages . . . . . . . . . . .

29、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13914014114314314414514513User Interface class overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1464/176DocID18458 Rev 8UM1052Contents13.413.513.613.713.813.9User interface class (CUI) . . . . . . . . .

30、. . . . . . . . . . . . . . . . . . . . . . . . . .User interface configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .LCD manager class (CLCD_UI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using the LCD manager . . . . . . . . . . . . . . . . . . . . .

31、. . . . . . . . . . . . . . . .Motor control protocol class (CMCP_UI) . . . . . . . . . . . . . . . . . . . . . . . .Using the motor control protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .DAC manager class (CDACx_UI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using

32、 the DAC manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .How to configure the user defined DAC variables . . . . . . . . . . . . . . . . .14715015115215215415415715714Serial communication class overview . . . . . . . . . . . . . . . . . . . . . . . . .15916116416516616

33、716816914.414.514.614.7Set register frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Get register frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Execute command frame . . . . . . . . . . . . . . . . . . . . .

34、 . . . . . . . . . . . . . . .Execute ramp frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Get revup data frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Set revup data frame . . . . . . . . . . . . . . . . . . . . . . . . . . .

35、 . . . . . . . . . . . .Set current references frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15Fast serial communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17116Document conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

36、 . . . . . .172Appendix AAdditional information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .173173A.1References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Revision history174DocID18458 Rev 85/176List of tablesUM1052List of tab

37、lesTable 1.Table 2.Table 3.Table 4.Table 5.References26Sector identification38Three-shunt current reading, used resources (single drive, F103 LD/MD)43Three-shunt current reading, used resources (Dual drive,F103 HD, F2x, F4x)44Three-shunt current reading, used resources, single drive, STM32F302x6,STM

38、32F302x850Current through the shunt resistor56Single-shunt current reading, used resources (single drive, F103/F100 LD/MD, F0x)58single-shunt current reading, used resources (single or dual drive, F103HD)58Single-shunt current reading, used resources, single or dual drive, STM32F2xxx/F4xx59ICS curre

39、nt reading, used resources (single drive, F103 LD/MD)64ICS current reading, used resources (single or dual drive, F103 HD, F2xx, F4xx)64File structure91Project configurations101Integrating the MC Interface in a user project112MC application preemption priorities115Priority configuration, overall (no

40、n FreeRTOS)115Priority configuration, overall (FreeRTOS)116Joystick actions and conventions119List of controls used in the LCD demonstration program121Definitions123List of DAC variables124DAC variables related to each state observer sensor125Fault conditions list127Control groups129Speed controller

41、 page controls130Control groups131Current controller page controls132Control groups134Sensorless tuning STO & PLL page controls135Control groups137Sensorless tuning STO & PLL page controls138User interface configuration - Sensor codes150User interface configuration - CFG bit descriptions150Descripti

42、on of relevant DAC variables155Generic starting frame160FRAME_START byte160FRAME_START motor bits161Starting frame codes161List of error codes162List of relevant motor control registers162List of commands166List of abbreviations172Document revision history174Table 6.Table 7.Table 8.Table 9.Table 10.

43、Table 11.Table 12.Table 13.Table 14.Table 15.Table 16.Table 17.Table 18.Table 19.Table 20.Table 21.Table 22.Table 23.Table 24.Table 25.Table 26.Table 27.Table 28.Table 29.Table 30.Table 31.Table 32.Table 33.Table 34.Table 35.Table 36.Table 37.Table 38.Table 39.Table 40.Table 41.Table 42.Table 43.6/1

44、76DocID18458 Rev 8UM1052List of figuresList of figuresFigure 1.Figure 2.Figure 3.Figure 4.Figure 5.Figure 6.Figure 7.Figure 8.Figure 9.Figure 10.Figure 11.Figure 12.Figure 13.Figure 14.Figure 15.Figure 16.Figure 17.Figure 18.Figure 19.Figure 20.Figure 21.Figure 22.Figure 23.Figure 24.Figure 25.Figur

45、e 26.Figure 27.Figure 28.Figure 29.Figure 30.Figure 31.Figure 32.Figure 33.Figure 34.Figure 35.Figure 36.Figure 37.Figure 38.Figure 39.Figure 40.Figure 41.Figure 42.Figure 43.Figure 44.Figure 45.Figure 46.Figure 47.Figure 48.MC software library architecture13Motor control library14Example scenario15

46、Motor profiler18How to enable Motor Profiler19Send a “Motor profiler” command20Dialog showing the measure parameters21Enabling On-the-fly start-up with Basic profile22Enabling On-the-fly start-up with Advanced profile23Basic FOC algorithm structure, torque control25Speed control loop25Different PM m

47、otor constructions26Assumed PMSM reference frame convention27MTPA trajectory30MTPA control30Feed-forward current regulation32Flux-weakening operation scheme33PID general equation34Time domain to discrete PID equations34Block diagram of PI controller35Closed loop block diagram36Pole-zero cancellation

48、36Block diagram of closed loop system after pole-zero cancellation36Va and Vb stator voltage components37SVPWM phase voltage waveforms38Transformation from an abc stationary frame to a rotating frame (q, d)40Circle limitation working principle41Three-shunt topology hardware architecture42PWM and ADC

49、 synchronization43Inverter leg and shunt resistor position44Low-side switch gate signals (low modulation indexes)45Low side Phase A duty cycle DT+TN46(DT+TN+TS)/2 DutyA DT+TN and DutyAB DT+TR+TS46DutyA DT+TR+TS47DutyA(DT+TN+TS)/2 and DutyA-B DT + max(TN,TR)52Low side Phase A duty cycle DT+ max(TN,TR

50、)53Two current samplings performed into 2DDutyA time53Two current samplings performed into DDutyAB time54Two current samplings cannot performed55Single-shunt hardware architecture56Single-shunt current reading57Boundary between two space-vector sectors60Low modulation index60DocID18458 Rev 87/176Lis

51、t of figuresUM1052Figure 49.Figure 50.Figure 51.Figure 52.Figure 53.Figure 54.Figure 55.Figure 56.Figure 57.Figure 58.Figure 59.Figure 60.Figure 61.Figure 62.Figure 63.Figure 64.Figure 65.Figure 66.Figure 67.Figure 68.Figure 69.Figure 70.Figure 71.Figure 72.Figure 73.Figure 74.Figure 75.Figure 76.Fi

52、gure 77.Figure 78.Figure 79.Figure 80.Figure 81.Figure 82.Figure 83.Figure 84.Figure 85.Figure 86.Figure 87.Figure 88.Figure 89.Figure 90.Figure 91.Figure 92.Figure 93.Figure 94.Figure 95.Figure 96.Figure 97.Figure 98.Figure 99.Figure 100.Definition of noise parameters61Regular region61Boundary 162B

53、oundary 262Boundary 363ICS hardware architecture63Stator currents sampling in ICS configuration65Current sensing network and over-current protection with STM32F302/30366Current sensing network using external gains67Current sensing network using internal gains plus filtering capacitor68STMCWB window

54、related to PGA/COMP settings for motor currents69Overvoltage protection network74STMCWB windows related to ADC/COMP settings for DC bus Voltage75STMCWB windows related to ADC/COMP settings for DC bus Voltage75General sensorless algorithm block diagram77PMSM back-emfs detected by the sensorless state observer algorithm78IPMSM anisotropy fitting HFI algorithm82Incremental system building oscillosco

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论