background image

 

 

 

 

U S E R   M A N U A L  

 

10 

 

Jan 26, 2015, AN709-00011-1v0-E   

 
 
 
 
 
 

The relationship between each layer is shown as the diagram in Figure 4-3. 

 

Figure 4-3: Servo motor FW Architecture 

 

 

 

 

 

4.3 

Files Description 

The detailed descriptions for each file are shown as Table 4-3. 

Table 4-3: File Description of Project 

Folder 

File 

Description 

s01_global 

N/A 

No files temporarily. 

S02_driver 

N/A 

No files temporarily. 

s03_module 

coordinate_transfrom.c 

FOC axis convert 

filter.c 

One order low pass filter 

math.c 

The  math  module  including  the  function  such  as 

SQRT,COS,SIN 

User Layer 

App Layer 

Module Layer 

Drive Layer   

Global Layer   

Coordinate transformation 

SVPWM 

PID Regulator 

Math 

Filter 

Motor Start-up 

Brake 

Motor Speed Set 

Speed Calculation 

Voltage Protect 

A/D Offset Protect 

Over Current Protect 

Lock Rotor Protect 

Voltage and Current Limit   

User interface 

Main program entrance 

Interrupt vectors 

Initialization 

Int. event 

Current sample 

Field-weaken 

Encoder zero check 

Dead-time compensation 

Содержание SPANSION FM4 MB9BF568 Series

Страница 1: ...es and Design Support We look forward to partnering with you to provide solutions that will help make your systems successful Cypress maintains a worldwide network of offices solution centers manufact...

Страница 2: ...PMSM Servo Motor Speed Control User Manual 32 bit ARM Cortex M4F based Microcontroller MB9BF568x Series and S6E2HG Series User Manual Jan 26 2015 AN709 00011 1v0 E 1...

Страница 3: ...Run Motor 22 6 2 4 Speed Acceleration and Deceleration 24 6 3 Troubleshooting 24 6 3 1 Protection 24 7 Additional Information 25 8 Reference Documents 26 Figures Figure 4 1 Structure of FW 8 Figure 4...

Страница 4: ...ble 5 1 System Used Interrupt Function 12 Table 6 1 Encoder Connection 16 Table 6 2 Sample Resistor Amplification Carrier Frequency and Dead Time 19 Table 6 3 Current PID and Speed PID 19 Table 6 4 Mo...

Страница 5: ...FOC drive modules When you have understood the provided information you can get an overview of a whole servo motor project And you can run a motor following the demo project step 1 2 Definitions Acro...

Страница 6: ...Environment The below shows the brief information of MCU used in servo motor inverter board CPU chip Spansion MB9BF568R CPU Frequency 160MHz MCU pin number 120pin RAM Space 128Kbytes Code Space 1024K...

Страница 7: ...ment Name Description Part Number Manufacturer Remark IAR bedded Workbench 7 3 FW code edit compile and debug N A N A N A J Link Debug and Load FW by JTAG N A N A N A SPANSION FLASH LOADER Flash downl...

Страница 8: ...pid speed acceleration Motor can be accelerated from 0rpm to 5000rpm within 200ms 5 Rapid speed deceleration Motor can be decelerated from 5000rpm to 0rpm within 200ms 6 FOC Control Using FOC control...

Страница 9: ...ic motor control such as FOC frame transform SVPWM math PID filter app h04_app s04_app Application folder for the files of application functions such as speed and position generator by hall sensor pro...

Страница 10: ...U S E R M A N U A L Jan 26 2015 AN709 00011 1v0 E 9 Figure 4 2 Sub files in Each Layer...

Страница 11: ...rily s03_module coordinate_transfrom c FOC axis convert filter c One order low pass filter math c The math module including the function such as SQRT COS SIN User Layer App Layer Module Layer Drive La...

Страница 12: ...The Speed Calculate module qprc_zero_seach Search encoder zero signal module s05_user customer_interface c The motor parameter setting main c Main function isr c MCU interrupt vector list init_mcu c I...

Страница 13: ...R for the motor control s05_user isr c __root void Mft0_Wfg_IsrHandler void The HW over current ISR s05_user isr c __root void Adc_0_IsrHandler void The ADC unit0 ISR trigger at the zero point for the...

Страница 14: ...re 5 2 Free Run Timer Interrupt 5 3 2 Encoder Capture The PWC timer is used to capture the encoder A B signal and calculate pulse width of the edge of A B Figure 5 3 Encoder Capture with Base Timer H...

Страница 15: ...otection 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 Figu...

Страница 16: ...imary steps are shown as following Hardware Connection FW Interface Configuration Encoder Check Run Motor Speed Acceleration and Deceleration 6 1 Demo System Introduction The servo motor solution can...

Страница 17: ...rt Encoder A AIN Encoder B BIN Encoder Z ZIN 5V Vcc GND GND Note Connection order between A and B is mixable VCC and GND must be connected rightly otherwise the encoder won t work right and the motor...

Страница 18: ...laptop computer 4 Connect AC power to inverter board shown as below Figure 6 5 AC Plug 6 2 Motor Debug After the hardware connection with the motor is completed you can debug the new motor as describe...

Страница 19: ...f the variables reserved for the user interfaces are located in the file s05_user customer_interface c and the macro definitions are located in the file h05_user customer_interface h Figure 6 7 Interf...

Страница 20: ...icroSec Dead time 2 5us Motor_u16CarrierFreq Carrier frequency for PWM 15000Hz Sample resistor and amplification is related to hardware board they must be written correctly Dead time is depended on IP...

Страница 21: ...Motor_u16OpenLoopLoopIqRef Set current in open loop stage Q8 2 0 2A Current setting in orientation and open loop stage is related to motor electrical parameter Ensure that not exceeding motor rated c...

Страница 22: ...en target speed is set to 0 to stop motor running 1 enable fast braking when target speed is set to 0 to stop motor running 6 2 2 Encoder Check When the basic setting has been finished the encoder inf...

Страница 23: ...onfig h Set it the same value as Qprc_RunPars i32Q22_AngleToZeroInx Redefine ZEROMATHCEN to 1 Encoder check is complete 6 2 3 Run Motor When the encoder angle has been checked the motor can be started...

Страница 24: ...U S E R M A N U A L Jan 26 2015 AN709 00011 1v0 E 23 Figure 6 9 Download and debug by J link Figure 6 10 Motor Run by J link Figure 6 11 Motor in Running Status A B D C...

Страница 25: ...tion are shown as below You can match the value with these fault codes to find what protection is performed define NORMAL_RUNNING 0x00 no error define OVER_VOLTAGE 0x01 DC bus over voltage define UNDE...

Страница 26: ...p www spansion com Products microcontrollers Chinese version address http www spansion com CN Products microcontrollers Please contact your local support team for any technical question America Spansi...

Страница 27: ...U S E R M A N U A L 26 Jan 26 2015 AN709 00011 1v0 E 8 Reference Documents...

Страница 28: ...L Jan 26 2015 AN709 00011 1v0 E 27 AN709 00011 1v0 E Spansion Application Note FM4 Family 32 BIT MICROCONTROLLER PMSM Servo Motor Speed Control User Manual Jan 2015 Rev 1 0 Published Spansion Inc Edit...

Страница 29: ...tection and prevention of over current levels and other abnormal operating conditions If any products described in this document represent goods or technologies subject to certain restrictions on expo...

Отзывы: