Motorola M68HC08 manual Main Data Flow Part 2 Alignment, Starting

Page 80

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

Software Design

 

 

 

 

 

 

 

 

 

 

TIMER 2

 

 

 

BACK-EMF

 

 

 

T_CMT

 

 

Sp_Input

 

 

 

ACTUAL TIME

 

 

ZERO CROSSING

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

INPUT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Speed_Min_U8

 

 

 

Coef_Speed_Inp

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

V_TASC2

 

 

 

CORRECTIVE CALCULATION 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PROCESS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OF COMMUTATION PARAMTERS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CORRECTIVE CALCULATION 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DESIRED SPEED SETTING

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PROCESS

 

 

 

OF COMMUTATION PARAMETERS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BACK-EMF

 

 

 

(ACCELERATION)

 

 

 

 

 

 

 

 

 

 

 

 

 

ZERO CROSSING SENSING

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*Only when regular

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

feedback can not

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

be used

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ICR_F

 

 

 

 

T_ZCros

 

 

 

FOK_F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Speed_Desired

 

 

 

 

 

 

 

 

 

 

COMMUTATION HAS BEEN

PIParamsScl_U8_Speed

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PROCESS

 

 

 

PERFORMED — FLAG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

COMUTATION TIMES

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PC_F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CALCULATION

 

 

 

 

 

 

 

Per_Speed_MAX_Range

 

Per_ZCrosFlt

T2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PROCESS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TIMER 2

PRESET COMMUTATION

 

 

 

 

 

PROCESS

 

 

 

 

 

 

 

 

 

 

 

AND ZERO CROSSING

 

 

 

 

SPEED CONTROL

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PWM MODULE

 

 

 

 

 

 

 

 

 

 

 

 

VIRTUAL

 

 

 

 

 

 

 

 

 

 

 

 

 

V_MUX

V_TASC2

 

 

TIMER 3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TIMER2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TIMEOUT,

 

 

 

 

 

 

PROCESS

 

 

 

 

 

 

 

 

 

 

 

 

ACTUAL TIME

 

 

 

 

 

 

 

 

 

 

 

 

 

PROCESS

 

 

 

 

 

 

SET COMMUTATION AND

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ALIGNMENT CONTROL

 

 

 

 

 

 

 

 

 

 

ZERO CROSSING SELECTION

 

 

 

 

 

 

 

 

 

TIMER1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

INIT

 

 

 

 

T_Cmt

 

 

 

 

 

 

PC_F

 

 

 

Curr

 

Curr_Align

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BACK-EMF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PIParamsScl_S8_Curr

 

 

 

 

 

 

 

 

 

 

ZERO CROSSING

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MULTIPLEXER

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 5-2. Main Data Flow — Part 2: Alignment, Starting,

 

 

 

 

 

 

 

 

 

 

 

 

Running Control

 

 

 

 

 

 

 

 

 

Designer Reference Manual

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DRM028 — Rev 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

80

 

 

 

 

 

 

 

Software Design

 

 

 

 

 

 

MOTOROLA

 

 

 

 

 

 

 

 

For More Information On This Product,

 

 

 

 

 

 

 

 

 

 

 

 

Go to: www.freescale.com

 

 

 

Image 80
Contents M68HC08 Freescale Semiconductor, IncFor More Information On This Product Sensorless Bldc Motor Control Using MC68HC908MR32 Designer Reference Manual RevRevision history List of Sections List of Sections Table of Contents Table of Contents List of Figures TitleList of Figures List of Tables List of Tables Contents Benefits of the SolutionIntroduction Application FunctionalityIntroduction System Description System ConceptSystem Description System Specification Software Specification Software written in C language specifications are listedSoftware parameter tuning to a customer motor Software SpecificationsHardware and Drive Specifications High-Voltage Hardware Set SpecificationHigh Voltage Hardware Set Specifications Motor -Brake SetLow-Voltage Hardware Set Specification Low-Voltage Evaluation Hardware Set SpecificationLow Voltage Evaluation Hardware Set Specifications Low Voltage Hardware Set Specifications Bldc Motor Targeted by This Application Bldc Motor ControlBrushless DC Motor Control Theory Semiconductor, Inc Bldc Motor Control Brushless DC Motor Control Theory Bldc Motor Back EMF and Magnetic Flux 2 3-Phase Bldc Power Stage Why Sensorless Control?Power Stage Motor Topology Stator Winding Equations Indirect Back EMF SensingSame expressions can also be found for phase a and B Phase Voltage Waveform Effect of Mutual InductanceMutual Inductance Effect Effect of Mutual Phase Capacitance Detail of Mutual Inductance EffectMutual Capacitance Model 10. Distributed Back-EMF by Unbalanced Capacity Coupling 11. Balanced Capacity Coupling Back-EMF Sensing Circuit Inc Alignment Starting Back-EMF Acquisition Running Used Control TechniqueSensorless Commutation Control 14. Commutation Control Stages Alignment15. Alignment RunningFreescale Semiconductor, Inc Running Commutation Time Calculation Commutation time calculation is shown in FigureService of received back-EMF zero crossing 17. Bldc Commutation Time with Zero Crossing SensingWhere Starting Back-EMF Acquisition Freescale Semiconductor, Inc 18. Vectors of Magnetic Fields 19. Back-EMF at Start Up Computation coefficients are different Starting Commutation Time CalculationRunning Commutation Time Calculation, but the following PC Master Software Application ControlSpeed Control Communication with PC Master Software Specifications PC Master Software Communication CommandsPC Master Software API Variables Name Type Representing Description RangeMotorStatusDef, FailureDef BIT6 ReservedBIT2 Reserved PerSpeedMAXRange and zero crossing period PerZCrosFltT2 SpeedRangeMaxRPM*PerSpeedMAXRange/PerZCrosFltT2Freescale Semiconductor, Inc System Configuration and Documentation Hardware DesignMC68HC908MR32 Control Board For High-Voltage Hardware Set cofigurationFor Low-Voltage Evaluation Motor Hardware Set configuration EVM Motor Board Phase Low Voltage EVM Bldc MotorLow-Voltage Hardware Set configuration Components will describe the individual boardsHigh-Voltage Hardware Set Configuration High-Voltage Hardware System ConfigurationSee References Described in MC68HC908MR32 Control Board User’sManual Motorola document order number Low-Voltage Evaluation Motor Hardware Set Configuration Low-Voltage Evaluation Motor Hardware System ConfigurationLow-Voltage Hardware Set Configuration System configuration for low-voltage hardware set is shownLow-Voltage Hardware System Configuration 1 MC68HC908MR32 Control Board All HW Sets ComponentsReferences 4shows a block diagram of the board’s circuitry Electrical characteristics in -1apply to operation at 25CHigh-Voltage Hardware Set Components Electrical Characteristics of Control Board1 3-Phase AC/BLDC High Voltage Power Stage Phase AC High Voltage Power Stage Electrical Characteristics of Power Stage Optoisolation BoardElectrical Characteristics of the Optoisolation Board Electrical CharacteristicsEVM Motor Board 3 3-phase Bldc High Voltage Motor with Motor BrakeLow-Voltage Evaluation Motor Hardware Set Components Electrical Characteristics of the EVM Motor Board Electrical Characteristics of the EVM Motor Board2 3-phase Low Voltage EVM Bldc Motor Characteristics of the Bldc motor1 3-Ph AC/BLDC Low Voltage Power Stage Low-Voltage Hardware Set ComponentsBlock Diagram 2 3-phase Bldc Low Voltage Motor with Motor Brake SectionData Flow Main Software Flowchart State Diagram Software DesignIntroduction Data FlowSoftware Variables Software Variables and Defined ConstantsImportant system variables are listed in Table Process Measurement Start/Stop Switch Reading and Start/Stop DecisionSys3Def Main Data Flow Part1 Process Fault Control Fault Stop Process Back, EMF Zero Crossing SensingFreescale Semiconductor, Inc Main Data Flow Part 2 Alignment, Starting Process Desired Speed Setting Closed Loop Control SystemProcess Alignment Control Processes Commutation and Zero Crossing Preset and SetBldc Speed Control and Calculation Main Software Flowchart Bldc Commutation and Zero Crossing SelectionMain Software Flowchart Freescale Semiconductor, Inc Main Software Flowchart Main Software Loop Freescale Semiconductor, Inc Freescale Semiconductor, Inc State Diagram Software Flowchart InterruptsApplication State Transitions State diagram for this software is shown in Figure Initialize MCUInitialize Application Stand-ByFreescale Semiconductor, Inc Stand-by State Align State Starting Commutation Time Calculation Freescale Semiconductor, Inc 10. Back-EMF Acquisition Commutation Time Calculation Service of CommutationSet Explained in 5.5.5 Back-EMF Acquisition State Service of Received Back-EMF Zero CrossingRunning State Over Current 11. Running State 12. Stop State Fault State Stop StateImplementation Notes See FigureSoftware Files Software files and structure are described in sectionSet Bldc Commutation and Bemf Zero Crossing Selection Preset Bldc Commutation and Bemf Zero Crossing SelectionBldc Commutation and Zero Crossing Selection Bldc Speed Control and Calculation Desired Speed CalculationPWM Duty Cycle PWMValMax = DUTYPWMMAX*MCPWMMODULUSTimers TimerFunction TIMACh3Int Designer Reference Manual DRM028 Rev 108 Software Design User Guide Application Suitability GuideMinimal Application Speed Motor’s nominal speedMotor Suitability Maximal Application SpeedVoltage Closed Loop Mutual Inductance Designer Reference Manual DRM028 Rev 112 User Guide Hardware setups are shown in -1, -2, Application Hardware and Software ConfigurationHardware Configuration High-Voltage Hardware Set Configuration Low-Voltage Evaluation Motor Hardware Set ConfigurationLow-Voltage Hardware Set Configuration Controller Board Settings Software Setup EVM Board SettingsEVM board settings are the same for all hardware platforms Application HC08 Software Files \bldczerocros08MR32\sources\bldc08.c, main program Application PC Master Software Control Files Execute from Evaluation Board Software ExecutionBuild When the software is built, the S-record file Execute from Pre-programmed MCUBldczerocros08mr32MMDS.sx is generated Application ControlManual Operating Mode PC Master Software Remote Operating ModePC Master Software Control Window For More Information On This Product Tuning for Customer Motor User Guide Tuning for Customer Motor Follow-up for Software Customizing to Customer Motor Follow-up for Advanced Software Customizing To have PC master software installed on your PC computer Start the PC master software parameters tuning application11. PC Master Software Parameters Tuning Control Window Software Parameters Setting Follow-up Labels in the File const.h Software Customizing to Power Stage Parameters File Selection\bldczerocros08MR32\sources\constcustlv.h, definitions for Example of Software Customizing to HardwareRange 0,infinity Voltage Setting Hardware CustomizingCurrent Setting Hardware Customizing Example of Software Customizing to Hardware Modified maximal measurable voltage is 55 V, so setSoftware Customizing to Motor Voltage and Current Settings Maximal and Minimal Voltage Limits SettingDetailed description starts here Range 0,VOLTRANGEMAXMaximal and Minimal Current Limits Setting Range 0,CURRENTRANGEMAXARange 0,8 Alignment Current and Current Regulator SettingCurrent during alignment state before motor starts Α From Evaluation Board Parameters Tuning with PC Master Software Project FileSet constcustx.h 12. PC Master Software Current Parameters Tuning Window Designer Reference Manual DRM028 Rev 142 User Guide MUSTCHANGEEXPERnn in file constcustx.h Commutation Parameters Commutation time period to discharge coil current ∝sStart-up Constants and Maximal Commutation Period Range -128,127 Start-up PeriodMaximal commutation period limit ∝s Alignment Current and Current Regulator Setting 6.5.4.3 Constcustx.hConstcustx.h Set #define Percmtstartus in constcustx.h Ensure Percmtstartus =PERCMTMAXUS /2#define Speedpiregigain Constcustx.h file13. PC Master Software Start Parameters Tuning Window Range 0,255 Software Customizing to Motor Speed Control SettingNumber of commutations per motor revolution Range 0,SPEEDRANGEMAXRPM Maximal speed range rpmMinimal speed of the drive rpm Speedminrpm = 0.07 to 0.5SPEEDMAXRPM User Guide 153 Execute from Evaluation Board Start motor see Application Control and PC Master Software Set PC master software control mode and start motor seeRemote Operating Mode PWM Frequency and Current Sampling Period Setting For the PWM frequency setting, follow the labelPWM frequency setting is provided by PWM FrequencyCurrent Sampling Period PWM Frequency SettingPWM period = Periodpwmus = SETPERPWM*2 EQ Conclusion Software Parameters Setting and Tuning CANCHANGEPERCURSAMPn in const.h filePERCST1US = Periodpwmus * Setpercs ∝s Current Sampling InstantUser Guide 159 Designer Reference Manual DRM028 Rev 160 User Guide Appendix A. References Motor using MC68HC705MC4 document order number AN1627, MotorolaAppendix B. Glossary SG40NGlossary Serial communications interface module SCI a module that Designer Reference Manual DRM028 Rev 166 Glossary Freescale Semiconductor, Inc HOW to Reach US USA/EUROPE/LOCATIONS not Listed