background image

 

 

 

 

U S E R   M A N U A L  

 

24 

 

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

 
 
 
 
 
 

Table 6-9: Running Status by the Command Speed 

MotorCtrl_stcRunPar.i16TargetSpeedRpm

 

Running Status   

>0 

CW 

<0 

CCW 

=0 

Stop 

Note

:   

 

(4) 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 (-5000rpm ~ 5000rpm).   

The negative or positive indicates rotational direction. 

6.3 

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. The fault codes for each protection 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

 UNDER_VOLTAGE                    0x02   

//DC bus under-voltage

 

#define

 SW_OVER_CURRENT            0x04   

//over-current   

 

#define

 MOTOR_OVER_CURRENT    0x08   

//over-current of HW 

 

#define

 MOTOR_LOSE_PHASE          0x10   

//motor lose phase

 

#define

 NO_CONECT_COMPRESSOR 0x20   

//no motor connected

 

#define

 AD_MIDDLE_ERROR            0x40   

//current sample 2.5V offset error

 

#define

 SF_WTD_RESET                    0x80 

 

//FW watch dog reset

 

#define

 MOTOR_LOCK                        0x100   

//motor lock

 

#define

 UNDEFINED_INT                    0x200   

//undefined interrupt

 

#define

 HW_WTD_RESET                  0x400   

//HW watch dog reset

 

There may be different processing logic about the protection.   

The fault code may not be cleared except the DC bus voltage protection for the inverter DEMO. 

That  is  the  FW  may  not  run  again  when  the  protection  fault  happens.  You  can  access  the  variable                 
‘Motor_stcRunParam.u16FaultCode’ to make your own protection processing logic.   
 

 

 

 

 

 

 

 

 

 

 

 

Содержание 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...

Отзывы: