AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240

APPLICATION REPORT: SPRA284A

Zhenyu Yu and David Figoli DSP Digital Control System Applications

Digital Signal Processing Solutions April 1998

IMPORTANT NOTICE
Texas Instruments (TI) reserves the right to make changes to its products or to discontinue any semiconductor product or service without notice, and advises its customers to obtain the latest version of relevant information to verify, before placing orders, that the information being relied on is current. TI warrants performance of its semiconductor products and related software to the specifications applicable at the time of sale in accordance with TI’s standard warranty. Testing and other quality control techniques are utilized to the extent TI deems necessary to support this warranty. Specific testing of all parameters of each device is not necessarily performed, except those mandated by government requirements. Certain application using semiconductor products may involve potential risks of death, personal injury, or severe property or environmental damage (“Critical Applications”). TI SEMICONDUCTOR PRODUCTS ARE NOT DESIGNED, INTENDED, AUTHORIZED, OR WARRANTED TO BE SUITABLE FOR USE IN LIFE-SUPPORT APPLICATIONS, DEVICES OR SYSTEMS OR OTHER CRITICAL APPLICATIONS. Inclusion of TI products in such applications is understood to be fully at the risk of the customer. Use of TI products in such applications requires the written approval of an appropriate TI officer. Questions concerning potential risk applications should be directed to TI through a local SC sales office. In order to minimize risks associated with the customer’s applications, adequate design and operating safeguards should be provided by the customer to minimize inherent or procedural hazards. TI assumes no liability for applications assistance, customer product design, software performance, or infringement of patents or services described herein. Nor does TI warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other intellectual property right of TI covering or relating to any combination, machine, or process in which such semiconductor products or services might be or are used.

Copyright © 1998, Texas Instruments Incorporated

TRADEMARKS
TI is a trademark of Texas Instruments Incorporated. Other brands and names are the property of their respective owners.

CONTACT INFORMATION US TMS320 HOTLINE US TMS320 FAX US TMS320 BBS US TMS320 email (281) 274-2320 (281) 274-2324 (281) 274-2323 dsph@ti.com .

...................................................... 21 Overview........................ 21 Step by Step Explanation ... 59 Appendix I........... 15 Approximation of Output with Basic Space Vectors........................................................ 19 Implementation I .............................................................................................................................................................. 8 World Wide Web .............................. 11 Profile I:...... 39 Decomposing the reference voltage vector .... 13 Space Vector PWM Technique .............................................................................................. 22 Scaling and Accuracy..................Open-loop speed control for 3-phase AC induction motor ........... 99 ........................................................................................................................................................................................ Closed-loop speed control for AC induction motor based on constant V/Hz principle and space vector PWM ............................ 50 Experimental Results .............................................................................................................................9 Background..........Contents Abstract .......................................................................................................... 8 Introduction........................................................................... 11 The Principle of Constant V/Hz for AC Induction Motor .......... 46 Measuring the motor shaft rotation speed ................Closed loop speed control for 3-phase AC induction motor ........................... 14 Switching Patterns and the Basic Space Vectors ............................................ 13 Profile II:............................................................................................. 7 Product Support........................................................................................ 17 Implementation . 42 Realization of the PWM Switching Pattern .......................................................................... 33 Implementation II ........................................................... 35 Space vector PWM ............................................................. 48 Closed loop speed control................... 55 Experimental Data of Implementation II........................................................................................................ 55 Experimental Data of Implementation I......................................................... 56 References ........................................................................................................................................................................................ 60 Appendix II.......................................................................................................................................................................... 38 Generating the Reference Voltage Vector........................................................................................................................................................ Open-loop speed control for AC induction motor based on constant V/Hz principle and space vector PWM ............................................................................................................................................ 35 Software Flow Overview.................. 44 Verification of space vector PWM algorithm ..........................

.. 55 Motor current and spectrum obtained with implementation I for F=55Hz ............... 16 A symmetric space vector PWM switching pattern ....... Figure 9..... Figure 3................................................................. Fin=60Hz ..... 40 Resolution of frequency mapping ....... Figure 21........................... 49 32-bit/16bit division................................................................................................................ Fin=30Hz57 Motor current and spectrum obtained with implementation II............................................................................................................... Figure 24.............. 40 Asymmetric and symmetric PWM resolution ..................... Figure 26............................ ..... Figure 5.......................................... Figure 15. Figure 14................. Figure 13..... 14 The basic space vectors and switching patterns ... Table 5............................................................ 37 Generating and representing the reference voltage vector .............................. 18 Program flow chart .. Figure 4.................... Figure 23............................ 34 Software structure of Implementation II....... 13 Three phase power inverter diagram........................................... Figure 8.................................................... 56 Motor current and current spectrum obtained with implementation II.................................... 36 Flow chart of Implementation II.............. 23 Switching sequence for each sector............................................... 47 Speed measurement with a sprocket ........ ..... Figure 22..... Figure 12.......................... Figure 20... 53 Motor current and its spectrum obtained with implementation I for F=25Hz.... ......... Figure 11..................... Figure 19.................................... Table 4.................. 12 Closed-loop PI speed control based on constant V/Hz.... 39 PWM output switching pattern of Implementation II.................... Figure 7.. Symmetric and asymmetric PWM signals ............................................. 46 ................. 49 Approximating the integral.......... Figure 18.......... Figure 2............ 31 Block diagram of implementation I................................................ Figure 17.......................... 15 CPU Cycles of Major Program Blocks ............................ 58 Tables Table 1............................... Figure 10........................ 13 V/Hz profile I . Figure 6.. Switching patterns and output voltages of a 3-phase power inverter ............................................................................................................. Table 2 Table 3.............................. Figure 16..... 48 Calculation of speed... Figure 25................. ....Figures Figure 1......................................................... 47 The wave form of filtered space vector PWM outputs.......................... 10 Voltage versus frequency under the constant V/Hz principle.. 12 Torque versus slip speed of an induction motor with constant stator flux . 38 Frequency mapping ...................................................... 51 The overall block diagram of Implementation II ............ 45 Filtering the PWM outputs ....................................................

Implementation issues such as command voltage generation. Experimental data are shown. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 7 with TMS320C240 .AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 Abstract The principles of constant V/Hz control for AC Induction motor and space vector PWM technique are reviewed. switching pattern determination. speed measurement and scaling are discussed. Two different implementations are presented. Full programs are attached in the appendices.

and additions.SPRA284A Product Support World Wide Web Our World Wide Web site at www. Users registering with TI&ME can build custom information pages and receive new product updates automatically via email. 8 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .ti. revisions.com contains the most up to date product information.

The frequency of a PWM signal must be much higher than that of the modulating signal. symmetric and asymmetric edge-aligned. the fundamental frequency. Figure 1 shows two types of PWM signals. variable speed AC Induction motors powered by switching power converters are becoming more and more popular. The most common principle of this kind. When a PWM signal is applied to the gate of a power transistor. Thus. As a result much higher efficiency and performance can be achieved by these motor drives with less generated noises. is the constant V/Hz principle which requires that the magnitude and frequency of the voltage applied to the stator of a motor maintain a constant ratio. the magnitude of the magnetic field in the stator is kept at an approximately constant level throughout the operating range. (maximum) constant torque producing capability is maintained. Switching power converters offer an easy way to regulate both the frequency and magnitude of the voltage and current applied to a motor. However.SPRA284A Introduction Because of advances in solid state power devices and microprocessors. Both types of PWM signals are used in this application. The pulses of an asymmetric edge-aligned PWM signal always have the same side aligned with one end of each PWM period. The constant V/Hz principle is considered for this application. The pulses of a symmetric PWM signal are always symmetric with respect to the center of each PWM period. The energy that a switching power converter delivers to a motor is controlled by Pulse Width Modulated (PWM) signals applied to the gates of the power transistors. When transient response is critical. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 9 . PWM signals are pulse trains with fixed frequency and magnitude and variable pulse width. the width of the pulses changes from period to period according to a modulating signal. such that the energy delivered to the motor and its load depends mostly on the modulating signal. switching power converters also allow easy control of transient voltage and current applied to the motor to achieve faster dynamic response. By doing this. it causes the turn on and turn off intervals of the transistor to change from one PWM period to another PWM period according to the same modulating signal. There is one pulse of fixed magnitude in every PWM period.

or ways of determining the modulating signal and the switch-on/switch-off instants from the modulating signal. exist. Symmetric and asymmetric PWM signals Symmetric PWM PWM period PWM period PWM period PWM period Asymmetric PWM It has been shown that symmetric PWM signals generate less harmonics in the output current and voltage. Popular examples are sinusoidal PWM. The space vector PWM technique is employed in this application. These techniques are commonly used with three phase Voltage Source power inverters for the control of three-phase AC induction motors. 10 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . Different PWM techniques.SPRA284A Figure 1. hysterises PWM and the relatively new space vector PWM.

the principle of constant V/Hz for AC induction motor and the theory of space vector pulse-width modulation are reviewed for better understanding of this application. (1) V »w L (2) $ $ where V and L are the phasors of stator voltage and stator flux. and V and L are their magnitude. the ratio between the magnitude and frequency of the stator voltage is usually based on the rated values of these variables. when the frequency and hence also the voltage are low. the stator voltage must not exceed its rated value. At frequencies higher than the rated value. This principle is illustrated in Figure 2.SPRA284A Background In this section. Thus. the constant V/Hz principle also have to be violated because. at steady state. In actual implementation. Then we have. or motor ratings. respectively. then L remains constant too and the torque is independent of the supply frequency. However. to avoid insulation break down. The Principle of Constant V/Hz for AC Induction Motor Assume the voltage applied to a three phase AC Induction motor is sinusoidal and neglect the voltage drop across the stator resistor. the voltage drop across the stator resistance cannot be neglected and must be compensated. $ $ V » jw L i. we get L» V 1 V = w 2p f (3) from which it follows that if the ratio V f remains constant with the change of f .e. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 11 with TMS320C240 .

fan or blower applications. which is shown in Figure 3. In this case. Figure 3. as illustrated in Figure 4. When accuracy in speed response is a concern. independent of the change in supply frequency. the supply frequency is determined based on the desired speed and the assumption that the motor will roughly follow its synchronous speed. the torque developed depends on the slip speed only. So by regulating the slip speed.SPRA284A Figure 2. closed-loop speed control can be implemented with the constant V/Hz principle through regulation of slip speed. the torque and speed of an AC Induction motor can be controlled with the constant V/Hz principle. ventilation and air conditioning). where a PI controller is employed to regulate the slip speed of the motor to keep the motor speed at its set value. Torque versus slip speed of an induction motor with constant stator flux Torque w Slip speed Both open and closed-loop control of the speed of an AC induction motor can be implemented based on the constant V/Hz principle. Open-loop speed control is used when accuracy in speed response is not a concern such as in HVAC (heating. Voltage versus frequency under the constant V/Hz principle V rate Voltage f rate Frequency Since the stator flux is maintained constant. 12 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . The error in speed resulted from slip of the motor is considered acceptable.

the V/Hz profile can be modified to off set the voltage drop across the stator resistance and the inverter. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 13 with TMS320C240 . This approach is acceptable to applications such as fan and blower drives where the speed response at low end is not critical. minimum and maximum frequency information is needed to implement the profile.M M - + w * sl M + Inverter * Syn P/2 MM ò + MM Speed sensor Two variations of the profile in Figure 2 are implemented here: Profile I: The profile in Figure 2 is used except that a lower limit is imposed on frequency. V/Hz profile I V rate V m i n Voltage fmin f rate Frequency Profile II: All four parameters.SPRA284A Figure 4. f rate and f min . Vrate . only the rated. in Figure 5 are used. This way. Closed-loop PI speed control based on constant V/Hz DC Supply Voltage Constant V/Hz PI speed controller * MM . Vmin . However the command frequency is allowed to go below f min with the command voltage saturating at Vmin . Since the rated voltage which is also the maximum voltage is applied to the motor at rated frequency. Figure 5.

b’. a’. i. which are controlled by a. The on and off states of the upper transistors Q1. b or c is 1. b and c. b’ or c’ is 0. the state of a. the corresponding a’. c and c’. Figure 6.1 .1 0 1 úêc ú ë û ë ûë û (4) from which one can arrive at equation (5) as follows which determines the phase voltage vector [Va Vb Vc]t.1ú êb ú êVbc ú = Vdc ê 0 êVca ú ê. For AC Induction motor control.1 .. Three phase power inverter diagram Q1 a V dc + Q3 b c Q5 Q2 a' b' Q4 c' Q6 Va Vb motor phases Vc The relationship between the switching variable vector [a.SPRA284A Space Vector PWM Technique The structure of a typical three-phase voltage source power inverter is shown in Figure 6. or equivalently. Va.e. the corresponding lower transistor is switched off.1 2 ú ê c ú ë û ë ûë û (5) 14 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . b. Q1 through Q6 are the six power transistors that shape the output. or the bus voltage. Q3 and Q5.e. b.. when an upper transistor is switched on.1ù éa ù ê ú 1 ê úê ú êVb ú = 3 Vdc ê. éVa ù é 2 . i.1 2 . where Vdc is the DC supply voltage.1ú êb ú êVc ú ê.1 0 ù éa ù ê ú ê úê ú 1 . are sufficient to evaluate the output voltage. when a. c]t and the line-to-line voltage vector [Vab Vbc Vca]t is given by (4) in the following: éVab ù é 1 . Vb and Vc are the output voltages applied to the windings of a motor.

The phase voltages corresponding to the eight combinations of switching patterns can be mapped into the d-q plane in Figure 7 by the same d-q transformation. Switching patterns and output voltages of a 3-phase power inverter a 0 1 1 0 0 0 1 1 b 0 0 1 1 1 0 0 1 c 0 0 0 0 1 1 1 1 va 0 2/3 1/3 -1/3 -2/3 -1/3 1/3 0 vb 0 -1/3 1/3 2/3 1/3 -1/3 -2/3 0 vc 0 -1/3 -2/3 -1/3 1/3 2/3 1/3 0 vab 0 1 0 -1 -1 0 1 0 vbc 0 0 1 1 0 -1 -1 0 vca 0 -1 -1 0 1 1 0 0 Assuming d and q are the horizontal and vertical axes of the stator coordinate frame. Notice that the on and off states of the lower power transistors are opposite to the upper ones and so are completely determined once the states of the upper power transistors are known. Table 1. Tabc-dq = 1 1 ù é ê1 -2 -2 ú 2 ê ú 3 3ú 3ê 0 ê 2 2 ú ë û (6) AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 15 with TMS320C240 . The eight combinations and the derived output line-to-line and phase voltages in terms of DC supply voltage Vdc. according to equations (4) and (5). there are eight possible combinations of on and off patterns for the three upper power transistors that feed the three phase power inverter. then the d-q transformation given in equation (6) can transform a three phase voltage vector into a vector in the d-q coordinate frame which represents the spatial vector sum of the three phase voltage. Space Vector PWM refers to a special switching sequence of the upper three power transistors of a three phase power inverter.SPRA284A Switching Patterns and the Basic Space Vectors As shown in Figure 6. are shown in Table 1. It has been shown to generate less harmonic distortion in the output voltages and or currents applied to the phases of an AC motor and provides more efficient use of supply voltage in comparison with direct sinusoidal modulation technique.

The zero vectors are at the origin and apply zero voltage to a motor. T) to be the same as the average of Uout in the same period. the results of which are six non-zero vectors and two zero vectors. The eight vectors are called the basic space vectors and are denoted by U 0. is small. The nonzero vectors form the axes of a hexagonal as shown in Figure 7. and Ux and Ux±60 form the sector containing Uout. The objective of space vector PWM technique is to approximate the reference voltage vector Uout by a combination of the eight switching patterns. 0 (- 2 3.1 2 ) 16 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . The angle between any adjacent two non-zero vectors is 60 degrees. The same transformation can be applied to the desired output voltage to get the desired reference voltage vector Uout in the d-q plane. from equation (7) we get equation (8). U180. One simple means of approximation is to require the average output of the inverter (in a small period. U120. U240. Figure 7. TPWM. 1. U300. This is shown in equation (7). 1 2 ) (1 6. .SPRA284A This transformation is equivalent to an orthogonal projection of [a. c]t onto the two dimensional plane perpendicular to the vector [1. 1]t (the equivalent d-q plane) in a three-dimensional coordinate system. The basic space vectors and switching patterns U 120 (010) q axis U 60 (110) (. 1 2 ) T1 O 000 (000) U out T2 U0 (100) d axis 3.1 U 180 (011) 6. b. . U60. Assuming the PWM period. O000 and O111. where T1 and T2 are the respective durations in time for which switching patterns Ux and Ux±60 are applied within period T. and the change of Uout is relatively slow. 0 ) O 111 (111) ( 2 ) (.1 6.1 2 ) U 240 (001) U 300 (101) (1 6.

Uout becomes a vector rotating around the origin of the d-q plane with a frequency corresponding to that of the desired three phase voltages. ... AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 17 with TMS320C240 . An example of symmetric space vector PWM wave forms are shown in Figure 8 where it is assumed that the reference voltage Uout is in the sector formed by vectors U0 and U60. the power inverter needs to have a 0 (000 or 111) pattern inserted for the rest of the period.1. which is 2 3 times higher than what a sinusoidal PWM technique can generate. 2.SPRA284A 1 T n n +1T nT òU out = 1 (T1U x + T2U x ± 60 ) T n = 0. Since the sum of T1 and T2 is less than or equal to Tpwm. 2. Therefore. This gives a maximum magnitude of Vdc 2 for Uout. Therefore the bus voltage Vdc needed for a motor rated at Vrate is determined by Vdc = 2 Vrate ... the maximum rms values of the fundamental line-to-line and line-toneutral output voltages are Vdc 2 and Vdc 6 .. the desired reference voltage Uout can be approximated by having the power inverter in switching pattern Ux and Ux+60 (Ux-60) for T1 and T2 duration of time respectively. The envelope of the hexagonal formed by the basic space vectors. T1 + T2 £ T (7) +1TPWM nTPWM òU out = TPWM U out = (T1U x + T2U x ± 60 ) n = 0. Therefore equation (8) becomes equation (9) in the following. as shown in Figure 6 is the locus of maximum Uout. the magnitude of Uout must be limited to the shortest radius of this envelope when Uout is a rotating vector.. T1 + T2 £ TPWM (8) Approximation of Output with Basic Space Vectors Equation (8) means for every PWM period.. The reference voltage vector Uout is obtained by mapping the desired three phase output voltages to the d-q plane through the same d-q transform. where T1 + T2 + To = Tpwm .. . Correspondingly. Tpwm U out = T1 U x + T2 U x ± 60 + T0 (0 000 or 0111 ) (9) Note that the third term on the right-hand side of equation (8) above doesn't affect the vector sum on the left-hand side.1.. When the desired output voltages are three phase sinusoidal voltages with 120 degree phase shift..

25T 0 . A symmetric space vector PWM switching pattern a b c .SPRA284A Figure 8.25T 0 +.25T 0 +.5T 1 +.5T 1 .5T 2 O 000 (000) U0 U 60 (100) (110) O 111 (111) U 60 U0 (110) (100) O 000 (000) 18 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .

8) Decompose Uout to obtain T1. one needs a threephase inverter with the required DC link and driving circuits. 16K words of onchip program ROM or Flash EEPROM. 544 words of on-chip data/program memory. A 3-phase AC induction motor control algorithm based on the discussed constant V/Hz principle and the space vector PWM technique generally contains the following steps: 1) Configure the timers and compare units to generate symmetric or asymmetric PWM outputs. The major features of the TMS320C240 include: G G G TMS320C2xx CPU core with 50nS instruction cycle time. 4) Obtain command frequency with speed controller if closedloop speed control is implemented. Here we assume that a three-phase switching power inverter with the necessary driving circuits and DC link is available and focus on algorithm and software implementation issues. 64K words of program. The above procedure assumes that the digital signal processor has all the needed timers and compare units with associated PWM outputs. This is true in the case of TMS320C240. 7) Determine which sector Uout is in. T2 and T0. and a digital processor that supplies the PWM signals based on a selected control algorithm. Dual 10-bit A/D converter with 6. 5) Obtain the magnitude of reference voltage vector Uout (command voltage) based on V/Hz profile.SPRA284A Implementation To control a three-phase AC Induction motor. use it as the command speed if openloop speed control is implemented. 6) Obtain the phase of Uout based on command frequency. 3) Measure speed feedback if closed-loop speed control is implemented. 2) Input desired speed.6 mS of converter time per two input channels. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 19 with TMS320C240 . 9) Determine the switching pattern or sequence to be used and load the calculated compare values into the corresponding compare registers. 64Kwords of data and 64K words of I/O space of address reach.

Open-loop speed control for AC induction motor based on constant V/Hz principle and space vector PWM. two separate implementations are discussed in detail. 9 of which are independent. TMS320C240 has the necessary features to allow easy implementation of different motor control algorithms and PWM techniques. c) Three 16-bit full compare units capable of generating 6 complimentary PWM outputs with programmable dead band. f) Direct QEP encoder interface shared with two capture inputs. For the application here. and the second corresponding to the code in Appendix II. The three full compare units are configured in PWM mode to generate six complementary PWM outputs. with the first corresponding to the code in Appendix I. Watchdog Timer.SPRA284A G G PLL. 20 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . Once the above items are completed. Next. Event Manager featuring a) 12 compare/PWM outputs. and 28 multiplexed I/O pins. e) Four capture units each with one capture input and a twolevel deep FIFO stack. all that is needed to generate the required PWM outputs is for the application code to update the compare values based on the discussed principle and PWM techniques. SPI. d) Three 16-bit simple compare units capable of generating 3 independent PWM outputs. the following set up is needed for the generation of PWM outputs: G G GP Timer 1 is configured in either continuous-up or continuous-up/down mode to generate correspondingly asymmetric or symmetric PWM. each with a 16-bit compare unit capable of generating one independent PWM output. SCI. b) Three general-purpose up and up/down timers. Closed-loop speed control for AC induction motor based on constant V/Hz principle and space vector PWM.

One is how to generate or represent the revolving reference voltage vector Uout given the command frequency and magnitude of the reference voltage vector. However. Use s based look-up table to determine which PWM channel toggles first. s . An ADC channel is used to input the speed command. The flow chart of this implementation is illustrated in Figure 9 in the following. sector-based table look-up for decomposition matrix. Therefore.SPRA284A Implementation I . Use theta based look-up table to obtain SIN(theta) and COS(theta) and the d and q components of the reference voltage vector. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 21 with TMS320C240 . theta. open-loop speed control is implemented. second and third and load the compare registers with appropriate values.Open-loop speed control for 3-phase AC induction motor There are two major issues that must be resolved to implement the discussed principle and PWM technique. quarter mapping to calculate SIN and COS functions. theta is in. the same frequency of 25KHz is used here. Use s based look-up table to find the decomposition matrix and decompose the reference voltage vector. map theta to the first quarter and record the correct signs of SIN(theta) and COS(theta). Overview The major features of this implementation are 32-bit integration to obtain the phase of the reference voltage vector. and sector-based table look-up for PWM channel toggling sequence. Determine the sector. GP Timer 1 is used as the time base for PWM output generation with the Full Compare Units. of the reference vector. Determine the quarter theta is in. Applications such as blower/fan drives typically don’t care too much about the accuracy in speed response. GP Timer 2 is used to time the sampling period allowing independent control of sampling frequency from PWM frequency. The other is the determination of the switching pattern based on this reference voltage vector. The major steps involved in this implementation are: G G G G G G Integrate the command speed to get the phase. It is assumed that the accuracy of speed response is not a concern.

Step by Step Explanation 32-bit integration to obtain the phase of the reference voltage vector to minimize error accumulation. round up to upper 16 bits 22 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . continue if within limit THETAH . . as shown in the following code segment: ******************************************************************** ** Obtain theta (phase of Uout) through 32 bit integration ** ******************************************************************** LT MPY PAC S_W T_sample . compare with 2*pi: D3-D3=D3 Theta_in_limit .15 theta_r . accumulate: D3+D3=D3 SUBH theta_360 BLEZ SACH . ADDS ADDH SACH SACL THETAL THETAH THETAH THETAL . . . D-9*D11=D(2+1) . . THETA) if not Theta_in_limit ZALH ADDS ADD SACH THETAH THETAL one. . .SPRA284A The assumption here is that the timers and compare units and associated compare/PWM outputs have been properly configured to generate the right PWM outputs based on on-line determined compare values. The following explains the details of these steps. mod(2*pi. .

SPRA284A Figure 9. T 2 and T 3 Sampling period flag set? No Get output toggling sequence and load the compare registers Yes 1 Reset sampling period flag Read ADC data and re-start ADC GP Timer 2 INT service Calaculate set speed and voltage Set sampling period flag Integrate speed to get phase THETA of U out Enable interrupt Return Determine quadrant of U out AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 23 with TMS320C240 . Program flow chart Start Determine quadrant of U out System configuration Obtain SIN(THETA) and COS(THETA) Configure and Start ADC Set up GP Timers and Full Compare Units Calculate d-q components of U out Initialize variables Reset flags Determine sector of U out Clear INT flags Enable interrupt 1 Get decomposition matrix and calculate T 1 .

Determination of which quarter theta is in is done by simply comparing theta to the quarter limits. Since SIN and COS of any angle can always be obtained by mapping the angle to the first quarter with correct sign modification. only SIN values of the first quarter are needed. The following code implements this operation: 24 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . Notice that the notation Dx is used to indicate and track the scaling of variables. However.x ) (10) Quarter mapping.SPRA284A Notice that modulo 360 is applied to theta to keep theta within 360 range. The signs of SIN and COS and mapping of theta to the first quarter are obtained in the mean time. It relates to the more popular Q scaling notation according to the following: Dx = Q(15 . the result is rounded to the higher 16 bits for later reference.

jump to end if 180>=THETA LACK #-1 . . . . . jump to end if 90>=THETA LACK #-1 . sign of COS(THETA) . =>theta_m . . assume THETA (THETAH) is in quadrant 1 . 1=>SC. assume THETA (THETAH) is in quadrant 2 .SPRA284A ******************************************************************** ** Determine quadrant ** ******************************************************************** LACC SACL SACL LACC SACL SUB BLEZ one SS SC theta_r theta_m theta_90 E_Q . THETA (THETAH) is in quadrant 4 if not . =>theta_m . THETA=>theta_m . 1=>SS. -1=>SC . if not SACL LACC SUB SACL LACC SUB BGEZ SS theta_r theta_180 theta_m theta_270 theta_r E_Q . assume THETA (THETAH) is in quadrant 3 . . 360-THETAH=>theta_m AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 25 with TMS320C240 . 180-THETA . . if not SACL LACC SUB SACL BGEZ SC theta_180 theta_r theta_m E_Q . jump to end if 270>=THETA LACC SACL LACC SUB SACL E_Q one SC theta_360 theta_r theta_m . -1=>SS . . THETA-180 . 1=>SC . sign of SIN(THETA) .

decrease SP further if smaller . This pointer is then used to index the SIN table to get the SIN and COS of theta. . compare theta_m with table(SP-1) . The following code implements this operation: ******************************************************************** ** Obtain theta table entry ** ******************************************************************** LACC ADD TBLR theta_1stentry SP GPR0 . SP-1=>SP SUB SACL one SP ADD TBLR theta_1stentry GPR0 . decrease SP other wise . get table(SP) LACC SUB BZ BGZ theta_m GPR0 look_end inc_SP .SPRA284A Table look-up to determine SIN and COS of theta. . SP+1=>SP ADD theta_1stentry . jump to end if not inc_SP LACC SP ADD SACL one SP . . Two tables are used here. increase SP if bigger dec_SP LACC SP . This way uneven spacing of theta values is allowed if necessary. A pointer is maintained and updated based on comparing the newly determined theta with entries in the theta table. The first table lists all the discrete theta values while the second lists the corresponding SIN values. . . . compare theta_m with table(SP) . . end look-up if equal . point to SP+1 26 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . get table(SP-1) LACC SUB BLZ B theta_m GPR0 dec_SP look_end . point to SP-1 .

SPRA284A TBLR GPR0 . sin_theta . compare theta_m with table(SP+1) . two multiplications give the d and q components of the reference voltage vector. . . . modify sin: D15*D1=D(16+1) . By simply comparing theta with the sector limits. get table(SP+1) LACC SUB BGZ look_end theta_m GPR0 inc_SP . get cos(THETA) LT MPY PAC SACL SC cos_theta . left shift 16 bits and save: D1 ******************************************************************** ** Get cos(theta) ** ******************************************************************** LACC SUB TBLR SIN_lastentry SP cos_theta . modify sign: D15*D1=D(16+1) . . left shift 16 bits and save: D1 Once SIN and COS of theta are obtained. the sector s of theta is obtained as shown in the following code: AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 27 with TMS320C240 . . . end if not ******************************************************************** ** Get sin(theta) ** ******************************************************************** LACC ADD TBLR SIN_1stentry SP sin_theta . cos_theta . get sin(THETA) LT MPY PAC SACL SS sin_theta . . increase further if bigger .

S=6 if not E_S SAR AR0. . Based on s . jump to end if yes . jump to end if yes . assume S=3 if not.S .#1 . compare with 300 (in sector 5?) . compare with 240 (in sector 4?) . . ARP points to AR0 . jump to end if yes . compare with 60 (in sector 1?) . Decomposition of the reference voltage vector onto the basic space vectors of the sector is done by 2-by-2 matrix multiplication. assume S=4 if not LACC SUB BLEZ MAR theta_r theta_240 E_S *+ . jump to end if yes . the decomposition matrix is fetched. assume S=2 if not LACC SUB BLEZ MAR theta_r theta_120 E_S *+ . assume S=5 if not LACC SUB BLEZ MAR theta_r theta_300 E_S *+ .AR0 AR0. . The following code accomplishes this operation: 28 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .SPRA284A ******************************************************************** ** Determine sector MAR LAR *. compare with 180 (in sector 3?) . LACC SUB BLEZ MAR theta_r theta_180 E_S *+ . compare with 120 (in sector 2?) . . assume S=1 ** LACC SUB BLEZ MAR theta_r theta_60 E_S *+ . jump to end if yes . .

continue if bigger than zero . 0.5*T2: D15+D15=D15 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 29 with TMS320C240 . get the pointer . ******************************************************************** LACC ADD SACL LAR #(decpar_1stent-4) S.5*T1: D15+D15=D15 cmp1_big0 . Uq *+ .5*T1 .SPRA284A ******************************************************************** ** Calculate T1 & T2 based on ** ** or ** ** ** ** where ** ** Mdec(S) = Tp [V1 V2]' Uout = Trans([Ud Uq]) [T1 T2] = Tpwm [V1 V2]' Uout [0.5*T1 0.5*T2] = Tp [V1 V2]' Uout = Mdec(S) Uout Tpwm Uout = V1*T1 + V2*T2 ** ** ** ** ** ** ** ** ** ** ** ** Mdec is obtained through table look-up. calculate 0.GPR0 .1) Ud: D4*D10=D(14+1) .1) Ud: D4*D10=D(14+1) . Calculate 0. . M(1. . zero it if less than zero . M(1.5*T2 . M(2. Uq *+ . point to parameter table LT MPY PAC LT MPY APAC BGEZ ZAC Ud *+ . ** Note that timer period is half of PWM period. . cmp1_big0 SACH cmp_1 LT MPY PAC LT MPY APAC Ud *+ . M(2.2) UqP D4*D10=D(14+1) .2 GPR0 AR0.2) Uq: D4*D10=D(14+1) . 0.

5*T1 . left shift 15 (right shift 1) bit . This switching pattern is fixed for each sector and can be summarized as 000.SPRA284A BGEZ ZAC cmp2_big0 . The correct PWM output pattern are then generated by the compare logic. and back to 000 in each period. 0. This approach has chosen the switching direction for each sector that results in one channel toggling at a time. some discussion on the switching patterns implementing space vector PWM must be done. 0. only one direction is such that only one channel toggles at a time.25*T0 SACH cmp_0 Before moving on to the next step. Ui ± 60. Therefore.5*T0 . there are two possible switching directions for each sector. 30 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . cmp0_big0 SACL cmp_0 LACC cmp_0.5*T2: D15 . zero it if less than zero . second and third are determined also. Obviously. The compare registers are then loaded with obtained compare values.15 .Ui -0. where Ui and Ui ± 60 are the basic space vectors forming the sector the reference voltage vector is in. continue if bigger than zero .5*T0 = Tp . Calculate 0. Ui ± 60. meaning the PWM outputs switch sequentially from 000 to Ui. . Ui. once the sector of Uout has been determined. as shown in Figure 10 below.Ui ± 60-111Ui ± 60. The pattern in Figure 8 is just one of them and is used in this implementation. continue if bigger than zero . clock wise and counter clock wise. cmp2_big0 SACH cmp_2 LACC SUB SUB BGEZ ZAC #max_cmp_ cmp_1 cmp_2 cmp0_big0 .Ui . There are many switching patterns to implement space vector PWM. However.0.0. zero it if less than zero . the channels that toggle first. Based on this analysis. 111. except when the reference voltage vector is on one of the basic space vectors. The compare register address for the channel that toggles the third can then be easily calculated. two look-up tables are constructed to use the sector s as an index to look for the respective compare register addresses for the channels that toggle the first and second in a PWM period.

. ******************************************************************** ** Addresses of compare registers corresponding to channels to ** toggle the 2nd in a given period indexed by the sector THETA ** (Uout) is in.WORD CMPR2 . ** ** ** ******************************************************************** first_ .WORD CMPR2 . 1 2 ) T1 O 000 (000) U out T2 U0 (100) d axis 3. .WORD CMPR1 .1 U 180 (011) 6. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 31 with TMS320C240 .1 2 ) 1) The above operation is carried out by the following code: ******************************************************************** ** Addresses of compare registers corresponding to channels to ** toggle the 1st in a given period indexed by the sector THETA ** (Uout) is in. .WORD CMPR3 . U 120 (010) q axis U 60 (110) (. . . . ** ** ** ******************************************************************** second_ . 0 (- 2 3.WORD CMPR2 .1 6. 1 2 ) (1 6.SPRA284A Figure 10.WORD CMPR1 . 0 ) O 111 (111) ( 2 ) (. .1 2 ) U 240 (001) U 300 (101) (1 6. Switching sequence for each sector.WORD CMPR3 .

.WORD CMPR2 . get the channel to toggle the .WORD CMPR1 . point at the 2nd channel .WORD CMPR3 . . point at entry in look up table . get the channel to toggle the . .CM . 2nd LAR AR0. get the channel to toggle the . point at entry in look up table . .GPR0 . . cmp_0+cmp_1 . . point at the 1st channel . 3rd SACL GPR0 LAR AR0. point at the 3rd channel 32 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .CL . 1st LAR AR0.SPRA284A . ADD S .WORD CMPR3 . . ******************************************************************** ** Determine the channel toggling sequence and load compare values** ******************************************************************** LACC #(first_-1) . => the 2nd channel TBLR CM LACC cmp_0 ADD cmp_1 SACL * LACC #CMPR3 SUB ADD SUB ADD CL #CMPR2 CM #CMPR1 .. . . . . . ADD S .WORD CMPR1 . . cmp_0=>the 1st channel TBLR CL LACC cmp_0 SACL * LACC #(second_-1).

In stead of assigning a scale of Q15 to all the variables. In this case. respectively. because they may result in overflow. . Assume ranges of Y and Z are separately 0-7. Scaling and Accuracy As has been pointed out that a different scaling notation is used here which uses Dx to indicate and track the scaling of variables and Dx relates to Q notation by the equation Dx = Q(15 . AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 33 with TMS320C240 . Y and Z are assigned to be D-1.12499 to 0.x ) .D . in most cases. the result of b* Z has to be right shifted by one bit to change the scaling to D0 before the addition is made to obtain X which. the scaling of variables is determined based on the underlying physical quantities so that little or no concern of overflow is needed. Y and Z each with maximum possible resolution. in this case will have a scale of D0. right shift of both operands by one bit may be needed before an addition or subtraction. where D is an infinitely small number. . Therefore. The scales of a* Y and b* Z are then D0 and D1 based on the equation: Dx * D y = D ( x + y ) (12) Therefore. b = 0.4.2 x + D to 2 x . In fact. Notice also that the scaling on the final compare values has to be D15 (or Q0) to result in integer values. Similarly. the scale of a is assigned to be D-3 (or Q18) which can represent numbers from -0. The user must pay attention to the additions and subtractions just like in the popular Q15 format. a scaling approach different from the popular Q15 approach is adopted here which maximizes the dynamic accuracy of calculation.999 and 0-0. Therefore a variable with scale Dx can represent numbers from . However.999.12499. Consider the equation: X = a* Y + b* Z (11) where a = 0. The block diagram of this implementation is shown in Figure 11in the following. b. the scales of b. the scaling approach here assigns a separate scaling to a. =>the 3rd channel SACL * Notice that the final compare values are obtained at the same time the switching sequence is determined. D3 and D0.SPRA284A LACC cmp_0 ADD ADD cmp_1 cmp_2 . cmp_0+cmp_1+cmp_2 .124.

Block diagram of implementation I.T2&T3 Matrix M Table look-up Table look-up Load cmp registers Toggling pattern PWM H/W Inverter ADC I/F M 32-bit integrator 3 Obtain Quadrant q Obtain Sector 34 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . Constant V/Hz profile Vcc U out DC Supply Voltage Obtain Ud & U q Obtain SIN/COS Decompose T1.SPRA284A Figure 11.

e. though a different implementation method is used. Interrupt control & Event manager) and a time-out loop which allows the motor to startup in open-loop for a fixed duration until the closed-loop PI controller takes over. Watchdog. background loop) consists simply of TMS320C240 peripheral initialization (e. This ISR is invoked every 41. As shown in Figure 12. The closed loop speed control is based on the classical Proportional-Integral (PI) controller.Closed loop speed control for 3-phase AC induction motor This section covers the details of the second implementation closed-loop speed control with V/Hz principle for AC induction motors.SPRA284A Implementation II . PLL. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 35 with TMS320C240 .g. The description given here is divided into 4 sections. the main code (i. The remainder of the code is taken up entirely by PWM_ISR. namely: 1) Software Flow Overview 2) Space vector PWM 3) Measuring the motor shaft rotation speed 4) Closed loop speed control Software Flow Overview The entire application s/w is driven by an Interrupt service routine (ISR). The PWM technique is the same.6uS (24KHz) by the Period event flag on Timer 1 of the Event manager.

Meas Speed ISR called every 41.Interrupt control LOOP_ON_FLG = 0 Summary only -PI algorithm . NO openloop timeout ? YES LOOP_ON_FLG = 1 Motor is run open-loop initially for approx 2 sec to allow for valid speed meas.PLL. RESET PWM_ISR Initialisation .Calc new angle of V* . Software structure of Implementation II. that is: 1) The PI algorithm is bypassed until LOOP_ON_FLG is set once the startup time-out occurs. RET Figure 13 shows the entire flow of PWM_ISR.DSP core .Calc magnitude of V* .Decompose V* . Most of the code is “in-line” code with the exception of 3 main conditional blocks.SPRA284A Figure 12.Event Mgr .Monitor Push buttons.Calc Timer Comp values . 36 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . . 2) The up/down push-buttons which control the motor speed set point are interrogated every ISR cycle but no action is taken unless PB1 or PB2 is depressed. 3) The motor shaft period measurement and speed calculation is done only when the Capture 1 flag is set indicating a valid rising edge was detected from the hall effect sensor.6 uS by Timer 1 Period event. WD .

In addition the algorithms benefit from the performance increase obtained when using high sampling rates.Averaging algorithm . Tc & load into Evt mgr Inc Virtual timer Valid Pushbutton Press ? YES YES PI .Calculate speed (1/period) Decompose V* into dq components RET Since there is only one ISR which is invoked every 41.Calculate Tooth-tooth period . motor shaft speed measurement and push-button debounce. since the C240 DSP core at 20 MIPs has ample bandwidth to easily complete the entire ISR within the 41.SPRA284A Figure 13.6uS all algorithms shown in the flow diagram in Figure 13 make use of the common sampling rate of 24KHz.Inc Freq If PB2 .Algorithm If PB1 .6 uS it makes the s/w implementation much cleaner. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 37 with TMS320C240 . Tb. PWM_ISR Calculate Compare values Ta. However as will be discussed later. Although this rate may be appropriate for the Space vector PWM generation it may be “overkill” for the PI speed control loop. since a multi-interrupt structure with priority and synchronization issues is avoided.Dec Freq NO Is LOOP_ON_FLG NO set ? Calculate Magnitude of V* based on V/Hz profile NO Is Capture Flag set ? YES Calculate new Angular position of V* based on angle step increment . Flow chart of Implementation II.

96 6.17 39. Table 2 CPU Cycles of Major Program Blocks S/W block Volts/Hz profile V* positioning & decomposition Compare value calculation & transform Push button debounce & action Period measurement & speed calculation PI-loop algorithm Misc overhead TOTAL # cycles 24 33 53 32 114 28 43 327 # uS @ 50nS (20 MIPs) 1.SPRA284A Table 2 below gives an outline of the number of cycles taken to complete each major block of the ISR and how much total DSP CPU bandwidth is utilized by the entire application. b and c.60 5.b. M.65 1.70 3.37 3.15 16.88 3. w and magnitude of this vector. outputs PW1 PWM6.85 13.35 uS % CPU loading 2.37 5. Realization of the switching pattern using PWM outputs: By using the decomposed form of V* appropriate compare values are calculated for use with the C240 Event manager PWM generation units.65 2.40 2. i.3 % Space vector PWM In order to create the required rotating MMF (magneto-motive force) in the stator of an AC induction machine the power inverter in Figure 6 needs to be driven with the correct switching variable vector [a.20 1. To do this. This implies accurately controlling the rotational speed.c]t. Decomposing the Reference Voltage vector: For any given position of V* within the d-q plane it must be decomposed (transformed) into the set of appropriate switching variables a.70 1. G G à 38 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . 3 main elements need to be addressed: G Generating the Reference voltage vector: This requires precise positioning of the Reference voltage vector (V*) within the d-q plane shown in Figure 14.e.

wrap-around) of a finite length register.SPRA284A Generating the Reference Voltage Vector To accurately position the Reference vector V* in both space and time. The vector magnitude M controls the resultant peak line voltage which is supplied by the inverter. The aim here is to rotate V* in the d-q plane at a given angular speed (frequency) w. Generating and representing the reference voltage vector q V2 (010) V6 (110) "Vy" M "Vx" V* V * = MVmax e j= dxVx Sector S1 0000 S3 V3 (011) -1 S4 dyVy a 60 o V4 (100) FFFF d Integrator 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 S6 S5 3 2 0000 FFFF V1 (001) V5 (101) 8 bit sine Table lookup In this implementation the angular speed w is controlled by a precision frequency generation algorithm which relies on the modulo nature (i. By adding a fixed value (step size) to this register. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 39 with TMS320C240 . In effect we are integrating angular velocity to give angular position. The rate of cycling through the table is very easily and accurately controlled by the value of step size. The upper 8 bits of this integrator (a data memory location in the C240) is used as a pointer to a 256 word Sine lookup table. Figure 14. This angular speed represents the rate of displacement of the electrical degrees of the AC induction machine. causes the 8 bit pointer to cycle at a constant rate through the Sine table. called Integrator in Figure 14. At the end limit the pointer simply wraps around and continues at the next modulo value given by the step size.e. precise control of both the vector magnitude M (also called the modulation index) and the angle a is required.

e. the actual line voltage frequency delivered to the AC motor can be controlled to better than 0. only a 60 degree sine lookup table is needed.62 42. In order to complete one revolution (360o) the sine table must be cycled through 6 times.1 Hz. sine of a is needed to decompose the reference voltage vector into the basic space vectors of the sector the voltage vector is in.88 6. Frequency mapping STEP 1 20 40 60 80 100 Freq(Hz) 0.9766 m (# bits) 17 18 Freq res(Hz) 0.14 STEP 1700 1800 1900 2000 2100 2200 Freq(Hz) 103. Resolution of frequency mapping m (# bits) 8 12 Freq res(Hz) 15.93 61. PWM frequency) STEP = angle stepping increment m = # bits in the integration register.6250 0. à Table 3.83 54.061 1.e.76 109.10 STEP 600 700 800 900 1000 1100 Freq(Hz) 36. Table 3 gives an example of the resulting angular frequency for various values of STEP.44 3.28 From the table it is clear that a STEP value of 1 gives a frequency of 0.66 4.17 134.22 2.0153 40 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . For a given fs the frequency setting resolution is determined by m the number of bits in the integration register.07 128. Table 4.97 122.72 48. In the attached software implementation fs = 24KHz .86 115. i.04 67.061Hz. this defines the frequency setting resolution. m=16 bits & STEP ranges from 0 2048.SPRA284A As shown in Figure 14. Table 4 shows the theoretical resolution which results from various sizes of m.0305 0. For a given step size the angular frequency (in cycles/sec) of V* is given by: M= STEP ´ fs 6 ´ 2m (13) where fs = sampling frequency (i. Since this decomposition is identical among the six sectors.

0076 0.36 58.SPRA284A 14 16 0.word . 0 1 2 3 4 5 6 7 8 9 " " " " 246 247 248 249 250 251 252 253 0 0.word .-------------------------------------------------STABLE .word .01 0. .word . Samples: 256.85 0.86 0.06 59.01 0.word .word 0 134 268 402 536 670 804 938 1072 1206 " " " " 27684 27756 27827 27897 27967 28037 28106 28175 .0610 19 20 0. As mentioned previously a 256 entry sine table is used which has a range of 60o. Angle Range: 60.word .word . SINVAL .0038 Another important parameter is the size of the lookup table.-------------------------------------------------.59 58.86 0.85 0. . .13 58.word . .02 0.03 0.70 0. .00 0.word .23 0.41 1.word .53 0.86 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 41 with TMS320C240 .02 0. interpolation techniques can improve the accuracy of the extracted sine values significantly.64 1.word . . .04 " " " " 0.83 59. . Index Angle Sin(Angle) . . .word .17 1.23o. This directly effects the harmonic distortion produced in the resulting synthesized sine wave.2441 0.-------------------------------------------------.No. .88 2.word .word . . .00 0.94 1. . .word .84 0.85 0.89 58.47 0. .02 0.word " " " " . . This gives an angle lookup resolution of 60o / 256 = 0.11 " " " " 57. The table entries are given in Q15 format and a summarized version is shown below.word . Format: Q15 . .66 57.03 0. Although not implemented here.85 0.

. hence: V* = dxVx + dyVy + dzVz (14) where Vz is the zero vector. Vector V* in Figure 14 can also be written as: V* = MVmaxeja = dxVx + dyVy + dzVz where M is the modulation index. i. which are framing the sector. a time average of given base vectors is required. In order to produce an arbitrary Reference vector V*. can be synthesized as a linear combination of the two adjacent base vectors. The duty ratios must add to 100% of the PWM period. b.word 28243 28311 . At any given time the Inverter can produce only one of these vectors. V2. By decomposing V* into its dq components it can be shown that: (15) 3 1 ´ M cos(a ) = dx + dy 2 2 3 3 ´ M sin(a ) = dy 2 2 Solving for dx and dy gives: (16) (17) dx = M sin(60 .word . V5 & V6) which represent the line-to-neutral voltages for various switching combinations of [a.86 0. these are the zero vectors corresponding to states 0 (000) and 7 (111) of the switching variables. dy and dz are the duty ratios of the states X. Vx and Vy.86 Decomposing the reference voltage vector Figure 14 shows the 6 base vectors (V1. V3. Y and Z within the PWM switching interval. and dx. c]. the desired voltage vector V* located in a given sector.SPRA284A .e: dx + dy + dz = 1. i. 254 255 59.a ) dy = M sin(a ) (18) (19) 42 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .e. V4. Two other vectors not shown in the figure are V0 and V7.53 59. and either one of the two zero vectors.77 0.

resolution SACH dy LACC #0FFh SUB ADD ENTRY_NEW S_TABLE .Prepare pointer for Sine table SACL ALPHA LACC ALPHA.Inc angle.P = V * dx .ACC = actual table pointer .11 dy V .SPRA284A These same equations apply to any sector.P = V * dy . This is the reason why only a 60 degree sine lookup table is needed in this implementation. Shown below is the code section which implements the previously described V* positioning & decomposition: .ACC=60 deg TBLR dx LT MPY PAC SACH dx. since the d-q reference frame.1 dx V .dx=Sin(60-ALPHA) .shift 1 to restore Q15 format .Save .dy is in Q15 . can be aligned with any base vector.Save in Q0 format .dy=Sin(ALPHA) .1 LACC dy.shift 1 to restore Q15 format AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 43 with TMS320C240 .------------------------------------------------------------------NEW_ALPHA LACC ENTRY_NEW SACL ENTRY_OLD LACC ALPHA ADD STEP_ANGLE .8 SACH ENTRY_NEW LACC S_TABLE ADD ENTRY_NEW .V is in Q15 .Calculate the angle ALPHA for the new position of the Space vector . which has here no specific orientation in the physical space. value TBLR dy LT MPY PAC SACH dy.& perform the decomposition into the appropriate Base unit vectors.------------------------------------------------------------------.scale for 10 bit integer . . .

Sector Some points to note in the code are: G G G G Q15 math is used to calculate dx & dy from sine table. LACC ENTRY_NEW SUB ENTRY_OLD BCND BRNCH_SR. GEQ .6uS) to generate this switching pattern. Final format for dx and dy is in Q0 so that integer compare values are obtained. The switching pattern in Figure 15 is adopted here and is implemented with the Full Compare Units of C240. Realization of the PWM Switching Pattern Once the PWM duty ratios dx.If negative need to change . A set of 3 new compare values (Ta. a sector pointer needs to be maintained so that the appropriate compare values (Ta. The modulation index M (named V in code) is derived from the V/Hz profile based upon the Frequency set point entered via Up/down push buttons by the user. the appropriate compare values for the compare registers of the C240 Event Manager can be evaluated. Tb and Tc) need to be calculated every PWM period (T=41. Since no distinction is made between sectors for dx and dy calculations.resolution SACH dx . Tb and Tc) are obtained.scale for 10 bit integer . 44 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .Save in Q0 format .SPRA284A LACC dx.11 . dy and dz are calculated.Determine which Sector Space the vector is in.

b.Acc = T-dx . The appropriate phase "scrambling" to maintain correct switching sequences is embedded within the sector calculation section. d0 Ta dx dy d7 d0 dx Tb Tc T = 1 PWM period Note: d 0 = d7 = dz From Figure 15.Acc = Ta = 1/2(T-dx-dy) <A> AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 45 with TMS320C240 . Notice that only one sector calculation is performed every PWM period. PWM output switching pattern of Implementation II.c --> a.dx -dy )/2 Tb = dx + Ta Tc = T -Ta (20) (21) (22) The code section below calculates the resultant PWM compare values from dx and dy.-------------------------------------------------. This code section is repeated with a different mapping of Ta.Sector 1 calculations . Tb and Tc for each of the 6 sectors.a.-------------------------------------------------SECTOR_SR1: LACC SUB SUB SFR SACL ADD SACL LACC Ta dx Tb T .ACC = T .b. it can be seen: Ta = ( T .Acc = T . .Acc = T-dx-dy .Acc = Tb = dx+Ta <B> T dx dy .c .SPRA284A Figure 15.

Little change to the above code is needed to accommodate for this change. asymmetric PWM does have twice the resolution of symmetric PWM when the resolution of the timer is fixed.SPRA284A SUB SACL B Ta Tc . and Figure 17 shows the expected wave forms for all the phases.ACC = T-Ta . Table 5 shows how the effective PWM resolution in number of bits compare between the asymmetrical and symmetrical PWM for a given PWM frequency of 24KHz. 46 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . GP Timer 1 of C240 can also be put in continuous-up/down mode to generate symmetric PWM instead. However. It is generally considered that symmetric PWM generates less harmonic distortion in motor voltage and currents.ACC = Tc = T-Ta <C> LOAD_COMPARES The switching pattern shown in Figure 15 is an asymmetric PWM implementation. At 20 MIPs. Asymmetric and symmetric PWM resolution Asymmetric PWM PWM freq PWM resolution Effective resolution 24KHz 50nS 10 bits Symmetric PWM 24KHz 100nS 9 bits Verification of space vector PWM algorithm The correctness of the space vector PWM algorithm can be verified by probing the filtered PWM outputs of C240 using a very simple low-pass filter with a cutoff frequency of fc @ 1000Hz and viewing the resultant signal on a scope. Table 5. The choice between the symmetrical and asymmetrical case depends on the other care-about in the final implementation. C240 has a PWM (time) resolution of 50nS when asymmetrical PWM outputs are generated and a resolution of 100nS when symmetric PWM outputs are generated. Figure 16 shows a simple setup which can be used to filter the PWM output. However.

6 180.5 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 47 with TMS320C240 .5 330.6 30.5 210. As expected the 3 wave forms are spaced 120o apart.5 150.6 60.6 0. Filtering the PWM outputs Note the resulting wave forms are a “time-averaged” version of the PWM switching signals and show clearly the fundamental frequency at w and the third harmonic at 3w which is inherently generated by the space vector method.5 90.6 300. Figure 17.5 270.6 240. The wave form of filtered space vector PWM outputs 600 500 400 300 200 100 0 120.SPRA284A Figure 16.

Although not shown in the equation for w in Figure 19.t1 sec q= 360 = 14. Speed measurement with a sprocket t1 Dt q t2 Dt = t2 . Figure 18 shows the physical details associated with the sprocket and how it relates to the angular velocity. Figure 18. In order to reduce jitter or period fluctuation. an average of the most recent 25 period measurements is performed each time a new pulse is detected. is calculated according to Figure 19.40 25 1 M 25 teeth w= å Dt = n 1 25 rev/sec n The C240 capture unit allows accurate time measurement (in multiples of clock cycles and defined by a prescaler selection) between events. The hall effect sensor outputs a square wave pulse every time a tooth rotates within it’s proximity.SPRA284A Measuring the motor shaft rotation speed In order to have closed loop control of motor shaft speed.6uS resolution) and the delta time D. The resultant pulse rate is 25 pulses / revolution. The hall effect output is fed directly to the C240 Capture 1 input where the tooth-to-tooth period (t2-t1) can be measured. What we are interested in is the delta time between events and hence for this implementation Timer 1 is allowed to free run with a prescale of 32 (1. in clock counts. In this case the events are selected to be the rising edge of the incoming pulse train. In the implementation described here a low cost shaft sprocket with 25 teeth and a hall effect gear tooth sensor is used with good results. the averaging performed is actually a “box-car” average in which the newest value replaces the oldest value in the 25 deep circular buffer. 48 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . a speed error signal is required between the desired set speed and the actual measured speed.

. By keeping the current and previous capture values it is easy to test for each of these cases.. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 49 with TMS320C240 . Figure 20. 2. 1 0 f f f f f sign fraction Below is the code section which performs the 32bit/16bit division using the SUBC instruction. Note that 2 cases need to be accounted for: 1. integer 16 15 i i i f f f .. This value is subsequently scaled to a 16 bit. 32-bit/16bit division. the angular velocity (frequency) needs to be calculated by inverting the period value.f ( t1 ) D 2 D Case 2 f ( t2 ) £ f ( t1 ) D = 1 + f (t2 ) .. the vertical axis f(t) represents the value of the Timer counter which is running in continuous up count mode and resetting when the period register = 7FFFh. Once a “robust” period measurement is extracted from the averaging algorithm. a 32-bit/16bit division is performed as shown in Figure 20 in the following. the simple case where the Timer has not wrapped around and. Once complete the result is a 32 bit value in Q16 format containing both an integer and fractional part. 1 7 FFFFFFF (Q31) = = speed (Q16 ® 32bit ) period period (Q15) Q16 31 30 Speed = s i i i i .SPRA284A Figure 19. Calculation of speed f(t) 7FFFh 1 T Case 1 f ( t2 ) ³ f ( t1 ) D = f ( t2 ) . In order to maintain high precision in the calculation for the full range of motor speeds.t1 < T In Figure 19. This allows D to be calculated in Q15 format for later use in the averaging and division algorithms. Q15 format value for later calculation of the speed error (see Figure 20).f (t1 ) 0 t1 t2 t1 t2 t Note: only true if t2 . where it has wrapped around.

DT® 0 then all three methods above produce equally good results.Load Numerator Hi . Trapezoidal. 2. i. speed = . 50 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . A PI controller in the continuous-data domain is given by: Ki G ( s) = K p + s (23) There are a number of numerical integration rules that can be used to digitally approximate the integral controller Ki / s.Phase 2 RPT SUBC SACL #15 BCAVG SPEED_LO . i. Forward rectangular and 3. Backward rectangular integration rules.SPEED_fb = SPEED_HI:LO x .Phase 1 LACC RPT SUBC SACL XOR OR #07FFFh #15 BCAVG SPEED_HI SPEED_HI #0FFFFh .Load Numerator Lo . It is clear from Figure 24 that if the sampling rate is increased. Q15) LACC ADDH SFL SACH SPEED_fb.SPRA284A .256 SPEED_LO SPEED_HI Closed loop speed control The Closed loop speed control described here uses the classical Proportional-Integral (PI) controller implemented in the digital or discrete (Z) domain.Scale 32 bit value to fit in 16 bits (i.Result is in Q16 in 32 bit . 7 .e. As is well known. These are shown below in Figure 21.e. fmt .Calculate the Speed of rotation.e. the 3 basic methods to approximate the area of a function numerically are: 1.1/period .

e.en is actually performed in 32 bit precision. The integrator part of the difference equation Yn=Yn-1+Ki.T t (n-1) T nT Trapezoidal Forward rectangle Backward rectangle Hence with the high sampling rate the choice of integration method is of very little importance and the simplest approach is to use the forward rectangle rule which gives the following Ztransform for the integral: Ki s Û Ki 1. defined as a 32 bit quantity.6uS. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 51 with TMS320C240 . but works out very conveniently here since the C240 allows ample spare time within the 41. In focusing on the PI portion of Figure 22. the following things are worth noting in the software section given below: G G Variables wsp (set speed).z -1 (25) The final difference equation for the PI controller implemented here is then: Yn = Yn-1 + Kien + Kpen (26) The complete diagram with all the control blocks of the system implemented here is shown in Figure 22. wfb (speed feedback) & we (speed error) are all represented in Q15 format.6uS PWM ISR to process the entire application including the PI controller. i.T t (n-1) T nT . Approximating the integral e(t) e(t) e(t) . the accumulation or integration register is in Q31 format. For an ACI motor speed loop this is much higher than is typically needed.T t (n-1) T nT . Figure 21. DT = 41.SPRA284A In the implementation described here the sampling rate used for the PWM switching (24KHz) is also used for the speed loop.

w* is actually the Step angle which is used in the V* placement in the d-q plane as discussed previously. In the final implementation the values for constants Ki & Kp were chosen by trial & error. The V/Hz profile block consists of 3 sections. Although not a very “scientific” method it worked out quite convenient since no parameter data was available for the low-cost “off the shelf” AC induction motor being used. Every value of w* is mapped to corresponding value of M. Initially both Ki & Kp were chosen very small and then increased (one at a time) until instability (oscillations or hunting) was encountered. this corresponds to a range of input Voltage frequency of 0 125Hz. à G G The PI controller runs open-loop for the first 2 sec after startup so as to allow the motor to start spinning whereby giving a valid speed measurement from the hall effect speed sensor. 52 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .SPRA284A G The resulting controller output. The value was then simply backed off a little. w* is converted to Q0 format and scaled such that the range is 0 2048. An upper & lower limit and a proportional range between the range of w1 w2. à à G w* is also used in the calculation of the modulation index M by the V/Hz profile block.

Calculate Speed Setpoint .e. Vq V* generation & decomposition m .SPEED_sp = FREQ_SETPT x 22 .The PI controller uses STEP_ANGLE to control the Stator MMF AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 53 with TMS320C240 . T c PWM1 PWM2 PWM3 PWM4 PWM5 PWM6 M fb 1 x Tfb å Tm = n 1 25 i 3 phase Power Inverter Va Vb Vc "Box-car" Averager 3 phase AC induction motor Tm Hall effect speed sensor Below is the code section which implements the PI controller: .22 is a scaling factor . PI controller section . m.SPRA284A Figure 22.Vq T a. T b. The overall block diagram of Implementation II +5v Inc Freq Dec Freq Debounce + Setpoint Controller s/w M Speed (frequency) Set point M max Volts / Hz Profile M sp + M å fb M Proportional e + Mmin M=F n (w) _ å + M* w1 w w2 wmax m Modulation Index control X V d . V d. .------------------------------------------------------------------.i.loop.------------------------------------------------------------------. Vq V2(010) V6(110) b ò Integral V3(011) V4(100) V1(001) V5(101) V e jb V d.This variable is used in the error calculation when closing the . the Setpoint for the system. LT MPY PAC SACL SPEED_sp FREQ_SETPT #22 .

Store as Q0 54 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .Allow shift left of 1 .Skip PI loop if Flag not .Keep a 32 bit integ value I .I = I + Ki*E (E=SPD_ERROR) . . NEQ .measurement from the Hall sensor is valid LACC SUB BCND LOOP_ON_FLG #0Fh PROFILE1.---------------------------------- PL_1 LT SPD_ERROR MPY PAC ADD ADDH SACL SACH STEP_INTEG_L STEP_INTEG_H STEP_INTEG_L STEP_INTEG_H Ki .after a start-up delay in which motor starts to spin & the Speed .SPRA284A . PI loop is closed only .ACC = E*Ki .Check if it's time to close the PI loop.ACC GPR0 = I + Ki*E + Kp*E .rotation speed.set.2048 is in Q0 .Store Hi word LT MPY APAC SACH SPD_ERROR Kp .Calculate error term E .Result is Q15 in 32bit format STEP_ANGLE .06Hz) --> 2048(125Hz) PI_LOOP POINT_B0 SPM LACC SUB SACL 1 SPEED_sp SPEED_fb SPD_ERROR . .GPR0 is in Q15 .---------------------------------.GPR0 = I + Ki*E + Kp*E LT MPY PAC SACH GPR0 #2048 .Store Low word .Save it . STEP_ANGLE has a range of 1(0.

Motor current and its spectrum obtained with implementation I for F=25Hz AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 55 with TMS320C240 . The TMS320C240/F240 EVM is used to run the motor control program. The motor is a 4-pole 3-phase AC induction motor rated at 60Hz. It can be seen that little or no harmonics are present in the current spectrums. 144V and 1/3hp. Figure 23 and Figure 24 show the current wave forms and spectrums obtained with the first implementation.SPRA284A Experimental Results Experimental Data of Implementation I Experimental figures are presented in this section to demonstrate the effectiveness of the discussed algorithms. The converter is designed to interface directly with the TMS320C240/F240 EVM. A motor with fan load controlled by an experimental Spectrum Digital power converter is used in this setup. Figure 23.

Motor current and spectrum obtained with implementation I for F=55Hz Experimental Data of Implementation II Figure 25 and Figure 26 show the current wave forms and spectrums obtained with the second implementation. The TMS320C240/F240 test-bed is used to run the motor control program.SPRA284A Figure 24. 56 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . A generic off-the-shelf GE motor rated at 60Hz. It can be seen again that little or no harmonics are present in the current spectrums. 220V and 1/4hp and a beta power converter from International Rectifier are used in the setup.

SPRA284A Figure 25. Fin=30Hz AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 57 with TMS320C240 . Motor current and current spectrum obtained with implementation II.

Motor current and spectrum obtained with implementation II. Fin=60Hz 58 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .SPRA284A Figure 26.

A novel PWM scheme of voltage source inverters based on space vector theory..M.SPRA284A References 1) Trzynadlowski. EPE. 2) Ogasawara. Kluwer Academic. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 59 with TMS320C240 .. 1989. et al. A. 1994. Aachen. S. Akagi. The field orientation principle in control of induction motors. H.

1. . Description .SPRA284A Appendix I. 3. 5.asm : ACI motor drive : Zhenyu Yu Texas Instruments DSP Automotive/Industrial Applications : TMS320C240/F240(EVM) ** ** ** ** ** ** ******************************************************************** . Constant V/Hz principle is used to generate the magnitude of .------------------------------------------------------------------. . .------------------------------------------------------------------. . three-phase AC induction motors using constant V/Hz principle and . This program implements an open-loop speed control algorithm for . . voltage command from frequency input. .------------------------------------------------------------------. . Maximum scaling and 32 bit integration are used to maximize the 60 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . Open-loop speed control for AC induction motor based on constant V/Hz principle and space vector PWM ******************************************************************** ** File Name ** Project ** Originator ** ** **Target : sv25_attach. Both the PWM and sampling frequencies have been chosen to be . . Space vector PWM technique is used to generate the pulse-width . Notes . space vector PWM technique. . 20KHz. modulated signals controlling a three-phase voltage source power inverter so that desired voltage magnitude and frequency are applied to the phased of a three-phase AC induction motor. calculations. 2. The PWM and sampling frequencies are independently controlled. 4.------------------------------------------------------------------. This program implements a sampling loop to carry out all the .

maximum duty ratio is .------------------------------------------------------------------. accuracy of integer math involved to achieve a better dynamic response. watchdog timer reset string 2 . .1 .------------------------------------------------------------------. watchdog timer reset strings .bss period_flag.set . temporary storage . 7.1 . watchdog timer period .include "c240app. 8.h" ST0 ST1 .set LED_addr . watchdog timer reset string 1 . .1 wd_reset1.bss . Frequency input is through an ADC interface. Peripheral Registers and constants of TMS320C240 .set 0 1 055h 0aah 0Ch . status register ST0 .------------------------------------------------------------------.bss wd_period. +1 .bss .1 . 6. status register ST1 . notation based on equation Dx=Q(15-x). .1 wd_reset2. achieved when input is 60Hz). .bss one.SPRA284A . The motor is rated at 60Hz (that is.set . ADC value 7fe0h corresponds to 120Hz. period start flag AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 61 with TMS320C240 .------------------------------------------------------------------******************************************************************** ** Variables in B1 page 0 ** ******************************************************************** . . The D scaling notation used here is equivalent to the popular Q .bss GPR0. addr of LED display on EVM wd_rst_1 . ADC value 0 . . corresponds to 0Hz.set wd_rst_2 .1 . Variable definitions .

1 S_W. cos(THETA): D1 . voltage Ud: D4 . rounded THETAH .1 min_U.1 theta_1stent.1 SC. adc 0. channel 0 data .1 .bss .1 A_U.bss .1 .bss .bss .bss .1 adc1_13.1 cos_theta. normalized set voltage: D2 . adc 1. D15.1 adc1_14. lower limit on set U: D2 .bss A_W. channel 2 data .bss .bss .1 min_W.bss . sin sign modification: D15 .bss . adc 0.bss .bss . sector reference U is in .1 . adc 1.bss . angular position higher word .bss .1 S.bss . beginning of sin table . ADC data to set W ratio . D1. channel 1 data .1 .1 .1 .bss theta_m.bss adc0_7.1 S_U.bss T_sample.bss theta_60.1 Uq. adc 1. upper limit on set U: D2 . set angular speed: D11 .bss .1 Ud.SPRA284A .1 SS.1 adc1_15. beginning of theta table . channel 2 data .1 adc0_5. adc 0.bss . sin(THETA): D1 .bss . cos sign modification: D15 . sampling period: D-9 .bss .1 adc0_6.bss .bss THETAH.1 max_U. THETA mapped to 1st quadrant . end of sin table .1 SP. lower limit on set W (frequency) .bss . channel 1 data .1 theta_r. D3.1 SIN_lastent.bss . 60: D3 62 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .bss . angular position lower word .1 THETAL.1 SIN_1stent. ADC data to set U ratio .bss . voltage Uq: D4 .1 sin_theta. D3. channel 0 data . sin table entry . D10.bss .

bss .bss .bss LED_dir.set .SET .SPRA284A .------------------------------------------------------------------.1 theta_120.bss LED_freq . LED direction (1: left.SET .bss theta_90.bss CL. channel to toggle 2nd . saved accumulator low . component on 2nd basic sp vector .bss .bss cmp_1.1 theta_360.bss .1 cmp_0. 120: D3 .bss . saved accumulator high . 90: D3 .SET ST1_save .1 . LED update sub-divider . 0: right) .1 . 270: D3 .1 LED_data.1 theta_180. 240: D3 . Program parameters .bss .1 . working storage . LED display .------------------------------------------------------------------AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 63 with TMS320C240 . saved status register ST1 .1 CM. sub-divider counter for LED ******************************************************************** ** Variables in B2 ** ******************************************************************** ST0_save . saved status register ST0 .24 . component on 1st basic sp vector .SET 060h 061h 062h 063h 064h 065h . channel to toggle 1st .SET . component on 0 basic sp vector /2 .bss .1 3000 LED_count.1 cmp_2. saved BSR .bss decpar_1stent. 360: D3 .1 theta_270.1 theta_300.bss .set ACCH ACCL BSRS WSTORE . 180: D3 .bss .1 theta_240. Decomposition matrices: D10 . 300: D3 .1 .bss .

1. . Min magnitude of reference voltage given by . User's choice min_afrequency .0/sqrt(2)*min_f/60Hz min_voltage min_U_ .3512 rad/Sec) adc_to_afrequency. D2 . D11 . 120*2*pi/7fe0h(D0)=05721018. 64 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . adc_to_voltage .set 24222 A_W_ . Max magnitude of reference voltage . D2 .set min_afrequency .set 01aa5h . Motor is rated at 60Hz meaning max duty ratio is achieved at 60Hz.0/sqrt(2) max_voltage max_U_ .set 0 min_W_ .354b)(25Hz. D11 .SPRA284A .1aa5 . . D10 . D2 . D2 . Tp = 2*500*50nS=50uS => Fp = 20KHz . D2 .set adc_to_voltage .set min_voltage . D10 .0/sqrt(2)/ADC(60Hz)(D0). Min input frequency. Timer 2 period which determines the sampling frequency. 7fe0h corresponds to 120Hz (754.set 5792 .set 11630 A_U_ . 100Hz.set adc_to_afrequency . . ADC to magnitude of reference voltage conversion ratio .set 500 . T1_period_ . debug_data . 1. D2 .set 0 . 1. ADC to radian frequency conversion ratio given by . Debug data used to substitute ADC input to debug the program.set max_voltage . Timer 1 period which determines the PWM frequency.6a9d)(50Hz.

pi/3: D3 . 4*pi/3: D3 .SPRA284A T2_period_ .word . angles_ . in the following must not be changed.WORD 04b66h . 5*pi/3: D3 . 2*pi/3: D3 . Max compare value max_cmp_ . Memory resident program data .WORD 010c1h .data ******************************************************************** ** Frequently used angles ** ******************************************************************** . 2*pi: D3 ******************************************************************** ** Decomposition matrices indexed by the sector THETA (Uout) is in** ******************************************************************** .WORD 03244h .set 500 . Ts = 50uS.WORD 01922h . The order between these angles and the decomposition matrices . 3*pi/2: D3 .WORD 02183h .set 500 . Sampling period T_sample_ . Fs = 20KHz .set 00346h . pi .word .------------------------------------------------------------------.WORD 04305h .WORD 06488h .WORD 053c7h .word 19595 -11314 0 . Ts = 2*500*50nS=50uS => Fs = 20KHz . D-9. pi/2: D3 . D10 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 65 with TMS320C240 .------------------------------------------------------------------.

word . .word .word . .word .word .word .word .word .word 22627 -19595 11314 19595 11314 0 22627 -19595 -11314 0 -22627 -19595 11314 -19595 -11314 19595 -11314 19595 11314 0 -22627 ******************************************************************** ** Addresses of compare registers corresponding to channels to ** ** toggle the 1st in a given period indexed by the sector THETA ** (Uout) is in.word . ** ** ******************************************************************** first_ .WORD CMPR1 .word .word .SPRA284A .word .word .word .WORD CMPR2 . .WORD CMPR3 .word .word .word . .WORD CMPR1 . ******************************************************************** 66 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .WORD CMPR2 .word .word . .WORD CMPR3 .word .

PM 16 User S/W int PHANTOM . ******************************************************************** ** Reset & interrupt vectors ** ******************************************************************** . PM 18 User S/W int PHANTOM .WORD CMPR3 . .sect ". PM 26 Emulator Trap EMU_TRAP B AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 67 with TMS320C240 .WORD CMPR2 . PM 12 User S/W int PHANTOM . PM 4 EV_isr_B . PM E Int level 4 Int level 5 Int level 6 (Analysis Int) RESERVED B SW_INT8 B SW_INT9 B SW_INT10 B SW_INT11 B SW_INT12 B SW_INT13 B SW_INT14 B SW_INT15 B SW_INT16 B TRAP NMI B B PHANTOM . .WORD CMPR3 . ** ** ** ******************************************************************** second_ .WORD CMPR1 . PM 24 Non maskable Int PHANTOM . PM 14 User S/W int PHANTOM . PM 1C User S/W int PHANTOM . . PM 10 User S/W int PHANTOM .SPRA284A ** Addresses of compare registers corresponding to channels to ** toggle the 2nd in a given period indexed by the sector THETA ** (Uout) is in.WORD CMPR1 . PM 20 User S/W int PHANTOM . PM 8 PHANTOM . PM 0 Reset Vector Int level 1 Int level 2 PHANTOM . PM C PHANTOM .vectors" RESET INT1 INT2 INT3 INT4 INT5 INT6 B B B B B B B START . EV interrupt Group B PHANTOM . PM A PHANTOM . . PM 22 Trap vector PHANTOM . PM 1A User S/W int PHANTOM . PM 1E User S/W int PHANTOM . . PM 2 PHANTOM .WORD CMPR2 .

Note bit 5 is a read/clear bit. Disable watchdog timer if VCCP pin is at 5V SPLK #06Fh.WD_KEY #wd_rst_2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ . PM 2A User S/W int PHANTOM . It can not be set. PM 2E User S/W int . Clear all SYSSR register bits except HP0 (bit 5) . PM 28 User S/W int PHANTOM .SYSCR . Set global interrupt mask ******************************************************************** ** System configuration ** ******************************************************************** .text ******************************************************************** ** Start of main body of code ** ******************************************************************** START dint . Reset watchdog timer SPLK SPLK #wd_rst_1.WD_KEY . PM 2C User S/W int PHANTOM . WD_CNTL .SYSSR 68 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . splk #00000000000000100000b. FLASH programming and WD disabled allowed when bit 5 is 1. Set the source of CLKOUT to be CPUCLK SPLK #0100000011000000b.SPRA284A SW_INT20 B SW_INT21 B SW_INT22 B SW_INT23 B PHANTOM . Configure system registers . Point at Sys Module reg page 0 LDP #0E0h . .

Disable and re-enable the PLL to make sure changes to CKCCR1 .WSTORE OUT WSTORE. Configure wait state generator register so that no wait state is . Point to memory page 0 (B2) LDP #0 . Disable PLL #0000000011000001b.OPCRA * IOPA3/ADCIN8 => IOPA3 * IOPA2/ADCIN9 => IOPA2 * IOPA1/ADCIN1 => IOPA1 * IOPA0/ADCIN0 => IOPA0 SPLK #00f0H.CKCR1 . Configure i/o pins so that all pins shared by Event Manager . added for any off chip access SPLK #1000b. happen SPLK SPLK #0000000000000001b. WSGR <= (WSTORE) .0ffffh . Configure PLL/Clocks to generate CPUCLK of 20MHz when CLKIN=10MHz SPLK #0000000010110001b. See comment lines for configuration of other pins SPLK #0ff00H.CKCR0.SPRA284A . are configured as Event Manager pins . Re-enable PLL .CKCR0. Point at Sys Module reg page 1 LDP #0E1h .OPCRB * BIO_/IOPC3 => BIO_ * XF/IOPC2 => XF AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 69 with TMS320C240 .

70 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . Configure the directions of all digital i/o pins to be input SPLK SPLK SPLK #0000H. disable ADC interrupt.IOPA_DDR #0000H. Point at Sys Mod reg page 0 LDP #0E0h .ADC_CNTL1 #0101100111111111b. ADC_CNTL0 .IOPB_DDR #0000H. Initialize and start ADC . . SPLK SPLK #0000000000000011b. Initialize Event Manager . start conversion. Clear all Event Manager registers before proceeding further. select channel 15 (ADC1) and channel 7 (ADC0) and . Point at Event Manager register page LDP #232 .------------------------------------------------------------------. . ~~~~~~~~~~~~~~~~~~~~~~~~ . disable ext SOC and E.M. enable both ADC modules.IOPC_DDR ******************************************************************** ** Initialize peripherals ** ******************************************************************** . Set up ADC module with p/s=1.------------------------------------------------------------------- . Good to have even when reset works properly. . read.SPRA284A * IOPC0/ADCSOC => IOPC0 . SOC. . ADC is re-started every time the previous conversion results are .

.T2PER .T3CNT . Let GP Timer compare outputs toggle (to have more things I can . Init GP Timer 3 period for other use SPLK #T1_period_. . Define PWM output polarities. .T1CMP #200. .CAPCON #0.CMPR2 #T1_period_. Kill all F.T3PER .T2CON #0.SPRA284A SPLK SPLK SPLK SPLK SPLK SPLK SPLK SPLK SPLK #0. SPLK #T1_period_.T2CMP #200. . Init GP Timer 2 period that determines the sampling frequency .ACTR * bits * bits 15 14-12 0: Dir = CCW (n/c) 000: D2D1D0 = 000 (n/c) AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 71 with TMS320C240 .COMCON #0.DBTCON #0. .T1CNT #0. . SPLK SPLK SPLK #200.T3CMP . SPLK #T2_period_. . look at with an oscilloscope). of speed loop.CMPR1 #T1_period_.T1PER . Comp/PWM outputs. Init GP Timer 1 period that determines the PWM frequency. SPLK SPLK SPLK #T1_period_.CMPR3 .T1CON #0. SPLK #0000100110011001b. .T3CON #0.T2CNT #0.

enabling bits in COMCON. Comp. Comp.GPTCON * bits 12-11 00: No GP Timer 3 event starts ADC 72 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . Define GP Timer compare output polarities and GP Timer actions SPLK #0000000001010101b. Write COMCON twice to configure F&S compare units SPLK SPLK #0000001100000111b. Unit 2 in PWM mode PWM3/CMP3 & PWM4/CMP4 are PWM outputs 0 1: F. Comp. Unit 3 in PWM mode PWM5/CMP5 & PWM6/CMP6 are PWM outputs 1 1: F. before I configure COMCON SPLK #0h.IMRA .COMCON * bit * bits * bit * bits * bit * bit * bit * * bits * bits * bit * * bit * * bit * 15 14-13 12 11-10 9 8 7 1: 00: 0: 00: 1: 1: 0: Enable Compare/PWM operation Load F. Mask PDPINT to prevent it from disabling the compare output .COMCON #1000001100000111b. Registers on underflow of GPT1 Disable Space Vector PWM Mode Load ACTR on underflow of GPt1 Enable F Compare outputs Enable S Compare outputs Select GP Timer 1 as time base for S Comp Units 6-5 4-3 2 00: 00: 1: Load SCMPR on Underflow of selected GP Timer Load SACTR on underflow of selected GP Timer F.SPRA284A * bits * bits * bits * bits * bits * bits 11-10 9-8 7-6 5-4 3-2 1-0 10: 01: 10: 01: 10: 01: PWM6/CMP6 active high PWM5/CMP5 active low PWM4/CMP4 active high PWM3/CMP3 active low PWM2/CMP2 active high PWM1/CMP1 active low . Comp. Unit 1 in PWM mode PWM1/CMP1 & PWM2/CMP2 are PWM outputs .

T2CON * bit * bit * bits * bits * bit * bit * bits * bits * bit * bit 15 14 13-11 10-8 7 6 5-4 3-2 1 0 1: 0: FREE = 1 SOFT = 0 101: continuous-up/dn count mode 000: Prescaler = /1 1: 0: 00: 00: 1: 0: Use Timer ENABLE of GP Timer 1 Disable timer (counting operation) Select internal CLK Load GP Timer comp register on underflow GP Timer compare enabled Use own PR AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 73 with TMS320C240 .T3CON * bit * bit * bits * bits * bit * bit * bits * bits * bit * bit 15 14 13-11 10-8 7 6 5-4 3-2 1 0 1: 0: FREE = 1 SOFT = 0 101: continuous-up/dn count mode 000: Prescaler = /1 1: 0: 00: 00: 1: 0: Use Timer ENABLE of GP Timer 1 Disable timer (counting operation Select internal CLK Load GP Timer comp register on underflow GP Timer compare enabled Use own PR . Configure GP Timer 3 SPLK #1010100010000010b. Configure GP Timer 2 SPLK #1010100010000010b.SPRA284A * bits * bits * bit * bits * bits * bits 10-9 8-7 6 5-4 3-2 1-0 00: 00: 1: 01: 01: 01: No GP Timer 2 event starts ADC No GP Timer 1 event starts ADC Enable GP Timer Compare outputs GP Timer 3 comp output active low GP Timer 2 comp output active low GP Timer 1 comp output active low .

D1. +1 => one #T_sample_. Mask all Grp C ints ******************************************************************** ** Initialize variables ** ******************************************************************** .SPRA284A .IMRC . Clear all Group B interrupt flags .A_W #A_U_.IFRA #0ffh.min_U .IMRB #00h. Mask all Grp A ints . lower limit on set W #max_U_. ADC to set U ratio #min_W_.min_W . ADC to set W ratio .IFRC #0h. Point to B1 page 0 LDP #6 SPLK SPLK SPLK SPLK SPLK SPLK SPLK #1.IMRA #04h. Configure GP Timer 1 SPLK #1010100000000010b. Clear all Group C interrupt flag . Clear all Group A interrupt flags . upper limit on set U #min_U_. lower limit on set U 74 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .one . sampling period #A_W_.A_U . D8.T1CON * bit * bit * bits * bits * bit * bit * bits * bits * bit * bit 15 14 13-11 10-8 7 6 5-4 3-2 1 0 1: 0: FREE = 1 SOFT = 0 101: continuous-up/dn count mode 000: Prescaler = /1 0: 1: 00: 00: 1: 0: Reserved Disable Timer (counting operation) Select internal CLK Load GP Timer comp register on underflow GP Timer compare enabled reserved SPLK SPLK SPLK SPLK SPLK SPLK #0fffh.max_U .IFRB #0fh.T_sample. Mask all but GPT2 UF Grp B ints .

1 destination ADD one . Unmask all EV interrupts to AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 75 with TMS320C240 . Init table 1st and last entries and table pointer SPLK #TB_TH.IMR .SIN_1stent SPLK #(TB_S+180).#(32-1) #angles_ AR0 .SIN_lastent ******************************************************************** ** More house keeping ** ******************************************************************** .SP SPLK #TB_S. theta low byte .0 . Clear all core interrupt . ~~~~~~~~~~~~~~~~~~~~~~ splk #01h. point to 1st destination AR1.LED_addr .THETAL #0.IFR . reset sub-divider counter splk #1. move and point to next .#theta_60 . BANZ INITB.SPRA284A SPLK SPLK #0. TBLR *+. 32 entries . point to memory page 0 LDP #0 SPLK #0ffh. Set LED display splk #LED_freq.LED_count .THETAH . Set LED display on EVM . flags SPLK #0eh.LED_data out LED_data. .theta_1stent SPLK #1. point to next data item .LED_dir . theta high byte LAR LAR LACC LARP INITB AR0. set LED display direction . point to 1st data item .

Set sign extension (allow) . Start all three GP Timers SPLK #1010100001000010b. Toggle xf for debug purpose setc xf . Wait for sampling period start. w_sample LACC period_flag . . time to update LED display? .period_flag . Enable global interrupt . no sacl LED_count BNZ LED_nc 76 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . . Set overflow protect mode .T1CON ******************************************************************** ** Start of main loop ** ******************************************************************** MAIN . point at B1 page 0 ldp #6 . Wait if not set SPLK #0. Update LED display on EVM lacc LED_count sub one . flag BZ w_sample . update sub_divide counter . Reset the flag if it is set . CPU SETC OVM SETC SXM .SPRA284A . Load sampling period start . mode EINT . Point at EV reg page LDP #232 .

point at B1 page 0 ldp #6 .LED_dir b LED_update right_shift lacc LED_data. shift right by one bit .SPRA284A splk #LED_freq. . save (D0) . sfr sacl adc0_7 . no .NTC lacc LED_data. 0 ACC high SPLK #0101100111111111b. lacl ADC0_DATA . reset subdivide counter bit LED_dir.NTC splk #0.BIT0 . yes .NTC splk #1. yes.LED_addr ******************************************************************** ** Read ref frequency ** ******************************************************************** . yes . Get ADC data and re-start ADC. AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 77 with TMS320C240 . no . Replace adc0_7 with debug data.1 sacl LED_data bit LED_data. Point at Sys Mod reg page 0 LDP #0E0h . ADC_CNTL0.BIT0 bcnd LED_update. Right shift ADC data by one bit to get D0 representation.BIT7 bcnd LED_update. yes . update LED display bcnd right_shift. left shift one bit .LED_dir LED_update out LED_nc LED_data.15 sach LED_data bit LED_data. no . time to change direction? . re-start ADC . Get ADC data. right shift one bit . For debug purpose only. left shift? .LED_count . . time to change direction? .

******************************************************************** ** Calculate radian frequency ** ******************************************************************** LT MPY PAC SACH S_W adc0_7 A_W . D0*D1=D(1+1) . . saturate if not . limit BLEZ U_in_uplimit LACC max_U SACL S_U U_in_uplimit LACC S_U SUB min_U . continue if within limit . . D0*D10=D(10+1) . compare Uout with its upper . LACC min_W SACL S_W W_in_limit ******************************************************************** ** Calculate magnitude of ref voltage Uout ** ******************************************************************** . . Note const. load ADC data: D0 . continue if within limit . compare Uout with its lower . saturate if not . limit BGEZ U_in_lolimit LACC min_U . continue if within limit . V/Hz is implied MPY PAC SACH S_U A_U .adc0_7 .SPRA284A SPLK #debug_data. set U: D2 SUBH max_U . radian frequency: D11 SUBH min_W BGZ W_in_limit . . saturate if not 78 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . compare W with its limit .

assume THETA (THETAH) is in quadrant 1 SACL SS SACL SC LACC theta_r SACL theta_m SUB theta_90 . accumulate: D3+D3=D3 SUBH theta_360 BLEZ Theta_in_limit SACH THETAH Theta_in_limit . round up to upper 16 bits SACH theta_r ******************************************************************** ** Determine quadrant ** ******************************************************************** . assume THETA (THETAH) is in quadrant 1 LACC one. . . . compare with 2*pi: D3-D3=D3 . D-9*D11=D(2+1) . sign of COS(THETA) . sign of SIN(THETA) . . .SPRA284A SACL S_U U_in_lolimit . mod(2*pi. 1=>SS. 1=>SC. . . ******************************************************************** ** Obtain theta (phase of Uout) through 32 bit integration ** ******************************************************************** LT MPY PAC S_W T_sample . ADDS THETAL ADDH THETAH SACH THETAH SACL THETAL .15 . continue if within limit . THETA=>theta_m . AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 79 with TMS320C240 . THETA) if not ZALH THETAH ADDS THETAL ADD one. .

SPRA284A

BLEZ E_Q

; jump to end if 90>=THETA

; assume THETA (THETAH) is in quadrant 2 if not splk #-1,SC LACC theta_180 SUB theta_r ; -1=>SC ; ; 180-THETA ; =>theta_m ; jump to end if 180>=THETA

SACL theta_m BGEZ E_Q

; assume THETA (THETAH) is in quadrant 3 if not splk #-1,SS LACC theta_r SUB theta_180 ; -1=>SS ; ; THETA-180 ; =>theta_m ; ; ; jump to end if 270>=THETA

SACL theta_m LACC theta_270 SUB theta_r

BGEZ E_Q

; THETA (THETAH) is in quadrant 4 if not splk #1,SC LACC theta_360 SUB theta_r ; 1=>SC ; ; ; 360-THETAH=>theta_m

SACL theta_m E_Q

******************************************************************** ** Obtain theta table entry **

******************************************************************** LACC theta_1stent ADD SP ; ; ; get table(SP)

TBLR GPR0

LACC theta_m SUB GPR0

; ; compare theta_m with ; table(SP)

80 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240

SPRA284A

BZ look_end BGZ inc_SP

; end look-up if equal ; increase SP if bigger

dec_SP

LACC SP SUB one

; decrease SP other wise ; ; SP-1=>SP

SACL SP

ADD

theta_1stent

; point to SP-1 ; get table(SP-1)

TBLR GPR0

LACC theta_m SUB GPR0

; ; compare theta_m with ; table(SP-1)

BLZ

dec_SP

; decrease SP further if ; smaller

B

look_end

; jump to end if not

inc_SP

LACC SP ADD one

; ; ; SP+1=>SP

SACL SP

ADD

theta_1stent

; point to SP+1 ; get table(SP+1)

TBLR GPR0

LACC theta_m SUB GPR0

; ; compare theta_m with ; table(SP+1)

BGZ look_end

inc_SP

; increase further if bigger ; end if not

******************************************************************** ** Get sin(theta) **

******************************************************************** LACC SIN_1stent ADD SP ; ;

AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 81 with TMS320C240

SPRA284A

TBLR sin_theta

; get sin(THETA)

LT SS MPY PAC SACL sin_theta sin_theta

; ; modify sign: D15*D1=D(16+1) ; ; left shift 16 bits and save: ; D1

******************************************************************** ** Get cos(theta) **

******************************************************************** LACC SIN_lastent SUB SP ; ; ; get cos(THETA)

TBLR cos_theta

LT MPY PAC

SC cos_theta

; ; modify sin: D15*D1=D(16+1) ; ; left shift 16 bits and save: ; D1

SACL cos_theta

******************************************************************** ** Calculate Ud & Uq **

******************************************************************** LT MPY PAC SACH Ud MPY PAC SACH Uq sin_theta S_U cos_theta ; ; Uref*cos(THETA): D2*D1=D(3+1) ; ; ; Uref*sin(THETA): D2*D1=D(3+1) ; ;

******************************************************************** ** Determine sector **

********************************************************************
82 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240

ARP points to AR0 . jump to end if yes . 4?) BLEZ E_S MAR *+ . . . jump to end if yes . jump to end if yes . assume S=4 if not LACC theta_r SUB theta_240 . jump to end if yes .AR0 AR0. assume S=3 if not. compare with 300 (in sector . compare with 180 (in sector . . AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 83 with TMS320C240 . jump to end if yes . compare with 60 (in sector .S .SPRA284A MAR LAR *. . S=6 if not . . 5?) BLEZ E_S MAR SAR *+ AR0. compare with 120 (in sector . LACC theta_r SUB theta_180 . 2?) BLEZ E_S MAR *+ . 1?) BLEZ E_S MAR *+ . assume S=5 if not LACC theta_r SUB theta_300 . 3?) BLEZ E_S MAR *+ .#1 . assume S=1 LACC theta_r SUB theta_60 . assume S=2 if not LACC theta_r SUB theta_120 . compare with 240 (in sector .

5 Tpwm.5*T2] = Tp [V1 V2]' Uout = Mdec(S) Uout Tpwm Uout = V1*T1 + V2*T2 ** ** ** ** ** ** ** ** ** ** ** ** ** Mdec is obtained through table look-up.SPRA284A ***************************************************** ** Calculate T1 & T2 based on ** ** or ** ** ** ** where ** ** Mdec(S) = Tp [V1 V2]' Uout = Trans([Ud Uq]) [T1 T2] = Tpwm [V1 V2]' Uout [0.5*T1: D15+D15=D15 . ** i.5*T1 . M(2. M(1. Uq *+ . Calculate 0.e. continue if bigger than zero . *+ .2) UqP D4*D10=D(14+1) .GPR0 LT MPY PAC LT Uq MPY APAC Ud *+ . ** Note that timer period is half of PWM period. M(2. calculate 0. 0.2) Uq: D4*D10=D(14+1) .1) Ud: D4*D10=D(14+1) .1) Ud: D4*D10=D(14+1) .2 .5*T2 . . zero it if less than zero . point to parameter table SACL GPR0 LAR AR0.5*T2: D15+D15=D15 84 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . ***************************************************** LACC #(decpar_1stent-4) ADD S.5*T1 0. Tp=0. . . 0. BGEZ cmp1_big0 ZAC cmp1_big0 SACH cmp_1 LT MPY PAC LT MPY APAC Ud *+ . M(1. get the pointer .

5*T0 . zero it if less than zero . . table TBLR CM .0. table TBLR CL . 0. Calculate 0. . . get the channel to toggle the . LACC #max_cmp_ SUB SUB cmp_1 cmp_2 . point to entry in look up .25*T0 ******************************************************************** ** Determine the channel toggling sequence and load compare values** ******************************************************************** LACC ADD #(first_-1) S . AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 85 with TMS320C240 . 2nd LAR LACC AR0. zero it if less than zero . LACC cmp_0. bit SACH cmp_0 . left shift 15 (right shift 1) .5*T2: D15 BGEZ cmp0_big0 ZAC cmp0_big0 SACL cmp_0 . point to entry in look up .CL cmp_0 * .15 . 1st LAR LACC SACL AR0. . 0.CM cmp_0 .SPRA284A BGEZ cmp2_big0 ZAC cmp2_big0 SACH cmp_2 . 0. cmp_0=>the 1st channel LACC ADD #(second_-1) S .5*T0 = Tp . point to the 2nd channel .5*T1 – . get the channel to toggle the . continue if bigger than zero . point to the 1st channel . continue if bigger than zero .

cmp_0+cmp_1 . =>the 3rd channel ************************************** ** Reset wd timer ** ************************************** .GPR0 cmp_0 cmp_1 cmp_2 * .WD_KEY #wd_rst_2. .WD_KEY ************************************** ** Jump back to start of main loop ** ************************************** clrc B xf . . point to the 3rd channel .SPRA284A ADD SACL cmp_1 * . . Point at Sys Module reg page 0 LDP #0E0h . 3rd LAR LACC ADD ADD SACL AR0. . . . Branch back MAIN ************************************** ** Handle interrupt ** ************************************** 86 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . => the 2nd channel LACC SUB ADD SUB ADD SACL #CMPR3 CL #CMPR2 CM #CMPR1 GPR0 . . cmp_0+cmp_1+cmp_2 . Reset watchdog timer SPLK SPLK #wd_rst_1. Debug signal . get the channel to toggle the .

. point to memory page 0 . 6fh <= "BAD" value indicates . save status register ST1 . point to memory page 0 . Clear all group B flags LDP #6 SPLK #1. save ACC LDP #232 LACC SACL IFRB IFRB . point to memory page 0 .ST0_save . restore status register ST1 . restore ACC . point to EV reg page .ST1_save #ST0. Point to B1 page 0 . PHANTOM SST SST LDP SACH SACL #ST0.ST1_save #0 ACCH ACCL . save status register ST0 . .period_flag .SPRA284A EV_isr_B SST #ST0. save ACC LDP SPLK #0 #00badh. save status register ST1 .ST1_save LDP #0 SACH SACL ACCH ACCL .B2_SADDR+15 . . point to memory page 0 . save status register ST0 . set start flag LDP ZALH ADDS LST LST EINT RET #0 ACCH ACCL #ST1.ST0_save SST #ST1. point to memory page 0 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 87 with TMS320C240 . error LDP #0 . . Read group B flag register .ST0_save #ST1. restore status register ST0 .

word .word .ST0_save .word .word .5 degree .word .word .word 0 .word .word . return .word .word .word . restore status register ST0 .word .SPRA284A ZALH ADDS LST LST EINT RET ACCH ACCL #ST1. Theta and sine table .word . restore status register ST1 .word .ST1_save #ST0. .word .-------------------------------------------------. restore ACC . angles at 0. .word .word .-------------------------------------------------TB_TH .word .word .word .word .word 36 71 107 143 179 214 250 286 322 357 393 429 465 500 536 572 608 643 679 715 751 786 822 88 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .word . increment: D3 .

word .SPRA284A .word .word .word .word .word .word .word .word .word .word .word .word .word 858 894 929 965 1001 1037 1072 1108 1144 1180 1215 1251 1287 1323 1358 1394 1430 1466 1501 1537 1573 1608 1644 1680 1716 1751 1787 1823 1859 1894 1930 1966 2002 2037 2073 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 89 with TMS320C240 .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .

word .word .word 2109 2145 2180 2216 2252 2288 2323 2359 2395 2431 2466 2502 2538 2574 2609 2645 2681 2717 2752 2788 2824 2860 2895 2931 2967 3003 3038 3074 3110 3146 3181 3217 3253 3288 3324 90 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .word .word .word .word .word .word .word .word .word .SPRA284A .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .

word .word .word .SPRA284A .word .word .word .word .word .word .word .word .word .word .word .word .word .word 3360 3396 3431 3467 3503 3539 3574 3610 3646 3682 3717 3753 3789 3825 3860 3896 3932 3968 4003 4039 4075 4111 4146 4182 4218 4254 4289 4325 4361 4397 4432 4468 4504 4540 4575 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 91 with TMS320C240 .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .

word .word .word .word .word 4611 4647 4683 4718 4754 4790 4825 4861 4897 4933 4968 5004 5040 5076 5111 5147 5183 5219 5254 5290 5326 5362 5397 5433 5469 5505 5540 5576 5612 5648 5683 5719 5755 5791 5826 92 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .word .word .word .word .word .word .word .word .word .word .word .word .SPRA284A .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .

word .word .word .word .word .word .word .word .word .word .word .SPRA284A .word .word .word .word . sin table: D1 143 286 429 572 715 857 1000 1143 1285 1428 1570 1713 1855 1997 2139 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 93 with TMS320C240 .word .word 0 .word .word .word .word .word .word .word 5862 5898 5934 5969 6005 6041 6077 6112 6148 6184 6220 6255 6291 6327 6362 6398 6434 TB_S: .word .word .word .word .word .word .word .word .word .

word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word 2280 2422 2563 2704 2845 2986 3126 3266 3406 3546 3686 3825 3964 4102 4240 4378 4516 4653 4790 4927 5063 5199 5334 5469 5604 5738 5872 6005 6138 6270 6402 6533 6664 6794 6924 94 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .word .word .word .word .word .word .word .word .word .word .word .word .word .word .SPRA284A .

word .word .word .word .word .word 8316 8438 8561 8682 8803 8923 9043 9162 9280 9397 9514 9630 9746 9860 9974 10087 10199 10311 10422 10531 10641 10749 10856 10963 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 95 with TMS320C240 .SPRA284A .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word 7053 7182 7311 7438 7565 7692 7818 7943 8068 8192 .word .word .word .word .

word .word .word .word .word .word .word .word 11069 11174 11278 11381 11484 11585 11686 11786 11885 11982 12080 12176 12271 12365 12458 12551 12642 12733 12822 12911 12998 13085 13170 13255 13338 13421 13502 13583 13662 13741 13818 13894 13970 14044 14117 96 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .SPRA284A .word .word .word .word .word .word .word .word .

word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word 14189 14260 14330 14399 14466 14533 14598 14663 14726 14788 14849 14909 14968 15025 15082 15137 15191 15244 15296 15346 15396 15444 15491 15537 15582 15626 15668 15709 15749 15788 15826 15862 15897 15931 15964 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 97 with TMS320C240 .word .word .word .word .SPRA284A .word .

SPRA284A

.word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word

15996 16026 16055 16083 16110 16135 16159 16182 16204 16225 16244 16262 16279 16294 16309 16322 16333 16344 16353 16362 16368 16374 16378 16382 16383 16384

98 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240

SPRA284A

Appendix II. Closed-loop speed control for AC induction motor based on constant V/Hz principle and space vector PWM
;******************************************************************* ; File Name: ; Project: ; ; Originator: David Figoli ; ; ; Target Sys: C240 EVM + ; ; ; Description: This is an implementation of a 3 phase Space vector ; ; ; ; ; ; ; ; ; ; ; ; Status: ; ; ; ; ; ; ; ; This version runs using the Full Compares, With GPT1 as the Time base & providing the Period control - Asymmetrical PWM scheme (i.e. effective clk res = 40nS) - PWM period = 41.6uS (24KHz) - Effective #bits resolution per PWM period = 10 (1024 counts) - Effective forced "zero" vector=41.6-40.0=1.6 uS - S/W has successfully run a 3 phase AC Induction PWM control scheme for 3 phase AC Induction motor driven via a power inverter. External frequency control is provided by push buttons i.e. PB1 for Incr & PB2 for decrement freq. This version has a fully implemented Speed measurement routine based on Capture input & using 25 teeth Sprocket & Hall sensor. Speed (calculated from the Capture waveform) is used as the feedback variable which is compared to a speed setpoint value by the PI controller block when maintaining closed loop speed control. (ACI i/f board & Inverter from Spectrum Digital) (Texas Instruments Ind/Auto Apps team - Houston) SVPWM_FB.ASM Digital Motor Control Applications development.

AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 99 with TMS320C240

SPRA284A

; ; ;

motor, i.e.: GE 1/4 HP 60Hz 208-230V AC Rated speed 1725 (1800 no slip)

; Last Update: 17-MAR 97 ;******************************************************************* ;------------------------------------------------------------------; Debug directives ;-------------------------------------------------------------------

.def GPR0 .def GPR1 .def GPR2 .def ALPHA .def STEP_ANGLE .def FREQ_SETPT .def ENTRY_NEW .def ENTRY_OLD .def dx .def dy .def Ta .def Tb .def Tc .def V .def CAP_PERIOD .def CAP_NEW .def CAP_OLD .def SPEED_HI .def SPEED_LO .def SPEED_fb .def SPEED_sp .def SPD_ERROR .def BCAVG

;General purpose registers.

.def STEP_INTEG_H .def STEP_INTEG_L .def Kp
100 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240

page 3 of peripheral file .Bit Mask for 7 .set 0400h .Bit Mask for 2 .Bit Mask for 1 .set 0080h .Bit Mask for 0 WSGR DP_PF1 .set 0001h .------------------------------------------------------------------. (7400h/80h) AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 101 with TMS320C240 .set 2000h .Bit Mask for 5 .Bit Mask for 14 .Bit Mask for 15 . Constant Declarations .set 0E0h .set 0E2h . (7100h/80h) DP_EV .SPRA284A .Bit Mask for 8 .page 1 of peripheral file . Used by the SBIT0 & SBIT1 Macro B15_MSK B14_MSK B13_MSK B12_MSK B11_MSK B10_MSK B9_MSK B8_MSK B7_MSK B6_MSK B5_MSK B4_MSK B3_MSK B2_MSK B1_MSK B0_MSK .H .def Ki .set 0200h .set 0004h .set 0020h .set 0FFFFh .Bit Mask for 6 .------------------------------------------------------------------.Bit Mask for 3 .def LOOP_ON_FLG .set 0010h .set 0100h .set 1000h .set 0E1h .Bit Mask for 12 .include C240APP.Bit Mask for 13 .set 8000h .page 2 of peripheral file .set 0002h .set 0E8h .Bit Mask for 9 .EV register data mem page . (7000h/80h) DP_PF2 .Bit Mask for 4 .set 0800h . (7080h/80h) DP_PF3 .Bit Mask for 11 .set 0040h .set 4000h .Bit Mask for 10 .set 0008h .

30000.bss GPR2.1 .B2 button counter (Dec Freq) .bss FREQ_TRGT.set 1024 . Variable Declarations for on chip RAM Block B0 .PI loop Integration constant .set 09830 . in Q15 in Q15 .set 100 .Frequency Target value 0 --> . .High Freq point on profile = 60Hz .0.Start of BC buffer ..1 .87 in Q13 format .Box car average size of 50 .1 .set Ah .set 3000h .set 100 .1 .set 0250h .99999. .-------------------------F1 F2 VF_SLOPE INTERCEPT .Open loop start up value .7FFFh = 5660 rpm .bss GPR1.1 .07 in .Volts/Hz slope 1.set 0256 .bss GPR0.bss RMP_DLY_CNT.Line equation intercept 0.set 25 .bss B1_CNT.PI loop Proportional constant .set 032767 .------------------------------------------------------------------.set 800h . Q13 Vmax Vmin BCNT_MAX .004 Sec depress to be .Value from 0 --> 255 .100x40uS=0.set 02600h .bss FREQ_SETPT.255 . " . .100x40uS=0.set 15292 .set 300h .Low Freq point on profile = 15Hz .bss B2_CNT. " .1 .004 sec between steps.B1 button counter (Inc Freq) .SPRA284A .set 0260h .Ramp rate in adjusting to 102 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .1 .0.set 0546 .General purpose registers. valid RMP_DLY_MAX BC_SIZE BC_BUF_STRT K_integ K_prop STALL_SLIP STARTUP_DELAY STRTUP_FREQ STRTUP_STP_ANGL STRTUP_INTEG .1 ..FFFF x 40uS = 2.set 0FFFFh .Space vector PWM constants .6 sec .------------------------------------------------------------------.

bss ENTRY_OLD. . .1 .bss CAP_OLD.1 .1 .angle(angular speed) .addr.bss REPRESS_DLY.bss dx.1 .Speed setpoint value .Forced delay between .Keeps track of current sector .1 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 103 with TMS320C240 . .bss Kp.1 .Integral constant . .bss SR_ADDR.bss STEP_ANGLE.1 .1 .1 .Angle integrator .bss CAP_NEW.1 .bss STEP_INTEG_H.bss ENTRY_NEW.1 .1 .bss dy.bss Ki.1 .Speed feedback value .bss SPD_ERROR."Box car" average .1 .Rate of change of . .(1-6) .1 .1 .bss ALPHA.1 .1 .bss SPEED_LO.Proportional constant .bss SINVAL.1 . .1 .Represses.Capture period value (between .value .Error signal for PI loop .PI integration variable 32 bit .1 .bss SECTOR_PTR.bss STEP_INTEG_L.bss S_TABLE.bss SPEED_fb.Data addr to store Sine table .1 .bss SPEED_HI.1 .SPRA284A .teeth) .bss SPEED_sp.Space Vector PWM calc variables .bss BCAVG.bss CAP_PERIOD.Target freq.Table lookup entry point .1 .32 bit Speed calc working reg.

endm SBIT1 .bss V_TIMER1. 1 .macro DMA.usect "blk_b2".endm KICK_DOG .macro DMA.bss Ta.Convenience & debug feature variables .usect "blk_b2".1 . 1 .------------------------------------------------------------------SBIT0 . MASK .Stack space in B0 stk1 stk2 stk3 stk4 . WD_KEY 104 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .Set bit Macro LACC DMA OR #MASK SACL DMA .1 .bss T.Definitions .Open/close loop control flag .bss Tc. 1 .1 .1 .1 .usect "blk_b2".1 .bss LOOP_ON_FLG.usect "blk_b2". 1 .------------------------------------------------------------------.SPRA284A .bss V.bss Tb. MASK .Virtual timer counter .Watchdog reset macro SPLK #05555h.macro LDP #00E0h .1 .1 . M A C R O .Clear bit Macro LACC DMA AND #(0FFFFh-MASK) SACL DMA .bss vf_slope.

Vector address declarations .macro LDP . PM A Int level 5 1 4 5 6 7 8 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 105 with TMS320C240 .endm #0h POINT_PG0 .------------------------------------------------------------------. PM 6 Int level 3 .endm #0E8h .endm #0E1h POINT_EV .macro LDP .macro LDP . WD_KEY LDP .macro LDP .SPRA284A SPLK #0AAAAh. PM 0 Reset Vector . PM 2 Int level 1 .------------------------------------------------------------------.macro LDP .endm #0E0h POINT_PF2 .endm #04h POINT_PF1 . PM 4 Int level 2 .vectors" RSVECT INT1 INT2 INT3 INT4 INT5 B B B B B B START PHANTOM PWM_ISR PHANTOM PHANTOM PHANTOM . PM 8 Int level 4 .sect ".endm #00h POINT_B0 .

PM 18 . IFR SXM OVM CNF .Reset Overflow Mode . PM 16 . PM E (Analysis Int) . M A I N C O D E .SPRA284A INT6 RESERVED SW_INT8 SW_INT9 SW_INT10 SW_INT11 SW_INT12 SW_INT13 SW_INT14 SW_INT15 SW_INT16 TRAP NMI EMU_TRAP SW_INT20 SW_INT21 SW_INT22 SW_INT23 B B B B B B B B B B B B B B B B B B PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM PHANTOM .Clear all Int Flags .Clear Sign Extension Mode . PM 1C . PM 1A . PM 1E . PM 14 . PM 2A .=================================================================== . PM 28 . PM 2E User S/W int User S/W int User S/W int User S/W int User S/W int User S/W int User S/W int User S/W int User S/W int Trap vector Non maskable Int Emulator Trap User S/W int User S/W int User S/W int User S/W int 9 10 3 2 - .Config Block B0 to Data mem. PM 24 .Disable interrupts .text START: POINT_PG0 SETC SPLK SPLK CLRC CLRC CLRC INTM #0h. PM 26 . PM 22 . PM 20 .starts here . GPR0 GPR0. PM 2C . IMR #0FFh.Set 0 wait states for XMIF 106 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . PM 10 . PM C Int level 6 . WSGR .=================================================================== . POINT_B0 SPLK OUT #04h.Mask all Ints . PM 12 .

Note: comment out if using cystal & PLL option .This sets the CPU clk to 25MHz & allows 25KHz PWM to be generated .with full 10 Bit compare resolution.PLL_CNTL1 .------------------------------------------------------------------. Initialize Counter. #CMPR1 AR2.Init Sector table index pointer LACC SACL #1040 T .CLKIN(XTAL)=10MHz. & AR pointers .Init Timer Comp reg pointers AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 107 with TMS320C240 .SYSCR . #CMPR2 . SPLK #0041h.Comment out if WD is to be active SPLK #006Fh.PLL_CNTL1 . #40C0h.Use 41. Step parameters. PLL*2.Init PI constants LACC SACL SACL SACL #0h ALPHA ENTRY_NEW SECTOR_PTR . Ki .5=20MHz #0081h.6 uS period (1040 x 40nS) .PLL_CNTL2 .Init the PWM period LAR LAR AR1. Kp #K_integ.CLKMD=PLL Enable. .------------------------------------------------------------------SV_PWM: POINT_B0 SPLK SPLK SPLK SPLK #STABLE.CLKMD=CLKIN/1. CPUCLK/2=CPUCLK/2 .Clear Sine Table Pointer .Start at 0 deg.Note: uncomment if using cystal & PLL option . SPLK SPLK SPLK #00BCh.CLKOUT=CPUCLK .Clear ANGLE integrator . vf_slope #K_prop.SYSCLK/4=CPUCLK/2.Used only to save a cycle . WD_CNTL . . S_TABLE #VF_SLOPE.SPRA284A POINT_PF1 .Disable WD if VCCP=5V KICK_DOG .Used later for multiply.

DP => EV Registers .EV Config starts here.CAPFIFO . #CMPR3 . Initialize period registers for Timers T1.A3. T2 used for CAP1 POINT_B0 LACC T 108 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .Capture FIFO status bits .OPCRA #0h.GP Timer 2 control .------------------------------------------------------------------.T2CON #00000h. A1. A3.1 SPLK .T1CON #00000h. (prevent stray PDPINTs from disabling compare outputs) POINT_EV SPLK SPLK SPLK #00000h. T1 used for PWM.IMRA #00000h. T2 .Dead band control register .A0=I/P.A2=O/P.Mask all Group B interrupt flags . Clear EV control registers SPLK SPLK SPLK SPLK SPLK SPLK SPLK #00000h.SPRA284A LAR AR3.Mask all Group C interrupt flags .CAPCON #000FFh.T3CON #00000h.IMRB #00000h. Setup GP Timers .IMRC .COMCON #00000h.DBTCON #00000h.Capture control .Configure all I/O pins to I/O function pins POINT_PF2 SPLK SPLK EV_LP #0h.------------------------------------------------------------------.OPCRB #0C0Ch.A2=1.GP Timer 1 control . Mask all EV interrupts .------------------------------------------------------------------.------------------------------------------------------------------EV_CONFIG: . .Mask all Group A interrupt flags .PADATDIR .GP Timer 3 control .Compare control .

Configure GP Timer registers .SPRA284A POINT_EV SACL SPLK T1PER #07FFFh.------------------------------------------------------------------. Configure Simple & Full Compare registers .---------------------------------------------------------. SPLK LACC LACC 5432109876543210 ||||!!!!||||!!!! #1010000001000000b. T2PER .GP Timer 1 period . SPLK SPLK SPLK 5432109876543210 ||||!!!!||||!!!! #1001010101000010b.---------------------------------------------------------.T2CON #1010100001000000b.Start the "Ball rolling" with Timers & Compare units.Cont Up. .---------------------------------------------------------.CAPCON FIFO1 FIFO1 POINT_PF2 SPLK #0F0h.Asym . . POINT_EV SPLK SPLK SPLK . Configure Capture 1 registers . . #0000011001100110b. /32.T1CON .T1CON #1001000001000000b.Sym .COMCON ||||!!!!||||!!!! 5432109876543210 . OPCRB . * .Compare Cntl . .ACTR #1010001000000111b.Compare Cntl AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 109 with TMS320C240 .Enable Capture function on pins .------------------------------------------------------------------.Full Action Cntl .---------------------------------------------------------.COMCON #1010001000000111b.Limit counter values to +ve only .

SPLK CLRC #0FFFFh. #BC_BUF_STRT .------------------------------------------------------------------POINT_EV SPLK .SPRA284A . #0000000000000010b. #FIFO1 AR5.Clear all Group B interrupt flags . .Point to Capture FIFO reg .Enable Int lvl 2 for ||||!!!!||||!!!! 5432109876543210 .Clear virtual timer & s/w Flags POINT_B0 LACC SACL SACL SACL SACL #0h V_TIMER1 STOP GO LOOP_ON_FLG .------------------------------------------------------------------.Clear all Group A interrupt flags .Use open loop freq initially 110 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .IFRC . #0000001000000000b.EV & DSP core .Set to 0 for normal operation .Init for Capture LAR LAR AR4.Reset V_Timer .Clear any pending Ints .Enable global Ints . .Start with open loop .Enable Underflow Int .IFRB #0FFFFh.Point to start of BC buffer .DSP core & Emu Int.Clear all Group C interrupt flags POINT_PG0 SPLK . for Evt Mgr SPLK SPLK SPLK #0FFFFh.IMR .IFRA #0FFFFh.Set to 0 for normal operation .Init for open loop start-up LACC #STRTUP_FREQ . Enable appropriate Interrupts .IMRA ||||!!!!||||!!!! 5432109876543210 . IFR INTM .

.On time-out set Flag . .Use appropriate value for STEP_ANGLE .Init Step integrator . LOOP_ON_FLG MAIN . NEQ #0Fh.------------------------------------------------------------------- . . Description: . Tb.Determine current Sector Pointer .Do Calculated Branch to Sector Subroutine . Tc . .to give ~20Hz also. .Load Timer compare regs with previously calculated Ta.SPRA284A SACL LACC SACL LACC SACL FREQ_SETPT #STRTUP_STP_ANGL STEP_ANGLE #STRTUP_INTEG STEP_INTEG_H . .------------------------------------------------------------------. Routine Name: P W M _ I S R .Pass once through PI loop .Deduce dx & dy . .Main background loop .=================================================================== .Calculate new Angle (alpha) . AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 111 with TMS320C240 Routine Type: ISR .Get a speed reading from the Hall sensor using the Capture unit. . Originator: David Figoli .Calculate new speed set point .Init the angular speed . . . . .------------------------------------------------------------------MAIN POINT_B0 LACC SUB BCND SPLK B V_TIMER1 #STARTUP_DELAY MAIN. .

stk1 #1.------------------------------------------------------------------.save ACCL .the loop. stk2 . .This variable is used in the error calculation when closing .=================================================================== PWM_ISR: . LT FREQ_SETPT MPY PAC SACL SPEED_sp #22 . the Setpoint for the system.Calculate Speed Setpoint .save ACCH POINT_EV SPLK #0FFFFh.save ST0 .------------------------------------------------------------------. Last Update: 13 MAR 97 .06Hz) --> 2048(125Hz) PI_LOOP POINT_B0 SPM 1 .Forced Page 0 .Forced Page 0 POINT_PG0 SACL SACH stk3 stk4 .e.SPEED_sp = FREQ_SETPT x 22 .IFRA .save ST1 .Clear all Group A interrupt flags .The PI controller uses STEP_ANGLE to control the Stator MMF . 1(0.i. PI controller section .Increment Virtual Timers POINT_B0 LACC ADD SACL V_TIMER1 #1 V_TIMER1 .Allow shift left of 1 112 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .SPRA284A .save regs SST SST #0.rotation speed. STEP_ANGLE has a range of .22 is a scaling factor .

Keep a 32 bit integ value I .e.Calculate error term E .Save it . GT . NEQ .GPR0 = I + Ki*E + Kp*E LT GPR0 MPY PAC SACH STEP_ANGLE #2048 .---------------------------------------------------------------.---------------------------------------------------------------- PL_1 LT SPD_ERROR MPY PAC ADD ADDH SACL SACH STEP_INTEG_L STEP_INTEG_H STEP_INTEG_L STEP_INTEG_H Ki .set.Result is Q15 in 32bit format .I = I + Ki*E (E=SPD_ERROR) .Store Low word .ACC = I + Ki*E + Kp*E . .measurement from the Hall sensor is valid LACC SUB BCND LOOP_ON_FLG #0Fh PROFILE1.ACC = E*Ki .i. .SPRA284A LACC SUB SACL SPEED_sp SPEED_fb SPD_ERROR .Store Hi word LT SPD_ERROR MPY APAC SACH GPR0 Kp .Check if "over-speed" AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 113 with TMS320C240 .2048 is in Q0 .GPR0 is in Q15 .Check for Out of range STEP_ANGLE .Store as Q0 .after a start-up delay in which motor starts to spin & the Speed .Check if it's time to close the PI loop.Skip PI loop if Flag not . PI loop is closed only . 1 < STEP_ANGLE < 2048 LACC SUB BCND STEP_ANGLE #2048 OVER_RANGE.

Check if "under-speed" .If not continue OVER_RANGE SPLK B PROFILE1 #2048.2 NEW_ALPHA .SPRA284A LACC BCND B STEP_ANGLE UNDER_RANGE.convert result to Q15 format . STEP_ANGLE.Set back to default mode STEP_ANGLE #F1 PROFILE2. GT LACC SACL LT MPY PAC SACH LACC ADD SACL B STEP_ANGLE. GT #Vmin V NEW_ALPHA .1 V #INTERCEPT V.V is in Q15 .Force lower limit .Q13 * Q15 --> Q28 V.------------------------------------------------------------------.Is Freq<=F1 PROFILE2 LACC SUB BCND STEP_ANGLE #F2 PROFILE3.Calculate new Voltage V based on Volts/Freq (V/Hz) profile .P = vf_slope * FCV .result V is in Q15 114 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . STEP_ANGLE .4 GPR0 GPR0 vf_slope . LT PROFILE1 .INTERCEPT is in Q13 .Convert FCV to Q15 format .------------------------------------------------------------------PROFILE1 SPM LACC SUB BCND LACC SACL B 0 .Continue UNDER_RANGE SPLK #1.Force upper limit .

.V is in Q15 .1 .scale for 10 bit integer resolution .dy=Sin(ALPHA) .Inc angle.1 .Calculate angle ALPHA for the new position of the Space vector .------------------------------------------------------------------.P = V * dy dy.Save .shift 1 to restore Q15 format LACC SACH LACC SUB ADD TBLR dy.V is in Q15 .ACC = actual table pointer value .------------------------------------------------------------------NEW_ALPHA SACL LACC ADD SACL LACC SACH LACC ADD TBLR LACC ENTRY_NEW ENTRY_OLD ALPHA STEP_ANGLE ALPHA ALPHA. .dy is in Q15 .& perform decomposition of the Basic unit vectors.P = V * dx dx.SPRA284A PROFILE3 LACC SACL V #Vmax .11 dy #0FFh ENTRY_NEW S_TABLE dx .ACC=60 deg .Prepare pointer for Sine table LT MPY PAC SACH dy V .Save in Q0 format .8 ENTRY_NEW S_TABLE ENTRY_NEW dy .shift 1 to restore Q15 format AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 115 with TMS320C240 .dx=Sin(60-ALPHA) LT MPY PAC SACH dx V .

If no.------------------------------------------------------------------.Calculate resultant PWM compare values from dx & dy & perform . . SUB BCND LACC ADD SACL B PISR1 SPLK #05h PISR1. inc SECTOR_PTR .Save in Q0 format . re-init AR1= 1st Sector (S1) .c .e.b.If negative need to change Sector .sequence.------------------------------------------------------------------SECTOR_SR1: 116 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .Note: only one of the following Sector calculations are done per . SECTOR_PTR .SPRA284A LACC SACH dx.Sector 1 calculations .c --> a.b.If yes. GEQ .a.Reset Sector pointer to 0 .Determine which Sector Space vector is in LACC SUB BCND ENTRY_NEW ENTRY_OLD BRNCH_SR.i.ISR call.------------------------------------------------------------------.If positive continue MODIFY_SEC_PTR LACC SECTOR_PTR .------------------------------------------------------------------.appropriate phase "scrambling" to maintain correct switching .Check if at last sector (S6) .EQ SECTOR_PTR #01h SECTOR_PTR BRNCH_SR #00. select next Sector (Sn->Sn+1) BRNCH_SR: LACC ADD TBLR LACC BACC #SECTOR_TBL SECTOR_PTR SR_ADDR SR_ADDR .11 dx .scale for 10 bit integer resolution . .

c --> b.Sector 2 calculations .Acc = Ta = dy+Tb <B> LACC SUB SACL B T Tb Tc LOAD_COMPARES .Acc = T .ACC = T-Tb .Acc = T-dx-dy .Acc = T-dx-dy .Acc = Tb = 1/2(T-dx-dy) <A> ADD SACL dy Ta .Acc = Ta = 1/2(T-dx-dy) <A> Ta ADD SACL dx Tb .Acc = Tb = dx+Ta <B> LACC SUB SACL B T Ta Tc LOAD_COMPARES .ACC = T .a.Acc = T .------------------------------------------------------------------.ACC = T .ACC = Tc = T-Tb <C> .------------------------------------------------------------------SECTOR_SR2: LACC SUB SUB SFR SACL Tb T dx dy .------------------------------------------------------------------.Sector 3 calculations .b.a.------------------------------------------------------------------AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 117 with TMS320C240 .a.Acc = T-dx .a.SPRA284A LACC SUB SUB SFR SACL T dx dy .ACC = T-Ta .ACC = Tc = T-Ta <C> .c --> c.c & dx <--> dy .Acc = T-dx .b.b .

SPRA284A SECTOR_SR3: LACC SUB SUB SFR SACL Tb T dx dy .a & dx <--> dy .b.Acc = T-dx .Acc = Tc = 1/2(T-dx-dy) <A> ADD SACL dy Tb .c --> c.Acc = Tb = dx+Ta <B> LACC SUB SACL B T Tc Ta LOAD_COMPARES .Sector 4 calculations .Acc = Tc = 1/2(T-dx-dy) <A> ADD SACL dx Tc .ACC = T-Tc .ACC = T .Acc = T-dx .Acc = T .ACC = Ta = T-Tc <C> 118 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .------------------------------------------------------------------SECTOR_SR4: LACC SUB SUB SFR SACL Tc T dx dy .a.Acc = Ta = dx+Tc <B> LACC SUB SACL B T Tb Ta LOAD_COMPARES .Acc = T-dx-dy .ACC = T .b.Acc = T-dx-dy .ACC = Tb = T-Tc <C> .Acc = T .------------------------------------------------------------------.ACC = T-Tc .

SPRA284A

;------------------------------------------------------------------;Sector 5 calculations - a,b,c --> b,c,a ;------------------------------------------------------------------SECTOR_SR5: LACC SUB SUB SACL T dx dy Tc ;Acc = T ;Acc = T-dx ;Acc = Tb = 1/2(T-dx-dy) <A>

ADD SACL

dx Ta

;Acc = Tc = dx+Ta

<B>

LACC SUB SACL B

T Tc Tb LOAD_COMPARES

;ACC = T ;ACC = T-Tb ;ACC = Ta = T-Tb <C>

;------------------------------------------------------------------;Sector 6 calculations - a,b,c --> a,c,b & dx <--> dy

;------------------------------------------------------------------SECTOR_SR6: LACC SUB SUB SFR SACL Ta T dx dy ;Acc = T ;Acc = T-dx ;Acc = T-dx-dy ;Acc = Ta = 1/2(T-dx-dy) <A>

ADD SACL

dy Tc

;Acc = Tc = dx+Ta

<B>

LACC SUB SACL

T Ta Tb

;ACC = T ;ACC = T-Ta ;ACC = Tb = T-Ta <C>

;Transfer new Compare values for this PWM period
AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 119 with TMS320C240

SPRA284A

LOAD_COMPARES POINT_B0 MAR LACC SACL LACC SACL LACC SACL *, AR1 Ta *,0,AR2 Tb *,0,AR3 Tc *,0,AR1 ;Load Compare4 Register with Tc ;Load Compare3 Register with Tb ;Load Compare2 Register with Ta

;------------------------------------------------------------------;Check Push-Button I/Ps for User Frequency (Speed) change. ;------------------------------------------------------------------POINT_PF2 LACC PADATDIR

POINT_B0 SACL AND BCND LACC AND BCND GPR0 #0001h B1_DWN, EQ GPR0 #0002h B2_DWN, EQ ;Has PB2 been pressed? ;Has PB1 been pressed? ;No! - check B2

SPLK SPLK B

#0,B1_CNT #0,B2_CNT PB_END

;No! - Clear B1 button counter ;No! - Clear B2 button counter ; & return

B1_DWN

LACC #1

B1_CNT

;Yes! - Inc B1 button counter

ADD SACL SUB BCND SPLK B1_ACTION ADD SACL

B1_CNT #BCNT_MAX PB_END, LEQ #0,B1_CNT LACC #1 FREQ_SETPT FREQ_SETPT ;If max not reached go back ;Clear B1 button counter ;If max then Inc Frequency

120 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240

SPRA284A

SUB BCND SPLK B1_END B

#MAX_SPEED_LMT B1_END, LEQ #MAX_SPEED_LMT, FREQ_SETPT PB_END ;return

B2_DWN

LACC #1

B2_CNT

;Yes! - Inc B2 button counter

ADD SACL SUB BCND SPLK

B2_CNT #BCNT_MAX PB_END, LEQ #0,B2_CNT ;If max not reached go back ;Clear B2 button counter

B2_ACTION SUB SACL SUB BCND SPLK B2_END

LACC #1

FREQ_SETPT

;If max then Dec Frequency

FREQ_SETPT #MIN_SPEED_LMT B2_END, GT #MIN_SPEED_LMT, FREQ_SETPT B PB_END ;return

PB_END:

;------------------------------------------------------------------;Use Capture to get a "speed" reading from Hall sensor & sprocket ;------------------------------------------------------------------POINT_EV CHECK_CAP_FLG BIT BCND IFRC, BIT0 ;If no edge present exit ISR

FD_END2, NTC

POINT_B0 MAR LACC SACL LACC SACL *, AR4 CAP_NEW CAP_OLD * CAP_NEW ;Load FIFO1 ;Point to FIFO1 reg

AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 121 with TMS320C240

Delta = f(t2) .If not continue . LT . NTC AR5. 7 . i.e.f(t1) . AR5 CAP_PERIOD *+ .Update circular buffer pointer MAR LACC SACL LAR CMPR BCND LAR *. #BC_BUF_STRT #0 #(BC_SIZE-1) *+ .e. AR0.Calculate the Speed of rotation.Sum all Capture values in buffer .f(t1) BOX_CAR NEG_DELTA SACL ADD #7FFFh CAP_PERIOD .Phase 1 LACC RPT SUBC #07FFFh #15 BCAVG .Prepare to sum values AR6.Replace oldest with newest.Perform "Box-Car" average BOX_CAR MAR LAR LACC RPT ADD SFL SFL SFL SFL SACH BCAVG. #(BC_SIZE+BC_BUF_STRT) 2 CAP_EXIT. box car size) ? . *.If yes wrap pointer back to start . #BC_BUF_STRT .Scale for max +ve Q15 result.If negative POS_DELTA B SACL CAP_PERIOD . speed = 1/period . AR6 .Delta = 1 + f(t2) .Add 1 to Delta .Is AR5 > BC (i.Load Numerator Hi 122 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .SPRA284A SUB BCND CAP_OLD NEG_DELTA.

-------------------------------------------------FD_END2 POINT_PG0 ZALH ADDS LST LST CLRC RET . 7 .Exit ISR & Restore regs .Phase 2 RPT SUBC SACL #15 BCAVG SPEED_LO . IFRC .------------------------------------------------------------------.Dummy read only .Sector routine jump table . restore ACCL .------------------------------------------------------------------SECTOR_TBL: SR0 SR1 SR2 .e.SPEED_fb = SPEED_HI:LO x 256 SPEED_LO SPEED_HI CAP_EXIT POINT_EV LACC SPLK FIFO1 #0FFFFh.SPRA284A SACL XOR OR SPEED_HI SPEED_HI #0FFFFh .word SECTOR_SR1 .-------------------------------------------------. restore ST0 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 123 with TMS320C240 .Load Numerator Lo .Scale 32 bit value to fit in 16 bits (i.Result is in Q16 in 32 bit fmt .Clear all CAP flags . restore ACCH . stk1 INTM . Q15) LACC ADDH SFL SACH SPEED_fb.word SECTOR_SR2 . . restore ST1 . stk2 #0.word SECTOR_SR3 stk4 stk3 #1.used with BACC inst.

word .word .06 0. 3078 . .word .17 1.word . .word . 2945 . Samples: 256.No.05 3.47 0.word .02 0.word . .word .03 0.word 0 134 268 402 536 670 804 938 . .04 0. 2143 .------------------------------------------------------------------.word .16 5. .word .09 0.09 0.word SECTOR_SR4 . Format: Q15 .word .02 0.00 0.41 1.64 1. SINVAL.01 0. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 0 0.word SECTOR_SR5 . 124 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . 1340 . 2277 .75 3.word .81 3.09 0.52 3.10 0.69 4. 2811 . 3345 .------------------------------------------------------------------STABLE .word . Index Angle Sin(Angle) .34 2.word .word . 1876 .92 5.10 0.94 1.07 0.word .word .09 0. 2678 . 2544 . 1742 .07 0.98 4.70 0.04 0.word .word . 1206 . Angle Range: 60.00 0. 1474 .08 0.11 1072 .88 2.word . 3212 .02 0.86 6.06 0. . 2009 .39 5.01 0.45 4.05 0.word .03 0. . 2411 .word . 3479 .22 4.04 0.word .SPRA284A SR3 SR4 SR5 .word .05 0.23 0.07 0.word SECTOR_SR6 .08 0.11 2.word .word .63 5.28 3.------------------------------------------------------------------. 1608 .58 2.

20 0.14 0.12 0.72 11.word .word .word .word .word .24 0.word .word .22 0.42 12. 7571 .16 0.18 0.78 11. 7310 . 4011 . 5998 .17 0. 4277 .SPRA284A .08 10.22 0.83 14. 5073 .word . 5470 .66 12.word .word .20 0.59 13.word .word .20 0.13 0. 4543 .23 0.18 0.13 13.80 7.13 0. 6130 .word . 4675 . 7832 .word .44 8.31 10. 5205 .21 0.word 3612 .15 0. 7702 .36 13.14 9. 4808 .word .73 7.30 0. 5338 .word .84 10. 4144 .word . 7049 .25 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 125 with TMS320C240 .word .word .13 0. 5866 . 6655 .word .word . 4410 .17 0.word .11 0.91 9. 5734 .06 14.89 13.21 0.word .word . 7962 . 8092 .11 0. 6393 .95 12.56 6.word .15 0.20 8. 6261 . 7441 . 5602 . 6787 .word .24 0.22 0.word .48 11.24 0.23 0.50 7. 6918 .19 12.word .25 11.67 8.55 10.word .12 0.27 7. 3745 .word .03 7.38 9. 4941 .17 0.02 11.word .19 0. 7180 .19 0.15 0.14 0.61 9. 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 6. 3878 .33 6.word .word .word . 6524 .16 0.97 8.

00 15.word .98 19.27 0.word .word .47 15. 9640 .29 0.41 16.33 0.45 19. 12043 . 8869 .word .26 0.39 126 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 . 9127 .word . 9896 .77 15. 11039 .03 22.70 15.36 0.36 0.11 17. 11918 .37 0.word . 12416 .word .30 0.word .31 0.word .word . 11668 . 8610 .32 0.word .37 0.word .34 0.73 0.word .17 16.33 21.05 18.69 19.word .word .53 14.word .SPRA284A .word .word .28 0. 10151 .31 0.58 17.50 22.34 17. 12292 .word .52 18. 9255 .23 15.word .31 0. 9384 .word . 10786 .34 0.29 0.28 18. 10406 .34 0.word .28 0.word .word . 8351 .36 0.word .38 0.09 21. 8740 . 12167 .25 0.word .94 16.word 8222 .64 16.16 20.word .81 18. 8998 . 10660 .86 21. 10913 . 12664 . 9768 .32 0. 10533 .27 0.92 20. 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 89 90 91 92 93 94 95 96 97 14. 11291 . 9512 .22 19.26 0.33 0.56 21.39 20.88 17.38 0.29 0. 11793 . 11165 .word .word .word .word .33 0. 8481 .30 0.word . 12540 .38 0.35 0.25 0. 11417 .75 18. 10279 .27 22.80 22.word .27 0. 10024 .word .

91 24.43 0.42 0.46 0.word .48 0.48 0. 13033 .59 28.41 0.20 23. 14733 .19 27.44 23.SPRA284A .42 27.31 25.89 28.word .40 0.word .45 0. 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 22. 13279 .53 29. 13767 .02 26.word . 16268 .word .word .72 26.77 30.08 25.word .70 30. 13889 . 12910 .50 0.word .word .51 0.word .43 0.97 23. 16500 .30 29. 14373 .55 25. 15800 .46 0.95 27.word .word .word .00 30.25 26. 15447 . 13401 .word .word .word 12787 . 16731 .48 26. 15683 .84 25.42 0.40 0.word .50 0.word . 16616 . 15210 .word .46 0.word .43 0. 15917 .word .47 0. 14972 .word .word . 14010 .45 0.42 0.51 0.49 0.word .51 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 127 with TMS320C240 .word .49 0.word .47 0.45 0. 15328 .23 30.44 0.word . 14613 .94 0. 16151 . 13156 . 15091 .36 28. 15565 .word . 16035 .06 29.41 0. 16384 .47 30. 14852 .word .44 0.48 0.50 0. 14131 .61 24.14 24.word .83 29. 13646 .78 26. 14493 .word .67 23.41 0.word .49 0.word .39 0.38 24. 16846 .word .39 0. 13524 .13 28.66 27.word . 14252 .

05 33.52 33. 18093 . 20160 .60 0.61 0.word .word .word .word .word .73 37.63 0.67 38.word . 20684 .56 0. 19627 .63 128 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .56 36. 20054 . 18538 . 18205 .59 0. 17869 .62 0.45 34. 18316 .SPRA284A .word . 17757 .91 39.61 0.58 0. 18758 .word . 19948 .58 32.80 37.56 0.98 34.word .word .27 37.86 36. 19195 .word .33 36.17 31.word .60 0.word .50 37.57 0.62 0.88 32.word .53 0.52 0. 18427 .03 37.20 38. 19520 .52 0.11 32. 18978 .55 0.22 34.55 0.54 0.75 33.word .word .word . 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 31.word .28 33.word .57 0.53 0. 17981 . 19412 .57 0.56 0.word .word . 17304 .16 35. 19304 .64 31.81 33.34 32.59 0.58 0. 17417 .62 0.92 35.53 0.41 31. 18648 . 19735 . 17190 . 20475 . 17531 .word . 19841 . 17644 .word .55 0.word .62 0.60 0. 19087 .52 0. 20265 .97 38. 20580 .09 36.word .word 16961 .word .word .word .39 35.69 34. 17075 .word . 18868 .61 0.44 38.14 0.59 0.word .word . 20371 .63 35.word .58 0.54 0.word .word .

23359 . 21605 .95 42.word .word .word .word .59 43.94 46.71 0. 20994 .word .30 44.02 41.word .65 0.word .65 0.53 44.word .72 0.66 42.68 0.word .word .word .68 0.00 45.70 0.72 0. 22006 .70 45.25 41.word 20788 . 22204 .word .65 0.48 41.word .13 43.word .word . 21906 .67 0.69 0.word .word .72 0. 24008 .83 44.73 0.word . 21301 .19 42. 21199 .67 0.64 0.84 40.word .word . 21097 . 22788 . 22400 .41 46.63 0.72 0.38 39. 23075 .31 40.word .66 0.70 0.23 45.74 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 129 with TMS320C240 . 21403 . 23265 .64 0.88 47.word .89 43. 20891 .word .42 42.73 0.word . 21706 .64 0.77 45.word .word . 24099 . 21806 .word .word . 22498 . 23170 . 23640 . 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 39.08 40. 23546 .67 0.word .66 0.55 40. 23453 .word .word .17 46. 22884 .67 0.71 0.66 0. 22980 .68 0.word .61 39.word .47 45.69 0.word .70 0.78 41.72 41.70 0. 22105 . 21504 .69 0. 22302 .SPRA284A .73 0.34 0.71 0. 23916 .36 43.64 46. 22692 .11 47. 23824 . 23732 . 22595 .06 44.

80 0.79 0.82 130 AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique with TMS320C240 .76 0.20 53. 26713 .word . 26159 . 25330 .55 0.word .word . 24986 .33 51. 25245 .03 52.word . 24459 .word .word .word .79 0.word . 25159 . 26868 .81 0. 24369 .38 54. 25073 .82 0.74 0.92 50.word .word .80 52.78 0.word 24189 . 27020 .word .97 53.16 50.word .31 55.58 47.word .78 0.word . 26239 . 24279 .word .76 0.77 0.08 55. 26399 . 26078 . 24636 .27 52.word .75 0. 24724 .word . 25997 .69 49.14 54. 25750 .61 54.75 48.84 55. 25833 .98 49.78 0. 26635 .77 0. 25583 .80 0.word . 26320 .word . 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 47.75 0.75 0.74 0.28 48.word .45 49.word . 25915 .77 0.74 0.44 53.word .word .73 52.word .75 0.39 50. 26944 .81 48.67 53. 25667 .82 0.91 54. 25499 .81 0.52 48.word .78 0.05 48.80 0.word .77 0.76 0. 24812 .86 51.82 0.word .82 0.80 0.79 0. 24548 .81 0.63 50. 26478 .SPRA284A .word .word . 24900 .word .word .word . 26557 .79 0.50 52.09 51.56 51. 25415 .word .22 49. 26791 .word .81 0.

42 57.85 0. 27756 .84 0.86 0.84 0. .================================================== . 27171 . 27394 .86 0. Modifies: .83 0. 27246 .word .59 58.13 58. 28106 . 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 254 255 5.word 27096 .25 56.77 0.word .word . .word .SPRA284A .30 59.66 57. 27612 .word .36 58.86 0.85 0. 28311 . used to trap spurious interrupts.word .84 0.72 56.word .================================================== PHANTOM B PHANTOM PHANTOM AC Induction Motor Control Using Constant V/Hz Principle and Space Vector PWM Technique 131 with TMS320C240 .53 59. .83 0.word .19 57.83 0.word .48 56.84 0.83 0.word .02 56.86 .word . 27467 .word . Description: Dummy ISR.78 56. 27827 . 28243 .85 0. 27897 . 27967 . 27684 .word .84 0. 27540 .83 59.85 0.word .89 58. 28037 . 27320 .word .word . I S R .95 57. .

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.