Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
TABLE OF CONTENT
TABLE OF FIGURES
Related documentation:
• DSP-2 board
• DSP-2 Library for Simulink
• DSP Terminal
• Three phase bridge (Hardware description).
Figure 1: DC motor
DSP-2 DC MOTOR SIMULINK LIBRARY 4
The dcservolib library is used for working with DC motor with permanent magnets.
The library contains two blocks. Block named DC motor SIM model is used for
simulations, while the block named DC motor DSP-2 interface is used for realization
on DSP-2 board.
Block DC motor DSP-2 interface consist from group of blocks that interface to the DC
motor. It has two inputs and four outputs.
Inputs are:
• Enable signal which enables execution of pulse width modulation from DSP
Terminal. Enable signal is also used in logic unit, which reset PI regulators
integrators at the beginning of control algorithms.
• Motor terminal voltage ua. Motor terminal voltage is then fed into PWM block,
which calculate switching times for H-bridge.
Outputs are:
• Measured DC link voltage (Udc).
• Measured motor (armature) current (Ia).
• Measured rotor speed (ω).
• Measured rotor position (ϕ)
Parameters of used hardware (ESCAP 28D2R 219P DC motor and H bridge ver.2. or
three phase bridge) are defined in parb_hbv2.m file.
>dcmot_demos
After confirming the command the DC motor demos window, shown on Figure 7
appear.
Demo examples are made for simulation purposes and also for realization of control
algorithms on DSP-2 board. Desired demo example is chosen with mouse click on
corresponding button.
After the desired demo example is chosen the block scheme in Simulink is opened.
The block scheme has two yellow blocks in left upper corner with names Edit
Parameters and Update Parameters. Double click on Edit Parameters block opens m-
file in MATLAB Editor window. In this m-file all necessary parameters for simulation
are called and defined. A variable called limits is also defined in this m-file. The
variable is used to take limits in consideration (set limits>0) or not (set limits<0).
Limits are defined in set_limits.m and no_limits.m files. By default limits are not taken
into consideration.
Double click on Update Parameters block runs parameters.
Demo examples for realization on DSP-2 board are based on demo examples for
simulation. The main difference is in representation of DC motor. Instead of DC mot
sim model block, here DC mot DSP-2 interface block is used to represent DC motor.
Because of noise second order low pass filter is added to rotor speed measurement.
Note that, by default limits are taken into consideration.
A block Build is added to blocks Edit Parameters and Update Parameters, which have
the same meaning as in demo examples for simulation. Double click on Build block
starts the code generation process for the DSP-2 board from Simulink block scheme
(Figure 9).
Figure 9: Demo example for realization on DSP-2 board – current control of DC motor
CHAPTER 3: DEMO EXAMPLES FOR DC MOTOR 1
To perform demo examples for realization on DSP-2 board the following steps should be
made:
• choose demo example,
• change parameters if necessary, if not this step can be skipped,
• run parameters with double click on Update Parameters block,
• start code generation process for the DSP-2 board with double click on Build block,
• start the control algorithm on DSP board with setting Enable value greater than zero
in DSP Terminal (Figure 10).
For proper working of demo examples, files listed in table below are needed. All files are
located in dcmotor directory.
CHAPTER 3: DEMO EXAMPLES FOR DC MOTOR 2