22
Never stop thinking. Microcontrollers Application Note, V 1.0, Sep. 2005 XC866 Constant V/f Control of Induction Motors Using Space Vector Modulation AP0801701

ap0801710_XC866

Embed Size (px)

Citation preview

Page 1: ap0801710_XC866

N e v e r s t o p t h i n k i n g .

Microcontrol lers

Appl icat ion Note, V 1.0, Sep. 2005

XC866Constant V/f Control of Induct ion Motors Using Space Vector Modulat ion

AP0801701

Page 2: ap0801710_XC866

XC866 Revision History: 2005-09 V 1.0Previous Version: -Page Subjects (major changes since last revision)

We Listen to Your CommentsAny information within this document that you feel is wrong, unclear or missing at all? Your feedback will help us to continuously improve the quality of this document. Please send your proposal (including a reference to this document) to:[email protected]

Page 3: ap0801710_XC866

Edition 2006-05-03

Published by Infineon Technologies AG 81726 München, Germany

© Infineon Technologies AG 2006. All Rights Reserved.

LEGAL DISCLAIMER THE INFORMATION GIVEN IN THIS APPLICATION NOTE IS GIVEN AS A HINT FOR THE IMPLEMENTATION OF THE INFINEON TECHNOLOGIES COMPONENT ONLY AND SHALL NOT BE REGARDED AS ANY DESCRIPTION OR WARRANTY OF A CERTAIN FUNCTIONALITY, CONDITION OR QUALITY OF THE INFINEON TECHNOLOGIES COMPONENT. THE RECIPIENT OF THIS APPLICATION NOTE MUST VERIFY ANY FUNCTION DESCRIBED HEREIN IN THE REAL APPLICATION. INFINEON TECHNOLOGIES HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND LIABILITIES OF ANY KIND (INCLUDING WITHOUT LIMITATION WARRANTIES OF NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY) WITH RESPECT TO ANY AND ALL INFORMATION GIVEN IN THIS APPLICATION NOTE.

Information For further information on technology, delivery terms and conditions and prices please contact your nearest Infineon Technologies Office (www.infineon.com).

Warnings

Due to technical requirements components may contain dangerous substances. For information on the types in question please contact your nearest Infineon Technologies Office. Infineon Technologies Components may only be used in life-support devices or systems with the express written approval of Infineon Technologies, if a failure of such components can reasonably be expected to cause the failure of that life-support device or system, or to affect the safety or effectiveness of that device or system. Life support devices or systems are intended to be implanted in the human body, or to support and/or maintain and sustain and/or protect human life. If they fail, it is reasonable to assume that the health of the user or other persons may be endangered.

Page 4: ap0801710_XC866

AP0801701XC866

Table of Contents Page

Application Note 4 V 1.0, 2005-09

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Control of Induction Motors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.1 Constant V/f Control Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2 Implementation of Constant V/f Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.3 Space Vector Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Implementation via XC866 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.1 Control System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2 Consideration of Variable Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.3 Timer 2 Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.4 ADC Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.5 CCU6 Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Page 5: ap0801710_XC866

AP0801701XC866

Introduction

1 IntroductionThis application note presents how to configure an XC866 microcontroller to implement constant V/f control with space vector modulation on an induction motor. First of all, a brief introduction of constant V/f control and space vector modulation is given for the preparation of system knowledge. In the following section, implementation of this control strategy and PWM technique using XC866 is presented. Corresponding flowcharts and description of the motor control firmware are included to provide a clear picture for further development. Finally, results of the implemented control algorithm using XC866 development board are presented for reference.Accompanying this ApNote are the source code files and an Excel spreadsheet which can be used to calculate the look-up table values if different PWM periods or dead-times are needed.

Application Note 5 V 1.0, 2005-09

Page 6: ap0801710_XC866

AP0801701XC866

Control of Induction Motors

2 Control of Induction MotorsDriving and controlling the induction motor efficiently are prime concerns in today’s energy conscious world. With the advancement in the semiconductor fabrication technology, both the size and the price of semiconductors have gone down drastically. This means that the motor user can replace an energy inefficient mechanical motor drive and control system with a Variable Frequency Drive (VFD). The VFD not only controls the motor speed, but can improve the motor’s dynamic and steady state characteristics as well. In addition, the VFD can reduce the system’s average energy consumption.Speed control in the inverter-driven induction motor is achieved by means of variable frequency. Apart from frequency, the applied voltage needs to be varied, to keep the air gap flux constant and not let it saturate. This is explained as follows.The air gap induced electric magnetic field (emf) in an AC machine is given by

E1 = 4.44kω1ΦmfsT1 [1]

where kω1 is the stator winding factor, Φm is the peak air gap flux, fs is the supply frequency, and T1 is the number of turns per phase in the stator. Neglecting the stator impedance, Rs + jX1s, the induced emf approximately equals the supply phase voltage. Hence,

Vph E1≅ [2]

The flux is then written as

ΦmVphKbfs-----------≅ [3]

where

Kb = 4.44kω1T1 [4]

If Kb is constant, flux is approximately proportional to the ratio between the supply voltage and frequency. This is represented as

ΦmVphfs--------- Kvf∝ ∝ [5]

where Kvf is the ratio between Vph and fs.From Equation [5], it is seen that, to maintain the flux constant, Kvf has to be maintained constant. Therefore, whenever stator frequency is changed to obtain the speed control, the stator input voltages have to be changed accordingly to maintain the air gap flux constant.

Application Note 6 V 1.0, 2005-09

Page 7: ap0801710_XC866

AP0801701XC866

Control of Induction Motors

A number of control strategies have been formulated, depending on how the voltage-to-frequency ratio is implemented:1. Constant voltage / frequency (V/f) control2. Constant slip-speed control3. Constant air gap flux control4. Vector controlIn this motor control application, constant V/f control strategy is adopted. Generally used for open-loop systems, V/f control caters to a large number of applications where the basic need is to vary the motor speed and to achieve efficient control. It is also simple to implement and cost-effective.

2.1 Constant V/f Control BasicsIf the effect of the stator impedance, Rs + jX1s is not neglected, the relationship between the applied phase voltage and the induced emf is expressed as shown below.

Vph = E1 + Is1(Rs + jX1s) [6]

where Is1 is the fundamental stator phase current.The dependence of the phase voltage on the stator impedance drop is derived as follows.

Vph = jλmωs + Is1(Rs + jL1sωs) = Is1Rs + jωs(λm + Is1L1s) [7]

where Rs is the stator resistance, L1s is the stator leakage inductance, ωs is the stator frequency, and λm is the air gap flux linkages. Hence, the magnitude of the phase voltage is determined by:

Vph Is1Rs( )2 ωs2 λm Is1L1s+( )2+= [8]

Equation [8] demonstrates that the V/f ratio needs to be adjusted in dependence on the frequency, the air gap flux magnitude, the stator impedance, and the magnitude of the stator current. Such a complex implementation is not desirable for low-performance applications, such as fans and pumps. It is usual to have a pre-programmed volts-to-frequency relationship as shown in Figure 1. This allows for an offset voltage at zero stator frequency to overcome the stator resistance drop, which is kept as an adjustable parameter in the controller. The relationship between the applied phase voltage and frequency in general is written as

Vph = Vo + Kvffs [9]

where

Vo = Is1Rs [10]

Application Note 7 V 1.0, 2005-09

Page 8: ap0801710_XC866

AP0801701XC866

Control of Induction Motors

Vo is the offset voltage to overcome the stator resistive drop.

0

0.2

0.4

0.6

0.8

1

1.2

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

fs, p.u.

Vph,

p.u

.

Figure 1 General implementation of the voltage-to-frequency profile in inverter-fed induction motor drives.

2.2 Implementation of Constant V/f ControlAn implementation of the constant V/f control strategy for the inverter-fed induction motor in open loop is shown in Figure 2. This type of variable-speed drive is used in low-performance applications where precise speed control is not necessary. The frequency command ω is multiplied by the V/f constant, and the offset voltage, Vo, is added to this voltage. The final result is further used for space vector modulation, which generates PWM signals to control the inverter.

Control unit

Speedreference f *

Vph = Vo + Kvf*f *

Pre-definedPWM table

ϕ PWMgeneration

Vphf(ϕ) toinverter

Vph

dtf∫ *2π

Figure 2 Implementation of V/f strategy in inverter-fed induction motor drives

Application Note 8 V 1.0, 2005-09

Page 9: ap0801710_XC866

AP0801701XC866

Control of Induction Motors

Some problems encountered in the operation of this open-loop drive are the following:1. The speed of the motor cannot be controlled precisely, because the rotor speed will

be less than the synchronous speed. Note that stator frequency, and hence the synchronous speed, is the only variable controlled in this drive.

2. The slip speed, being the difference between the synchronous and electrical rotor speed, cannot be maintained: the rotor speed is not measured in this drive scheme. This can lead to operation in the unstable region of the torque-speed characteristics.

3. The effect discussed in 2 can make the stator currents exceed rated current by many times, thus endangering the inverter.

These problems are, to an extent, overcome by having an outer speed loop in the induction motor drive, shown in Figure 3. The actual rotor speed is measured and compared with its command value, ω∗ , and the error is processed through a controller, usually a PI, and a limiter to obtain the slip-speed command, ωs∗ . The limiter ensures that the slip-speed command is within the maximum allowable slip speed of the induction motor. The slip-speed command is added to electrical rotor speed to obtain the stator frequency command. Thereafter, the stator frequency command is processed as in an open-loop drive.In the closed-loop induction motor drive, the limits on the slip speed, offset voltage, and reference speed are externally adjustable variables. This external adjustment allows the tuning and matching of the induction motor to the inverter and the tailoring of its characteristics to match the load requirements.

Control unit

1/2π

Vph = Vo + Kvf*f *

Pre-definedPWM table

ϕ PWMgeneration

Vphf(ϕ)

Vph

PI Inverterf *ωs

* +ω *

ωω

+

+-

IM

Tacho

dtf∫ *2π

Figure 3 Closed-loop induction motor drive with constant V/f control strategy

2.3 Space Vector ModulationPulse Width Modulation (PWM) can be used to create a sinusoidal voltage by creating a fixed frequency signal and adjusting the duty cycle. If the duty cycle varies sinusoidally, so will the output voltage. It is always assumed that the inductance of the motor will filter

Application Note 9 V 1.0, 2005-09

Page 10: ap0801710_XC866

AP0801701XC866

Control of Induction Motors

the PWM into a smooth signal. There are many ways to generated sinusoidal voltages and currents with a 3-phase inverter. One popular method for generating sinusoidal voltages is Space Vector Modulation (SVM). SVM is popular because it generates higher voltages with low total harmonic distortion. Another advantage of SVM is that it works very well with vector control (or field oriented) schemes for induction motors. A detailed explanation of SVM can be found in another ApNote (ap083601, Space vector modulation and overmodulation with an 8-bit microcontroller, www.infineon.com), and hence only a short introduction is given here to avoid duplicating.Consider a three phase voltage source inverter as illustrated in Figure 4 a. The switching states of the inverter can be represented by a combination of ‘+’ and ‘-’. That is, ‘+’ represents the on state of an upper switch in one phase (the lower switch is off in the same phase) and vice versa for ‘-’. For example, the state when the upper switches of phase A and B are on while phase C is off can be easily expressed as (+ + -). Consequently, eight combinations can be derived accordingly as shown in Table 1. Figure 4 b illustrates six resultant nonzero voltage vectors generated from six switch states respectively. They are of the same magnitude, and each shifted by an angle of 60 degrees in space. It is assumed that the phase A axis goes along the real axis.

a b

Figure 4 a) Three phase voltage source inverter; b) Six nonzero voltage vectors

SVM is a digital modulating technique where the objective is to generate PWM load line voltages that are in average equal to a given (or reference) load line voltages. This is done in each sampling period Ts by properly selecting the switch states of the inverter and the calculation of the appropriate time period for each state. The selection of the states and their time periods are accomplished by the space vector transformation.

Application Note 10 V 1.0, 2005-09

Page 11: ap0801710_XC866

AP0801701XC866

Control of Induction Motors

Table 1 Switching states and resultant voltage vectorsState No.

Switching states(A B C)

Voltage vectors in p.u.

1 + - - u1 = 0.5 0°∠ -0.5 120°∠ -0.5 240°∠ = 1 0°∠

2 + + - u2 = 0.5 0°∠ +0.5 120°∠ -0.5 240°∠ = 0.5 + j0.866 = 1 60°∠

3 - + - u3 = -0.5 0°∠ +0.5 120°∠ -0.5 240°∠ = -0.5 + j0.866 = 1 120°∠

4 - + + u4 = -0.5 0°∠ +0.5 120°∠ +0.5 240°∠ = 1 180°∠

5 - - + u5 = -0.5 0°∠ -0.5 120°∠ +0.5 240°∠ = 1 240°∠

6 + - + u6 = 0.5 0°∠ -0.5 120°∠ +0.5 240°∠ = 0.5 - j0.866 = 1 300°∠

7 + + + u7 = 0.5 0°∠ +0.5 120°∠ +0.5 240°∠ = 0 8 - - - u8 = -0.5 0°∠ -0.5 120°∠ -0.5 240°∠ = 0

Figure 5 Generate a load line voltage us

As an example, Figure 5 shows that a voltage vector us can be realized by the voltage vectors u1 and u2 and one of the two null vectors (u7 or u8) to obtain the maximum load line voltage and to minimize the switching frequency. In other words, u1 state is active for time ta, u2 is active for tb, and one of the null vector is active for tz (tz = Ts - ta - tb). That is,

us Ts× u1 ta× u2 tb× uz tz×+ += [11]

which is defined as the SVM. This is achieved by using two adjacent space vectors with the appropriate duty cycle.

Application Note 11 V 1.0, 2005-09

Page 12: ap0801710_XC866

AP0801701XC866

Implementation via XC866

3 Implementation via XC866This section presents how the open-loop constant V/f control and SVM technique are implemented using an XC866 microcontroller.

3.1 Control System OverviewTo implement this application, three on-chip peripheral modules of XC866 are needed, and they are Timer 2, ADC (A/D Converter), and CCU6 (CAPCOM6). Figure 6 illustrates how the microcontroller performs V/f control and generates corresponding drive signals. Timer 2 is used to generate an interrupt routine service around every 400µs. During this interrupt period, speed and direction are measured, and the motor running state for the next step is determined according to these speed and direction commands. Subsequently, the constant V/f control is performed, and corresponding SVM signals are generated. Speed and direction measurement is performed using two ADC channels (P2.5 and P2.6), while SVM signals are generated via six channels of CCU6 (P3.0 - P3.5). A look-up table is pre-defined to decrease the calculation consumption of CPU, which is caused by space vector modulation.

Controller

CPU

speedspeed

TIMER 2INTERRUPT

ADCdirection

directionV/f control ()

SVM ()

MAIN ()

CAPCOM6222 INVERTER INDUCTION

MOTOR

protection

Look-up table

Figure 6 The block diagram of motor control system overview

Figure 7 shows the flowchart of the main control program, and Figure 8 shows how the motor running state for the next step is determined.

Application Note 12 V 1.0, 2005-09

Page 13: ap0801710_XC866

AP0801701XC866

Implementation via XC866

START

MCU INIT

CONTROL & PWM INIT

START TIMER 2INTERRUPT ROUTINE

SERVICE

ADC MEASUREOPERATOR SPEED &

DIRECTION

APPLY V/f CONTROL OFINDUCTION MOTOR

SPACE VECTOR PWM &CCU6 GENERATE IGBT

DRIVE SIGNALS

TIMER 2 REACHINTERRUPT

PERIOD?

CCU6 GENERATE THESAME IGBT DRIVE

SIGNALS

Y

N

CCU6 TRAP?

END

N

Y

SWITCH OFF POWERDEVICES

Figure 7 The flowchart of main program

Application Note 13 V 1.0, 2005-09

Page 14: ap0801710_XC866

AP0801701XC866

Implementation via XC866

START

READ OPERATOR SPEED& DIRECTION

INIT=1?

dir_pre= dir_op?

STATE=?

STATE = STARTdir_pre = dir_opdir_out = dir_op

INIT = 0

STATE = BRAKE

dir_pre = dir_op

START

spd_out <spd_op?

Increase spd_out

STATE = RUN

N

Y

BRAKE

spd_out >0?

Decrease spd_out

STATE = WAIT

N

Y

WAIT

Wait timerun out?

Idle and timer++

spd_out = 0dir_out = dir_op

STATE = START

Y

N

RUN

spd_out <spd_op?

Increase spd_out

spd_out >spd_op?

Decrease spd_out

N

Y

Y

OTHERVALUES

STATE = START

N

END

N

Y

Y

N

Figure 8 The flowchart of motor control program

Application Note 14 V 1.0, 2005-09

Page 15: ap0801710_XC866

AP0801701XC866

Implementation via XC866

3.2 Consideration of Variable ScalingTo generate six PWM signals (two signals for each phase), a reference voltage vector is required to determine the switch states and the corresponding duty cycles. It is usually convenient if the voltage vector is given in terms of a magnitude (Vph) and an angle (ϕ). Given Vph and ϕ, the switching times can be calculated by the formulas:

tb = 2/(31/2)Vphsin(ϕ) [12]

ta = Vph[cos(ϕ)-sin(ϕ)/(31/2)] [13]

tz = Ts - ta - tb [14]

The voltage magnitude (Vph) can be obtained by multiplying the reference speed by the V/f constant. The reference speed is measured and transformed into an 8-bit digital number via ADC. On the other hand, the V/f constant should be determined according to the particular motor used in the application. In this case, it is defined as 5 (= Vph_rated/frated = 230V/50Hz). Another thing should be noted is that the voltage magnitude cannot exceed 1 in engineering units, and hence a final scaling (divided by 2048, since it’s an 11-bit value) is necessary.Subsequently, the vector angle (ϕ) is derived by integrating the motor speed over a time period. Since the control strategy used here is open-loop, the actual motor speed is unavailable. Thus, the reference speed is utilized instead to calculate the angle. However, in the actual implementation, integral calculation is achieved via simple summation of the reference speed.A look-up table can be used for sine and cosine so that ta and tb can be calculated, and hence it decreases computation work of CPU. The values can then be looked up and scaled for the appropriate value of Vph. Please note that the PWM period and dead time in the look-up table should be changed according to the values defined by user, and then the modulation index should be tuned until the condition defined in the table becomes ‘TRUE’. It is recommended that the PWM period should be chosen as close to 0xFF as possible for better resolution.

3.3 Timer 2 SettingsFor XC866, Timer 2 is a 16-bit general purpose timer that has two modes of operation, a 16-bit auto-reload mode and a 16-bit one channel capture mode. In the auto-reload mode, Timer 2 counts to an overflow value and then reloads its register contents with a 16-bit start value for a fresh counting sequence. The overflow condition is indicated by setting bit TF2 in the T2CON register. This will then generate an interrupt request to the core. The overflow flag TF2 must be cleared by software.In the motor control application, Timer 2 is used to generate interrupt request every 400µs, and hence motor can be controlled according to the given commands during the

Application Note 15 V 1.0, 2005-09

Page 16: ap0801710_XC866

AP0801701XC866

Implementation via XC866

interrupt routine service. Auto-reload mode with up-counting is selected, and in order to determine the reload value, the following equation is derived.

(FFFFH + 1 - reload_value) / fTimer 2 = interrupt_period [15]

where fTimer 2 = fPCLK (= 26.67 MHz), and interrupt_period = 400 µs.Therefore, the reload value can be calculated accordingly

reload_value = FFFFH + 1 - interrupt_period * fTimer 2 = D655H [16]

which are the contents of Timer 2 Reload/Capture Registers (RC2L & RC2H).To ensure Timer 2 to work in the auto-reload mode, the following SFRs should be initialized.T2_RC2L = 0x55; // timer 2 reload/capture register, low byteT2_RC2H = 0xD6; // timer 2 reload/capture register, high byteT2_T2MOD = 0x10; // PREN = 1, prescalar is enabled, fTimer2 = fPCLKET2 = 1; // Enable interrupt

3.4 ADC SettingsDuring the interrupt service generated by Timer 2, speed and direction are measured via two channels of ADC, and commands in digital format can therefore be used. Reference speed and direction are tuned using a potentiometer and a switch respectively. Analog Channel 6 is used to measure reference speed and Channel 5 for direction. This means that Pin 2.6 should be connected to the potentiometer and Pin 2.5 to the switch with regard to hardware.In this application, parallel request source is selected. The arbitration is started by pending conversion request, and wait-for-start mode is used. Two 8-bit results are stored in different result registers. Wait-for-read mode is enabled and the result valid flag (VF) is reset by read access to result register.Upon every conversion, requests are generated via software by writing access at register CRPR1. The load event will take place one clock cycle after the write access. This automatic load event can be used to start conversions with a single move operation. In this case, the information about the channels to be converted is given as an argument in the move instruction.The following codes show how to generate conversion requests and to read valid results.ADC_PAGE = 0x06; // switch to page 6, ADC moduleADC_CRPR1 = 0x40; // write conversion request control reg. (Ch6)while(ADC_ubBusy()); // wait until conversion complete ADC_PAGE = 0x02; // switch to page 2, ADC moduleif(ADC_RESR1L & 0x10); // check whether the result is validVPot = ADC_RESR1H; // read 8-bit result (speed)ADC_PAGE = 0x06; // switch to page 6, ADC moduleADC_CRMR1 |= 0x20; // clear CRPR1 bits

Application Note 16 V 1.0, 2005-09

Page 17: ap0801710_XC866

AP0801701XC866

Implementation via XC866

Note: ADC_ubBusy() is a function generated by DAvE, to check whether ADC is in the conversion stage.

3.5 CCU6 SettingsThe Capture/Compare Unit 6 (CCU6) provides two independent timers (T12, T13), which can be used for Pulse Width Modulation (PWM) generation, especially for AC-motor control. The timer T12 can function in capture and/or compare mode for its three channels. The timer T13 can work in compare mode only.For the purpose of PWM generation, three channels of timer T12 should be configured in center-aligned compare mode. The period of timer T12 should match the switching frequency of IGBT, which is normally chosen from a range of 12kHz to 20kHz. In this application, 15kHz (66.67µs) is selected as the PWM switching frequency. Dead time control is enabled to avoid short circuit when the highside and the lowside IGBTs are ‘on’ simultaneously. The dead time is configured as 2µs to correspond with the hardware. The duty cycle of PWM waveform is determined by the compare value of each channel. After the shadow transfer of the compare value, the corresponding duty cycle of each PWM waveform will be changed accordingly. Please note that shadow transfer should be enabled after every change of compare value (channel shadow registers) in the real-time control.Timer T13 is not used, and hence no initialization is needed.Therefore, in the initialization of CCU6, user must ensure that timer control register 0 low (CCU6_TCTR0L), modulation control register low (CCU6_MODCTRL), Timer 12 capture/compare mode select register (CCU6_T12MSEL), passive state level register (CCU6_PSLR), compare state register (CCU6_CMPSTAT), dead-time control register for Timer 12 (CCU6_T12DTC), Timer 12 period register (CCU6_T12PR) and three channel shadow registers (CCU6_CC6xSR) are properly set. In addition, Pin 3.0 to Pin 3.5 must be configured as the CCU6 compare outputs (P3_ALTSEL0/1, P3_DIR). The CCU6 module of XC866 also provides a functionality named ‘TRAP’. TRAP can act as an emergency stop to protect power stage devices by switching off all control signals generated from CCU6. Users can activate this funtionality by setting the following SFRs: trap control registers (CCU6_TRPCTRL, CCU6_TRPCTRH).Figure 9 illustrates the CCU6 features which are used to generate PWM signals (highlighted in color).

Application Note 17 V 1.0, 2005-09

Page 18: ap0801710_XC866

AP0801701XC866

Implementation via XC866

channel 0

channel 1

channel 2

T12dead-time

control

input / output controlC

C62

CO

UT6

2

CC

61

CO

UT6

1

CC

60

CO

UT6

0

CO

UT6

3

CTR

AP

channel 3T13

CC

PO

S0

1

1

1

2221

start

compare

capt

ure

3

multi-channelcontrol

trapcontrol

compareco

mpa

re

com

pare

com

pare

1

trap

inpu

t

port control

CC

PO

S1

CC

PO

S2

outp

ut s

elec

t

outp

ut s

elec

t

3

Hal

l inp

ut

module kernelT1

3HR

T12H

R

Figure 9 The block diagram of CCU6 features used to generate PWM signals.

Application Note 18 V 1.0, 2005-09

Page 19: ap0801710_XC866

AP0801701XC866

Results

4 ResultsThe source code was executed using the XC866 microcontroller and the X-board which comes with the XC866 Starter Kit. Since XC866 is integrated with an on-chip oscillator (10MHz), external oscillator is not necessary. However, XC866 still keeps the capability to work properly using an external oscillator (3 MHz to 12 MHz).Figure 10 shows the output signals of three CAPCOM6 channels - CC60, CC61 and CC62, and Figure 11 illustrates the generation of dead time (2µs) between the two reversed outputs of the same compare channel.

Figure 10 Outputs of three CAPCOM6 channels (CC60, CC61 and CC62)

a b

Figure 11 a. Generation of dead time (2µs) between the two reversed outputs

Application Note 19 V 1.0, 2005-09

Page 20: ap0801710_XC866

AP0801701XC866

Results

of the same compare channel (CC6x and COUT6x); b. the enlarged one

To view the output, either the CC6x or COUT6x pins of the microcontroller can be connected to a low pass filter (implemented with a 10kΩ resistor and a 47nF capacitor). Capacitors are used to filter the PWM outputs so the voltages will appear smooth when viewed by an oscilloscope. Figure 12 shows the line-to-neutral voltage waveform, which is the output signal of pin CC6x/COUT6x after filtering.

Figure 12 Line-to-neutral voltage (CC6x/COUT6x signal after filtering)

Accompanying this ApNote are the source code files and an Excel spreadsheet which can be used to calculate the look-up table values if different PWM periods or dead-times are needed.

Application Note 20 V 1.0, 2005-09

Page 21: ap0801710_XC866

((21))

Page 22: ap0801710_XC866

Qualität hat für uns eine umfassende Bedeutung. Wir wollen allen Ihren Ansprüchen in der bestmöglichen Weise gerecht werden. Es geht uns also nicht nur um die Produktqualität – unsere Anstrengungen gelten gleichermaßen der Lieferqualität und Logistik, dem Service und Support sowie allen sonstigen Beratungs- und Betreuungsleistungen.Dazu gehört eine bestimmte Geisteshaltung unserer Mitarbeiter. Total Quality im Denken und Handeln gegenüber Kollegen, Lieferanten und Ihnen, unserem Kunden. Unsere Leitlinie ist jede Aufgabe mit „Null Fehlern“ zu lösen – in offener Sichtweise auch über den eigenen Arbeitsplatz hinaus – und uns ständig zu verbessern.Unternehmensweit orientieren wir uns dabei auch an „top“ (Time Optimized Processes), um Ihnen durch größere Schnelligkeit den entscheidenden Wettbewerbsvorsprung zu verschaffen.Geben Sie uns die Chance, hohe Leistung durch umfassende Qualität zu beweisen.Wir werden Sie überzeugen.

Quality takes on an allencompassing significance at Semiconductor Group. For us it means living up to each and every one of your demands in the best possible way. So we are not only concerned with product quality. We direct our efforts equally at quality of supply and logistics, service and support, as well as all the other ways in which we advise and attend to you.Part of this is the very special attitude of our staff. Total Quality in thought and deed, towards co-workers, suppliers and you, our customer. Our guideline is “do everything with zero defects”, in an open manner that is demonstrated beyond your immediate workplace, and to constantly improve.Throughout the corporation we also think in terms of Time Optimized Processes (top), greater speed on our part to give you that decisive competitive edge.Give us the chance to prove the best of performance through the best of quality – you will be convinced.

h t t p : / / w w w . i n f i n e o n . c o m

Total Quality Management

Published by Infineon Technologies AG