Digital Control Applications Using TI Digital Signal Controller
Digital Control Applications Using TI Digital Signal Controller
Abstract: - Two digital control applications are presented: velocity control of a DC motor and adaptive system
identification and control of an automotive alternator. A tuning method is proposed for DC motors.
Experimental application for the DC motor illustrates the effectiveness and the simplicity of the proposed
method for controller design. Using adaptive system identification, an automotive alternator is identified. A
regulator is implemented in order to control its output voltage. The control applications run on a Texas
Instruments Digital Signal Controller. Rapid Control Prototyping is used for code generation. Once the desired
functionality has been captured and simulated, using the MATLAB/Simulink/Real-Time Workshop
environment can be generated code for the DSP. All task assignments to processor are automatically made by
the software.
Key-Words: - Embedded Target, DC motor, Digital Signal Controller, Digital Control, Rapid Control
Prototyping, Digital Signal Processor, Matlab/Simulink, Code Composer Studio.
the presented applications is Matlab/Simulink/Real- stands alone to set the target preferences for the
Time Workshop. The target processor is a model (build options for the compiler, assembler
TMS320F2812 DSP. This processor is highly and linker which will be invoked to generate the
integrated, high-performance solution for executable image file for download to the DSP).
demanding control applications. Once the desired functionality has been captured
With the great diversity of applications, a and simulated, can be generated code for the DSP.
development environment must be flexible and Simulink/Real-Time Workshop generates a C
provide exactly the functionality necessary for language real time implementation of the model,
efficient problem solving. Simulink software from creates and populates a CCS project with the code.
Mathworks is such a graphical modeling tool. CCS is opened, the project compiled and linked, and
Simulink is a platform for multidomain the image file downloaded to the target DSP.
simulation and model-based design of dynamic The code may be instrumented with Real Time
systems. It provides an interactive graphical Data eXchange modules to stream data to and from
environment and a customizable set of block the target. These are additional I/O blocks from the
libraries. The engineer can accurately design, Embedded Target library.
simulate, implement, and test control, signal A key feature of Embedded Target is its ability to
processing, communications, and other time-varying generate efficient DSP code [3].
systems.
A recent toolbox of Simulink is the 'Embedded
Target' for Texas Instruments' C2000 DSP platform. 3 Target Processor
The control algorithms run on eZdsp F2812 target
equipped with a TI TMS320F2812 DSP, for fast
2 C2000 Embedded Target fixed-point calculation at 150 MHz (6.67 ns cycle
Simulink, Real-Time Workshop, the Embedded time).
Target for Texas Instruments (TI) C2000 DSP, and The TMS320F2812 belongs to a group of
Link for Code Composer Studio (CCS) provide an devices that are called “Digital Signal Controller
integrated platform for design, simulation, (DSC)”. DSC is a new type of microcontroller,
implementation, and verification of embedded where the processing power is delivered by a DSP -
control systems on standard and custom C2000 DSP a single chip device combining both the computing
targets [4] (Fig.2). power of a Digital Signal Processor and the
embedded peripherals of a single chip computing
system.
The TMS320F2812 device, member of the
TMS320C28x DSP generation, is highly integrated,
high-performance solutions for demanding control
applications.
The board can be adapted to a wide range of
closed-loop applications due to its motor control
peripherals (two event managers (EVA, EVB)), 16
Fig.2. The steps from model to the implementation. 12-Bit ADC channels with fast conversion rate: 80
ns/12.5 MSPS, up to 56 general purpose I/O (GPIO)
Simulink models are constructed from standard pins, high-performance 32-bit CPU, three 32-Bit
libraries. Embedded Target provides blocks specific CPU-timers.
to the C2000 DSP family: I/O, CAN, PWM, QEP, The multiple bus architecture, commonly termed
Read From Memory, and Write To Memory. “Harvard Bus”, enables the F2812 to fetch an
Engineers can automatically generate prototype code instruction, read a data value and write a data value
for any of the supported boards, combining these in a single cycle. All peripherals and memories
blocks with standard blocks from Simulink, attached to the memory bus will prioritize memory
Simulink Fixed Point, and the Signal Processing accesses.
Blockset. User defined blocks, S-functions, can be
added to the Simulink model. Thus portions of
proven code can be integrated in the model. 4 Velocity Control of DC Motor
A Target Preference block has to be added to the A digital control application for a DC motor is
model. It does not connect to any other blocks, but implemented, in which a tuning method is proposed
for DC motors, using a DSC from TI. Experimental feedback subsystem is presented in Fig.8 and the
application for the DC motor illustrates the target speed subsystem in Fig.9.
effectiveness and the simplicity of the proposed
method for controller design. A PID tuning method
for a DC motor is implemented and tested.
4.1 DC Motor
The DC Motor comprises the motor, a shaft sprocket
with 32 teeth, an optical gear tooth sensor for speed
measurement, and a DC/DC electronic converter.
The DC/DC electronic converter is driven by pulse
width modulated (PWM) signals from the F2812
target. The whole setup is shown in Fig.3.
Fig.3. DC motor control setup with F2812. Fig. 4. The motor drive.
adapts to the environment described by these of the process using the algorithm based on the
signals. When the environment changes, the filter singular value decomposition of the Hankel matrix.
adapts to the new characteristics by generating a The Hankel matrix is constructed using the Markov
new set of coefficients. parameters [11].
The digital filter shown in Fig.16 can be an FIR,
symmetric FIR, IIR, or other structure. The
coefficients of an adaptive filter are time functions
because the adaptive algorithm continuously
updates them either sample by sample or block by
block.
To design an adaptive filter the correct filter
structure has to be selected. For the selected filter
structure many adaptive algorithms can be used to
update the filter coefficients. The complexity of an
Fig.17. System identification using adaptive filters.
adaptive algorithm is usually measured in terms of
its multiplication and memory requirements [10].
The block diagram of the test setup is shown in
System identification is an important step to
Fig.18. The excitation field of the alternator is
verify the theoretical model with experimental data,
controlled using a PWM signal generated by the
since the best theoretical models are only
F2812 eZdsp target. The output voltage of the
approximations of the real system.
alternator is applied at the desired input port of the
Non parametric system identification methods
LMS Filter Block.
determine the time and the frequency response of a
liner time invariant system without prior knowledge
of the model structure of a system. They are often
used as a preliminary tool to get initial estimate of
the model structure of a system with unknown
dynamics.
Adaptive system identification is illustrated in
Fig.17. The adaptive filter is connected in parallel
with the unknown system (or plant) to be modelled.
The modelling signal x (n ) excites both the
unknown system and the adaptive filter. The
objectives of the adaptive filter is to adapt to the
unknown plant; thus, the adaptive filter
output, y (n) , closely matches the unknown system
output, d (n) . This is achieved by minimizing the
error signal, e(n) , which is the difference between
the physical response d (n ) and the modelled
response y (n) . If the excitation signal, x(n) , is rich Fig.18. Adaptive system identification block
in frequency contents such as white noise and the diagram setup using F2812 eZdsp target.
internal plant is small, the adaptive filter converges
to the unknown system from I/O viewpoint. The automotive alternator is driven by an
The coefficients of the adaptive filter are asynchronous motor. The motor is controlled using
computed using the LMS algorithm. The Simulink an inverter. The hardware setup at work is shown in
LMS block from the Signal Processing Toolbox is Fig.19.
used. The LMS Filter block can implement an The operational characteristics of the automotive
adaptive FIR filter using five different algorithms. alternator system are shown in Fig.20. The output
The block estimates the filter weights, or voltage versus input voltage curves of Fig.20 are
coefficients, needed to minimize the error between calculated for constant speed of the alternator and
the output signal, and the desired signal. parameterized by the field current.
The FIR filter estimates the Markov parameters Two ADC channels of the eZdsp target are used
of the process to be identified. The Markov to acquire the field and the output voltage. The
parameters are used to compute the transfer function results are shown in Fig.21.
34.97 s + 1844
H ( s) =
s + 261.2 s + 2046
2
The Simulink block diagram used for the The obtained PI controller has a first order filter,
adaptive system identification of the automotive for the cancellation of the zero of the identified
alternator is shown in Fig.22. The field voltage and process.The Simulink block diagram used for
the output voltage of the alternator are applied at the controlling the output voltage of the automotive
input ports of Simulink LMS block. The block alternator is presented in Fig.24.
Fig.24. Simulink block diagram for controlling the output voltage control.
[17]T. Sekozawa, Model-based Control and [19] A. A. Voda and L. D. Landau, A method for
Learning Control Method for Automobile Idle auto-calibration of PID controllers, Automatica,
Speed Control using Electric Throttle, WSEAS VOL. 31, pp. 41-53, 1995.
TRANSACTIONS on SYSTEMS and CONTROL, [20] X. Yuan, Y. Wang, L. Wu, Adaptive Inverse
Issue 2, Volume 3, February 2008. Control of Excitation System with Actuator
[18] A. Leva and F. Schivo, Robust autotunning of Uncertainty, WSEAS TRANSACTIONS on
industrial regulators based on complex process SYSTEMS and CONTROL, Issue 8, Volume 2,
models: the DIMC approach, Proc. IEEE August 2007.
Conference on Conference of Computer Aided
Control System Design, Munich, 2006.