Home

Low voltage 3-Phase BLDC&PMSM Control

image

Contents

1. 15 6 REPEAT 16 6 1 gi 16 X Driver FUNCT OM suuin e e pe EXER 17 7 1 17 8 Interrupt FUNCION e 18 8 1 FUNCHON Listes D ele ee 18 8 2 Interrupt Priority 18 8 3 Interrupt Generation isse 19 8 3 1 ui Lube UE 19 8 3 2 Halll Capture EE 19 8 3 3 DTT Ls A 20 9 Demo System oe eee bd iR Pena EI 21 9 1 Demo System 21 9 1 1 Hardware 21 9 2 Motor Debug 9 2 1 FW Interface 23 9 2 2 CHECK iiiter 28 9 2 3 EE 30 9 2 4 Deb g Whi 31 9 3 TrOUDIGSMOOUING 31 9 3 1 Motor Start p UE 31 9 3 2 e e 32 9 3 3 Carrier Changeable 32 9 3 4 Hall Gheck ILU AERARII Nd RI 32 9 3 5 Power Consumer Higher 32 10 Additional Information iiic cient cerent ex uua passae a xu cun pae 34 Figures Figure 4 1 Structure of FW ooo 9 Figure 4 2 Sub files in Each
2. 10 Figure 4 3 Diagram of the Control Flow 11 Figure 5 1 Diagram of Live Waltch ett neret Ru 12 Apr 2 2015 S6E1A1_AN710 00002 SPANSION USER MANUAL ww Figure 8 1 Interrupt Priority 18 Figure 8 2 Free Run Timer 19 Figure 8 3 Base Timer 19 Figura 8 4 DTI Interrupts ttt re RE REGERE RICO ERE 20 Figure 9 1 System 21 Figure 9 2 Open the Workspace 22 Figure 9 3 Interface File 23 Figure 9 4 Motor Parameter 24 Figure 9 5 ADC Port 25 Figure 9 6 Parameter 25 Figure 9 7 ADC Coefficient 26 Figure 9 8 Variables Setting for Motor Start up 26 Figure 9 9 Variables Setting for 27 Figure 9 10 Protection Parameter 27 Figure 9 11 Function 8 27 Figure 9 12 Configuration of the Test Mode 4 neret 28 Figure 9 13 Hall Check 29 Figure 9 14 Configuration of the Tested Hall Phase Angle eeccesceeeeeeceneeeeeeeteeeee
3. Low Voltage 3 Phase BLDC PMSM Control 32 BIT MICROCONTROLLER FMO Family USER MANUAL lt SPANSION Publication Number 56 1 1 710 00002 Revision 1 0 Issue Date Apr 2 2015 SPANSION USER MANUAL a Target products This user manual describes the following products Series Product Number FMO Series S6E1A1 2 Apr 2 2015 S6E1A1_AN710 00002 a gt lt USER MANUAL SPANSION ww Table of Contents 5 1 1 Purpose 5 1 2 Definitions Acronyms and Abbreviations nenne 5 1 39 DOCUMENT OVerview 5 1 4 Reference 5 2 System Hardware 6 3 Development Environment 7 4 System Firmware Design 8 4 1 FW 8 42 5 8 43 Files Descriptions ie edd Ret eiiis 10 44 FW Control 11 5 System FUNG OM eM m 12 5 1 Global Structure Variable Definition 12 5 1 1 Variables for Motor Running emen 12 5 1 2 Variables for 13 5 1 3 Variables for PID Control 14 52 Function
4. the phase resistance unit ohm hall sensor otor need not define loat32 t Motor f32CurrentMax MOTOR IMAX motor s max run peak current loat32 t Motor f32Ke 3B motor s back EMF value v 1000rpm loat32 t Motor f32BackEmfMin 0 6 motor s back EMF value at min speed Motor f32Ke 1000 WorkMinSpd 32_ Motor 32Transkate 1 define whether need transmission ratio in the project system uintl6 t Motor ul6SpdMax 4000 motor run maximum speed rpm uintl6 t Motor ul6SpdMin 400 motor run minimum speed rpm char t Motor cHallControlMode FOC HALL FOC or VF control with hall sensor char t Motor cHallAngleCheck FALSE enable or disable hall angle check uint8 t Motor u8HallNumber 3 3or 2 hall number of the motor uint8 t Motor u8HallStatuList 7 0 2 6 4 5 1 3 hall status change sequence int32 t Motor i32HallAngleCCW 7 0 DEGREE 270 DEGREE 30 DEGREE 330 DEGREE 150 DEGREE 210 DEGREE 90 int32 t Motor i32HallAngleCW 7 0 DEGREE 153 DEGREE 33 93 DEGREE 273 DEGREE 213 DEGREE 333 Figure 9 4 Motor Parameter Configuration The firmware can work at different mode such as VF or FOC you can take the Table 9 3 for your detailed reference for the working mode setting Table 9 3 Motor Control Mode Motor u8SensorType Motor cHallControlMode Description SENSORLESS HALL FOC Sensor less with FOC control HALL HALL FOC Hall sensor with F
5. define VDC FACTOR 22 18 dc voltage sample factor please set as user manual define CH 2 dc voltage sample ad channel define MOTOR SHUNT NUM define the current sample resistor number 2 or 1 define ADC CH IU lu phase current sample channel define ADC CH IV v phase current sample channel define ADC CH IW not used in system Figure 9 5 ADC Port Setting The port assignation for the LVBP demo can be found in the hardware user manual in the Reference Documents 9 2 1 2 Advanced Variables Setting If the motor runs well in any working condition the settings in this section could not be changed The settings can be changed to improve the corresponding performance of the module Advanced Setting for FW These variables in this part can be modified if the performance of corresponding module is not so good or you want to change the setting for a different washing machine and you can find them in the file s05 user customer interface c PI Parameter Setting UT 02 PID parameter set float32 t Motor f32SpdKp float32 t Motor f32SpdKi float32 t Motor f32Dkp 0 PI regulator proportion constant et speed PI regulator integral constant 7 d axis current PI regulator integral constant float32 t Motor 320 Floats Rte Motongrs20ki float FieldWeaken Ki End 0 05 float PI FieldWeaken Kp End 0 1 q axis current regulator integral constant i 0 1 float
6. 0 00 Hall check stage n cError 0x00 Flag for Hall check error Em cNumberErrar 0x00 Flag for Hall number error m cStatusError 0 00 for Hall status error one cTimeOverError 0x00 Flag for Hall check time out error u8HallSensorNumber 0x00 The hall number of the motor E u8StatusTable NN The status list table 132022 array The CCW angle table 132022 array The CW angle table 28 Apr 2 2015 S6E1A1_AN710 00002 a gt lt SPANSION USER MANUAL u8StatusTable uiu 0 0x00 1 0x04 2 0x06 3 0x02 4 0503 5 B 0x05 7 0x00 132022 array 0 269 2 149 3 209 4 29 5 329 5 83 7 0 m 32022 AngleCwW array 0 0 1 149 2 23 3 89 4 270 b 5 209 jam 6 330 pm 7 0 Figure 9 13 Hall Check Result The data output by the hall check function in the Figure 9 13 must be filled into corresponding variables or array for the motor s normal running in the file 05 user customer_interface c as shown below define MOTOR ID 0 if 0 MOTOR ID configure motor parameter define which motor could be used in this project otor u8HallStatuList 7 0 4 6 2 3 1 5 hall status change Sequence EGRE GRE
7. The DTTIO 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 be shut off immediately Mft Wfg IsrHandler IPM fault signal low voltage H Trigger over Current Interrupt PWM closed Figure 8 4 DTTI Interrupt 20 Apr 2 2015 S6E1A1_AN710 00002 SPANSION USER MANUAL AN 9 Demo System This chapter introduces one example of low voltage 3 phase motor project and help you run a motor quickly 9 1 Demo System introduction The low voltage 3 phase motor solution can be adaptive to any type of PMSM or BLDC motor The connection diagram for debugger is shown in Figure 9 1 4 24V 2A DC Power 2 Motor phase line Hall line Figure 9 1 System Connection The motor parameters used for the sample project are shown in the following table Table 9 1 Motor Parameter Pole pairs 2 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 2A Speed range 400rpm 4000rpm Hall Number 3 Hal line definition Red Vcc Black GND Yellow Hall A Green Hall B Blue Hall C Motor phase definition Yellow U Green V Blue W 9 1 1 Hardware Connection It is necessary to connect below 4 lines 1 Connect motor
8. Breakpoints Figure 5 1 Diagram of Live Watch 5 1 1 Variables for Motor Running MotorCirl_stcRunPar The structure is used to control motor and get the basic running information for the motor such as real running speed DC bus voltage rotor angle and etc Detailed information can be found in the comments for each variable 12 Apr 2 2015 S6E1A1_AN710 00002 lt SPANSION USER MANUAL typedef struct int32 t i32CommandSpdRpm user set speed int32 t i32TargetSpdRpm pi reference speed int32 t i32CommandSpdRpmMax speed max defined in customerinterface c int32 t i32CommandSpdRpmMin speed min defined in customerinterface c int32 t i32MotorSpdRpmRt motor s real time speed int32 t i32MotorSpdRpmRtf motor s real time speed filter value int92 t 18263 real time dc voltage 2 132022 Deltarhetars forward angle in every PWM 116326 132022 DeltaThetaKTs the calculated factor of 132022 DeltaThetaTs int32 t 132022 RlecAngle cotor s electrical angle uint8 t u8RunningStage start running stage uint8 t u8Runninglevel motor running level open loop or close loop or oriented char t cStartupcomplete flag char t cCloseloop motor run in close loop flag ehar t JeRun Dir run direction CW or CCW char t cRunstacus motor run or stop status uintl6 t ul6FaultCode fault code for protection uint8 t u8InitStage other definition for product lines intl6 t ul6BrakeTi
9. Show e otor i32HallAngleCCW 7 0 DEGREE 270 DE EXON E 30 DE GRE otor i32HallAngleCW 7 330 DE GRE 90 0 DE GRE GRE E 150 DP GRE 30 DE GRE E 90 270 DE 210 DE GRE 330 Figure 9 14 Configuration the Tested Hall Phase Angle Motor u8HallStatuList 7 The hall status change sequence it can be self checked and filled sequentially according to buffer HallCheck stcPar u8Status Table 8 which is shown in Figure 9 13 Motor iS32HallAngleCCW 7 The hall angle matched with each hall status for CCW running it can be self checked and filled sequentially according to buffer HallCheck sicPar j32Q22 AngleCCW 8 which is shown in Figure 9 13 Note e Due to the check error the angle can be set to HallCheck stcPar i32Q22 AngleCCW 1 269 is shown Motor_i32HallAngleCCW 1 270 as Figure 9 14 the integrate number nearby If in Figure 9 13 we fill the buffer Motor i32HallAngleCW 7 The hall angle matched with each hall status for CW running it can be self checked and filled sequentially according to buffer HallCheck stcPar j32Q22 AngleCWZ 8 which is shown in Figure 9 13 Apr 2 2015 S6E1A1_AN710 0
10. 00002 SPANSION USER MANUAL AN 3 Development Environment Table 3 1 MCU Development Environment Name Description Part Number Manufacturer Remark IAR bedded Workbench FW code edit compile and N A N A N A 7 3 debug J Link Debug and Load FW by JTAG N A N A N A SPANSION FLASH Flash download N A N A N A LOADER ash download program Source Insight V3 50 Source code edit N A N A Editor Eclipse Source code edit N A N A Editor Apr 2 2015 S6E1A1_AN710 00002 7 a gt lt USER MANUAL b Y 4 System Firmware Design This chapter introduces the FW structure of low voltage 3 phase motor project 4 1 FW Feature The features of the low voltage 3 phase motor solution are shown in Table 4 1 Table 4 1 Feature of LVBP Solution No Feature Description Remark Hall status self check Hall phase angle self check 1 Hall Self check Ne Check whether the hall circuit in hardware part is normal 2 Adjustable Carrier Frequency Carrier frequency can be set by the corresponding online variable in user interface Rotor electrical phase angle was corrected by hall or 3 Rotor Angle Control DE sensor less estimation module Calculate speed through hall or sensor less 4 Rotor Speed Calculate estimation module FOC Control Using FOC control algorithm VF Control Using VF control algorithm with the hall sensor Motor ca
11. 6 4 5 1 3 hall s uBlnitStage NO 0 mm E 88 2 int32 t Motor i32Hall ngleCCW 7 0 DEGREE 270 DEGREE 30 ul amp BrakeTime 0 89 DEGREE 150 DEGREE 210 D cWorkMode 0 Oxt Ea ash startup_s6 o0 s 90 int32_t Motor_i32HallAngleCW 7 0 DEGREE 153 DEGREE 33 amp Adc_stcMotorOffset lt struct gt E Output 91 DEGREE 273 DEGREE 213 MotorCtrl_stcluwwSensed struct 92 endif MotorCtil stevdqRef struct EM MotorCti stcidaRef struct stcSpdPidReg struct d define MOTOR IMAX 2 3 amp MotorCtrl_stcldPidReg struct LowVoltageBldc lt Log Thu Apr 02 2015 10 27 35 Prepare hardware for Flashloader Thu Apr 02 2015 10 27 37 Download complete 1 Thu Apr 02 2015 10 27 37 Loaded debugee 01 Customer 126 Low Voltage 00 0 3 Refrigerat Thu 02 2015 10 27 37 Target reset Memory Debug Log Build Find in Files Breakpoints Figure 9 15 Motor Run by J link And you can take the Table 9 5 for your detailed reference for the speed command You can make the motor running at any speed during the speed limitation by this variable Table 9 5 Motor Running Status by the Command Speed MotorCtrl stcRunPar mE Drum Direction Motor s status i32Command
12. Called by the Timer_Event Prototype Description Remark SpdSt_CommandReceive The speed set function used for the motor speed acceleration 1ms amp SpdSt_stcSet amp SpdSt_stcReg or deceleration timer SpdSt_TargetReg amp SpdSt_stcReg The speed regulation function for the middle speed generation PID_ParameterChange The function of the PID Parameter Change CV LimitCtrl The function of the FOC current and voltage limitation 5ms Protect LockRotor The function of the motor lock protection Protect Voltage The function of the DC bus over and under protection Timer CarrierChange Function for carrier changeable on line 50ms 16 Apr 2 2015 S6E1A1_AN710 00002 USER MANUAL e 7T Driver Function The MCU peripheral resources used for motor control are introduced in this chapter 7 1 Function List Most of the MCU peripheral driver functions are located in the file 505 user init mcu c Table 7 1 Driver Function List Prototype Description Remark void InitMcu Nvic void Enable the motor interrupt control and set the priority Init mcu c void InitMcu Clock void MCU clock initial Init mcu c void InitMcu Wdg void Watch dog initial Init mcu c void InitMcu Gpio void The used GPIO initial user can add the GPIO for other Init mcu c usage void InitMcu MotorSvpwm void The SVPWM initial such as the FRT mode and cyc
13. asm pid_requlator asm ee E limitetion c I init mcu h gt P MM ctrl c LL motor startup hall c motor startup senso E observer fee c customer interface c 0 protect c init mcu c single shunt c E isr c speed setc main c spi c Asm startup s amp ooocs E timer event c Figure 4 2 Sub files in Each Layer 4 3 Files Description The detailed descriptions for each file are shown in Table 4 3 Table 4 3 Description of Project Files Folder File Description coordinate transform c FOC axis convert filter c One order low pass filter s03 module math c The math module including the functions such as SQRT COS and SIN pid_regulator asm The PID module for current and speed adc_sample c The ADC process module based on the ADC ISR brake c The brake module including the speed down by brake limitation c The FOC current and voltage limitation module hall_capture c Hall capture module motor_ctrl c The main file of the motor control including the main function of FOC process of motor and the start stop function of motor s04_app motor startup hall c The motor start up module with hall sensor timer event c Timer event module speed set c The speed setting module Spi c The SPI module for the DAC board The library file including the sensor less position calculate module by sensor less estimation hall check modu
14. loop running 3 closed loop running 4 change speed enable uintl6 t Motor ul6StartupSpdRpm 200 start up speed unit rpm Startup parameter for hall sensor motor float32 t Motor f32StartupHallSensorInitCurrentA 0 5 initial startup current unit A float32 t Motor f32StartupHallSensorIncCurrentA 0 05 initial startup current float32 t Motor f32StartupHallSensorMaxCurrentA 1 5 hall sensor startup max force current float32 t Motor f328tartupHallSensorCloseCurrentRate 1 times of the Imax for phase current at closeloop float32 t Motor f32StartupHallSensorPreCloseSpdKp dU float32 t Motor f32StartupHallSensorPreCloseSpdKi 052 uineis t Motor f32StartupHallSensorPreCloseTimsMs 100 Startup parameter for sensor less motor float32 t Motor f32StartupSensorLessMaxCurrentA 1 0 uintl6 t Motor ul6StartupSensorlessOrientTimeMs 200 uintl6 t Motor ul6StartupSensorlessOrientStableTimeMs 50 uintl6 t Motor ul6StartupSensorLessForceRunTimeMs 250 uintl6 t Motor ul6StartupSensorLessForceRunStableTimeMs 50 uint16 t Motor ul6StartupSensorLessPreCloseLoopTimeMs 50 float32 t Motor f32StartupSensorLessCloseCurrentRate 1 float32 t Motor f32StartupSensorLessPreCloseSpdKp 10 float32 t Motor f32StartupSensorLessPreCloseSpdKi 0 5 uintl6 t Motor f32StartupSensorLessPreCloseTimsMs 200 Startup parameter for hall sensor motor with VF control float32 t Motor f3
15. manual describes SPANSION low voltage 3 phase BLDC PMSM solution and describes how to use the FW library The document introduces the basic information of the solution including hardware firmware initial functions basic motor setting functions and FOC drive modules When you have understood these contents you can get an overview of the whole low voltage 3 phase BLDC PMSM project And you can run a motor following the demo project step 1 2 Definitions Acronyms and Abbreviations API Application Programming Interface FOC Field Oriented Control FW Firmware HW Hardware Input and output CW Clockwise CCW Counter clockwise LVBP Low Voltage 3 Phase BLDC PMSM 1 3 Document Overview The rest of document is organized as the following Chapter 2 explains System Hardware Environment Chapter 3 explains Development Environment Chapter 4 explains System Firmware Design Chapter 5 explains System Function Chapter 6 explains Event Function Chapter 7 explains Driver Function Chapter 8 explains Interrupt Function Chapter 9 explains Demo System 1 4 Reference Documents Apr 2 2015 S6E1A1_AN710 00002 5 SPANSION USER MANUAL 2 System Hardware Environment The following lists the MCUs used in LVBP inverter board CPU chip Spansion FM0 S6E1A1 series CPU Frequency 40MHz MCU pin number 48pin RAM Space 88 Kbyte Code Space 6 Kbyte Demo HW version SK MC 3P LVPS 0 V11 6 Apr 2 2015 S6E1A1_AN710
16. phase current restoration from ADC converter Clark amp MotorCtrl_stcluvwSensed amp MotorCtrl_stclabSensed The function of the Clarke frame transform Park amp MotorCtrl_stclabSensed amp MotorCtrl_stcldqSensed The function of the Park frame transform MotorFee_PostionEstimate amp Motor_stcFeeEsti amp MotorCtrl_stcVabReal amp MotorCtrl_stclabSensed The function of the rotor position estimator MotorCtrl_PositionGenerateSensorLess The function of the rotor position calculation from the estimator and hall module MotorCtrl_PositionGenerateHall The function of the rotor position generation void RegO stc pid t pstcPid i32QN_E0 int32_t The d q current regulator Startup_HallMotor The motor start up function for the hall sensor motor InvPark amp MotorCtrl_stcVdqRef amp MotorCtrl_stcVabRef The function of the inverse Clarke frame transform Svm_Calc amp MotorCtrl_stcSvmCalc The SVPWM function SingleShunt amp MotorCtrl_stcSvmGen The function for the OCCP register setting according to the SVPWM calculate result Protect HallLockRotor amp Protect_stcHallLock Hall_stcCapture The protection function for the hall lost detect Protect_OpenPhase The protection function for the open phase detect SPI_Draw1 i32Temp The function for DAC board to observe the FW variables by SPI Table 6 2 Event Function List
17. s hall signal to LVBP board shown as Figure 9 1 Skip to the next step if the motor is sensor less Apr 2 2015 S6E1A1_AN710 00002 21 SPANSION USER MANUAL The Hall signal line connection is defined in the following table Table 9 2 Hall Connection Motor Line Inverter Board Circuit Port Hall A Hall A Hall B Hall B Hall C Hall C 5V Vcc GND GND Note e 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 to the Hall C port on the board e VCC and GND must be connected rightly otherwise the hall won t work properly and the motor will also not run 2 Connect motor s U V W phase lines to LVBP board shown as Figure 9 1 It is recommended that the motor s U V W line is accordingly connected to Inverter s IPM s output U V W 3 Connect J link to LVBP board shown as Figure 9 1 Note If there is no isolator between the J link and the hardware you must unplug the AC power and use the battery of your note book It is recommended to use the isolated J link to debug the FW for the series 4 Connect 24V 2A DC power to LVBP board shown as Figure 9 1 9 2 Motor Debug The debug step on the new motor is described in this section when you finish the hardware connection with the motor Click the IAR program to open the IAR and open the work space file EWW of the low volt
18. than the maximum value 0x0020 DC bus under voltage DC lower than the minimum value 0x0100 Hall lost fault Motor hall lost 0x0200 motor lose phase Motor phase line lost 0x0400 motor lock Motor lock 0x2000 FW watch dog reset The hardware watch dog reset 0x4000 HW watch dog reset The hardware 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 9 3 3 Carrier Changeable On line The carrier can be changed on line by changing the variable Motor_u16CarryFreq that is shown in section Hardware Coefficient Setting If the firmware resets during the carrier change the carrier may exceed the maximum capacity of firmware The carrier for hall sensor solution can be 8KHz 16KHz but the carrier for sensor less solution can be 8KHz 10KHz 9 3 4 Hall Check When you run the hall check function the motor phase line must be properly connected to the UVW on the LVBP demo board and the hall line must be also properly connected to the port of VCC GND Ha Hb Hc Otherwise the hall angle of reverse direction may be wrong and the motor may not correctly run at the reverse direction 9 3 5 Power Consumption Higher If the power or the phase current is bigg
19. the hall parameter must be correctly set LM dd 103505 user 84 char t Motor cHallControlMode HALL FOC Im F 85 zhar t Motor cHall ngleCheck init mcu c 86 uint8 t Motor u8HallNumber 3 87 uint8 t Motor u8HallStatulist 7 0 2 6 isre 88 int32 t Motor i32Hall ngleCCU 7 0 DEG m main c 39 DEGREE E sh startup_sb 00x s 90 int32 t Motor i32Hall ngleCW 7 0 DEGR Figure 9 12 Configuration of the Test Mode Note The motor phase line must be properly connected to the UVW on the LVBP demo board and the hall line must be also properly connected to the port of VCC GND Ha Hb Hc 9 2 2 2 Hall Check Run be Click the debugger button Restart Debugger connect the J link and paste the global structure HallCheck stcPar into the Live Watch in the IAR debug online Enable the hall check function by the variable cStart as shown in Table 9 4 and the hall information of the motor can be self checked by this function When the hall check finished flag is set to 1 the hall information is output by the global structure as shown in Table 9 4 and Figure 9 13 Note The motor must be light loaded for the hall check Table 9 4 Global Structure for Hall Check HallCheck stcPar struct command cstan 0x00 Hall check stop command d m Hall check finished flag m cStage
20. 0002 29 SPANSION a 9 2 3 USER MANUAL Run Motor When the hall angle and status list have been checked by the hall check mode the motor can be started for the demo show 1 Reset the variable to the normal work mode in section Motor Parameter Configuration The setting is as the following char t Motor cHallAngleCheck FALSE 2 Check the basic motor and HW parameter setting in the user interfaces If the setting does not match the real hardware and the motor parameter there will be an unexpected running error in the motor running 3 Compile project and download program to inverter board by the J link lick button A that is shown in Figure 9 15 to connect the J link and download the FW into the MCU Click button B to run the FW online Jwo seconds after the relay is switched on you can enter none zero speed value to start the motor in the structure that is shown as C For example when the variable MotorCtrl_stcRunPar i32CommandSpdRpm 400 by your online input the motor will CCW run to 400rpm Edit View Project Debug Disassembly Simulator Tools Window Help A D B Dee 14 Y 75 xS Debug v if 0 MOTOR ID Expression Value Files sz 68 define IMAX 1 5 motor s max run S MotorCtrl_stcRunPar lt struct gt 55 32Commands Ga 0 n Bu Ed ene D 70 uint8 t u8Sen
21. 2StartupHallSensorVfInitVoltage 3 seie ig Motor i1608 CloseLoopIsMax Q8 MOTOR IMAX Figure 9 8 Variables Setting for Motor Start up 26 Apr 2 2015 56 1 1 AN710 00002 SPANSION USER MANUAL AN Acceleration Setting The acceleration and deceleration can be set in this part UI 05 configure the acceleration and deceleration speed uintl6 t SpdSt ul6AccMaxRpm 2000 maximum acceleration speed unit rpm s uintl6 t SpdSt ul6DecMaxRpm 2000 maximum deceleration speed unit rpm s uintl6 t SpdSt ul6DefaultAccRpm 007 default acceleration speed unit rpm s uintl6 t SpdSt ul6DefaultDecRpm 5007 default deceleration speed unit rpm s Figure 9 9 Variables Setting for Acceleration Protection Setting The protection setting is just the prompt The detailed information can be found in the FW Ur 08 configure the protect parameter char t Protect cDCVoltageEn TRUE uintl6 t Protect ul6DCVoltageMax 27 the maximum value of DC uintl6 t Protect ul6DCVoltageMin 15 the minimum value of DC uint32 t Protect u320verVoltageTime 1 configure the over voltage protect max time 50ms uint32 t Protect u32UnderVoltageTime 30 configure the under voltage protect max time 30ms uint32 t Protect u32RecoverVoltageTime 2000 configure the voltage back normal from error s time 2000ms char t Protect cLockRotorEn TRUE uintl6 t Protect ul6LockMinSpd 300 configure the locked min s
22. 32 t Motor f32Dki Uc d axis current PI regulator proportion constant ils 0 2 m icNasdsecuncentePibequiatonsonoporitioneconsant Figure 9 6 Parameter Setting Apr 2 2015 S6E1A1_AN710 00002 25 USER MANUAL a Hardware Coefficient Setting UI 03 define the hardware s a d sample information carry wave frequency and dead time float32 t Motor f321uvwSampleResistor 0 1 sample resistor ohm float32 t Motor i321uvwAmplifierFactor 5 Iuvw calculation factor int32 t Motor i32IuvwOffsetNormal 2048 the middle value of 12 bits ADC int32 t Motor i32IuvwOffsetRange 100 ADC offset range of Iuvw sampling int32 t Motor i32IuvwOffsetCheckTimes 64 Iuvw ADC sample offset float32 t Motor f32DeadTimeMicroSec uintl6 t Motor ul6CarryFreq 10000 motor carry frequency Hz Range 5 kHz 8 khz Figure 9 7 ADC Coefficient Setting The Demo Board s current sample resistor is 0 10 current OP is 5 times detailed information can be found in the hardware user manual and the schematic in the Reference Documents And the carrier can also be changed at this part Motor Start up and Start stop Setting The parameters for the motor start up can be set in this part And different part of the parameter as the comment can be applied to different motor type UI 04 configure the startup parameter wines Motor u8RunLevel 4 1 gt orientation 2 open
23. OC control HALL HALL VF Sensor less with VF control MOTOR The motor ID for user if the new motor is used for the debug the motor can be set in the region if O MOTOR ID and set the MOTOR 10 0 If the motor runs well with these motor parameters these parameters can be fixed and added to another motor ID And you can switch the motor debug more conveniently and quickly if you have the debugged parameter Motor u8PolePairs Motor pole pairs it must be got by the manufacturer MOTOR MAX It can be got by the manufacturer or determined by the phase peak current at the motor brake stable stage Motor f32Res The parameter of motor phase resistor it can be measured by the multi meter Motor u16SpdMin Motor u16SpdMax The speed range for the motor it is different for each motor due to 24 Apr 2 2015 56 1 1 710 00002 SPANSION USER MANUAL the performance difference of the motor Basic Setting for HW The basic settings for the HW can be set the H file h05 user hardware config h Other settings in this file are not recommended to modify for the FMO series Note e lt is recommended to design your schematic according to LVBP demo schematic especially the MCU port assignation such as hall port ADC port ADC Port Setting set the hardware s A D input define ADC VOLT REF SO always set as 5 5v is the reference define VALUE MAX 4096 0f always set as 4096 12bit ad sample precision
24. SpdRpm gt 0 CCW Running lt 0 CW Running 0 Stop Stop Note 30 Apr 2 2015 S6E1A1_AN710 00002 SPANSION USER MANUAL e Donotclick the button D to break the FW running the HW over current or DC over fault may appear and hardware may be damaged if you do that e When the motor needs to reverse the running direction you should stop the motor and then restart the motor to run in another direction 4 Watch the important variable to check the motor running performance such as whether the motor achieves the command speed and running speed is stable Detailed meaning about the important variable is shown in the previous section 5 1Global Structure and Variable Definition for your reference 9 2 44 Debug with DAC If you want to observe the variables in the firmware you can use the DAC board to observe the variable on the oscilloscope through the SPI interface as shown in Figure 9 16 Waveform Display Figure 9 16 DAC Board Connection You need to enable the SPI function cTxEn TRUE for the DAC as shown in section Other Function Enable The function prototypes for the DAC are shown in Table 9 6 And each of them must be called at the end of the MFT ISR function of the LVBP firmware Table 9 6 DAC Show Prototype Description Remark void DA Draw signed long 1 Line show void SPI Draw2 signed long ChA signed long ChB 2 Lines show void SPI Draw3 signed long C
25. aeeteaeeseaeeseeeeeeneees 29 Figure 9 15 Motor Run by d link iccirco Leite re cepe en eed tee xr 30 Figure 9 16 DAC Board 31 Tables Table 3 1 MCU Development Environment 7 Table 4 1 Feature List of LVBP 80 8 Table 4 2 Directory Description of eene nre 9 Table 4 3 File Description of 10 Table 5 1 System Function List 15 Table 6 1 Event Function List Called by the ISR sssseseseseeeeeeeneeenee nennen nennen 16 Table 6 2 Event Function List by the _ 16 Table 7 A Driver Function 17 Table 4 1 System Used Interrupt Function nennen nennen ener 18 9 gt 1 oe EE LONE Rodeo 21 Table 9 2 Hall Connection 22 Table 9 3 Motor Control Mode lea teste 24 Table 9 4 Global Structure for Hall Check 28 Table 9 5 Motor Running Status by the Command Speed 30 Table 9 6 DAC 31 Table 9 7 Protection LIS t aron 32 4 Apr 2 2015 S6E1A1_AN710 00002 SPANSION USER MANUAL 1 Introduction 1 1 Purpose This user
26. age 3 phase motor as shown in Figure 9 2 LowVoltageBldc IAR Embedded Workbench IDE New c v4 v S wb te dc D c Ue v Look ir C EWARM Save 2 NS O settings Page Setup My Recent LowVoltageBldc 2 ze h Recent Files hh Recent Workspaces Desktop Exit i S Ha C1502 driver 301503 module Ms 0204 app 31505 user Ha customer interface c Ha init Ha Computer Ha D main c Le 5 a File name FMO_LowVoRageBldc J Network Files of type Workspace Files eww v Figure 9 2 Open the Workspace 22 Apr 2 2015 S6E1A1_AN710 00002 5 5 USER MANUAL AN 9 2 1 FW Interface Configuration All of 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 hardware config h Both files are highlighted as shown in Figure 9 3 Workspace Debug v Files 2 E LowVoltageBldc De v Hanhi global Ha 02 driver Ha 9 003 module C3h04 app 1 8 CIh05 user I customer interface h L conar I C1501 global Ha C3502 driver 22 503 module C1504 app 1 8 22 505 user a customer init m
27. chance of failure is intolerable i e submersible repeater and artificial satellite Please note that Spansion will not be liable to you and or any third party for any claims or damages arising in connection with above mentioned uses of the products Any semiconductor devices have an inherent chance of failure You must protect against injury damage or loss from such failures by incorporating safety design measures into your facility and equipment such as redundancy fire protection 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 export under the Foreign Exchange and Foreign Trade Law of Japan the US Export Administration Regulations or the applicable laws of any other country the prior authorization by the respective government entity will be required for export of those products Trademarks and Notice The contents of this document are subject to change without notice This document may contain information on a Spansion product under development by Spansion Spansion reserves the right to change or discontinue work on any product without notice The information in this document is provided as is without warranty or guarantee of any kind as to its accuracy completeness operability fitness for particular purpose merchantability non infringement of third party rights or any other warranty express implied or
28. ction such as GPIO interrupt MFT AD S02 driver dul module Algorithm folder for basic motor control such as FOC frame transform SVM module S03 module math PID filter Application folder for the files of application functions such as speed and position app c generator by hall sensor or sensor less rotor estimation protection motor S04 app start up field weaken brake and etc H05 User S05 U Customer interface folder of the files for motor Configuration and HW setting User Note if you want to quick start the motor you can refer to the setting for user layer at 9 2 1FW Interface Configuration and chapter 5 System Function The sub files in each folder are shown in Figure 4 2 and the structure of header files is the same with C files Apr 2 2015 S6E1A1_AN710 00002 5 5 a USER MANUAL E LowVoltageBldc v h01 global C1h02 driver h03 module 30504 app at adc sample c 0109503 module 2 Fs E coordinateztransform brake c A at field_weaken c Ha C3h04 app Wa filter c field Ha C3h05 user mieth c hall capture c 7 hall check c N k alu A Oo oO J customer_interface c init_mcu c E isr c E main c La amp startup soox s La C3 Output amp C1s05 user customer interface h G
29. cu c Ha Bisr c Ha D main c fish startup_sbroox s La C3 Output Figure 9 3 Interface File Diagram 9 2 1 1 Basic Setting The motor can be started easily after the basic setting So the basic variables and macro definitions must be correctly set for the motor demo running All of the hardware settings in this section must be based on Hardware User Manual Basic Variables Setting The basic variables can be set in the c source file 1505 user customer interface c Motor Parameter Configuration The motor parameter must be correctly set except the hall related parameters that is highlighted in Figure 9 4 When the hall related parameter is self checked by hall check module it must be set correctly according to the motor parameter Apr 2 2015 S6E1A1_AN710 00002 23 dne e USER MANUAL 00 define which should be used in this project define MOTOR ID 0 define which motor could be used in this project UI 01 define the used motor parameter in this project if 0 MOTOR ID define MOTOR IMAX Loe motor s max run peak current uint8 t Motor u8SensorType SENSORLESS HALL or SENSORLESS inte its Motor ue PollePairs ep the pole pairs of rotor float32 t Motor f32Ld 0069 thed axis reductance unit mH hall sensor otor need not define loat32 t Motor f32Lq 0 85 theq axis reductance unit mH hall sensor otor need not define loat32 t Motor f32Res
30. d The function for the motor stop control motor ctrl c void MotorCtr InitPar uint16 t The key variable and the register initial at the motor start motor ctrl c u16SampleFreq void MotorCtrl_HallSensorProcess void The main function of the motor control with hall sensor that is motor_ctrl c called in each of the MFT zero detect ISR void MotorCtrl_SensorLessProcess void The main function of the motor control with sensor less that is motor_ctrl c called in each of the MFT zero detect ISR void MotorCtrl_HallVFProcess void The main function of the VF motor control with hall sensor that motor ctrl c is called in each of the MFT zero detect ISR void Timer Counter void The 1ms 5ms 50ms timer generated by the MFT ISR timer event c void Timer Event void The timer event for the motor control or the advanced function timer event c Apr 2 2015 S6E1A1_AN710 00002 15 SPANSION a gt lt a USE R MANUAL 6 Event Function The primary functions for the motor inverter control are introduced in this chapter 6 1 Function List The functions for the motor control that are Event are shown in Table 6 1 Table 6 2 called in the MFT ISR Mft Frt IsrHandler and timer c Table 6 1 Event Function Called by the MFT ISR Prototype Description SpdHall The speed calculate function of the hall module MotorCurrentSense The
31. er than other solution you can watch the value of d axis voltage MotorCtrl_stcVdqRef i32Q8 at the same working condition compared with others If the variable s value is out the range of 25600 which indicates the voltage on the d axis vibrates more than 10v that is the rotor angle corrected by the hall or sensor less module may not be so accurate 32 Apr 2 2015 S6E1A1_AN710 00002 SPANSION USER MANUAL AN You can do as follows e The Hall status list and angle must be re checked and modified to the corresponding motor parameters shown in section Hall Check e Recheck motor parameters when the motor is sensor less as described in section Motor Parameter Configuration e Recheck the hardware setting as described in section Hardware Coefficient Setting e Ifthe power is still higher you can make the same offset on correct angle for each hall status the array is Motor i32Hall ngleCCW 7 Motor i32Hall ngleCW 7 which is located at S05_user Customer_interface c re compile the projection and debug at the same working condition and you can find the best angle list when the power is the best Apr 2 2015 S6E1A1_AN710 00002 33 SPANSION USER MANUAL 10 Additional Information For more Information on Spansion semiconductor products visit the following websites English version address http Awww spansion com Products microcontrollers Chinese version address http w
32. hA signed long ChB signed 3 Lines show long ChC void SPI Draw4 signed long ChA signed long ChB signed long ChC signed long ChD 4 Lines show 9 3 Troubleshooting 9 3 1 Motor Start up When the motor can t start up normally there may be 2 reasons 1 The Hall Angle found in debug mode is faulty Even if the motor load is empty it also can t Start up 2 The startup parameter is not set correctly User should change the parameter in S05_user customer_interface c and refer to the section Motor Start up and Start stop Setting Apr 2 2015 S6E1A1_AN710 00002 31 SPANSION AN USER MANUAL 9 3 2 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 Table 9 7 Protection List MotorCtrl stcRunPar T Description Protect Type u16FaultCode 0x0000 no error 0x0001 current sample 2 5V offset error ADC sample circuit problem 0x0002 over current of FW Motor phase peak current exceeds the maximum value 0x0008 over current of HW interrupt due to the abnormal motor phase current 0x0010 DC bus over voltage DC higher
33. le AD Init mcu c trigger source OCCP mode etc void InitMcu MotorSvmEn void Enable the SVPWM output Init mcu c void InitMcu MotorSvmbDis void Disable the SVPWM output Init mcu c void InitMcu Adc uint16 t The AD initial such as the port setting converter time setting Init mcu c u16SampleFreq trigger point etc void MotorCtrl_ConfigPwm void Configuration the PWM such as the dead time of the Init_mcu c SVPWM max duty void InitMcu Basetimer void The PWC registers initial for hall capture Init mcu c void Brake IPMLowArmOn void Porting setting for motor brake Brake c void Brake IPMAllArmOff void Release the port to finish the brake Brake c Apr 2 2015 S6E1A1_AN710 00002 17 SPANSION USER MANUAL 8 Interrupt Function 8 1 Function List Table 8 1 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 0 7 IsHandler void interrupt for Hall interrupt S05 user isr c root void Mft Frt IsrHandler void The MFT zero detect ISR for the motor control s05 user isr c root void Mft Wfg IsrHandler void The HW over current ISR 505 user isr c root void Adc 0 IsrHandler void The ADC unitO ISR trigger at the zero point for the 3 shunts 505 user isr c 8 2 Interrupt Priority Setting Each interrupt pri
34. le the motor start up module with sensor less motor the SVPWM LowVoltageBldac V1 0 0 a module and the protect module Customer interface c The motor parameter setting main c Main function s05 user startup s6xxxx asm MCU interrupt vector list Init mcu c MCU system initialization including interrupt priority list Isr c The ISR file for all of the interrupt routine of the MCU 10 Apr 2 2015 S6E1A1_AN710 00002 5 5 USER MANUAL AN 4 4 FW Control Flow The control flow for the motor is shown as Figure 4 3 There are 4 interrupts that are red highlighted for the motor FOC control hall capture and AD converter The timer events are executed in the end less loop and the timers are generated in the zero detection interrupt Mft_Frt_IsrHandler of the free run timer 0 End less loop in main c PWC ISR for Hall Hall Interrupt Hall statue check Hall correct angle generate FeedWDT Speed Calculate from Hall Motor Start Stop par commana Current U V W sample A DC bus sample and calculate ADC unito ISR MFT ISR Figure 4 3 Diagram of the Control Flow Apr 2 2015 S6E1A1_AN710 00002 11 USER MANUAL a 5 System Function This chapter describes the global structure variables and system functions 5 1 Global Structure and Variable Definition The variable for user interface can be found in section 9 2 1FW Interface Configuration Any structure or
35. me brake times for brake stage char t cWorkMode motor work mode low or high speed Sit mmo Con runie extern stc motor run t MotorCtrl stcRunPar SpdSt stcSet The structure is used to set the drum speed It is the global structure for the Speed Set module that is realized in the file s04 app speed set c Detailed information can be found in the comments for each variable The variables in this structure are not recommended to modify typedef struct stc SpdSet mp M i32SpdCommand setting speed unit rpm Re i32SpdCommandPre previous setting speed unit rpm umso u32SpdMax the maximum speed limit UINES2 t u32SpdMin the min speed limit ELIMI ul6SpdChgTime speed change time from spd A to B ul6AcceLmt the acceleration limit at speed up ae ul6DeceLmt the acceleration limit at speed down char t cRotateDir motor running direction stc SpdSet t extern oter spdsetie SpdSt stcSet 5 1 2 Variables for FOC The variables for the FOC control are introduced in this section Apr 2 2015 S6E1A1_AN710 00002 13 SPANSION ww 5 1 3 USER MANUAL D amp Q axis Current and Voltage MotorCtrl_stcldqRef Reference current value on the 2 axis rotation frames gt i32Q8_Xd Reference current D axis Idref 213208 Reference current on Q axis Iqref 32012 Cos Cosine value of the
36. n startup with different type load without 7 Self adaption Start Up changing parameter This function is used to speed up or slow down a 8 Speed regulate motor by the command from host via UART or debugger 9 Brake Stop motor by braking down 10 Dual shunt sample Current Sample Single shunt sample algorithm DC voltage protection T A D offset protection Protect Lock rotor protection Motor phase lost protection Over Current Protection Use the DAC board to display the variables by the 12 DAC SPI 4 2 FW Structure There are 5 layers in the FW structure of IAR which are shown in Figure 4 1 8 Apr 2 2015 S6E1A1_AN710 00002 SPANSION USER MANUAL aN Debug vy Files 2 8 E LowVoltageBldc De v C3h01 global C3h02 driver h03 module h04 app 05 user I E customer_interface h I init mcuh 3 s01 global 22 502 driver 3503 module 3 C1s04 app 1 8 C305 user iacia customer interfacec init mcu c mein c startup s6 xx s Output Figure 4 1 Structure of FW The C source and Header files which are included in each layer are shown in Table 4 2 Table 4 2 Directory Description of Project Layer Folder Description global global MCU system file S01 global H02 driver 5 driver MCU register setting fun
37. nt for current lu AD sample i32Xv AD middle point for current AD sample 32 AD middle point for current Iw AD sample 2048 2 5V the offset error threshold is set OFFEST MAX VALUE Variables for PID Control MotorCtrl stcPidCtrl The variables used for PID control are introduced in this part The structure is used for PID control that enables or disables the corresponding PI regulator The detailed information can be found in the comments for each variable 14 Apr 2 2015 S6E1A1_AN710 00002 510 USER MANUAL AN MotorCtrl_stcldqRef Reference current value on the 2 axis rotation frames gt cldEN Id PI Enable Iq PI Enable gt cSpdEN speed PI Enable gt cFdWkEN field weaken PI Enable gt uf6SpdPICyc execute cycle of speed gt u16FdWkPICyc execute cycle of field weaken gt u16SpdPICnt counter for speed gt u16FdWkPICnt counter for field weaken cPIChangeEnable Enable the parameter change 5 2 Function List The functions for the system control are shown in Table 5 1 Table 5 1 System Function List Prototype Description Remark void main void Main function of the whole project main c void Runinit uint16 t The function for the motor start control but not for the motor motor ctrl c Sample freq start up void MotorCtrl Stop voi
38. ority can be set by the function void InitMcu Nvic void which is located at the file 505 user init mcu c Users are not recommended to modify it The priority diagram for motor control is shown in Figure 8 1 Priority H DTTI Watch Dog 4o em Figure 8 1 Interrupt Priority Diagram 18 Apr 2 2015 S6E1A1_AN710 00002 SPANSION USER MANUAL 8 3 Interrupt Generation The diagram of the interrupt used for the motor control is briefly introduced in this section 8 3 1 MFT The multifunction timer is used to generate the interrupt for the motor control algorithm and trigger the AD sample at the zero point Mft Frt IsrHandler Free run timer 0 UP DOWN mode PWM cycle 62 5 us 16K Hz Trigger AD unitO and FOC interrupt A D 0 sample U V W current FOC interrupt to drive motor Figure 8 2 Free Run Timer Interrupt 8 3 2 Hall Capture The PWC timer is used to capture the hall status change and the pulse of the edge of the hall signal Bt 0 7 IsHandler Hall signal Voltage High or Low level One motor ele cycle gt Y Trigger Hall interrupt Hall Edge Motor speed calculate change interrupt and and rotor phrase angle 4 base timer 2 over flow interrupt Base timer Count Over Flow Figure 8 3 Base Timer Interrupt Apr 2 2015 S6E1A1_AN710 00002 19 USER MANUAL 8 3 3
39. pdMax 4000 motor run 5 a 25 603 module 82 uintl6 t Motor ul6SpdMin 360 motor run cStartupcomplete 0 304 cCloseloop ND 0 La Ee 84 char t Wotor_cHallControlMode HALL FOC HALE VF FOC NOI coki p 85 2 E enable or disab cRunStatus NO Oxl stom t interf 2 Ha A ae iene 86 int8 t Motor u8HallNumber 2 hall num ul amp FaultCode 0 0000 Lae 87 uint8 t Motor usHallStatulist 7 0 2 6 4 5 1 3 hall s udlnitStage B mar 88 int32 t Motor i32Hall ngleCCU 7 0 DEGREE 270 DEGREE 30 ul6BrakeTime 0 Ca mem 89 DEGREE 150 DEGREE 210 D cWorkMode Ogi abnor 90 int32 t Motor i32HallAngleCU 7 0 DEGREE 153 DEGREE 33 Adc_stcMotorOffset ud amp C Outpu 91r DEGREE 273 DEGREE 213 MotorCtrl_stcluwwSensed struct 92 fendif MotorCtrl_steVdgqRef MotorCtrl_stcldqRef struct 94 12 1 MOTOR MotorCtrl_stcSpdPidReg url 95 e 250 MotorCtr_stcldPidReg satzucip FM LowVoltageBldc ANS i gt Log Thu Apr 02 2015 10 27 36 Prepare hardware for Flashloader Thu Apr 02 2015 10 27 37 Download complete Thu Apr 02 2015 10 27 37 Loaded debugee 01 Customer 1 26 Low Voltage 00 PAA PWSC FMO_LowVoltageBldc V0 3 5 editor EWARM Debug Exe FMO0_Refrigeral Thu Apr 02 2015 10 27 37 Target reset Memory Debug Log Build Find in Files
40. peed 10r min uintl6 t Protect ul6LockHallSensorMaxTime 4000 configure the check lock max time 500ms uintl6 t Protect ul6LockSensorLessMaxTime 2000 configure the check lock max time 500ms char t Protect cOpenPhaseEn TRUE uint32 t Protect u320penPhaseTime 1000 configure the lose phase max protect time 1000ms int32 t Protect i320penPhaseCurrentUp Q8 0 1 configure the open phase check on current 1A int32 t Protect i320penPhaseCurrentLow Q8 0 03 configure the open phase check min current Unit A such as gt 1 Iv gt 1A Iw 0 03A motor lose phase Figure 9 10 Protection Parameter Setting Other Function Enable UI 09 Function Enable char t SPI cTxEn TRUE enable the SPI Tx for DAC board Figure 9 11 Function Selection Apr 2 2015 S6E1A1_AN710 00002 27 SPANSION a 9 2 2 USER MANUAL Hall Check When the basic setting has been finished the hall information can be self checked by the hall check module if the hall angle and status information is not known If the hall information has been known or the FW runs in the sensor less mode this section can be ignored and the motor can be normally started Refer to section 9 2 3Run Motor 9 2 2 1 FW Setting Set the variable Motor cHallAngleCheck TRUE in section Motor Parameter Configuration according to Figure 9 12 to make the control system run in hall test mode Other parameters for the motor except
41. rotor position used for the frame transform 2132012 Sin Sine value of the rotor position used for the frame transform MotorCtrl_stcldqSensed current value on the 2 axis rotation frames gt i32Q8_Xd Real time current on D axis Id 213208 Real time current on Q axis Iq 32012 Cos Cosine value of the rotor position used for the frame transform gt i32Q12_Sin Sine value of the rotor position used for the frame transform stceVdqRef Voltage value on the 2 axis rotation frames 3208 Xd Real time voltage on D axis Vd 213208 Real time voltage on Q axis 32012 Cos Cosine value of the rotor position used for the frame transform 75132012 Sin Sine value of the rotor position used for the frame transform Alpha amp Beta axis Current and Voltage MotorCtrl stclabSensed 213208 Xa Real time current on a axis Id 213208 Real time current on Id MotorCtrl stcVabRef gt i32Q8_Xa Real time voltage on a axis Id gt i32Q8_Xb Real time voltage on Id Motor Offset The AD middle points of amplifier part on the HW are got in this structure If the middle voltage of the amplifying circuit for the phase current is changed the AD offset result will also be changed at same direction Adc stcMotorOffset Structure for the ADC middle points of phase current gt i32Xu AD middle poi
42. sorType SENSORLESS HALL or SENSORL i3ZTargetSpdRpm Bin dr 71 uint8 t Motor u8PolePairs 2 the pole pairs i32CommandSpdRpmMax 0 anver 72 float32 t Motor_f32Ld 0 65 the d axis red i32CommandSpdRpmMin 0 Ha 21 03 module 73 float32 t Motor 3219 0 85 the q axis red i32MotorSpdRpmRt 0 ma 904 app 74 float32 t Motor f32Res 0 5 the phase i32MotorSpdRpmPtt 0 Ha CIh05 user 75 float32 t Motor f32CurrentMax MOTOR IMAX motor s max run i32Vbus 0 E customer intefaca h 76 i32022 DeltaThetaTs 0 h hardware config 77 float32 t Motor f32Ke ES 2 8 motor s back EM 2022 DeltaThetaKTs 0 init mcu h 78 float32 t Motor f32BackEnflin 0 6 motor s back EM 132022 ElecAnal 0 L Bisrh 79 t 0 C1s01 global 80 float32 t Motor f3ZTransRate 1 define whether uU WU 5 u8Runninglevel 0 0 La 1502 driver 81 uintl6 t Motor 4000 motor run Start L8 03 module 82 uintl t Motor ul SpdMin 360 motor run ESE SEEEN SUP us _ 83 cCloseloop NO OxC ma C1s04 app RunDil 0 OxC Lac 84 char t Motor cHallControlMode FO0C HALL EROR oz s05_use o x gt TRUI JJanabla disab cRunStatus NO E customer interface c 16FaultCod 0 0000 D init mcu c 86 uint8_t Motor_u8HallNumber 3 2 hall num Ulbrountvode x Di 87 uint8 t Motor u8HallStatulist 7 0 2
43. statutory Spansion assumes no liability for any damages of any kind arising out of the use of the information in this document Copyright 2014 Spansion All rights reserved Spansion the Spansion logo MirrorBit MirrorBit Eclipse ORNAND and combinations thereof are trademarks and registered trademarks of Spansion LLC in the United States and other countries Other names used are for informational purposes only and may be trademarks of their respective owners 36 Apr 2 2015 56 1 1 AN710 00002
44. variable that you want to watch can be pasted into the Live Watch window of IAR as shown in us 5 1 Edit Project Debug Disassembly Simulator Tools Window Help 4 S Sif 0 MOTOR ID Jebug Expression Value Files es e 68 define MOTOR IMAX 1 5 motor s max run Motors struct mr E et D 70 uint8_t Motor u amp SensorType SENSORLESS HALL or SENSORL iGzTergetSpdFpm 0 Lag TE 71 uint8 t u8PolePairs 2 the pole pairs i32CormmandSpdRpmMax 0 h02_driver 1oat32_t Motor 3214 0 65 the d axis red i32CommendSpdRpmMin 0 Ha module 73 float32 t Motor f32Lq 0 85 the q axis red i32MotorSpdRpmRt 0 Ha C1h04 spp 74 float32 t Motor f32Res 0 5 the phase i32MotorSpdRpmRtt Ha C1h05 user 75 float32 t Motor f32CurrentMax MOTOR IMAX motor s max run i32 Vbus 0 customer interface h 32022 DeltaThetaTs 0 hardware 77 float32 t Motor f32Ke 2 8 motor s back EM i32022 DeltaTheteKTs 0 E init mcuh 78 float32 t Motor f32BackEnfMin 0 6 motor s back EM 32022 ElecAngle 0 Bisrh 2 01 global 80 float32 t Motor f32TrensRate 1 define whether AU 2 7 u8Runninglevel NO Ha C102 driver 81 uintl6 t Motor ul6S
45. ww spansion com CN Products microcontrollers Please contact your local support team for any technical question America Spansion Solutions Spansion com China mcu ticket cn spansion com Europe mcu ticket de spansion com Japan mcu ticket jp gt spansion com Other http www spansion com Support SES Pages Ask Spansion aspx 34 Apr 2 2015 S6E1A1_AN710 00002 SPANSION USER MANUAL AN710 00002 1v0 E SpansioneUser Manual FMO Family 32 BIT MICROCONTROLLER Low Voltage 3 Phase BLDC amp PMSM Control User Manual Apr 2015 Rev 1 0 Published Spansion Inc Edited Embd System Plat Dev Embd Solution Apr 2 2015 S6E1A1_AN710 00002 35 SPANSION USER MANUAL Colophon The products described in this document are designed developed and manufactured as contemplated for general use including without limitation ordinary industrial use general office use personal use and household use but are not designed developed and manufactured as contemplated 1 for any use that includes fatal risks or dangers that unless extremely high safety is secured could have a serious effect to the public and could lead directly to death personal injury severe physical damage or other loss i e nuclear reaction control in nuclear facility aircraft flight control air traffic control mass transport control medical life support system missile launch control in weapon system or 2 for any use where

Download Pdf Manuals

image

Related Search

Related Contents

  Guía del Usuario - Atención al Cliente  Manuel d`installation Notice d`installation du thermostat  TFA 30.3015 digital body thermometer  Electronic Applicator Counter Assembly Kit(s)  GE-D230043R  

Copyright © All rights reserved.
Failed to retrieve file