Page 1
FM3 Family 32-bit Microcontroller Math and Motor Control Library Quick Start Guide Doc. No. 002-04766 Rev. *A Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone (USA): 800.858.1810 Phone (Intnl): +1 408.943.2600 www.cypress.com...
Page 2
Cypress is not liable, in whole or in part, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from or related to all Unintended Uses of Cypress products.
Contents Demo System ................................. 4 Demo System Introduction ............................ 4 Hardware Connect ..............................4 Run the Motor ................................ 7 Additional Information ..............................9 Appendix ....................................10 Common Used Structure ............................. 10 Firmware Parameter Setting ..........................10 Motor Parameter ..............................16 Revision History ...................................
Math and Motor Control Library. The MMCL is based on the Cypress Cortex-M3 microcontrollers, all of the modules in the MMCL are used in the sample project that will be described in detail in this guide. You can use this sample project to control the low voltage PMSM or BLDC.
Page 5
Demo System Figure 1-2. Hall Signal Line Connection Hall port Note: If there are only 2 hall signals on the motor, the hall A and B line can be only connected to the inverter’s Hall A and Hall B port. Don’t connect on the Hall C port on the board. VCC and GND must be connected rightly, otherwise the hall won’t work right and the motor will also not run.
Page 6
Demo System Figure 1-4. JTAG Line Connection J-Link(SWD) Note: There is no isolator between the J-link and the HW, it is recommended to unplug the AC power and use the battery of your note book. Connect DC power 24V to Inverter board, shown as below. The DC voltage can be from 24~48V according to the rated voltage of the motor and the current of the board must be lower than 2A.
Demo System 1.3 Run the Motor This section introduces how to the make the motor running as the setting parameter. 1.3.1 Motor Start/Stop When the parameters for the firmware and hardware are correctly set, the motor can be started for the normal running. You can follow the steps to run to motor.
Page 8
Demo System 3). Watch the important variable in the live watch window of IAR as Figure 1-6 to check the motor running performance such as whether the real motor is achieved the command speed and running speed is stable. 1.3.2 Speed Acceleration and Deceleration After run motor normally, you can run motor in any speed, and the type speed of the drum for front loading washing machine can be taken for the reference at Table 1-2...
2. Additional Information For more information on MMCL, visit our website: http://www.cypress.com/applications/home-appliances/math-and-motor-control-library For more Information on Cypress semiconductor products, visit the following website: http://www.cypress.com/cypress-microcontrollers Please contact your local support team for any technical question FM3 Family Math and Motor Control Library Quick Start Guide, Doc. No. 002-04766 Rev. *A...
Appendix Common Used Structure The common used structures for the motor control are shown in the following table, you can use these structures to observe the running performance of the motor. Item Structure Description Motor Control Motor_stcRunPar The structure is used to control motor run or stop and the basic running information for the motor such as real running speed, DC bus voltage, Rotor position and Angle_stcGenerate...
Page 11
Appendix Figure A 1. Interface File Diagram Table A-1. File Description of Project Folder File Description Remark S01_global Ignored AMCLIB.c Advanced Motor Control Library BFLIB.asm Basic Function Library BMC.c C file for Basic Motor Control Library S03_module BMCLIB.asm Basic Motor Control Library UDFLIB.asm Universal Digital Filter Library UMFLIB.asm...
Page 12
Appendix Motor Parameter Configure The motor parameter such as motor resistance, inductance, and hall angle are set at this part. /** UI_0101 configure motor parameter */ 0== MOTOR_ID // FXD42BL-2460-002 int32_t Motor_PolePairs 2;// the pole pairs of rotor float32_t Motor_f32Ld 0.65;// the d axis reductance float32_t Motor_f32Lq...
Page 13
Appendix PID Parameter /** UI_0104 PID Parameter */ float32_t Motor_f32LowSpdKi = 0.0002f;//0.0003f; //speed PI regulator integral constant float32_t Motor_f32LowSpdKp = 0.043f;//0.15f; //speed PI regulator proportion constant float32_t Motor_f32Dki = 0.02; //d axis current PI regulator integral constant float32_t Motor_f32Dkp = 1; //d axis current PI regulator proportion constant float32_t Motor_f32Qki...
Page 14
Appendix Sensor-less Motor Start-up Parameter The parameters for sensor-less motor start-up are shown as below. When the sensor-less motor do not start well, the parameter can be modified to improve the start-up performance. /** UI_0107 running control of open loop*/ float32_t Motor_f32BemfLpfkMinSpd = 6;...
Page 15
Appendix /** UI_0201 ADC port and coefficient set */ #define CLK_XTAL_FREQ // MHz #define CLK_SYS_FREQ // System clock frequency = (CLK_XTAL_FREQ * (CLK_SYS_FREQ + 1)) #define APB0_CLK_DIV APBx_CLK_DIV0 #define APB1_CLK_DIV APBx_CLK_DIV0 #define APB2_CLK_DIV APBx_CLK_DIV0 #define ADC_VDC_FACTOR 21.4 #define ADC_VOLT_REF 5.0f // Reference voltage for ADC #define ADC_VALUE_MAX...
Appendix Motor Parameter The motor parameters used for the sample project are shown in the following table. Pole pairs D-axis Inductance 0.65mH Q-axis Inductance 0.85mH Resistance(line to line) 0.94 ohm Inductive voltage constant(line to line) 2.86 V/krpm Saturation current Speed range 360rpm~4000rpm Hall Number Hal line definition...
Document Number: 002-04766 Revisio ECN# Issue Date Origin of Description of Change Change − 09/19/2014 BOZH Initial release 5275832 08/29/2016 BOZH Migrated to Cypress format FM3 Family Math and Motor Control Library Quick Start Guide, Doc. No. 002-04766 Rev. *A...
Need help?
Do you have a question about the FM3 Series and is the answer not in the manual?
Questions and answers