| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
3-Phase Sensorless Motor Control using DSP56F80x Design Motor Con
Top Searches for this datasheetOrder AN1932/D (Motorola Order Number) Rev. 9/02 3-Phase Sensorless Motor Control using DSP56F80x Design Motor Control Application Based Motorola Software Development Radim Visinka Contents Introduction. Motorola DSP: Advantages Features Target Motor Theory. Switched Reluctance Motor. Mathematical Description Motor Digital Control Motor Voltage Current Control Motors Introduction Techniques Sensorless Control Motors This Application Note describes design sensorless 3-Phase (Switched Reluctance) motor drive. based Motorola's DSP56F80x family dedicated motor control devices. software design takes advantage (Software Development Kit) developed Motorola. motors gaining wider popularity among variable speed drives. This their simple low-cost construction characterized absence magnets rotor winding, high level performance over wide range speeds, fault tolerant power stage design. Availability moderate cost necessary electronic components make drives viable alternative other commonly used motors like BLDC, Synchronous universal motors numerous applications. concept this application that sensorless speed closed loop drive with inner current loop using flux linkage position estimation. change phase resistance during motor operation temperature dependency creates errors position estimation significantly affects performance drive. Therefore, novel algorithm on-the-fly estimation phase resistance included. This application demonstrates sensorless motor drive serves example system design using Motorola with support. also illustrates usage dedicated motor control libraries that included SDK. application helps start development sensorless drive dedicated targeted application. Sensorless Position Estimation using Flux Linkage Estimation Flux Linkage Calculation Discrete Time Domain. Sensorless On-the-fly Resistance Estimation. System Design System Outline. Application Description Hardware Implementation Hardware Setup. Motor-Brake Specifications Software Design. Data Flow. State Diagram Software Design. Implementation Notes. Scaling Quantities. Velocity Calculation Implementation Drivers Library Functions Appconfig.h File Initialization Drivers. Interrupts Master Software Usage References. Motorola, Inc., 2002. rights reserved. More Information This Product, www.freescale.com 3-Phase Sensorless Motor Control Motorola DSP: Advantages Features This Application Note includes description Motorola features, basic motor theory, system design concept, hardware implementation, software design including master software visualization tool. Motorola DSP: Advantages Features Motorola DSP56F80x family well suited digital motor control, combining DSP's computational ability with MCU's controller features single chip. These DSPs offer many dedicated peripherals like Pulse Width Modulation (PWM) unit, Analog-to-Digital Converter (ADC), timers, communications peripherals (SCI, SPI, CAN), on-board Flash RAM. Generally, family members well-suited Switched Reluctance motor control. typical member family, DSP56F805, provides following peripheral blocks: Pulse Width Modulator modules (PWMA PWMB), each with outputs, three Current Sense inputs, four Fault inputs; fault tolerant design with dead time insertion; supports both center- edge-aligned modes Twelve-bit, Analog-to-Digital Converters (ADCs), supporting simultaneous conversions with dual 4-pin multiplexed inputs; synchronized Quadrature Decoders (Quad Dec0 Quad Dec1), each with four inputs, additional Quad Timers dedicated General Purpose Quad Timers totaling pins: Timer with pins Timer with pins Module with 2-pin ports used transmit receive Serial Communication Interfaces (SCI0 SCI1), each with pins, four additional GPIO lines Serial Peripheral Interface (SPI), with configurable 4-pin port, four additional GPIO lines Computer Operating Properly (COP) Watchdog Timer dedicated external interrupt pins Fourteen dedicated General Purpose (GPIO) pins, multiplexed GPIO pins external reset hardware reset JTAG/On-Chip Emulation (OnCE) software-programmable, phase lock loop-based frequency synthesizer core clock Table 2-1. Memory Configuration DSP56F801 Program Flash Data Flash Program Data Boot Flash 8188 16-bit 16-bit 16-bit 16-bit 16-bit DSP56F803 32252 16-bit 16-bit 16-bit 16-bit 16-bit DSP56F805 32252 16-bit 16-bit 16-bit 16-bit 16-bit DSP56F807 61436 16-bit 16-bit 16-bit 16-bit 16-bit 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Motorola DSP: Advantages Features From switched reluctance motor control point view, most interesting peripherals fast Analog-to-Digital Converter (ADC) Pulse-Width-Modulation (PWM) on-chip modules. They offer freedom configuration, enabling efficient sensorless control motors. module incorporates generator, enabling generation control signals motor power stage. module following features: Three complementary signal pairs, independent signals Complementary channel operation Deadtime insertion Separate bottom pulse width correction current status inputs software Separate bottom polarity control Edge- center-aligned signals bits resolution Integral reload rates from with half-cycle reload capability Individual software-controlled output Programmable fault protection Polarity control 20-mA current sink capability pins Write-protectable registers motor control application utilizes module independent mode, permitting fully independent generation control signals switches power stage. addition generators, outputs controlled separately software, allowing setting control signal logical Thus, state control signals changed instantly given rotor position (phase commutation) without changing contents value registers. This change made asynchronously with duty cycle update. Analog-to-Digital Converter (ADC) consists digital control module analog sample hold (S/H) circuits. following features: 12-bit resolution Maximum clock frequency with 200ns period Single conversion time clock cycles (8.5 1.7µs) Additional conversion time clock cycles 1.2µs) Eight conversions 26.5 clock cycles (26.5 5.3µs) using simultaneous mode synchronized SYNC signal Simultaneous sequential sampling Internal multiplexer select eight inputs Ability sequentially scan store eight measurements Ability simultaneously sample hold inputs Optional interrupts scan, zero crossing out-of-range limit exceeded Optional sample correction subtracting pre-programmed offset value Signed unsigned result Single-ended differential inputs MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Target Motor Theory application utilizes on-chip module simultaneous mode sequential scan. sampling synchronized with pulses precise sampling reconstruction phase currents. Such configuration allows instant conversion desired analog values phase currents, voltages temperatures. Target Motor Theory Switched Reluctance Motor Switched Reluctance (SR) motor rotating electric machine where both stator rotor have salient poles. stator winding comprised coils, each which wound pole. rotor created from lamination order minimize eddy-current losses. motors differ number phases wound stator. Each them certain number suitable combinations stator rotor poles. Figure illustrates typical 3-Phase motor with (stator/rotor) pole configuration. Phase Phase Phase Stator poles) Stator Winding Rotor poles) Aligned Position Phase Figure 3-1. 3-Phase Motor motor excited sequence current pulses applied each phase. individual phases consequently excited, forcing motor rotate. current pulses need applied respective phase exact rotor position relative excited phase. When pair rotor poles exactly line with stator poles selected phase, phase said aligned position, i.e., rotor position maximal stator inductance (see Figure 3-1). interpolar axis rotor line with stator poles selected phase, phase said unaligned position, i.e., rotor position minimal stator inductance. inductance profile motors triangular shaped, with maximum inductance when aligned position minimum 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Target Motor Theory inductance when unaligned. Figure illustrates idealized triangular-like inductance profile three phases motor with phase highlighted. individual Phases shifted electrically 120o relative each other. When respective phase powered, interval called dwell angle dwell. defined turn-on turn-off angles. When voltage applied stator phase, motor creates torque direction increasing inductance. When phase energized minimum inductance position, rotor moves forthcoming position maximal inductance. movement defined magnetization characteristics motor. typical current profile constant phase voltage shown Figure 3-2. constant phase voltage phase current maximum position when inductance starts increase. This corresponds position where rotor stator poles start overlap. When phase turned off, phase current falls zero. phase current present region decreasing inductance generates negative torque. torque generated motor controlled applied phase voltage appropriate definition switching turn-on turn-off angles. more details, [5]. apparent from description, motor requires position feedback motor phase commutation. many cases, this requirement addressed using position sensors, like encoders, Hall sensors, etc. result that implementation mechanical sensors increases costs decreases system reliability. Traditionally, developers motion control products have attempted lower system costs reducing number sensors. variety algorithms sensorless control have been developed, most which involve evaluation variation magnetic circuit parameters that dependent rotor position. 6WDWRU 3KDVH 5RWRU $OLJQHG 8QDOLJQHG $OLJQHG LSK$ SRVLWLRQ WLPH SKDVH HQHUJL]LQJ GZHOO RQBSK$ RIIBSK$ SRVLWLRQ WLPH Figure 3-2. Phase Energizing MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Target Motor Theory motor itself cost machine simple construction. Since high-speed operation possible, motor suitable high speed applications, like vacuum cleaners, fans, white goods, etc. discussed above, disadvantage motor need shaft-position information proper switching individual phases. Also, motor structure causes noise torque ripple. greater number poles, smoother torque ripple, motor construction control electronics become more expensive. Torque ripple also reduced advanced control techniques such phase current profiling. Mathematical Description Motor motor highly non-linear system, non-linear theory describing behavior motor developed. Based this theory, mathematical model created. hand enables simulation motor systems other hand, makes development implementation sophisticated algorithms controlling motor easier. electromagnetic circuit motor characterized non-linear magnetization. Figure illustrates magnetization characteristic specific motor [1]. function between magnetic flux phase current motor position influence phase current mostly apparent aligned position, where saturation effects observed. magnetization characteristic curve defines non-linearity motor. torque generated motor phase function magnetic flux, therefore phase torque constant constant phase current different motor positions. This creates torque ripple noise motor. Figure 3-3. Magnetization Characteristics Motor mathematical model motor developed. model based electrical diagram motor, incorporating phase resistance phase inductance [1]. diagram phase illustrated Figure 3-4. 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Target Motor Theory Figure 3-4. Electrical Diagram Motor Phase According diagram, voltage applied phase motor described voltage drops phase resistance induced voltages phase inductance: where: uLph applied phase voltage phase resistance phase current induced voltage phase inductance 3-1.) equation 3-1.) supposes that phases independent have mutual influence. induced voltage uLph defined magnetic flux linkage that function phase current rotor position induced voltage expressed Then phase voltage expressed 3-2.) 3-3.) where: 3-4.) electrical speed motor. MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Target Motor Theory torque generated phase expressed 3-5.) mathematical model motor then represented system equations, describing conversion electromechanical energy. 3-Phase motors equation 3-4.) expanded follows: 3-6.) where index individual phases. 3-7.) 3-8.) Digital Control Motor motor driven voltage strokes coupled with given rotor position. profile phase current together with magnetization characteristics define generated torque thus speed motor. this fact, motor requires electronic control operation. Several power stage topologies being implemented, according number motor phases desired control algorithm. particular structure power stage structure defines freedom control individual phase. power stage with independent power switches motor phase most used topology. Such power stage 3-Phase motors illustrated Figure 3-5. enables control individual phases fully independent each other thus permits widest freedom control. Other power stage topologies share some power devices several phases, thus saving power stage cost, with these phases cannot fully independently controlled. Note that this particular topology power stage fault tolerant contrast power stages induction motors because eliminates possibility rail-to-rail short circuit. During normal operation, electromagnetic flux motor constant must built every stroke. motoring period, these strokes correspond rotor position when rotor poles approaching corresponding stator pole excited phase. case Phase shown Figure 3-1, stroke established activating switches low-speed operation Pulse Width Modulation (PWM), applied corresponding switches, modulates voltage level. basic switching techniques applied: Soft switching where transistor left turned-on during whole commutation period applied other Hard switching where applied both transistors simultaneously 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Target Motor Theory Voltage PWM_Q1 PWM_Q3 PWM_Q5 Phase Phase Phase PWM_Q2 PWM_Q4 PWM_Q6 Figure 3-5. 3-Phase Power Stage Figure illustrates both soft hard switching techniques. control signals upper lower switches above-described power stage define phase voltage thus phase current. soft switching technique generates lower current ripple compared hard switching technique. Also, produces lower acoustic noise less EMI. Therefore, soft switching techniques often preferred motoring operation. more details, [5]. MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Target Motor Theory Vhyvtrq 6yvtrq Vhyvtrq 6yvtrq Dqphpr 6RIW 6ZLWFKLQJ +DUG 6ZLWFKLQJ Figure 3-6. Soft Switching Hard Switching Voltage Current Control Motors number control techniques motors exist. They differ structure control algorithm position evaluation. basic techniques controlling motors distinguished, according motor variables that being controlled: Voltage control where phase voltage controlled variable Current control where phase current controlled variable 3.4.1 Voltage Control Motor voltage control techniques, voltage applied motor phases constant during complete sampling period speed control loop. commutation phases linked position rotor. voltage applied phase directly controlled speed controller. speed controller processes speed error difference between desired speed actual speed generates desired phase voltage. phase voltage defined duty cycle implemented DC-Bus voltage inverter. phase voltage constant during complete dwell angle. 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Target Motor Theory technique illustrated Figure 3-7. current voltage profiles seen Figure 3-8. phase current peak position when inductance starts increase (stator rotor poles start overlap) change inductance profile. 3RZHU 6WDJH &RQWUROOHU GHVLUHG HUURU 6SHHG &RQWUROOHU 2XWSXW 'XW\ &\FOH *HQHUDWRU DFWXDO Figure 3-7. Voltage Control Technique SKDVH FXUUHQW GHFD\V WKURXJK EDFN GLRGHV SRVLWLRQ WLPH 8'&%XV SRVLWLRQ WLPH 6SHHG &RQWUROOHU 2XWSXW '&%XV Figure 3-8. Voltage Control Technique Voltage Current Profiles MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Target Motor Theory 3.4.2 Current Control Motor current control techniques voltage applied motor phases modulated reach desired current powered phase. most applications, desired current constant during complete sampling period speed control loop. commutation phases linked position rotor. voltage applied phase controlled current controller with external speed control loop. speed controller processes speed error difference between desired speed actual speed generates desired phase current. current controller evaluates difference between actual desired phase current calculates appropriate duty cycle. phase voltage defined duty cycle implemented DC-Bus voltage inverter. Thus, phase voltage modulated rate current control loop. This technique illustrated Figure 3-9. processing current controller needs linked commutation phases. When phase turned (commutated), duty cycle 100% applied phase. increasing actual phase current regularly compared desired current. soon actual current slightly exceeds desired current, current controller turned current controller controls output duty cycle until phase turned (following commutation). procedure repeated each commutation cycle motor. current voltage profiles seen Figure 3-10. ideal cases phase current controlled follow desired current. 3RZHU 6WDJH &RQWUROOHU GHVLUHG HUURU 6SHHG &RQWUROOHU LGHVLUHG LHUURU 2XWSXW 'XW\ &\FOH &XUUHQW &RQWUROOHU *HQHUDWRU DFWXDO LDFWXDO Figure 3-9. Current Control Technique 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Target Motor Theory LGHVLUHG SKDVH FXUUHQW GHFD\V WKURXJK EDFN GLRGHV 8'&%XV SRVLWLRQ WLPH SRVLWLRQ WLPH &XUUHQW &RQWUROOHU 2XWSXW '&%XV Figure 3-10. Current Control Technique Voltage Current Profiles 3.4.3 Calculation Turn-On Angle individual phases motor need turned such position that phase current able rise desired level. basic condition specifies that phase current needs achieve least desired level position where stator rotor phases start overlap. After overlap position, phase current starts decrease positive change inductance. phase turned late, phase current able reach desired level commutation stroke. turn-on position needs determined according applied phase voltage, actual motor speed inductance profile motor. phase turned position minimal inductance, inductance considered constant until position where stator rotor poles start overlap. constant inductance, phase current considered linearly rising. Then time required achieve desired current determined from 3-3.) desired phase where: 3-9.) required time achieve desired current unaligned inductance idesired desired current achieved MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Techniques Sensorless Control Motors uDC_Bus DC-Bus voltage duty cycle electrical angle corresponding time required reach desired current determined actual where: actual actual speed. 3-10.) Techniques Sensorless Control Motors Sensorless Position Estimation using Flux Linkage Estimation flux linkage estimation method belongs among most popular sensorless position estimation techniques. number methods that flux linkage calculation have been developed [4], [6]. These methods calculate actual phase flux linkage relation reference flux linkage position estimation. method implemented this application based comparison estimated flux linkage reference flux linkage, defined turn-off (commutation) position. When estimated flux linkage reaches desired reference flux linkage indicates that commutation position reached. actual phase turned following phase turned reference flux linkage derived from magnetization characteristic function phase current desired commutation position (see Figure 4-1). UHIBDFWXDO UHILSKDVH FRQVW ,SKDVHBDFWXDO LSKDVH Figure 4-1. Reference Magnetization Curve Constant Position 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Techniques Sensorless Control Motors order simplify determination reference flux linkage, assume that constant current, flux linkage rises linearly interval between unaligned aligned positions. This assumption considered region expected commutation. Then reference flux linkage derived from flux linkage aligned position Aligned 4-1.) where k(off) linear function corresponding commutation angle. reach value interval corresponds unaligned position, corresponds aligned position). reference magnetization curve (iph) aligned position Aligned stored controller memory. estimated flux linkage turned-on phase calculated using following equation: where: 4-2.) voltage applied motor phase (coil) winding actual phase current phase resistance flux linkage estimation starts when phase turned simultaneously sampled phase current phase voltage measured periodically predetermined intervals flux linkage estimated. Each time flux linkage calculated, compared with reference level taken from reference magnetization curve function actual phase current. When estimated flux linkage exceeds reference flux linkage, indicates that switching position been reached commutation performed. method illustrated Figure 4-2. R.iph =off ref(iph), const Magnetization Curve Figure 4-2. Position Estimation using Reference Flux Linkage Function advantage flux linkage estimation methods that they usable over wide speed ranges, from start-up high speeds. position accurately estimated phase resistance determined correctly. Four-quadrant operation possible. MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Techniques Sensorless Control Motors main disadvantage these methods that estimation flux linkage based precise knowledge phase resistance. phase resistance varies significantly with temperature which yields unwanted integration errors, especially speed. integration error creates significant position estimation error. Note that powerful DSP-based controllers (like DSP56F80x) easily perform needed calculations sensorless flux linkage algorithm. Flux Linkage Calculation Discrete Time Domain introduced algorithm flux linkage estimation used both analog digital controllers. Digital control preferred today reasons cost, flexibility performance. digital systems, flux linkage calculation based 4-2.) needs converted discrete time domain. flux linkage estimation performed regularly sampling frequency measurements phase voltage phase current. Equation 4-2.) converted where: 4-3.) sampling period sampled phase voltage sampled phase current sampled phase resistance calculated flux linkage sample flux linkage calculated regularly each sampling cycle from beginning commutation stroke (t1). sampling period constant. Equation 4-3.) transformed following form: where: calculated flux linkage previous measuring cycle (N-1). 4-4.) order decrease computational requirements, equation 4-4.) transferred 4-5.) instead pure flux linkage, flux linkage divided sampling period calculated. Because sampling period kept constant, division considered scaling factor. proper functionality position estimation algorithm, reference flux linkage scaled same way. Sensorless On-the-fly Resistance Estimation resistance phase winding most decisive factors magnetic flux linkage estimation 4-2.). During motor operation, variation resistance exceed nominal value because phase resistance depends strongly temperature. effect phase 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Techniques Sensorless Control Motors resistance drift more significant low- middle-speed ranges, where voltage drop winding comparable phase supply voltage uph. This variation causes inaccurate estimation flux linkage, hence generates position estimation errors and, based such magnetic flux estimations, sensorless techniques give satisfactory results. Therefore, case accurate robust sensorless control algorithm, actual value winding resistance must accurately measured estimated during motor operation. order improve behavior sensorless flux linkage estimation algorithm, on-the-fly phase resistance estimator been invented. resistance estimation algorithm patented 6,366,865 Patent Office [3]. development phase resistance estimation based flux linkage estimator 4-2.). flux linkage estimator calculates flux linkage time using following formula: Where: 4-6.) voltage applied motor phase (coil) winding phase current assumed phase winding resistance time when motor phase winding starts energized assumed phase winding resistance actual phase winding resistance resistance error resistance error caused temperature drift, inaccurately obtained value, etc. 4-7.) Figure illustrates flux linkage waveforms calculated flux linkage estimator during typical working cycle phase motor. Unlike sensorless flux linkage estimation method, where flux linkage calculated phase commutation angle off, flux linkage calculated whole time during which current flowing through phase. phase current shape flux linkage defined control strategy, rotor position, magnetization characteristic. motors driven that motor phases energized sequentially phase current therefore rises from zero, beginning cycle where phase turned off, where phase disconnected then falls down zero again cycle (t2). seen, flux linkage rises during interval between turn-on (t1) turn-off angles phase. When phase turned off, flux linkage decreases until phase current disappears. parameters 4-6.) obtained correctly, resistance error zero, then flux linkage equal zero seen Figure 4-3. influence resistance error, let's assume that: 4-8.) phase voltage phase current were measured correctly measurement error ignored MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Techniques Sensorless Control Motors resistance error equal zero, affects estimation flux linkage. Because flux estimation result integration (see Figure 4-3), total flux estimation error working cycle (t2) quite significant. WLPH SRVLWLRQ WLPH SRVLWLRQ Figure 4-3. Flux Linkage Phase Current resistance estimation algorithm based fact that phase current zero, then magnetic flux must zero well. Resistance error leads flux estimation error (see Figure 4-3). Thus, enables calculate flux estimation error point time (t2) when phase current falls zero. phEstim Error 4-9.) Because flux linkage time equal zero 4-8.), estimation error equal phEstim Error 4-10.) Based equation 4-10, apparent that flux linkage estimation error positive, resistance error negative; flux linkage estimation error negative, resistance error positive. Error( Error( 4-11.) 4-12.) 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA System Design assume that rate change phase resistance small during commutation motor (this valid temperature drift): Using above assumption, equation 4-10.) rewritten following: 4-13.) EstErr 4-14.) Then resistance error expressed EstErr 4-15.) Equation 4-15 illustrates that resistance error expressed ratio between calculated flux linkage error time where phase current decreases zero, integral phase current, both which calculated over complete phase current pulse. More details this algorithm found [2]. System Design System Outline This system designed drive 3-Phase motor. application meets following performance specifications: Sensorless speed control motor using flux linkage estimation technique with inner-current closed loop Targeted DSP56F803EVM, DSP56F805EVM, DSP56F807EVM Running 3-Phase Motor Control Development Platform variable line voltage between 115V 230V (voltage range -15% +10%) control technique incorporates: current control with speed-closed loop phase resistance measurement during start-up phase resistance estimation speeds motor starts from position with rotor alignment direction rotation motoring mode minimal speed maximal speed 2600RPM input power line 230V maximal speed 1600RPM input power line 115V MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com System Design Encoder position reference evaluation position estimation visualized master software (not used control technique) Manual interface (start/stop switch, up/down push button control, indicator) master software control interface (motor start/stop, speed set-up) master software monitor graphical control page (required speed, actual motor speed, operational mode PC/manual, start/stop status, drive fault status, DC-Bus voltage level, identified power stage boards, system status) speed scope (observes actual desired speeds desired current) start-up recorder (observes start-up phase current, flux linkage, output duty cycle encoder position reference with fine resolution) flux linkage recorder (observes phase current, estimated flux linkage, reference flux linkage encoder position reference with fine resolution) current controller recorder (observes actual desired phase current, output duty cycle encoder position reference with fine resolution) Power stage identification DC-Bus over-voltage, DC-Bus under-voltage, DC-Bus over-current over-heating fault protection Application Description 5.2.1 Application Concept drive, standard system concept chosen (see Figure 5-1). system incorporates following hardware parts: 3-Phase high-voltage development platform (power stage with optoisolation board, motor with attached brake) Feedback sensors: DC-Bus voltage, DC-Bus current, phase currents, temperature DSP56F80x controller runs main control algorithm. generates 3-Phase output signals motor power stage according user interface input feedback signals. drive controlled different ways operational modes): Manual operational mode, required speed Start/Stop switch Down push buttons. master software operational mode, required speed master software. 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA System Design 3-phase Power Stage Line DC-Bus Voltage Phase Current Temperature LOAD DSP56F80x START STOP Req. Speed Speed Ramp Desired Speed Speed Error Speed Controller Desired Current Current Error Current Controller Duty Cycle Fault Protection Generation Commutation DOWN DC-Bus Voltage Commutation Angle Calculation Commut. Angle Phase Current Remote Control Comparator DC-Bus Voltage Estim. Flux Flux Linkage Resistance Estimation Refer. Flux Reference Flux Linkage Calculation Commut. Angle Actual Current Actual Speed Speed Calculation Commutation Figure 5-1. System Concept After RESET drive initialized automatically enters MANUAL operational mode. Note, master software only take over control when motor stopped. When Start command detected (using Start/Stop switch master software button "Start") while fault pending, application started. Rotor position evaluated using sensorless flux linkage estimation algorithm. actual flux linkage calculated rate frequency compared with reference flux linkage given commutation angle. commutation angle calculated according desired speed, desired current actual DC-Bus voltage. When actual flux linkage exceeds reference, commutation phases desired direction rotation done; actual phase turned following phase turned Flux linkage error used estimation phase resistance speeds Patent No.: 6,366,865). actual speed motor determined using commutation instances. reference speed calculated according control signals (start/stop switch, up/down push buttons) master software commands (when controlled master software). acceleration/deceleration ramp implemented. comparison between reference speed measured speed gives speed error. Based speed error, speed controller generates desired phase current. When phase commutated, turned with duty cycle 100%. Then, during each cycle, actual phase current compared with desired current. soon actual current exceeds MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com System Design desired current, current controller turned current controller controls output duty cycle until phase turned (following commutation). Finally, 3-Phase control signals generated. procedure repeated each commutation cycle motor. DC-Bus voltage, DC-Bus current, power stage temperature measured during control process. measurements used DC-Bus over-voltage, DC-Bus under-voltage, DC-Bus over-current over-temperature protection drive. DC-Bus under-voltage over-temperature protection performed software, while DC-Bus over-current DC-Bus over-voltage fault signals utilize Fault inputs on-chip module. line voltage measured during initialization application. According detected level, 115VAC 230VAC mains recognized. line voltage detected outside -15% +10% nominal voltage, fault "Out Mains Limit" disables drive operation. above mentioned faults occur, motor control outputs disabled order protect drive. fault status only exited when fault conditions have disappeared Start/Stop switch moved STOP position. fault state indicated on-board LED. power stage uses unique configuration power devices, different than BLDC configuration. software would cause destruction BLDC power stages simultaneous switching power devices. Since application software could accidentally loaded into BLDC drive, software incorporates protection feature prevent this. Each power stage contains simple module which generates logic signal sequence that unique that type power stage. During initialization chip, this sequence read evaluated according decoding table. correct power stage identified, "Wrong Power Stage" fault disables drive operation. 5.2.2 Initialization Start-Up Before motor started, rotor alignment initialization control algorithms must performed (see Figure 5-2). Initialization control algorithm includes measurement actual start-up phase resistance. First, rotor needs aligned known position able start motor desired direction rotation. This done following steps: phases (Phases turned simultaneously After 50msec phase (Phase turned off, other phase (Phase stays powered After additional msec, rotor stabilized enough aligned position with respect powered phase (Phase Step provides initial impulse rotor. Phase exactly unaligned position thus does generate torque, Phase provides initial movement. Then, Phase disconnected Phase stays powered (Step stabilization pulse Phase must long enough stabilize rotor aligned position with respect that phase. 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA System Design Start Command Accepted Turn Phases Rotor Position Wait Ensure Initial Pulse Turn Phase Wait 550msec Rotor Stabilized Measure Phase Resistance Average Measurements Phase Aligned Commutate Phases (Turn Phase Turn Phase Motor Starts Figure 5-2. Start-Up Sequence MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com System Design When rotor stabilized known position, measurement phase resistance powered phase performed. Phase resistance calculated from measured phase current iph, DC-Bus voltage UDC-Bus applied duty cycle assumed that resistance three phases identical. phase resistance calculated UDCBus 5-1.) total, stabilization resistance measurement take sec. After this time, rotor stable enough reliably start motor desired direction rotation. When phase resistance been measured, motor started commutation phases (turning stabilization Phase applying power start-up Phase This starting sequence followed every start-up motor because neither initial rotor position actual phase resistance known. 5.2.3 Commutation Algorithm Resistance Estimation core control algorithm includes calculation commutation angle, flux linkage, reference flux, commutation phases estimation phase resistance. Calculation commutation angle calculation performed regularly during motor operation according 3-9.) 3-10.). Flux linkage estimated during complete current stroke powered phase, from moment phase turned until moment phase current disappears. serves both position estimation (determination commutation instance) resistance estimation. Commutation motor phases based comparison actual estimated flux linkage reference flux linkage required commutation angle (see Section 4.1). Phase resistance estimated according flux linkage error, which captured moment phase current disappears (see Section 4.3). detailed block diagram control algorithm shown Figure 5-3. control process starts moment given phase turned either during start-up (after rotor aligned commutated. When phase turned (on), phase current phase voltage measured simultaneously center pulses. phase current, iph, measured directly using phase current sensing circuitry with noise elimination implemented, while phase voltage, uph, calculated according measured DC-Bus voltage actual duty cycle DCBus 5-2.) measured phase current DC-Bus voltage used calculating actual flux linkage actual 4-5.). 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA System Design Turn-on Phase (Commutate) Measure iph, Calculate Calculate actual DFWLYH LDFWLYH WLPH actual Commutate Phases Calc. Commutation Angle actual discharge GLVFKDUJH LGLVFKDUJH WLPH Measure idischarge, Calculate discharge idischarge Capture error Filter error HUURU LGLVFKDUJH WLPH error_filtered Decrease Increase Figure 5-3. Control Flow Diagram MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com System Design reference flux linkage given commutation angle function phase current iph, f(iph ,off reference flux linkage characteristic aligned position needs derived from motor magnetization characteristic. Such characteristic tested motor shown Figure 5-4. Compare with Figure 4-1. which illustrates general magnetization curve. seen, measured characteristic linear work linear part magnetization characteristic. other positions, reference flux linkage calculated according 4-1.). 0.50 0.40 Flux Linkage [Frac16] 0.30 0.20 0.10 0.00 0.000 0.200 0.400 0.600 0.800 1.000 Phase Current [Frac16] Figure 5-4. Flux Linkage Function Phase Current Aligned Position estimated flux linkage actual compared with reference flux linkage ref. estimated value lower than reference value, estimation continues regularly sampling frequency. When estimated value reaches reference value, this indicates that desired position achieved. that moment, commutation phases performed powered phase turned following phase, direction rotation, turned flux linkage calculation determining following commutation event starts again initial values zero. When phase turned off, phase current starts decrease phase discharged. flux linkage discharge continues calculated regularly rate sampling period (PWM frequency) during phase current discharge. discharge phase current idischarge monitored. soon phase current approaches zero, flux linkage error Error captured. flux linkage error corresponds phase resistance error used flux linkage calculation. flux linkage error then filtered through several samples order eliminate calculation, measurement, noise error. filtered value used evaluation phase resistance according 4-11.) 4-12.). filtered flux linkage error greater than zero, estimated phase resistance increased small amount (0.1%). opposite case, estimated phase resistance decreased small amount (0.1%). corrected resistance value then used during next flux linkage estimation process. this way, phase resistance tracked throughout operation. 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA System Design 5.2.4 Current Voltage Measurement Precise phase current DC-Bus voltage measurement factor implementation sensorless flux linkage estimation. inaccuracy measurement leads flux linkage estimation error thus position estimation error resistance estimation error. 5.2.4.1 Current Sensing Current measurement needs investigated according current sensors used influence noise measurement. quality current measurement depends heavily type current sensors used. most useful Hall effect sensors. Unfortunately, these sensors expensive thus suitable most cost-sensitive applications. Therefore, current shunt resistors inserted into current path phase often used (see Figure 5-5). phase current sensed voltage drop across sense resistor. Voltage PWM_T1 Phase PWM_T2 sense V_ref 1.65V Figure 5-5. Shunt Resistors Current Sensors When power switches' soft switching used (the lower switch left during complete commutation period, while upper switch modulated PWM), current visible shunt resistor time. soft switching phase current, measured shunt resistor, shown Figure 5-6. phase current visible only when both switches turned (the phase current flows through switches sensing resistor) when both switches turned (phase current flows through freewheeling diodes sensing resistor). When both switches phase turned measured current negative, needs inverted. diagram shows that reliable current shape reconstruction, sensing needs synchronized with frequency center pulse both positive negative voltage drop polarities should measured. zero current half range, both positive MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com R_sense sense System Design negative voltage drops phase current shunt resistors measured. voltage drop then amplified according range. Proceeding like this, current read with accuracy credibility. Figure illustrates actual phase currents 3-Phase motor, measured shunt resistors described above. Switch (T1) Time Bottom Switch (T2) Time Actual Phase Current Time Sensed Voltage Drop Time Synchronization Figure 5-6. Soft Switching Current Shunt Resistors 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA System Design Current Sensing Phase Current Phase Phase Phase 0.01 0.02 0.03 0.04 0.05 -0.2 -0.4 -0.6 -0.8 Time [sec] Figure 5-7. Phase Current Measured Current Shunt Resistors cost shunt resistor sensors bring serious issue. low-voltage drop sensed across shunt current resistors, measured signals susceptible noise. Based assumption that same noise induced simultaneously measured signals, technique noise elimination been developed successfully implemented. method supposes measurement signals simultaneously known signal reference) signal measured. Then reference signal consists known signal noise, while measured signal consists actual signal same noise. MeasuredSignal ActualSignal Noise ReferenceSignal KnownSignal Noise 5-1.) 5-2.) noise same, eliminated subtraction reference signal from measured signal. described above, necessary condition simultaneous sampling both signals, ensuring that noise both signals identical. ActualSignal MeasuredSignal (ReferenceSignal KnownSignal) 5-3.) This technique been implemented phase current sensing. motor controlled which phases commutated sequentially, which means that working phase turned off, following phase, direction rotation, turned Thus phase motor never MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com System Design powered during complete commutation interval. This phase considered reference. Because reference phase powered, reference phase current should equal zero. measured value reference current then considered noise given commutation interval. actual phase current equal difference between measured current reference current: Imeasured Ireference 5-4.) reference signal needs commutated together with commutation phases. Table defines active, discharge reference phases commutation sequence derived from Figure 5-7. Table 5-1. Commutation Sequence Reference Phase Step Active Phase Discharge Phase Reference Phase efficiency current sensing noise reduction technique illustrated Figure 5-8. figures illustrate phase current measured (the active phase current inverted compared Figure 5-7), same current with implemented noise reduction technique. seen, implemented technique improves current sensing significantly. eliminates only noise current sensors, also noise induced sensing cables noise reference power supply. Thus, position estimation resistance evaluation improved well. 5.2.4.2 Voltage Sensing DC-Bus voltage sensor represented simple voltage divider. DC-Bus voltage does change rapidly. nearly constant with ripple given power supply structure. bridge rectifier rectification line voltage used, ripple frequency times line frequency.If power stage designed correctly, ripple amplitude should exceed nominal DC-Bus value. measured DC-Bus voltage needs filtered order eliminate noise. most useful techniques moving average filter that calculates average value from last samples: DCBus uDCBus 5-1.) order increase precision voltage sensing, voltage drop power switches diodes power stage incorporated into determination actual voltage present motor phase. 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA System Design -0.1 active corrected discharge corrected current 0.01 0.02 time [sec] 0.03 0.04 0.05 -0.1 active discharge current 0.01 0.02 time [sec] 0.03 0.04 0.05 Figure 5-8. Measured 3-Phase Currents without Noise Correction with Noise Correction Implemented MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Hardware Implementation 5.2.5 Power Module Temperature Sensing measured power module temperature used thermal protection hardware realization shown Figure 5-9. circuit consists four diodes connected series, bias resistor, noise suppression capacitor. four diodes have combined temperature coefficient mV/C. resulting signal, Temp_sense, back input where software used safe operating limits. presented application, temperature degrees Celsius calculated according conversion equation: Temp_sense temp where: temp Temp_sense power module temperature degrees Celsius voltage drop diodes which measured diode-dependent conversion constant -0.0073738) diode-dependent conversion constant 2.4596) 5-2.) +3.3V_A 2.2k BAV99LT1 BAV99LT1 100nF Figure 5-9. Temperature Sensor Topology Hardware Implementation Hardware Setup already stated, application runs Motorola motor control DSPs using boards dedicated 3-Phase high-voltage platform. application controlled following Motorola motor control DSPs: DSP56F803 DSP56F805 DSP56F807 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Hardware Implementation Application hardware setup shown Figure 6-1. system hardware setup particular varies only Board used. application software identical DSPs. chip differences handled off-chip drivers particular board. Detailed application setup found document Targeting_DSP5680x_Platform that part documentation [14]. Dedicated User's Manuals describe individual boards detail. User's Manuals incorporate schematic board, description individual function blocks bill materials board. individual boards ordered from Motorola standard products. Descriptions mentioned boards documents found http://www.motorola.com/ system parts supplied documented according following references: Controller Board DSP56F803: supplied DSP56803EVM described DSP56F803EVMUM/D Evaluation Module Hardware User's Manual [11] Controller Board DSP56F805: supplied DSP56805EVM described DSP56F805EVMUM/D Evaluation Module Hardware User's Manual [12] Controller Board DSP56F807: supplied DSP56807EVM described DSP56F807EVMUM/D Evaluation Module Hardware User's Manual [13] 3-Phase High-Voltage Power Stage supplied with Optoisolation Board ECOPTHIVSR described MEMC3PSRHVPSUM/D Motorola Embedded Motion Control 3-Phase High-Voltage Power Stage User's Manual [16] Optoisolation Board (not supposed final application) supplied 3-ph. High Voltage Power Stage ECOPTHIVSR supplied separately ECOPT optoisolation board described MEMCOBUM/D Optoisolation Board User's Manual [15] Motor-Brake SR40V SG40N supplied ECMTRHIVSR Warning: optoisolation (optocouplers optoisolation amplifiers) strongly recommended during development avoid electric shock damage development equipment. MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com !W98 Hardware Implementation Figure 6-1. 3-Phase High-Voltage Platform Configuration phiyr phiyr &RQWUROOHU %RDUG 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA +LJK 9ROWDJH 3RZHU 6WDJH (&+,965 2SWRLVRODWLRQ %RDUG (&237 '63[(90 Quhr Xuvr 7yhpx White1 White2 Red1 Red2 Black1 Black2 0RWRU%UDNH 9TQ$%A'" 9TQ$%A'$ 9TQ$%A'& (&237+,965 8yyr 9TQ$%A'" 9TQ$%A'$ 9TQ$%A'& White @pqr Black (&075+,965 Hardware Implementation Motor-Brake Specifications Motor Brake incorporates 3-Phase Motor attached BLDC motor brake. detailed specifications listed Table 6-1. motor stator poles four rotor poles. This combination yields strokes pulses) single mechanical revolution. motor characterized dedicated inductance profile. motor inductance profile function mechanical position shown Figure 6-2. mechanical angle 90omech corresponds electrical period stroke. presented profile used determination reference flux linkage using simulations. motor brake shaft, position encoder position Hall sensor attached. They allow position sensing required control algorithm. introduced sensorless drive does these sensors control algorithm. encoder signals just used evaluation sensorless technique. Table 6-1. Motor Brake Specifications Manufacturer eMotor Type: Stator Rotor Poles: Motor Specification: Speed Range: Nominal Voltage: Nominal Current: Brake Type Brake Specification: Nominal Voltage: Nominal Current: Type Position Encoder Brno, Czech Republic SR40V (3-Phase Motor) 5000 300V 1.2A SG40N 3-Phase BLDC Motor Baumer Electric 16.05A 1024-12-5 1024 Pulses Revolution MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Software Design Inductance mechanical angle [deg] Phase Phase Phase Figure 6-2. Inductance Characteristic Software Design Control algorithm data flow State diagram Software implementation This section describes design software blocks drive. software will described terms Data Flow control algorithm closed loop drive described Figure Figure 7-2. based system description. individual processes described detail following sections. 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Software Design SPEED SETTING Interface 2.nd page omega_required_mech omega_reqPCM_mech time_captured Acceleration Ramp Filter Speed Calculation omega_desired omega_actual Speed Controller 2.nd page 2.nd page I_desired I_active 2.nd page Current Controller &srmCmtData outputDutyCycle 2.nd page Generation Outputs Pwm_AT Pwm_AB Pwm_BT Pwm_BB Pwm_CT Pwm_CB Figure 7-1. System Data Flow Speed Current Control MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Software Design DC-Bus Voltage (A/D Converter) 3-PHASE CURRENTS (A/D Converter) &SrmCmtData 1st. page Correction Current omega_actual u_dc_bus i_active i_discharge 1st. page Commutation Angle Calculation theta_commutation outputDutyCycle Reference Flux Linkage Calculation Flux Linkage Estimation psi_T_reference psi_T_active r_phase_actual psi_T_error Flux Linkage Comparator Commutation Resistance Estimation Estimation &srmCmtData time_captured Resistance initialization during motor start 1st. page 1st. page Figure 7-2. System Data Flow Commutation 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Software Design 7.1.1 Acceleration Ramp This process calculates desired speed based required speed according acceleration deceleration ramp. required speed either manually, using push buttons (when manual operational mode), master software (when master software operational mode). 7.1.2 Filter Speed Calculation process calculates actual speed motor. calculation based evaluation time between commutation instances. Each time commutation performed, actual time captured. process reads time between sequential commutation events calculates actual motor speed accordingly. software moving average filter applied speed measurement incorporated into process greater noise immunity. actual motor speed calculated average value last four measurements. 7.1.3 Speed Controller This process calculates desired phase current according speed error. Speed error difference between actual speed desired speed. Proportional-Integrational (PI) type controller implemented. constants speed controller tuned experimentally according load profile speed limits. 7.1.4 Current Controller This process calculates duty cycle based phase current error. Phase current error difference between actual phase current desired phase current. type controller implemented. current controller constants tuned experimentally according type motor used. 7.1.5 Generation This process sets on-chip module generation control pulses 3-Phase motor power stage. Generation these pulses based software control register that formulated process Commutation Calculation based required duty cycle generated Speed Controller process. calculated software control word loaded into proper register duty cycle updated according required duty cycle. Generation process accessed regularly rate given frequency. frequent enough ensure precise generation commutation pulses. 7.1.6 Correction Current This process takes care Analog-to-Digital Converter. sampling synchronized pulses. process selects proper channels converted reads processes results conversion. active discharge phase currents selected corrected using measured reference noise signal. DC-Bus voltage temperature filtered using moving average filter. Section 5.2.4 Current Voltage Measurement detailed description. MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Software Design 7.1.7 Flux Linkage Estimation This process calculates actual flux linkage. calculation active flux linkage started with each commutation phases. Flux linkage error captured current pulse further used phase resistance estimation (see Section 5.2.3 Section 4.2). 7.1.8 Commutation Angle Calculation This process calculates commutation angle according actual speed, DC-Bus voltage, desired current (see Section 5.2.3). 7.1.9 Reference Flux Linkage Calculation This process calculates reference flux linkage according stored characteristic (iphase) aligned position. process requires commutation angle actual phase current determination reference flux linkage (see Section 5.2.3). 7.1.10 Flux Linkage Comparator Commutation This process compares reference flux linkage active flux linkage determine commutation events. When actual flux linkage exceeds reference, commutation performed (see Section 5.2.3). Also, actual time captured used actual speed calculation. on-chip module used mode generation independent output signals that controlled either software module. commutation technique distinguishes three following cases: When output needs modulated, generator controls channel directly When output needs switched inactive state (0), software output control corresponding channel handed over channel turned manually When output needs switched active state (1), software output control corresponding channel handed over channel turned manually on-chip module enables control outputs from module either generator, using software. Setting output control enable bit, OUTCTLx, enables software drive outputs instead generator. independent mode, with OUTCTLx output OUTx controls PWMx channel. Setting clearing OUTx activates deactivates PWMx output. OUTCTLx OUTx bits output control register. This control technique requires preparation output control register. calculation OUTCTLx OUTx bits output control register, dedicated commutation algorithm, 3-Phase Motor Commutation Handler Configuration 2-Switches-per-Phase, srmcmt3ph2spp, developed. algorithm generates output control word according desired action desired direction rotation. example, when Phase needs turned off, algorithm sets corresponding OUTCTLx bits enable output control required PWMs clears OUTx bits turn PWMs. other output control register bits affected. detailed description algorithm found motor control library. 7.1.11 Resistance Estimation This process evaluates flux linkage estimation error phase current stroke estimates actual phase resistance (see Section 5.2.3). 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Software Design State Diagram processes described above implemented single state machine, illustrated Figure 7-3. state machine provides transition among application states INIT, STOP, RUN, FAULT. following variables used invoke transition between individual states: switchState (Stop, Run): state Start/Stop switch appFault (NO_FAULT, fault): fault occurrence appOpMode (change from Manual vice versa): change operational mode 5(6(7 ,1,7 6WDWH VZLWFK6WDWH 6WRS DSS2S0RGH FKDQJH DSS)DXOW 12B)$8/7 6WRS VZLWFK6WDWH DSS)DXOW 12B)$8/7 )$8/7 6WDWH 6723 6WDWH DSS)DXOW 12B)$8/7 VZLWFK6WDWH VZLWFK6WDWH DSS)DXOW DSS)DXOW 6WRS 12B)$8/7 DSS)DXOW 12B)$8/7 12B)$8/7 6WDWH Figure 7-3. Application State Diagram 7.2.1 Application State INIT After RESET application enters INIT state. this state, drive disabled motor cannot started. fault detected, application transits FAULT state (protection against faults). fault present, Start/Stop switch detected STOP position, application transits STOP state (protection against start after reset Start/Stop switch accidentally START position). MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Software Design 7.2.2 Application State STOP STOP state entered either from INIT state from state. STOP state, drive enabled application waits START command. When application STOP state, operational mode changed either from MANUAL mode master software mode vice versa. When operational mode changed, application always transits INIT state. fault STOP state detected, application enters FAULT state (fault protection). fault present start command accepted, application transits state motor started. 7.2.3 Application State state entered from STOP state. state drive enabled motor running. fault state detected, application enters FAULT state (fault protection). fault present stop command accepted application transits STOP state motor stopped. 7.2.4 Application State FAULT STOP state entered from state. FAULT state, drive disabled application waits faults cleared. When detected that fault been eliminated, fault clear command accepted (the Start/Stop switch moved stop position), then application transits INIT state. Software Design general software diagram incorporates: Main routine entered from Reset, Interrupt Service Routines (ISR). diagram illustrated Figure 7-4. After Reset, Main routine provides board identification, initialization DSP, initialization application, then enters infinite background loop. background loop contains Fault Detection, Application State Machine, scheduler routine. scheduler routine provides timing sequence tasks called Timeout Timeout Timeout Timeout flags periodically predetermined intervals Conversion Completed ISR. scheduler utilizes these flags calls required routines: routine Timeout provides user interface, calculates required speed, start-up routines, speed ramp (acceleration/deceleration) routine Timeout calculates Speed Controller Resistance Estimator 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Software Design Interrupt Service Routines Conversion Completed Interrupt RESET Interrupt Handlers done Initialize Application done Background Tasks Fault Interrupt Fault Detection Fault Interrupt Handler done Interrupt Application State Machine done Timeout Interrupt Handler done timeout Timeout done Timeout done done Timeout IRQ0, IRQ1 Interrupt Timeout Push Buttons Interrupt Handlers done Figure 7-4. Software Design General Overview MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Software Design Timeout Timeout tasks performed state, instead interrupt routines, order reduce time avoid software bottlenecks. following interrupt service routines utilized: Conversion Completed services provides control tasks linked event; synchronized with pulses. Fault services faults invoked external hardware fault services master software communication Push Button services Push Button Push Button Down services Down Push Button 7.3.1 Initialization After Reset, initialization performed. beginning initialization, interrupts disabled; initialization they enabled. initialization: Disable interrupts Identify power stage board identify High-Voltage Initialize on-chip module: center-aligned independent mode, positive polarity modulus frequency 16kHz interrupt reload each pulse FAULT2 (DC-Bus over-current fault) manual mode, interrupt enabled FAULT1 (DC-Bus over-voltage fault) manual mode, interrupt enabled associate interrupt with Fault events Initialize on-chip module triggered simultaneously associate interrupt with conversion completed event sample ADC_A: sample ADC_A: sample ADC_A: sample ADC_B: sample ADC_B: sample ADC_B: count Prescaler Initialize Quad Timer on-chip module (position reference visualization using master software) count Quadrature Decoder input count repeatedly Current Phase DC-Bus Voltage Temperature Current Phase Current Phase void Initialize Quad Timer on-chip module (speed measurement) 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Software Design Initialize Quadrature Decoder on-chip module (position reference master software) digital filter input signals connect Quadrature Decoder signals Quad TimerA1 Initialize brake driver Initialize driver Initialize push buttons push buttons interrupts IRQ0, IRQ1 Initialize switch driver switch driver used DSP56F805EVM DSP56F807EVM Application initialization: individual application parameters their initial values Start conversion Measure offset individual current sensors Measure DC-Bus voltage temperature Calculate application parameters according DC-Bus voltage Initialize Quad Timer driver (ADC-PWM Synchronization) synchronization delay enable Quad Timer started first SYNC driver initialization synchronization enable 8-sample conversion Initialize variables motor start-up according start-up phase Enable interrupts 7.3.2 Fault Detection Fault Detection routinely checks application faults. fault occurs, disables outputs sets application FAULT status. Note that case over-current over-voltage faults, outputs disabled directly internal module fault protection (see Section 7.3.7). 7.3.3 Application State Machine Application State Machine provides transition between individual states application: INIT, STOP, RUN, FAULT. reference, Section 7.2. 7.3.4 Scheduler Timeout This routine accessed from main scheduler period Timeout msec). following tasks then performed: Push button filter debounces push button switching noise Start/Stop switch filter debounces Start/Stop switch noise MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Software Design According operational mode, desired speed calculated manual mode according push buttons master software control mode, according master command Start-up routine performed required start-up switching pattern generated. detailed description refer Section 5.2.2. Speed command calculated using acceleration deceleration ramp using desired speed setup controlled according state drive. indicate STOP state, state FAULT state. 7.3.5 Scheduler Timeout This state accessed from main scheduler period Timeout (2.5 msec). following tasks then performed: Speed controller calculates desired phase current according actual desired speed. speed controller constants determined experimentally during initialization chip. Resistance estimator estimates phase resistance according flux linkage estimation error 7.3.6 Conversion Completed Conversion Completed most critical routine most demanding processor's time. Most application control processes need linked with this ISR. Analog-to-Digital converter initiated synchronously with reload pulse (center pulse). scans three phase currents, voltage temperature once. When conversion finalized, Completed called. routine provides following services calculations: Reads time speed calculation reference Reads conversion results (phase currents, DC-Bus voltage, temperature) Calculates offsets phase currents Calculates reference actual flux linkage determines commutation Current controller calculates output duty cycle according desired actual phase currents Provides commutation when required Provides speed measurement Records selected recorder variables master software) Loads registers Calculates references software timers Timer1 Timer2 Enables next synchronization trigger 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Implementation Notes 7.3.7 Fault Fault highest priority interrupt implemented software. case DC-Bus over-current DC-Bus over-voltage fault detection, external hardware circuit generates fault signal, that detected Fault input DSP. signal disables motor control outputs order protect power stage generates Fault interrupt, where fault condition handled. routine records corresponding fault source fault status register. 7.3.8 This interrupt handler provides communication master software service routines. These routines fully independent motor control tasks. 7.3.9 Push Button UP/Down Push Button Interrupt Handlers take care push button service. Button Interrupt Handler sets Button flag, Down Button Interrupt Handler sets Down Button flag. desired speed incremented/decremented according debounced Up/Down button flag. Implementation Notes Scaling Quantities motor control application uses fractional representation real quantities except time. N-bit signed fractional format represented using 1.[N-1] format sign bit, fractional bits). Signed fractional numbers (SF) following range: +1.0 8-1.) words long-word signed fractions, most negative number that represented -1.0, whose internal representation $8000 $80000000, respectively. most positive word $7FFF 2-15, most positive long-word $7FFFFFFF 2-31. following equation shows relationship between real fractional representations: Real Value Fractional Value -Real quantity range where: Fractional Value fractional representation real value [Frac16] Real Value real value quantity RPM, etc.] 8-2.) Real quantity range maximal range quantity, defined application RPM, etc.] MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Implementation Notes 8.1.1 Voltage Scaling application voltages scaled maximal measured voltage. DC-Bus voltage scaling equation following: VDC_BUS u_dc_bus Where: u_dc_bus scaled variable DC-Bus voltage [Frac16] VDC_BUS measured DC-Bus voltage VMAX maximal measurable DC-Bus voltage 8-3.) application, VMAX 407V high voltage platform. other application voltage variables scaled same (active phase voltage u_active, discharge phase voltage u_discharge, DC-Bus under-voltage limit, start-up voltage). 8.1.2 Phase Current Scaling application phase currents scaled maximal measured phase current. active phase current scaling equation following: active i_active phase_max Where: i_active scaled variable active phase current [Frac16] iactive measured active phase current iphase_max maximal measurable phase current application, iphase_max 5.86A high-voltage platform. 8-4.) other application phase current variables scaled same (desired current i_desired, discharge current i_discharge, current offsets i_phase_A_offset, i_phase_B_offset, i_phase_C_offset). 8.1.3 Phase Resistance Scaling There general scaling resistance. order decrease calculation requirements, application phase resistance scaled according scaling measured voltage phase current. actual phase resistance, scaling equation following: phase_actual r_phase_actual phase_max 8-5.) 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Implementation Notes Where: r_phase_actual scaled variable actual phase resistance [Frac16] Rphase_actual measured actual phase resistance uMAX maximal measurable DC-Bus voltage iphase_max maximal measurable phase current application, uMAX/iphase_max 407V/5.86A 69.4 other application resistance variables scaled same (resistance sample, r_phase_sample). 8.1.4 Phase Inductance Scaling There general scaling inductance. order decrease calculation requirements, application phase inductance scaled according scaling measured voltage phase current. unaligned phase inductance, scaling equation following: unaligned L_unaligned phase_max Where: L_unaligned scaled variable unaligned phase inductance [Frac16] Lunaligned unaligned phase inductance uMAX max. measurable DC-Bus voltage iphase_max max. measurable phase current application, uMAX iphase_max 407V/5.86A 69.4V/. 8-6.) 8.1.5 Flux Linkage Scaling application phase linkage calculated flux linkage divided sampling period 4-5.). 16-bit phase flux increments (uk-rk*ik) summed 32-bit flux linkage variable (N/T). integration output overflow more than 65,536 samples calculated. sampling period defined frequency 16kHz. application: 1/16000 62.5*10-6sec. 32-bit flux linkage, psi_T_active_sum, further scaled 16-bit variable psi_T_active. psi_T_active psi_T_active_sum Where: psi_T_active scaled variable active flux linkage [Frac16] psi_T_active_sum scaled variable active flux linkage [Frac32]. 8-7.) other application 16-bit flux linkage variables scaled same (flux linkage error, psi_T_error, reference flux linkage, psi_T_reference, delta flux linkage, psi_T_delta) MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Implementation Notes 8.1.6 Electrical Angle Scaling application electrical angle scaled electrical angle aligned position (see Figure 8-1). electrical commutation angle scaling equation following: commutation_el theta_commutation_el Where: 8-8.) theta_commutation_el scaled variable electrical commutation angle [Frac16] commutation_el desired commutation angle [oel] application, aligned_el 180oel other application electrical angle variables scaled same (delta theta required phase current reach desired current, theta_delta_el, theta where stator rotor poles start overlap, theta_start_to_overlap_el). start_to_overlap -180 aligned position Figure 8-1. Electrical Angle Definition 8.1.7 Speed Scaling Speed scaled maximal speed drive. desired start-up speed, scaling equation following: start_up omega_desired_startup Where: omega_desired_startup scaled variable desired start-up speed [Frac16] start-up desired start-up speed [RPM] maximal speed drive [RPM] 8-9.) application, 3000 RPM. 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Implementation Notes other application speed variables scaled same (actual speed, omega_actual_mech, speed limits, omega_reqMAX_mech omega_reqMIN_mech, push button speed increment, omega_increment_pb). 8.1.8 Duty Cycle Scaling duty cycle scaled maximal duty cycle drive. output duty cycle, scaling equation following: duty_cycle output output_duty_cycle -duty_cycle Where: output_duty_cycle scaled variable output duty cycle [Frac16] duty_cucleoutput desired output duty cycle duty_cycleMAX max. applicable duty cycle application, duty_cycleMAX 100% 8-10.) other application duty cycles scaled same (high duty cycle limits speed controller, start output duty cycle outputDutyCycleStartup). Velocity Calculation actual speed motor calculated from time, TimeCaptured, captured on-chip Quad Timer between following edges position Hall sensors. actual speed, OmegaActual calculated according following equation: SpeedCalcConst OmegaActual -TimeCaptured where: OmegaActual actual speed [RPM] 8-11.) TimeCaptured time, terms number timer pulses, captured between edges position sensor SpeedCalcConst constant defining relationship between actual speed number captured pulses between edges position sensor constant SpeedCalcConst calculated SpeedCalcConst where: SpeedMin -SpeedMax 8-12.) SpeedMin minimal measured speed [RPM] SpeedMax maximal measured speed [RPM] MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Implementation Minimal measured speed, SpeedMin, given configuration sensors parameters on-chip timer used speed measurement. calculated NoPulsesPerRev SpeedMin Presc BusClockFreq where: 8-13.) NoPulsesPerRev number sensed pulses position sensor single revolution Presc prescaler Quad Timer used speed measurements BusClockFreq Clock Frequency [Hz] Maximal measured speed, SpeedMax, selected SpeedMax SpeedMin where: integer constant greater than Then speed calculation constant determined 8-14.) SpeedCalcConst BusClockFreq -NoPulsesPerRev Presc SpeedMax application: NoPulsesPerRev Hall sensor pulses revolution motor Presc BusClockFreq 36*106 SpeedMax 3000 Then, SpeedCalcConst [rev-1] 8-15.) Implementation Motorola Embedded collection APIs, libraries, services, rules guidelines. This software infrastructure designed DSP5680x software developers create high-level, efficient, portable code. application code available SDK. This chapter describes motor control application written under SDK. Drivers Library Functions sensorless motor control application uses following drivers: driver Quad Timer driver Quadrature Decoder driver driver 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Implementation driver driver master software driver Switch driver (only DSP56F805EVM DSP56F807EVM) Brake driver drivers included bsp.lib library. motor control application uses following library functions: srmcmt3ph2spp motor commutation algorithm; srm.lib library) controller (standard controller, mcfunc.lib library) switchcontrol (switch control, mcfunc.lib library) boardId (board identification, bsp.lib library) phasefluxestimation (phase flux linkage estimation, mcfunc.lib library) Appconfig.h File purpose appconfig.h file provide mechanism overwriting default configuration settings which defined config.h file. There appconfig.h files. first appconfig.h file dedicated External (.\ConfigExtRam directory) second dedicated FLASH memory (.\ConfigFlash directory). case sensorless motor control application, both files identical with following exceptions: appconfig.h ExtRAM target contains master software recorder buffer 25000 samples long, while appconfig.h Flash target contains master software recorder buffer only samples long. This limited memory size. appconfig.h DSP56F805EVM DSP56F807EVM contains definition switch driver, while appconfig.h DSP56F803EVM does not. appconfig.h file divided into sections. first section defines which components libraries included application, second part overwrites standard settings components during their initialization. Initialization Drivers Each peripheral chip board accessible through driver. driver initialization used peripherals described this chapter. detailed description drivers document, Embedded Targeting Motorola DSP5680x Platform. following steps required driver: Include driver support appconfig.h Fill configuration structure application code specific drivers (depends driver type) Initialize configuration setting appconfig.h specific drivers (depends driver type) Call open (create) function Access individual driver functions provided ioctl function call. MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Implementation Interrupts serves interrupt routine calls automatically clears interrupt flags. user defines callback functions called during interrupts. callback functions assigned during driver initialization open(). Callback function assignment defined item initialization structure, which used parameter open()function. Some drivers define callback function appconfig.h file. Master Software master software designed provide application debugging, diagnostic, demonstration tools development algorithms applications. runs connected with RS232 serial cable. small program resident communicates with master software parse commands, return status information process control information from master software, executing uses part Microsoft Internet Explorer user interface master software part Motorola Embedded selectively installed during installation. enable master software operation target board application, following lines must added appconfig.h file: #define INCLUDE_SCI #define INCLUDE_PCMASTER support master software support automatically includes driver installs necessary services. default baud rate communication 9600Bd. automatically master software driver changed needed. detailed description master software provided dedicated User's Manual [19]. 3-Phase Sensorless Motor Control utilizes master software remote control from enables user Take over control master software Start/stop control motor speed Required actual motor speeds Application operational mode Start/stop status Drive fault status Identified power stage boards Identified voltage level System status Variables read master software displayed user are: Profiles required actual speeds together with desired phase current seen Speed Scope window. courses quickly changing variables, like phase current flux linkage profiles, observed Recorder windows. Recorder ONLY used when application running from External limited on-chip memory. length recorded window 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA Implementation "Recorder Properties" bookmark "Main" "Recorded Samples". dedicated memory space defined appconfig.h file ExtRAM target. Recorder samples taken each 64.5 µsec, rate frequency. following records captured: Start-up Recorder captures: Desired Phase Current Active Phase Current Reference Flux Linkage Active Flux Linkage Output Duty Cycle Encoder Position Reference Start-up Recorder initiated only with motor starting. Flux Linkage Recorder captures: Active Phase Current Discharge Phase Current Active Flux Linkage Discharge Flux Linkage Reference Flux Linkage Encoder Position Reference Flux Linkage Recorder initiated time during motor run. Current Controller Recorder captures: Desired Phase Current Active Phase Current Output Duty Cycle Encoder Position Reference Current Controller Recorder initiated time during motor run. MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Usage Usage Table 10-1 shows much memory needed 3-Phase drive sensorless drive based flux linkage estimation algorithm. recorder buffer master software zero. majority memory still available other tasks. Table 10-1. FLASH Memory Usage SDK2.4 CW4.1 Memory 16-bit Words) Program FLASH Data FLASH Available DSP56F803 DSP56F805 Available DSP56F807 Used Application Stack 11526 stack Used Application without master software, 7746 stack Program Data 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA References References following materials were used produce this paper: Chalupa, Pohon spinanym reluktancnim motorem, Master's Thesis, FEI-VUT BRNO, UPVE, 1994 Chalupa, Visinka, On-Fly Phase Resistance Estimation Switched Reluctance Motor Sensorless based Control Techniques, Conference Power Conversion Intelligent Motion, Nurnberg, PCIM, 2000 Motorola, Apparatus Method Estimating Coil Resistance Electric Motor, Chalupa, Visinka, Patent, 6,366,865, 2002-04-02 Gallegos-Lopez, Sensorless Low-Cost Method Switched Reluctance Motor Drives, University Glasgow SPEED Laboratory, 1997 Miller, T.J.E., Switched Reluctance Motors Their Control, Magna Physics Publishing Clarendon Press, ISBN 0-19-859387-2, 1993 Lyons, J.P., MacMinn, S.R., Preston, Flux/Current Methods Rotor Position Estimation, Proc. IEEE-IAS'91, 1991 3-Phase Motor Control with Hall Sensors using DSP56F80x, AN1912/D, Motorola, 2000 CodeWarrior Motorola DSP56800 Embedded Systems, CWDSP56800, Metrowerks, 2001 DSP56F800 16-bit Digital Signal Processor, Family Manual, DSP56F800FM/D, Motorola, 2001 [10] DSP56F80x 16-bit Digital Signal Processor, User's Manual, DSP56F801-7UM/D, Motorola, 2001 [11] DSP56F803 Evaluation Module Hardware User's Manual, DSP56F803EVMUM/D, Motorola, 2001 [12] DSP56F805 Evaluation Module Hardware User's Manual, DSP56F805EVMUM/D, Motorola, 2001 [13] DSP56F807 Evaluation Module Hardware User's Manual, DSP56F807EVMUM/D, Motorola, 2001 [14] Embedded Software Development 56800/56800E, MSW3SDK000AA, available Motorola page, Motorola, 2001 [15] Motorola Embedded Motion Optoisolation Board User's Manual, MEMCOBUM/D, Motorola, 2000 [16] Motorola Embedded Motion Control 3-Phase Switched Reluctance High-Voltage Power Stage User's Manual, MEMC3PSRHVPSUM/D, Motorola, 2000 [17] Motorola Embedded Motion Control 3-Phase Switched Reluctance Low-Voltage Power Stage User's Manual, MEMC3PSRLVPSUM/D, Motorola, 2000 [18] Motorola page: http://www.motorola.com/ [19] User's Manual master software, included documentation, Motorola, 2001 MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com References 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com MOTOROLA References MOTOROLA 3-Phase Sensorless Motor Control More Information This Product, www.freescale.com Motorola reserves right make changes without further notice products herein. Motorola makes warranty, representation guarantee regarding suitability products particular purpose, does Motorola assume liability arising application product circuit, specifically disclaims liability, including without limitation consequential incidental damages. "Typical" parameters which provided Motorola data sheets and/or specifications vary different applications actual performance vary over time. operating parameters, including "Typicals" must validated each customer application customer's technical experts. Motorola does convey license under patent rights rights others. Motorola products designed, intended, authorized components systems intended surgical implant into body, other applications intended support sustain life, other application which failure Motorola product could create situation where personal injury death occur. Should Buyer purchase Motorola products such unintended unauthorized application, Buyer shall indemnify hold Motorola officers, employees, subsidiaries, affiliates, distributors harmless against claims, costs, damages, expenses, reasonable attorney fees arising directly indirectly, claim personal injury death associated with such unintended unauthorized use, even such claim alleges that Motorola negligent regarding design manufacture part. Motorola Stylized Logo registered trademarks Motorola, Inc. Motorola, Inc. Equal Opportunity/Affirmative Action Employer. MOTOROLA Stylized Logo registered Patent Trademark Office. other product service names property their respective owners. Motorola, Inc. 2002. reach USA/EUROPE/Locations Listed: Motorola Literature Distribution; P.O. 5405, Denver, Colorado 80217. 1-303-675-2140 1-800-441-2447 JAPAN: Motorola Japan Ltd.; SPS, Technical Information Center, 3-20-1, Minami-Azabu. Minato-ku, Tokyo 106-8573 Japan. 81-3-3440-3569 ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd.; Silicon Harbour Centre, King Street, Industrial Estate, N.T., Hong Kong. 852-26668334 Technical Information Center: 1-800-521-6274 HOME PAGE: AN1932/D More Information This Product, www.freescale.com Other recent searchesSR22E - SR22E SR22E Datasheet SR26E - SR26E SR26E Datasheet PT5810 - PT5810 PT5810 Datasheet ICS950805 - ICS950805 ICS950805 Datasheet DD100 - DD100 DD100 Datasheet CHA2394 - CHA2394 CHA2394 Datasheet AN595 - AN595 AN595 Datasheet ADA1107 - ADA1107 ADA1107 Datasheet 74VCXH162373 - 74VCXH162373 74VCXH162373 Datasheet
Privacy Policy | Disclaimer |