| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
AP0822 additional file Generating sinusoidal Three-Phase-Cur
Top Searches for this datasheetAP082201.EXE available AP0822 additional file Generating sinusoidal Three-Phase-Currents Induction Machines with time-optimized Algorithm Capture Compare Unit C504 This application note proposes time optimized algorithm three-phase induction drive control Siemens microcontroller C504. Three sinewave phase currents easily generated controlled on-chip Capture Compare Unit (CCU), requiring very computing time (about frequency open-loop mode). Authors: Scheibert Seth Hollmann Semiconductor Group 6.97, Rel. Generating sinusoidal three-phase currents with C504 Table Contents: Introduction Fundamentals Operating.4 Controlling Three-Phase Induction Motors Generating Variable Motor Currents Using Pulse Width Modulation (PWM).5 Power Amplification Controller Output Signals Semiconductor Bridges Sinusoidal Weighted Half Bridge Driving with Dead Time Control Principle Generating Sinusoidal Weighted Signals with C504.9 Hardware Description Three-Phase Motor Motor Interface Open Loop Motor Control.13 C504 Controller Software Description.14 Calculation Period- Offset-Values Compare Timer 1.14 Considerations concerning Resolution Sine Table Pointers.14 Changing Amplitude without using Multiplication-Instruction Generating Memory Sine Tables Compare Timer Interrupt Service Routine Tasks.22 Main Program Task.23 Flow-Charts.24 Conclusion AP0822 ApNote Revision History Actual Revision Rel.01 Previous Revison: None Page Page Subjects changes since last release actual Rel. prev. Rel. Original Version Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Introduction Generating three-phase sine wave currents induction machines with microcontrollers requires CPU-time, depending PWM-frequency desired resolution. order minimize CPU-load, Siemens provides C504 microntroller with special peripheral onchip Capture Compare Unit (CCU). With this unit, three independent pulse width modulated output signals generated with minimum CPU-load. This application note introduces algorithm generating three-phase signals, whereby multiplications avoided (see chapter Software With this algorithm, there been realized resolution 7-bit period between different consecutive PWM-values) amplitude resolution 6-bit between 100%. load calculation compare values three phases induction machine within period (20kHz) about which corresponds calculation time. sinewave frequency choosen steps both rotation directions. frequency below output switched avoid feeding DC-current into machine. frequency change desired, second algorithm, also written assembler code, handles acceleration deceleration, which choosen between Hz/sec Hz/sec Hz/sec steps. communication between C504 host realized serial interface (USART). algorithm written language. motor speed (frequency), output amplitude (0.100%, steps) acceleration/deceleration-speed choosen with host C504 software programmed modular CPU-load only percent, additional sw-tasks (e.g. sw.-control algorithms closed-loop system) easily realized. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Fundamentals Operating Controlling Three-Phase Induction Motors Usually, induction machines supplied directly from 50/60Hz three-phase voltage line, where amplitude frequency constant. Diagram Period Time (1/f) Amplitude (120°) Phase Phase Phase Figure Three-Phase Sine Wave Currents Induction Motors Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 With supplying from line, drive cannot regulated simple way. delivered torque speed induction machine determined amplitude frequency driving voltage. Rotation speed shaft strongly depends frequency, torque strongly depends current amplitude. Knowing this, proper working open loop control realized applying three sine waves with constant electrical phase shift 120° each other with variable amplitude frequency. rotor slip (difference between rotor frequency stator frequency) vary function these parameters, difficult regulate exactly rotation speed. many applications, where rotor frequency deviation cents does matter (e.g. fan, driven three-phase induction machine), proposed open loop control cost very powerful solution. Generating Variable Motor Currents Using Pulse Width Modulation (PWM) There different ways generating variable actor currents with microcontroller. generate pulse width modulated rectangle voltage integrate with large time constant, e.g. low-pass filtering. result constant voltage proportional ratio high time (duty cycle) period. application this principle electric motors leads Voltage Motor Integrates Motor Winding Current Figure Variable Current efficiency whole power circuit much higher with switched power transistor drivers than with analog power amplifiers. integrating effect standard motor with high frequency (about 20kHz, which beyond audible range) allows switching patterns, which easily generated Capture Compare Unit (CCU) Siemens C504 8-bit microcontroller. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Power Amplification Controller Output Signals Semiconductor Bridges Each phase motor driven independent half bridge that amplifies controllers output signal. single half bridge consists switching elements (MOSFETs, IGBTs, etc.), which connected shown figure High Side Output Side Figure Single Half Bridge high side transistor switched other turned off, positive supply voltage (+Vb) applied output. side transistor switched high side off, output voltage will negative (-Vb). average output voltage will directly depend duty cycle both transistors activated alternately (push-pull-driving). this microprocessor unit able generate lowfrequent signal shape, e.g. sine wave. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Sinusoidal Weighted Three-phase induction motors need three sinusoidal phase currents with 120° phase shift each other adequate smooth rotating. Therefore, called `sine wave weighted PWM' used this application. phase angle, duty cycle each signal generated function desired sine value. Voltage (High Side) Sinusoidal Phase Current Motor Integrates Voltage (Low Side) Figure Sine Wave Weighted Voltage generates Sinusoidal Phase Current Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Half Bridge Driving with Dead Time Control this application, both transistors half bridge switched alternately (push-pull-driving). average output voltage varied between plus minus rectified line voltage, depending applied duty cycle. However, transistor's switching times must taken into account. order prevent half bridge from conducting short circuit current when transistor already switched other quite switched called between these events must implemented. Half Bridge Switching without Dead Time Control Control Voltage Half Bridge Switching with Dead Time Control Uoff Uoff Transistor Conductance Goff Goff Supply Current Short Circuit! Dead Time Figure Half Bridge Switching with without Dead Time Control Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Principle Generating Sinusoidal Weighted Signals with C504 C504 microcontroller easily programmed provide three independent sine waves using capability on-chip Capture Compare Unit (CCU). center aligned (symmetrical) three channels with dead time generated 16-bit wide compare timer follows: up/down counter counts from programmable 16-bit period value stored special function register (SFR) CCPx. When reaching count direction changed from up-counting down-counting. When becomes count direction will switched upwards again. This similar function triangle generator. Additionally, compare timer over/underflow interrupt requests activated. output signals three phases induction machine specified three compare values stored three independent 16-bit compare registers CCx0/CCx1/CCx2. compare timer oversteps 16-bit compare values three output signals, corresponding outputs toggle compare match interrupts requests three signals activated. result, three digital rectangle signals generated (the duty cycle channel corresponds position compare value between offset period value). switching frequency identical counter underflow frequency (e.g. 20kHz). This signals control high side transistors single half bridges. Furthermore, complementary output signals generated, which control side switches. global programmable dead time each channel, which both switches turned programmed additional 16-bit offset value stored CT1OFx. principle channel shown figure Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 counter value overflow interrupt request Period Value compare match interrupt request Compare Value Offset Value underflow interrupt request Output High Side Signal (Active Low) high Side Signal (Active Low) high Dead Time Figure Principle Signal Generation with Dead Time Once parameters period value, offset value, three compare values start compare timer set, requires access running permanently generating three independent rectangle signals with constant pulse widths. motor sine wave currents, C504 periodically three compare values CCU, that necessary sinusoidal output signals (refer figure after each period. This done corresponding compare timer underflow interrupt service routine. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Hardware Description This application consists four functional units: standard open loop motor control (with Siemens C504 8-bit microcontroller) motor interface three-phase induction motor User Interface Open Loop Control Motor Interface Three Phase Motor Async. Serial Link C504 Digital Signals Three Phase Inverter Three Phases Figure Hardware Block Diagram Open Loop Configuration Three-Phase Motor motor three-phase induction synchronous machine. nominal motor power vary wide range, restricted this application only power capability driver transistors. hard- software this application works with number motor pole pairs. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Motor Interface motor interface consists motor signal amplifier power supply. converter used this application, being adequate drive three-phase motors. It's build three IGBT (insulated gate bipolar transistor) single half bridges, which driven C504 opto couplers. This structure needs link voltage ability generate sine waves with variable frequency. DC-link large capacitor necessary supplying IGBTs 230V 50/60Hz line. capacitor value high enough minimizing ripple, which appears when rectifying line voltage. Additionally, it's impedance buffer switching bridge. DC-Link Capacitor Three Phase Bridge (IGBT's) Line Motor Opto Couplers Udrive Digital Control Signals from C504 (PWM) O1.O6 Figure Simplified Converter Schematic Diagram Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Open Loop Motor Control following block diagram shows digital control unit C504 three-phase motor control. this application following internal peripheral resources used: USART RS232 host computer communication timer baud rate generator (Capture Compare Unit) output timer interrupt generation C504 Microcontroller Settings Bridge: P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 COUT0 Interrupts COUT1 COUT2 High High High Host RS232 P3.0 P3.1 Timer USART Figure Open Loop Motor Control with C504, using Semiconductor Group Data AP08220 06.97 Generating sinusoidal three-phase currents with C504 C504 Software Description Fundamental Considerations most important task C504 generate three sine waves with variable frequency amplitude very short time frames. This chapter describes C504 software basically meets this requirement: Calculation Period- Offset-Values Compare Timer compute period value compare timer conditions have match: First: this application pulse width modulation frequency been choosen fPWM This means that every compare timer generate interrupt. Second: compare registers needs time-dependent different compare values refering desired sine waves (see page page These compare values computed C504 reasonable time, therefore values periodically read from sine table memory which means, that compare values 8-bit. Therefore, period value compare timer offset value should exceed ensure that whole duty-cycle used (see page PERIOD fOSC prescaler kHz2 match both conditions prescaler divide system oscillator signal (The factor necessary because compare timer operates mode up/down counting). With prescaler counter increased every fosc/prescaler With required dead time offset value OFFSET dead time fOSC 1µs40 prescaler Considerations concerning Resolution Sine Table Pointers accessing look-up table values short time, sine table should longer than bytes period because pointer (named angle variable) 8-bit value easily handled 8-bit C504. generate sine waves, angle variable increased every interrupt points value sine table which read moved compare value register. lowest frequency generated angle variable being increased every pointing another compare value sine table, frequency output signal will frequency 78.125 25650 AP08220 06.97 Semiconductor Group Generating sinusoidal three-phase currents with C504 That means lower frequencies pointing same sine table value more than time e.g. about times. best solution this problem take 16-bit pointer angle variable with only high byte being pointer sine table. Supposing 16-bit angle variable will increased every takes 6553650µs access every value table once, that means lowest frequency then results 0.305Hz (which corresponds minimum value 16-bit resolution electrical rotating field induction machine). generate other frequency every 50µs certain delta value added angle variable computed follows: delta frequency frequency65536 frequency6553650µs 0.305 20kHz angle angle delta figure simplified model generation sine wave output signal using above described mechanism shown. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 memory contents (decimal) Memory Sine Table offset value every angle angle delta 8-bit (HB) 8-bit (LB) angle period value compare value x254 x255 memory address (decimal) Pointer 8-bit delta angle output voltage Vmax 50µs time period e.g. =00000010 output time output voltage Vmax signal-shape after pass filter 50µs time Figure Simplified Model Generation Sine Wave Output Signal; Model shows Amplitude adjusted. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Changing Amplitude without using Multiplication-Instruction With 8-bit C504, signed 8-bit 8-bit multiplication takes cycles. This leads relatively long execution time, which cannot tolerated cases. Furthermore, higher resolution shall used, even more computing power needed. proposed algorithm based addition theorem sine waves. used reduce computing time signed multiplication. following equation describes desired three-phase sine waves induction machine: sinB corresponds angle variable high byte, corresponds value sine table multiplied with amplitude corresponds value moved compare register. avoid multiplication, following equation shows solution: sinB cos(arccosA) sinB cosA' sinB [sin( sin( with: arccos [sin(b sin(b (addition theorem) multiplication sinB transfered with addition theorem into operations B-A' B+A' sine table accesses. Figure gives impression equation used. examples addition sine waves shown. first case sine wave have phase shift. second case sine waves 180° phase shifted. this addition, desired amplitude between obtained adapting phase shift between sine waves. factor necessary transfer range 0.1. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 2*sin sin(X+180°) Figure Examples Addition Sine Waves. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 procedure generating sinusoidal frequency works follows: host sends desired amplitude frequency MCU. delta angle variables computed like mentioned above. arccos calculated better taken from look-up table like sine values. Then added substract from angle variable high byte (=B) yielding pointers sine table. Both values table added then divided result (=U) moved compare register directly corresponds amplitude. (Hint: division saved appropriate sine table values, next page). Some considerations about amplitude resolution: angle variable high byte identical covers range 360° with 8-bit 0.255 (memory space sine table). amplitude covers range 0.100% therefore arccos only covers range from 0.90° which fourth 360°. Compared with 0.255, only varies between 0.64 (memory space arccos table) which means resolution amplitude maximum 6-bit. result amplitude resolution 100%/64 1,56%. disadvantage this procedure that memory space sine table amplitude-resolution linked directly. enhance resolution, sine table length extended above 8-bit either pointer part angle variable. pointer with more than more difficult handle with C504 resulting increase CPU-time. other hand, obtained resolution angle amplitude without doubt high enough meet requirements midrange control algorithms induction machines. Increasing resolution will lead unproportional higher load. Better results achieved remaining time used closed-loop current control. proposed 8-bit solution shows interesting compromise between required computing power resolution. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Generating Memory Sine Tables sine table computed sine wave part stored field variable sine_src (include file sine.h). this field range 0°.90° represented memory bytes which means whole sine period would take 1024 bytes space memory 10-bit pointer variable. this application, only byte long sine table desired according pointer, algorithm (function init_sine_tbl) takes only every fourth value generate memory sine table. Additionally, algorithm multiplicates contents every memory place with adds offset value. result, data range compare values within sine table gets resolution 7-bit. These measures made once before microcontroller starts communicate with host save some instructions during time. following equation gives reasons multiplication with 0.5. addition offset value neccesary ensure dead time (see page [sin( sin( sin( sin( finally generated memory sine tables consist bytes, each byte with data range between offset value (dez.). fastest generate three 120° phase shifted sine waves provide three 120° shifted sine tables memory. That means same angle variable points different tables with different values three compare registers CCU. Figure shows generation three sine waves with arccos table three phase-shifted sine tables. procedure executed every within compare timer interrupt service routine takes about calculation time (which corresponds load). Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Arccos Table Angle Pointer these values moved compare registers B-A' B+A' 0.5*sin(B+A') desired amplitude from host e.g. (75%) Sine Table 0.5*sin (B-A') Sine Table Sine Table Figure Generating three Sine Waves with three 120° Phase-Shifted Sine Tables Arccos Table Memory. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Compare Timer Interrupt Service Routine Tasks compare register values updated periodically every compare timer underflow interrupt service routine. This task takes about which corresponds CPU-load. frequency change required, second task started. accelerate decelerate induction machine, electrical rotating field induction machine increased decreased with certain adjustable rate. handle this task, every period (depending desired acceleration deceleration speed), delta value increased decreased until frequency rotating field reached. With regard rotation direction change, frequency decreased down zero. avoid feeding current machine, delta variable observed output switched delta below 1Hz. During acceleration/deceleration task, CPU-load temporally extended every calculation time) period. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Main Program Task C504 main program, first, initializes on-chip peripherals, then, runs endless loop. This loop serves interface between user commands from host compare timer interrupt routine. Figure gives quick survey used command codes affected variables: Command Code 0x80 0x81 0x82 0xC0 0xC1 0xC2 0xC3 0xC4 0xC5 Description send identification byte host send actual frequency host send amplitude host frequency rotation from host frequency CCW* rotation from host amplitude from host acceleration value from host deceleration value from host rotation flag from host Corresponding Variables delta value, rotate power delta value delta value power up_step down_step rotate clockwise counterclockwise Figure Controller Command Codes from Host Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Flow-Charts This chapter shows flow-charts C504 software controlling three-phase induction machine. Figure shows RS232 interrupt service routine, which necessary receiving bytes serial link from host (sending bytes serial link performed directly main program) first part main program flow-chart. Figure contains remaining main program flow-charts. Figure timer interrupt flow-chart found. Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Start RS232 Transmit/ Receive Interrupt Initialize memory sine tabel Clear RS232 Transmit Interrupt RS232 Receive Interr. Initialize RS232 Interface Latch Received Byte Receive Buffer Initialize Capture Compare Unit Clear RS232 Receive Interrupt Initialize Interrupt Handling RS232 Receive Flag RS232 Receive Flag Leave Interrupt Clear RS232 Receive Flag Receive Buffer 0x80 Send Identification Byte 0x5A RS232 Figure Controller Program Flow-Chart Interrupt Service Routine Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Receive Buffer 0x81 Motor Rotation Switched Send Actual Frequency [Hz] RS232 Send 0x00 [Hz] RS232 Receive Buffer 0x82 Wave Generation Enabled Send Power Value RS232 Send 0x00 RS232 Receive Buffer 0xC0 RS232 Receive Flag Clear RS232 Receive Flag Frequency (for Rotating) from Receive Buffer Indicate frequency change Decide acceler. deceler. Receive Buffer 0xC1 RS232 Receive Flag Clear RS232 Receive Flag Frequency Rotating) from Receive Buffer Indicate frequency change Decide acceler. deceler. Receive Buffer 0xC2 RS232 Receive Flag Clear RS232 Receive Flag Power from Receive Buffer fetch corresponding arccos value Figure Controller Program Flow-Chart (continued) Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Receive Buffer 0xC3 RS232 Receive Flag Clear RS232 Receive Flag Acceleretion Value from Receive Buffer Receive Buffer 0xC4 RS232 Receive Flag Clear RS232 Receive Flag Deceleration Value from Receive Buffer Receive Buffer 0xC5 RS232 Receive Flag Clear RS232 Receive Flag Rotation Flag from Receive Buffer Rotate Flag Motor Frequency Figure Controller Program Flow-Chart (continued) Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Compare Timer Interrupt anlge angle delta calculate angle arccos(power) calculate angle arccos(power) load with sine wave values decrement interrupt counter frequency change decrease frequency 15µs interrupt counter 16.17µs increase frequency delta delta_new Decrea. frequency delta delta_new? frequency change finished delta delta up_step frequency change finished delta delta down_step dissable power output 30µs (frequency) enable power output leave interrupt Figure Controller Program Flow-Chart Compare Timer Interrupt Service Routine Semiconductor Group AP08220 06.97 Generating sinusoidal three-phase currents with C504 Conclusion versatile structure on-chip Capture Compare Unit Siemens microcontroller C504 allows easy generation three sine wave currents, dedicated control inductance drives. Thanks time-optimized algorithm, control tasks handled very efficient way, requiring only CPU-computing time. proposed communication protocol (via serial channel) with host shows flexibility combination well known C500 family with powerful Capture Compare Unit. This application note proposes structure dedicated drive control. integrated peripherals C504, very external components necessary, total system costs reduced. implementation this open-loop induction drive control algorithms with load shows first step towards closed-loop control solutions mid-range applications. adapted structure C504 leads very interesting compromise between system costs performance. Semiconductor Group AP08220 06.97 Other recent searchesTL145406 - TL145406 TL145406 Datasheet MC145406 - MC145406 MC145406 Datasheet Si7476DP - Si7476DP Si7476DP Datasheet OPB355 - OPB355 OPB355 Datasheet OPB360 - OPB360 OPB360 Datasheet OPB370 - OPB370 OPB370 Datasheet OPB380 - OPB380 OPB380 Datasheet OPB390 - OPB390 OPB390 Datasheet OPB859 - OPB859 OPB859 Datasheet OPB860 - OPB860 OPB860 Datasheet OPB870 - OPB870 OPB870 Datasheet OPB880 - OPB880 OPB880 Datasheet OPB890 - OPB890 OPB890 Datasheet ICS552-01 - ICS552-01 ICS552-01 Datasheet F1500NC - F1500NC F1500NC Datasheet DIP14 - DIP14 DIP14 Datasheet AN4099 - AN4099 AN4099 Datasheet A278308A - A278308A A278308A Datasheet 8m052724 - 8m052724 8m052724 Datasheet
Privacy Policy | Disclaimer |