Document Number: PMSMCRSPUG NXP Semiconductors User s Guide Rev. 4, 09/2016 PMSM Control Reference Solution Package By: Josef Tkadlec Contents 1. Introduction This users guide provides a step-by-step guide on how 1. Introduction ........................................................................ 1 2. Supported Development Boards ......................................... 2 to open, compile, and run Permanent Magnet 3. Motor Control versus SDK Peripheral Drivers ................... 2 Synchronous Motor (PMSM) projects. It describes the 4. Hardware Setup .................................................................. 2 basic compiling steps for IAR Embedded 4.1. Linix 45ZWN24-40 motor....................................... 3 4.2. MIGE 60CST-MO1330 motor ................................ 3 Workbench , Kinetis Design Studio (KDS), and 4.3. Running PMSM application on Tower System ....... 4 Vision Keil IDEs for a wide range of supported 4.4. NXP Freedom development platform .................... 12 development platforms, mentioned in Section 2, 4.5. High-Voltage Platform .......................................... 17 5. Project File Structure ........................................................ 21 Supported Development Boards. It also describes the 5.1. PMSM package structure....................................... 22 initialization of the FreeMASTER GUI tool for 5.2. IDE workspaces structure ...................................... 25 controlling motor-control applications. 5.3. Application types ................................................... 25 6. Tools ................................................................................. 25 7. Building and Debugging Applications.............................. 25 7.1. IAR Embedded Workbench IDE ........................... 25 7.2. Kinetis Design Studio (KDS) IDE ......................... 28 7.3. ARM-MDK Keil uVision IDE .............................. 32 7.4. OpenSDA debugger............................................... 34 7.5. Compiler warnings ................................................ 35 8. User Interface ................................................................... 35 8.1. Button control ........................................................ 36 8.2. Remote control using FreeMASTER ..................... 36 9. Performing Basic Tasks .................................................... 40 9.1. Running the motor ................................................. 40 9.2. Stopping the motor ................................................ 40 9.3. Clearing the fault ................................................... 40 9.4. Turning the demonstration mode on/off ................ 40 10. Acronyms and Abbreviations ........................................... 41 11. References ........................................................................ 41 12. Revision History ............................................................... 41 2016 NXP B.V. Hardware Setup 2. Supported Development Boards There are three supported development platforms with Kinetis V and E series MCUs for motor-control applications. The development boards and supported MCUs are shown in Table 1. The Tower System modular development platform and NXP Freedom development platform are targeted for low-voltage and low-power applications with PMSM control type. The High-Voltage Platform (HVP) is designed to drive high-voltage (115/220 V) applications with up to 1 kW of power. Table 1. Supported development platforms Platform Tower Freedom HVP Power stage TWR-MC-LV3PH FRDM-MC-LVPMSM HVP-MC3PH KV10Z TWR-KV10Z32 FRDM-KV10Z HVP-KV10Z32 KV31F TWR-KV31F120M FRDM-KV31F HVP-KV31F120M KV11Z TWR-KV11Z75M MCU KV46F TWR-KV46F256 HVP-KV46F120M KV58F TWR-KV58F220M HVP-KV58F KE15Z FRDM-KE15Z KE18F TWR-KE18F HVP-KE18F 3. Motor Control versus SDK Peripheral Drivers The motor-control examples use the SDK peripheral drivers to configure the general peripherals such as the clocks, SPI, SIM, and ports. However, the motor control requires critical application timing because most of the control algorithm runs in a 100- s loop. To optimize the CPU load, most of the peripheral hardware features are implemented for the PWM signal generation, analog signal sampling, and synchronization between the PWM and ADC units. The standard SDK peripheral drivers do not support the configuration and handling of all required features. The motor-control drivers are designed to configure the critical MC peripherals (eflexPWM, FTM, ADC, and PDB). It is highly recommended not to modify the default configuration of the allocated MC peripherals due to a possible application timing conflict. The particular mcdrv < board&MCU >.c source file contains the configuration functions of the allocated peripherals. 4. Hardware Setup The PMSM sensorless application runs on Tower and Freedom development platforms with 24 V Linix Motor and High-Voltage Platforms with 220 V PMSM motor in the default configuration. PMSM Control Reference Solution Package, Users Guide, Rev. 4, 09/2016 2 NXP Semiconductors