Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
F2812 EZ-DSP
Project report submitted in partial fulfillment of the requirements
For the award of the degree of
BACHELOR OF TECHNOLOGY
IN
ELECTRICAL AND ELECTRONICS ENGINEERING
By
S. SHIVA KUMAR
Assistant Professor
2012
CERTIFICATE
to the Jawaharlal
Nehru Technological University is a record of bonafide work carried out by him under my guidance and
supervision. The results embodied in this project report have not been submitted to any other
University or Institute for the award of any graduation degree.
Mr.P.M.SHARMA
HOD,EEE
GRIET, Hyderabad
EXTERNAL
(Internal Guide)
Acknowledgement
This is to place on record my appreciation and deep gratitude to the persons without whose
support this project would never seen the light of day.
I have immense pleasure in expressing my thanks and deep sense of gratitude to my guide
MR.S.SHIVA KUMAR , Assistant Professor, Department of Electrical
Engineering,G.R.I.E.T for his guidance throughout this project.
I express my gratitude Dr. S.N.SAXENA, Project Supervisor G.R.I.E.T for his valuable
recommendations and for accepting this project report.
Finally I express my sincere gratitude to all the members of faculty and my friends who
contributed their valuable advice and helped to complete the project successfully.
B.CHANAKYA REDDY
Y.KIREETI
K.SAINADH
ABSTRACT
Scalar control of Induction Motor is simple to implement, but the inherent coupling effect ( i.e
both torque and flux are functions of voltage or current and frequency)gives sluggish response
and system is easily prone to instability because of a high-order system effect. These problems
can be solved by vector or field-oriented control. In this vector control, Induction motor can be
controlled like separately excited DC Motor. DC machine-like performance can also be extended
to an induction motor if the machine control is considered in synchronously rotating reference
frame, where the sinusoidal variables appear ac DC quantities in steady state. Because of DC
machine-like performance, vector control is also known as decoupling, orthogonal, or transvector control. Vector control and corresponding signal processing, particularly for modern
sensor less vector control, are complex and the use of powerful micro-processor or DSP is
mandatory. We use PWM inverter to drive the Induction Motor. Outputs from DSP are PWM
signals and used as gate pulses of inverter. We can say it also a pulse width modulation speed
drive. Pulse Width Modulation variable speed drives are increasingly applied in many new
industrial applications that require superior performance. Recently, developments in power
electronics and semiconductor technology have lead improvements in power electronic systems.
Hence, different circuit configurations namely multi level inverters have become popular and
considerable interest by researcher are given on them. Variable voltage and frequency supply to
a.c drives is invariably obtained from a three-phase voltage source inverter. A number of Pulse
width modulation (PWM) schemes are used to obtain variable voltage and frequency supply. The
most widely used PWM schemes for three-phase voltage source inverters are carrier-based
sinusoidal PWM and space vector PWM (SVPWM).There is an increasing trend of using space
vector PWM(SVPWM) because of their easier digital realization and better dc bus utilization.
This project focuses on step by step development SVPWM implemented on an Induction motor.
The model of a three-phase a voltage source inverter is discussed based on space vector theory.
ABBREVIATIONS
1.PWM : Pulse width modulation
2.DSP: Digital signal processor
3.CCS: Code composer studio
4.SVPWM: Space vector PWM
INDEX
1. Introduction
1.1 introduction
1.2 scalar control
1.2.1 v/f control scheme
1.2.1.1 advantages and disadvantages
1.3 Vector control
1.3.1 FOC control scheme
1.3.1.1 park transform.
1.3.1.2 Clarke transform
1.3.1.3 space vector generation
1.4 conclusion
4. Park-transform
5. Clarke-transform
6. Space vector generation
6
6.1 description
6.2.1 object definition
6.2.2 special constants and data types
6.2.3 methods
6.3 technical details
6.4 conclusion
9. Hardware implementation
9.1 Hardware laboratory set up
7
REFERENCES
1. INTRODUCTION
1.1 Introduction
The control and estimation of Induction Motor drives constitute a vast subject, and the
technology has further advanced in recent years. Induction motor drives with cage-type machines
have been the workhorses in industry for variable-speed applications in a wide power range that
covers from fractional horse-power to multi-mega watts. These applications includes pumps and
fans ,paper and textile mills subway and locomotive propulsions, electric hybrid vehicles,
machine tools robotics, wind generations systems, etc. In addition to process control ,the energy
saving aspect of variable-frequency drives is getting a lot of attention nowadays.
The control and estimations of AC drives in general are considerably more complex than those
of dc drives, and this complexity increase substantially if high performances are demanded. The
main reasons for this complexity are the need of variable-frequency, harmonically optimum
converter power supplies, the complex dynamics of AC machines, machine-parameter variations,
and the difficulties of processing feedback signals in the presence of harmonics.
While considering drive applications, we need to address following questions:
one, two or four quadrant drive ?
Torque, speed, or position control in the primary or outer loop ?
Single or multi-motor drive ?
Range of speed control? does it include zero speed and field weakening regions?
Accuracy and response time ?
Robustness with load torque and parameter variations ?
Control with speed sensor or sensor less control?
type of front end converter?
9
10
cannot maintain a fixed position. In practice for low speed, we need to increase the delivered
voltage to the stator compared to the theoretical V/Hz law.
Fig 1.1
controlled like separately excited DC Motor. DC machine-like performance can also be extended
to an induction motor if the machine control is considered in synchronously rotating reference
frame, where the sinusoidal variables appear ac DC quantities in steady state. Because of DC
machine-like performance, vector control is also known as decoupling, orthogonal, or transvector control. Vector control and corresponding signal processing, particularly for modern
sensor less vector control, are complex and the use of powerful micro-processor or DSP is
mandatory. Field Oriented Control (FOC) or Vector Control, is a control strategy for 3-phases
induction motors where the torque producing and magnetizing component of the stator flux are
separately controlled. The approach consists in imitating DC motors operation. FOC will be
possible with system information: currents, voltages, flux and speed.
Instead of using a pure sine wave shaped modulation of the PWM stage, in recent years the space
vector theory has demonstrated some improvements for both the output crest
voltage and the harmonic copper loss. The maximum output voltage based on the space
vector theory is 1.155 times larger than the conventional sinusoidal modulation. It makes it
possible to feed the motor with a higher voltage than the simpler sub-oscillation modulation
method. This modulator enables higher torque at high speeds, and a higher efficiency. Torque
distortion is also reduced. The space vector PWM technique implemented into the
existing TI DMC library reduces the number of transistor commutations. It therefore
improves EMI behavior. A typical characteristic of FOC - PWM command strategy is that the
envelope of the generated signal is carrying the first and the third harmonics. We can interpret
this as a consequence of the special PWM sequence applied to the power inverters.
Literature also mentions the third harmonic injection to boost out the performance we get out
of the DC bus capacitor. This third- harmonic exists in the phase to neutral voltage but
disappears in the phase-to-phase voltage.
that the same control scheme with an additional field weakening controller can be used to
control3-phase asynchronous AC induction motors. We use some mathematical operations
Fig 1.2
13
1.4 Conclusion
Vector control scheme is widely used in many applications over than scalar control scheme,
because of its good dynamic performance in controlling, fast response, especially for large rated
applications as discussed earlier.
14
15
Fig 2.1
16
Fig 2.2
v s1
(VS )
vs 2
vS 3
17
vs1
vs 2
cos
cos(
vs 3
cos(
sin
2
)
3
4
)
3
sin(
sin(
vs1
vsd
vsd
vS 2
P( S ) . vsq
and vSq
vS 3
vso
vSo
2
)
3
4
)
3
vsd
vSq
vSo
1
vs1
P( S )
vS 2
vS 3
Where Vso is added as the zero sequence component, which may not be present.we have
considered voltage as variable. The current and flux linkages can be transformed by similar
equations.
It is convenient to set =0, so that the Qs axis is alingned with as-axis. Ignoring the zero
sequence component, the transformation relation can be simplified as
Vas=Vqs.s
Vbs=-0.5Vqs.s-0.866Vds.s
Vcs=-0.5Vqs.s+0.866Vds.s
And inversely
Vqs.s=0.66 Vas-0.33Vbs-0.33Vcs
Vds.s=-0.577Vbs+0.577Vcs
Fig 2.3 shows the synchronously rotating de-qe axes, which rotate at synchronous speedwith
respect to the d.s-q.s axes and =Wet. The two-phase d.s-q.s windings are transformed into the
hypothetical windings mounted on de-qe axes. The voltages on d.s-q.s axes can be converted into
the de-qe frame as follows
Vqes= Vqs.sCOS(wet)-Vds.sSIN(wet)
18
Vdes= Vqs.sSIN(wet)+Vds.sCOS(wet)
Resolving the rotating reference frame parameters into stationary frame, the relations are
Vqs.s= VqesCOS(wet)+ VdesSIN(wet)
Vds.s=-VqesSIN(wet)+ Vdes COS(wet)
Assume that three-phase stator voltages are sinusoidal and balanced, and are given by
Vas=VmCOS(wt+)
Vbs=VmCOS(wt-120+)
Vcs= VmCOS(wt+120+)
From figure 2.2
Vqs.s= VmCOS(wt+)
Vds.s= -VmSIN(wt+)
By converting stationary variables into rotating frame variables
Vqes = VmCOS(wt+ COS(wet)+VmSIN(wt+) SIN(wet)
-Vqes =VmCOS()
Vdes= -VmCOS(wt+) SIN(wet) -VmSIN(wt+) COS(wet)
-Vdes=-VmSIN()
And Vqes =VmCOS()
Above two equations verify that sinusoidal variables in a stationary frame appear as DC
quantities in a synchronously rotating reference frame. This is an important concept in vector
control technique. We can resolve above equations for currents and flux of induction motor.
19
2.2 Conclusion
Thus we convert the three phase voltages of induction motor into two dc values in rotating
reference frame, which used to control the torque and flux separately as dc motor control.
20
DC machine-like
performance can also be extended to an induction motor if the machine control is considered in a
synchronously rotating reference frame, where the sinusoidal variable appear as dc quantities in
steady state. The induction motor with the inverter and vector control in the front end is shown
with two control current inputs, Ids* and Iqs* are shown in the figure 3.1. These currents are the
direct axis component and quadrature axis component of the stator current, respectively, in a
21
synchronously rotating reference frame. With vector control, Ids is analogous to field current, Iqs
is analogous to armature current of a dc machine. Therefore torque can be expressed as
Te=Kt.r.Iqs
Te= Kt.Ids.Iqs
Where r is peak value of the sinusoidal vector . This dc machine-like performance is only
possible if Ids is oriented in the direction of flux r and Iqs is established perpendicular to it, as
shown in figure 3.2. This iqs* controlled, it affects the actual iqs* current only, but does not
affect the actual iqs only, but does nnot affect the flux r. Similarly, when ids* is controlled, it
controls the flux only and does not affect the iqs component of current. This vector orientation of
currents is essential under all operating conditions in a vector-controlled drive. Note when
compared to dc machine space vectors, induction machine space vectors rotate at frequency w, as
indicated in the figure. In the figure 3.2. In summary, vector control should assure the correct
orientation and equality of command and actual currents.
Fig 3.1
22
Fig 3.2
23
Figure 3.3
Steady-state phasors
figure 3.4
Complex (qds) equivalent circuit in steady state of IM
24
Figure 3.5
There are essentially two general methods of vector control, one, called the direct or feedback
method and indirect or feed forward method. The methods are different essentially by how the
unit vector(cos and sin) is generated for the control.
3.4 Conclusion
Alignment of ids and iqs to field vector r along and perpendicularly is mandatory in these
technique. We perform some transformations to convert these phase parameters of motor into 2phase parameters, which aligned and perpendicular to field vector. We perform park-transform
and inverse transform by using a DSP, and fed output of DSP to PWM inverter to control motor.
26
4. Park Transform
The PARK transform is not something new. This theory has been around for 75 years. As we
will see, this technique requires a large amount of mathematical calculations involving in
particular matrix multiplications. Thanks to new control processor technologies, it becomes now
possible to use this real-time control technique. Let us consider the voltage vector (VS ) applied
to the stator of the three phase machine we are working on (ACI or PMSM). This theory is not
limited to sinusoidal distribution and can be applied to any kind of vector. For now, we will
consider the general case. The PARK transform is only a referential change defined as below:
vs1
(VS )
vs 2
vS 3
vs1
vs 2
cos
cos(
vs 3
cos(
vs1
vS 2
vS 3
P(
sin
2
)
3
4
)
3
sin(
sin(
vsd
vsd
) . vsq
and vSq
vso
vSo
2
)
3
4
)
3
vsd
vSq
vSo
1
vs1
P(
vS 2
vS 3
Where Vs1,Vs2,Vs3 are sinusoidal three-phase input voltages. And Vsd,Vsq,Vso are rotating
reference frame parameters of a Induction machine. Vsd,Vsq,Vso are values, which we can get
after park transform. Vsd is direct axis component and Vsq is quadrature axis component and
Vso is null vector and always negligible. Vector representation is shown in fig 4.1.
27
Fig 4.1
PARK Transform
Vsd,Vsq,Vso are park coordinates. and the properties of these are shown below
vS 1 vS 2 vS 3
vSd .vSq 0
vSd .vSo 0
vSq .vSo 0
28
The index S indicates that we work with the stator parameters. This referential change
transforms the VS vector in a new vector as written below. PARK coordinates will play an
important role in the FOC control from a regulation point of view. Instead of using the general
PARK transform, literature prefers the normalized PARK transform for which inverted matrix is
much easier to calculate and which allows building an orthogonal referential change. The
normalized PARK transform is defined as above.
4.1 Conclusion
Park transform is key mathematical operation in vector control for induction motor. We can
obtain the park by combination of clark transform and rotation of vectors with synchronous
speed. DSP is mandatory to perform these mathematical operations according instantaneous
values of motor parameters and to obtain good dynamic performance.
29
5. CLARKE Transform
Park transform is mandatory mathematical operation in vector control method. But is some
complex to perform. Clarke transform is easy to understand and implement. And rotation of
vectors with synchronous speed after Clarke transform is results into park transform, and it is
simpler park transform and save time and memory in DSP registers.
We start from a three-phase balanced system that we first transform in a two-phase balanced
system: this is the role of the CLARKE transform that defines a two-phase rotating frame (,
)that rotates at the speed of the rotating stator magnetic field (S). If we sit on the rotating
frame(, ) then we see stationary variables. This is the role of the S angle rotation that allows
us to move from the rotating domain to the stationary domain. We can split park transform into
Clarke and one rotation.
The equations in Clarke transform are shown below
v1
2.v2
v1
3
Above V and V are results of Clarke transform. These are two-balanced values, which are 90
degrees apart from each other. These are sinusoidal values. These are equivalent values in
stationary reference frame of a induction machine. As shown in above equations, the V is align
in the direction of V1 and perpendicular to V.
We can get rotating reference model of a machine from these values by rotation with
synchronous speed. The equations about rotation to get park transform from Clarke trans form
are shown below. Vd,Vq are rotator reference frame parameters of machine and appear dc values
in stationary reference frame.
v
d
vq
cos( ) sin( ) v
S
S
sin( ) cos( ) v
S
S
30
Fig 5.1
Clarke-transform
Fig 5.2
Conclusion
Combining the CLARKE and PARK transforms as defined above, we move from the three phase
rotating domain to the stationary domain: we just need to control DC quantities in real-time. To
drive the power switches with new calculated values we have to re-transform these stationary
control values back into the three phase rotating domain. This is done with a similar transform
function called Inverse PARK. Obtaining d-q model parameters of machine using Clarke
transform is simple compared to park transform and I it is simple to implement.
32
Fig 6.1
Availability
This IQ module is available in one interface format:The C interface version
6.2 C Interface
6.2.1 Object Definition
The structure of SVGENDQ object is defined by following structure definition
typedef struct { _iq Ualpha; // Input: reference alpha-axis phase voltage
_iq Ubeta; // Input: reference beta-axis phase voltage
_iq Ta; // Output: reference phase-a switching function
_iq Tb; // Output: reference phase-b switching function
_iq Tc; // Output: reference phase-c switching function
void (*calc)(); // Pointer to calculation function
} SVGENDQ;
typedef SVGENDQ *SVGENDQ_handle;
here
Ualpha: Component of reference stator voltage vector on direct axis stationary reference frame.
Ubeta: Component of reference stator voltage vector on quadrature axis stationary reference
frame
Ta: Duty ratio of PWM1 (CMPR1 register value as a fraction of associated period register,
TxPR, value).
Tb: Duty ratio of PWM3 (CMPR2 register value as a fraction of associated period register,
TxPR, value).
Tc: Duty ratio of PWM5 (CMPR3 register value as a fraction of associated period register,
TxPR, value).
SVGENDQ_ handle
User defined Data type of pointer to SVGENDQ module
SVGENDQ_DEFAULTS
Structure symbolic constant to initialize SVGENDQ module. This provides the initial
34
6.2.3 Methods
void svgendq_calc(SVGENDQ_handle);
This definition implements one method viz., the space vector generator computation
function. The input argument to this function is the module handle.
Example
The following pseudo code provides the information about the module usage.
main()
{
}
void interrupt periodic_ interrupt_ isr()
{
svgen_dq1.Ualpha = Ualpha1; // Pass inputs to svgen_dq1
svgen_dq1.Ubeta = Ubeta1; // Pass inputs to svgen_dq1
svgen_dq2.Ualpha = Ualpha2; // Pass inputs to svgen_dq2
svgen_dq2.Ubeta = Ubeta2; // Pass inputs to svgen_dq2
svgen_dq1.calc(&svgen_dq1); // Call compute function for svgen_dq1
svgen_dq2.calc(&svgen_dq2); // Call compute function for svgen_dq2
Ta1 = svgen_dq1.Ta; // Access the outputs of svgen_dq1
Tb1 = svgen_dq1.Tb; // Access the outputs of svgen_dq1
Tc1 = svgen_dq1.Tc; // Access the outputs of svgen_dq1
Ta2 = svgen_dq2.Ta; // Access the outputs of svgen_dq2
Tb2 = svgen_dq2.Tb; // Access the outputs of svgen_dq2
Tc2 = svgen_dq2.Tc; // Access the outputs of svgen_dq2
}
the windings of the motor load and provides more efficient use of DC supply voltage, in
comparison to direct sinusoidal modulation technique. For the three phase power inverter
configurations shown in Figure 6.1, there are eight possible combinations of on and off states of
the upper power transistors. These combinations and the resulting instantaneous output line-toline and phase voltages, for a dc bus voltage of VDC, are shown in Table 6.1
Fig 6.1
PWM Inverter
C
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
Van
(Vdc/3)
0
2
-1
1
-1
1
-2
0
Vbn
(Vdc/3)
0
-1
2
1
-1
-2
1
0
Table 6.1
Here A, B, C refers on-of states of upper SCR's.
36
Vcn
(Vdc/3)
0
-1
-1
-2
2
1
1
0
Vab
(Vdc)
0
1
-1
0
0
1
-1
0
Vbc
(Vdc)
0
0
0
1
-1
0
0
0
Vca
(Vdc)
0
-1
1
-1
0
-1
1
0
6.4 Conclusion
Three duty ratios Ta,Tb,Tc from space vector generation are fed to PWM to produce six gate
pulses to inverter, which fed Induction motor. We use DSP, to perform this space vector
generation
37
Fig 7.1
7.1.1 Availability:
This IQ module is available in one interface format:
1) The C interface version
38
7.2 C Interface
Object Definition
The structure of IPARK object is defined by following structure definition.
typedef struct { _iq Alpha; // Output: stationary d-axis stator variable
_iq Beta; // Output: stationary q-axis stator variable
_iq Angle; // Input: rotating angle (pu)
_iq Ds; // Input: rotating d-axis stator variable
_iq Qs; // Input: rotating q-axis stator variable
void (*calc)(); // Pointer to calculation function
} IPARK;
typedef IPARK *IPARK_handle;
This definition implements one method viz., the inverse Park variable transformation
computation function. The input argument to this function is the module handle.
7.5.1Module Usage
Instantiation:
The following example instances two IPARK objects
IPARK ipark1, ipark2;
Initialization:
To Instance pre-initialized objects
IPARK ipark1 = IPARK_DEFAULTS;
IPARK ipark2 = IPARK_DEFAULTS;
7.6 C-code
Example
The following pseudo code provides the information about the module usage.
main()
{
}
void interrupt periodic_interrupt_isr()
{
ipark1.Ds = de1; // Pass inputs to ipark1
ipark1.Qs = qe1; // Pass inputs to ipark1
ipark1.Angle = ang1; // Pass inputs to ipark1
ipark2.Ds = de2; // Pass inputs to ipark2
ipark2.Qs = qe2; // Pass inputs to ipark2
ipark2.Angle = ang2; // Pass inputs to ipark2
ipark1.calc(&ipark1); // Call compute function for ipark1
ipark2.calc(&ipark2); // Call compute function for ipark2
ds1 = ipark1.Alpha; // Access the outputs of ipark1
qs1 = ipark1.Beta; // Access the outputs of ipark1
ds2 = ipark2.Alpha; // Access the outputs of ipark2
qs2 = ipark2.Beta; // Access the outputs of ipark2
}
Id=ID*COS IQ*SIN
Id=ID*SIN + IQ *COS
Where Id,Iq are stationary reference frame parameters ands , IQ and ID rotating reference frame
variables and inputs , and is angle between Id and ID. Figure 7.2 represents I-park transform
of vectors ID,IQ into Iq, Id.
Figure 7.2
7.8 Conclusion
Inverse transform converts constant values in rotating reference frame variables into two-phase
balanced values in stationary reference frame variables. Inverse transform is used to convert
control variables in to two-phase balance values, which is fed to space vector generator to
produce three driving PWM block of control operation
41
Fig 8.1
8.2 Description:
This module converts any s/w variables with Q15 representation into the PWM signals in EVB
for 281x or EPWM4-6 for 280x. Thus, it can be used to view the signal, represented by the
variable, at the outputs of the PWM7, PWM9, PWM11 (for 281x) or EPWM4A, EPWM5A,
EPWM6A (for 280x) pins through the external low-pass filters.
Availability:
This 16-bit module is available in one interface format:
1) The C interface version
42
8.3 C Interface
Object Definition:
The structure of PWMDAC object is defined by following structure definition.
typedef struct {
int16 *PwmDacInPointer0; // Input: Pointer to source data output on PWMDAC ch 0
int16 *PwmDacInPointer1; // Input: Pointer to source data output on PWMDAC ch 1
int16 *PwmDacInPointer2; // Input: Pointer to source data output on PWMDAC ch 2
Uint16 PeriodMax; // Parameter: PWMDAC half period in number of clocks (Q0)
void (*init)(); // Pointer to the init function
void (*update)(); // Pointer to the update function
} PWMDAC;
typedef PWMDAC *PWMDAC_handle;
PWMGEN_ handle:
User defined Data type of pointer to PWMGEN module
PWMGEN_DEFAULTS:
Structure symbolic constant to initialize PWMGEN module. This provides the initial values
to the terminal variables as well as method pointers.
Initialization:
To Instance pre-initialized objects
PWMDAC pwmdac1 = PWMDAC_DEFAULTS;
Example:
The following pseudo code provides the information about the module usage.
main()
{
pwmdac1.PeriodMax = 2500; // PWM frequency = 30 kHz, clock = 150 MHz
pwmdac1.PwmDacInPointer0= &pwmdac_ch1_Q15;
pwmdac1.PwmDacInPointer1= &pwmdac_ch2_Q15;
pwmdac1.PwmDacInPointer2= &pwmdac_ch3_Q15;
pwmdac1.init(&pwmdac1); // Call init function for pwmdac1
}
void interrupt periodic_interrupt_isr()
{
pwmdac_ch1_Q15 = (int)_IQtoIQ15(variable1_in_IQ);
pwmdac_ch2_Q15 = (int)_IQtoIQ15(variable2_in_IQ);
pwmdac_ch3_Q15 = (int)_IQtoIQ15(variable3_in_IQ);
pwmdac1.update(&pwmdac1); // Call update function for pwmdac1
}
= 1/(2** fc)= RC
44
8.7 Conclusion
Duty ratios, which generated from space vector generation, are converted into six PWM
triggering signals to fed PWM inverter. This task is performed by EZDSP necessary
programming.
45
9. Hardware implementation
9.1 Hardware laboratory setup
Spectrum Digital EZDSP TMS320F2812
Spectrum Digital DMC550 drive platform
3-phase PMSM with a QEP encoder
Applied Motion 40mm Alpha Motor
Type: A0100-104-3-100
240V DC power supply ( DC bus voltage )
load
PC parallel port to JTAG
5V DC ( eZdsp )
RS232 ( optional )
Oscilloscope
Iq_ref
PI
Id_ref
ids*
PI
vqs*
vds*
Ta
*
s
Space Tb
Inv.
Vector
Park v s*
Gen. Tc
PWM
Driver
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
Voltage
Source
Inverter
ANGLE
ids
iqs
ia
Park i s Clarke ib
ADCIN1
Ileg2_
Bus
Driver
ADCIN2
ADCIN3
Encoder
TMS320F28x controller
Fig 9.1
47
IM
15 - 33
9.3.1 ADC:
In this step, as shown in the figure 9.1, the three analog current inputs from motor are fed to
ADC. This consists two event mangers to convert two current values into two digital values at
same time. We use 12-bit ADC in our project. Output ADC is fed to DSP to perform further
operations.
9.3.4 PI control:
This task is first compare the control variable and park-transform outputs. Then difference
between them is fed PI control task. This error is integrated, and its gives a output, which is
proportional and integration of error. This task also performed DSP. The output of this task is act
as input to I-park task, which is performed by again DSP, as shown in the figure.
48
9.3.10 Conclusion:
As described above the vector control of induction motor is performed by DSP on code
composer studio platform.
49
Input voltages
Fig 9.2
50
Clarke waveform
Fig 9.3
51
Park waveform
Fig 9.3
52
Fig 9.4
53
PWM waveform
Fig 9.5
54
BLOCK DIAGRAM
Fig 9.6
55
Fig 9.7
56
57
REFERENCES
1. Mohan/ unde land/ Robbins, Power Electronics: Converters, Applications and Design.
2. Muhammad H.Rashid, Power Electronics: Circuits, Devices and applications
3. MDSingh /Khanchandani, Power Electronics, Tata-Mcgrawhill publications.
4.Bimal K.Bose, modern power electronics, Pearson education publications.
5. Wikepedia.org, FOC of induction motor.
6. Jorge Zambada, Nov. 8, 2007:Field-oriented control for
motors, http://machinedesign.com/article/field-oriented-control-for-motors-1108
7.Chuck Lewin, April 10, 2006: New Developments in Commutation and Motor Control
Techniques
8. Kedar Godbole, Texas Instruments, Sept 23, 2006: Field oriented control reduces
motor size, cost and power consumption in industrial applications
9. Naresh Kumar Sinha, 1986: Micro-processor based control systems, pg 161,
175, http://books.google.com/books?id=JgalRre0L8wC&printsec=frontcover#v=onepage
&q&f=false
58
FUTURE SCOPE
By elaborating this procedure of space vector generation to pwm technique and by getting the
feedback from the sensing devices we get the vector control of the a.c motor with the help of the
inverters.
APPENDIX
PROGRAMME
Watch Variables:
Voltage1[256]
Voltage2[256]
voltage3[256]
current2[256]
current3[256]
Program:
#include "DSP281x_Device.h"
#include "DSP281x_Examples.h"
#include "IQmathLib.h"
59
int16 Voltage2[256];
int16 Voltage3[256];
int16 current1[256];
int16 current2[256];
int16 current3[256];
int16 Vas[256];
int16 Vbs[256];
int16 power[256];
main()
{
InitSysCtrl();
SysCtrlRegs.HISPCP.all = 0x3;
EDIS;
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
EALLOW;
PieVectTable.ADCINT = &adc_isr;
EDIS;
InitAdc();
PieCtrlRegs.PIEIER1.bit.INTx6 = 1;
IER |= M_INT1;
EINT;
ERTM;
LoopCount = 0;
ConversionCount = 0;
60
AdcRegs.ADCMAXCONV.all = 0x0005;
AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x0;
AdcRegs.ADCCHSELSEQ1.bit.CONV01 = 0x1;
AdcRegs.ADCCHSELSEQ1.bit.CONV02 = 0x2;
AdcRegs.ADCCHSELSEQ1.bit.CONV03 = 0x3;
AdcRegs.ADCCHSELSEQ2.bit.CONV04 = 0x4;
AdcRegs.ADCCHSELSEQ2.bit.CONV05 = 0x5;
AdcRegs.ADCTRL2.bit.EVA_SOC_SEQ1 = 1;
AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1= 1;
EvaRegs.T1CMPR = 0x0080;
EvaRegs.T1PR = 0xFFFF;
EvaRegs.GPTCONA.bit.T1TOADC = 1;
EvaRegs.T1CON.all = 0x1042;
while(1)
{
LoopCount++;
}
}
interrupt void adc_isr(void)
{
Voltage1[ConversionCount] = (AdcRegs.ADCRESULT0 >>4) - offset;
Voltage3[ConversionCount] = (AdcRegs.ADCRESULT2 >>4) - offset;
Voltage2[ConversionCount] = - Voltage1[ConversionCount] - Voltage3[ConversionCount];
current1[ConversionCount] = (AdcRegs.ADCRESULT3 >>4) - offset;
current2[ConversionCount] = (AdcRegs.ADCRESULT4 >>4) - offset;
current3[ConversionCount] = - current1[ConversionCount] - current2[ConversionCount];
power[ConversionCount] =-( _IQmpy(Voltage1[ConversionCount],current1[ConversionCount]) +
61
_IQmpy(Voltage2[ConversionCount],current2[ConversionCount]) +
_IQmpy(Voltage3[ConversionCount],current3[ConversionCount]));
if(ConversionCount == 255)
{
ConversionCount = 0;
}
else ConversionCount++;
Vas[ConversionCount] = Voltage1[ConversionCount];
Vbs[ConversionCount] = _IQmpy((Voltage1[ConversionCount] +
_IQmpy(_IQ(2),Voltage3[ConversionCount])),_IQ(0.57735026918963));
Vas1[ConversionCount] = _IQmpy(Vd[ConversionCount],_IQ(0.866)) - _IQmpy(Vq[ConversionCount],_IQ(0.5));
Vbs1[ConversionCount] = _IQmpy(Vq[ConversionCount],_IQ(0.866)) +
_IQmpy(Vd[ConversionCount],_IQ(0.5));
62
// X = Va
Vb[ConversionCount] = _IQmpy(_IQ(0.5),Vbs1[ConversionCount]) +
_IQmpy(_IQ(0.8660254),Vas1[ConversionCount]); // Y = Vb
Vc[ConversionCount] = _IQmpy(_IQ(0.5),Vbs1[ConversionCount]) _IQmpy(_IQ(0.8660254),Vas1[ConversionCount]); // Z = Vc
// tbon =
Ta[ConversionCount] = Tb[ConversionCount]+t1[ConversionCount];
// taon = tbon+t1
Tc[ConversionCount] = Ta[ConversionCount]+t2[ConversionCount];
// tcon = taon+t2
}
else if (Sector==2) // Sector 2: t1=Y and t2=-X (abc ---> Ta,Tc,Tb)
{
t1[ConversionCount] = Vb[ConversionCount];
t2[ConversionCount] = -Va[ConversionCount];
Ta[ConversionCount] = _IQmpy(_IQ(0.5),(_IQ(1)-t1[ConversionCount]-t2[ConversionCount]));
(1-t1-t2)/2
Tc[ConversionCount] = Ta[ConversionCount]+t1[ConversionCount];
63
// taon =
// tcon = taon+t1
Tb[ConversionCount] = Tc[ConversionCount]+t2[ConversionCount];
// tbon = tcon+t2
}
else if (Sector==3) // Sector 3: t1=-Z and t2=X (abc ---> Ta,Tb,Tc)
{
t1[ConversionCount] = -Vc[ConversionCount];
t2[ConversionCount]= Va[ConversionCount];
Ta[ConversionCount] = _IQmpy(_IQ(0.5),(_IQ(1)-t1[ConversionCount]-t2[ConversionCount]));
(1-t1-t2)/2
// taon =
Tb[ConversionCount] = Ta[ConversionCount]+t1[ConversionCount];
// tbon = taon+t1
Tc[ConversionCount] = Tb[ConversionCount]+t2[ConversionCount];
// tcon = tbon+t2
}
else if (Sector==4) // Sector 4: t1=-X and t2=Z (abc ---> Tc,Tb,Ta)
{
t1[ConversionCount] = -Va[ConversionCount];
t2[ConversionCount] = Vc[ConversionCount];
Tc[ConversionCount] = _IQmpy(_IQ(0.5),(_IQ(1)-t1[ConversionCount]-t2[ConversionCount]));
(1-t1-t2)/2
// tcon =
Tb[ConversionCount] = Tc[ConversionCount]+t1[ConversionCount];
// tbon = tcon+t1
Ta[ConversionCount] = Tb[ConversionCount]+t2[ConversionCount];
// taon = tbon+t2
}
else if (Sector==5) // Sector 5: t1=X and t2=-Y (abc ---> Tb,Tc,Ta)
{
t1[ConversionCount] = Va[ConversionCount];
t2[ConversionCount] = -Vb[ConversionCount];
Tb[ConversionCount] = _IQmpy(_IQ(0.5),(_IQ(1)-t1[ConversionCount]-t2[ConversionCount]));
(1-t1-t2)/2
// tbon =
Tc[ConversionCount]= Tb[ConversionCount]+t1[ConversionCount];
// tcon = tbon+t1
Ta[ConversionCount] = Tc[ConversionCount]+t2[ConversionCount];
// taon = tcon+t2
64
// tcon =
Ta[ConversionCount] = Tc[ConversionCount]+t1[ConversionCount];
// taon = tcon+t1
Tb[ConversionCount] = Ta[ConversionCount]+t2[ConversionCount];
// tbon = taon+t2
// Convert the unsigned GLOBAL_Q format (ranged (0,1)) -> signed GLOBAL_Q format (ranged (-1,1))
Ta[ConversionCount] = _IQmpy(_IQ(2.0),(Ta[ConversionCount]-_IQ(0.5)));
Tb[ConversionCount] = _IQmpy(_IQ(2.0),(Tb[ConversionCount]-_IQ(0.5)));
Tc[ConversionCount] = _IQmpy(_IQ(2.0),(Tc[ConversionCount]-_IQ(0.5)));
AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1;
AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
return;
}
65
66
Projects
Code Composer works with a project paradigm. Essentially, within CCS a project for each
executable program is created. Projects store all the information required to build the executable.
For example, it lists things like: the source files, the header files, the target systems memorymap, and program build options
67
Project settings:
The project information is stored in a .PJT file, which is created and maintained by CCS. To
create a new project, select the Project:New menu item.
Along with the main Project menu, we can also manage open projects using the right-click
popup menu. Either of these menus allows to Add Files to a project. We can also drag-n-drop
files onto the project from Windows Explorer
2. A project is all the files needed to develop an executable output file which can be run on
the DSP hardware. To create a new project for a lab. On the menu bar click Project. Type Lab2
68
in the project name field and make sure the save in location is: C:\C28x\LABS\LAB2. This will
create a .pjtfile which will invoke all the necessary tools (compiler, assembler, linker) to build
the project. It will also create a debug folder that will hold immediate output files.
3. Project Add Files to Project in the same lab exercise. Change the files of type to view C
source files (*.c) and select Lab2.c and click OPEN. This will add the file Lab2.c to the newly
created project.
4. Add Lab2a.cmd to the project using the same procedure. This file will be edited during the lab
exercise.
5. Next, add the compiler run-time support library. To the
project(C:\ti\c2000\cgtools\lib\rts2800_ml.lib).
6. In the project window on the left click the plus sign (+) to the left of Project. Now,click on the
plus sign next to Lab2.pjt. The Lab2a.cmd file is listed.Click on Source to see the current source
file list (i.e. Lab2.c).
Project Build Options
7. There are numerous build options in the project. The default option settings are sufficient for
getting started.
Click: Project Build
Options
8. Select the Linker tab. The .out and .map files are created. The .out file is the executable code
that will be loaded into the DSP. The .map file will contain a linker report showing memory
usage and section addresses in memory.
9. Set the Stack Size to 0x200. Select OK and then close the Build Options window.
15. Code Composer Studio can automatically load the output file after a successful build.
On the menu bar click: Option Customize and select the Program Load Options
tab, check Load Program After Build, then click OK.
16. Click the Build button and watch the tools run in the build window. Check for
errors. When an error occurs, scroll the build window at the bottom of the Code Composer
Studio screen until the error message (in red) is seen, and double-click the error message. The
editor will automatically open the source file containing the error, and position the mouse cursor
at the correct code line.
17. Fix the error by adding a semicolon at the end of the "z = x + y" statement. For future
knowledge, realize that a single code error can sometimes generate multiple error messages at
build time.
18. Rebuild the project (there should be no errors this time). The output file should automatically
load. The Program Counter should be pointing to _c_int00 in the Disassembly Window.
19. Under Debug on the menu bar click Go Main. This will run through the C-environment
initialization routine in the rts2800_ml.lib and stop at main() in Lab2.c.
You can change the contents of any address in the memory window by double-clicking on its
value. This is useful during debug.
21. Open the watch window to view the local variables x and y.
Click: View Watch Window on the menu bar.
Click the Watch Locals tab and the local variables x and y are already present. The watch
window will always contain the local variables for the code function currently being executed.
(Note that local variables actually live on the stack. You can also view local variables in a
memory window by setting the address to SP after the code function has been entered).
22. We can also add global variables to the watch window if desired. To add the global variable z,
click the Watch 1" tab at the bottom of the watch window. In the empty box in the "Name"
column, type z. No ampersand is used here. Check that the watch window and memory window
both report the same value for z. Changing the value in one window also changes the value in
the other window.
71
72
73