Page 1
THIS SPEC IS OBSOLETE Spec No: 002-04466 Spec Title: MB9BF568R SERIES FM4 PMSM SERVO MOTOR SPEED CONTROL USER MANUAL Replaced by: NONE...
Page 2
MB9BF568R Series FM4 PMSM Servo Motor Speed Control User Manual Doc. No. 002-04466 Rev. *B 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 3
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.
1. Introduction Purpose This user manual describes the speed-control solution of the Cypress servo motor and how to use the inverter servo motor FW library. This document will help you quickly learn how to build a servo motor project and how to debug the motor with Cypress inverter servo motor FW library.
2. System Hardware Environment The below provides the brief information of MCU used in servo motor inverter board. CPU chip: Cypress MB9BF568R. CPU Frequency: 160 MHz. MCU pin number: 120 pin. RAM Space: 128KB. Code Space: 1024KB. Demo HW version: FSDC-FM3-314-1-0015-01 + FSDC-FM4-560-2-071200050...
4. System Firmware Design This chapter introduces the FW structure of the inverter servo motor project. FW Feature The features of the servo motor speed control solution are shown in Table Table 2. Feature List of Servo Motor Speed Control Feature Description Remark...
System Firmware Design FW Structure There are 5 layers in the FW structure of IAR, which are shown in Figure Figure 1. Structure of FW The C source and Header files which are included in each layer are shown in Table Table 3.
Page 10
System Firmware Design The sub-files in each folder are shown in Figure 2, and the structure of header files is the same with C files. Figure 2. Sub-files in Each Layer FM4 PMSM Servo Motor Speed Control User Manual, Doc. No. 002-04466 Rev. *B...
Page 11
System Firmware Design The relationship between each layer is shown as the diagram in Figure User Layer User interface Main program entrance Interrupt vectors Initialization Int. event App Layer Motor Start-up Motor Speed Set Brake Speed Calculation Current sample Voltage and Current Limit A/D Offset Protect Over Current Protect Field-weaken...
System Firmware Design Files Description The detailed descriptions for each file are shown as Table Table 4. File Description of Project Folder File Description s01_global No files temporarily. S02_driver No files temporarily. coordinate_transfrom.c FOC axis convert filter.c One order low pass filter math.c The math module including the function such as s03_module...
System Firmware Design FW Control Flow The control flow for the motor is shown as Figure 4. There are 4 interrupts that are red highlighted for the motor FOC control, hall capture, AD converter. The timer events are executed in the end-less loop and the timers are generated in the zero detection interrupt ‘ISR_MFT_FRT’...
5. Interrupt Function Function List Table 5. System Used Interrupt Function Prototype Description Remark __root void HWD_Handler(void) The HW watch dog ISR s05_user/isr.c __root void Swd_IsrHandler (void) The software watch dog ISR s05_user/isr.c __root void Mft0_Frt0_ZeroIsrHandler The MFT zero detect ISR for the motor control s05_user/isr.c (void) __root void Mft0_Wfg_IsrHandler (void)
Interrupt Function Interrupt Generation The diagram of the interrupt used for the motor control is briefly introduced in this section. 5.3.1 The multifunction timer is used to generate the interrupt for the motor control algorithm execution, and trigger the AD sample at the zero point. Figure 6.
Page 16
Interrupt Function 5.3.3 DTTI The DTTI0 is used to trigger the HW fault protection from the IPM. When the phase current is large enough to trigger the HW over-current fault, the interrupt is got and all of the drive signals for the motor control will shut off immediately.
6. Demo System This chapter introduces one example of inverter servo motor project and help you run a motor quickly. The primary steps are shown as following: Hardware Connection FW Interface Configuration Encoder Check Encoder CheckRun Motor ...
Page 18
Demo System 6.1.1 Hardware Connection It is necessary to connect below 4 lines: Connect motor’s encoder signal to inverter board, shown as below. Figure 10. Encoder Signal Line Connection Encoder port The connection of the encoder signal line follows the definition in the below table. Table 6.
Page 19
Demo System Motor’s U, V, W line can be optionally connected to Inverter’s output U, V, W. It has no constant define. Just connect it. And it is also recommended to connect according to the UVW definition of the motor. Connect JTAG to Inverter, shown as below.
Demo System Motor Debug After the hardware connection with the motor is completed, you can debug the new motor, as described in this section. Click the IAR program to open the IAR, and open the ‘EWW’ file of the inverter servo motor workspace at the location you’ve stored on your computer as shown in Figure Figure 14.
Page 21
Demo System 6.2.1.1 UI_01 Motor Parameters Set motor pole pairs. Set it to 3 if motor with 3 pole pairs is being used. 6.2.1.2 UI_02 Encoder Information QPRC_LineNumber: indicating pulses per cycle for encoder signal A or B. QPRC_times: indicating QPRC unit working mode for detecting encoder signal. This is set to 4 by default. For more information about it, you can refer to MCU peripheral manual reading chapter QPRC for PC_Mode2 setting.
Page 22
Demo System 6.2.1.4 UI_04 Current PID and Speed Loop PID Table 8. Current PID and Speed PID Name Explanation Motor_f32LowSpdKi Speed loop integration parameters when speed lower than These parameters are not Motor_u16ChgPiSpdHz fixed. Instead, they depend on motors and systems. Motor_f32LowSpdKP Speed loop proportion parameters when speed lower than Tune these parameters...
Page 23
Demo System 6.2.1.6 UI_06 Motor Close-Loop Parameters Table 10. Motor Close-Loop Parameters Name Explanation Value Motor_u16CloseLoopTargetSpdHz Initial target speed when getting in close loop 0 Hz (0 rpm) RotationFlg Initial rotation direction CW or CCW Motor_i16Q8_CloseLoopIsMax Maximum peak value for phase current Q8 (2.5): 2.5 A Motor_i16Q8_CloseLoopIqRefMax Maximum value for q-axis...
Page 24
Demo System 6.2.1.8 UI_08 Brake Enable Table 12. Brake Enable or Disable Flag Name Explanation Value 0:disable fast braking when target-speed is set to 0 to stop Motor_BrakeCtrlEn Switch on or off controlling for fast braking function motor running 1:enable fast braking when target-speed is set to 0 to stop motor running 6.2.2...
Page 25
Demo System 6.2.2.2 Encoder Check Run to connect the J-link, and pass the global structure ‘Qprc_RunPars’ Click the debugger button into the Live Watch in the IAR debug online. Connect PC and hardware with J-LINK, and give motor any target speed more than 0 to run motor. Wait until motor stops running, find structure “Qprc_RunPars”...
Page 26
Demo System Figure 17. Download and Debug by J-link Figure 18. Motor Run by J-link FM4 PMSM Servo Motor Speed Control User Manual, Doc. No. 002-04466 Rev. *B...
Page 27
Demo System Figure 19. Motor in Running Status Table 14. Running Status by the Command Speed MotorCtrl_stcRunPar.i16TargetSpeedRpm Running Status >0 <0 Stop Note: Watch the important variable “MotorCtrl.i32Q8_EstimWmHzf” to check whether motor is achieved the command speed and running speed is stable. 6.2.4 Speed Acceleration and Deceleration After run motor normally, you can run motor in any speed (-5000 rpm ~ 5000 rpm).
Demo System Troubleshooting 6.3.1 Protection When the motor is stopped without the normal stop command, the protection fault may appear, you can see the value of the variable ‘MotorCtrl_stcRunPar.u16FaultCode’ in the watch window and the code is assigned by the bit OR operation.
7. Additional Information For more information on Cypress semiconductor products, please visit our website: http://www.cypress.com/cypress-microcontrollers For more information on PMSM Servo Motor Speed Control, please visit our website: http://www.cypress.com/applications/home-appliances/servo-motor-speed-control Please contact your local support team for any technical question http://www.cypress.com/cypress-solutionsnetwork...
Revision History Document Revision History Document Title: MB9BF568R Series FM4 PMSM Servo Motor Speed Control User Manual Document Number: 002-04466 Revision Issue Date Origin of Description of Change Change 01/26/2014 WJLV Initial release Migrated Spansion User Manual “AN709-00011-1v0-E” to Cypress format...
Need help?
Do you have a question about the MB9BF568R Series and is the answer not in the manual?
Questions and answers