Sie sind auf Seite 1von 3

SIMULINK MODEL CONTROLLERS

EE371 CONTROL SYSTEMS TECH NOTE

INTRODUCTION

Matlab includes a powerful block diagram simulation subsystem known as Simulink. Simulink allows an
engineer to model a system by schematically creating the system block diagram and then simulating the
behavior. Each computer in the control systems laboratory (S312) includes an embedded computer card
that can serve as a controller for the Quansar plant. Analog-to-digital and digital-to-analog converters
allow interconnection between the embedded computer and Quansar plant signals. Simulink blocks that
model the ADC and DAC interconnection points are included on the laboratory computers.

The learning objectives of this technical note are:

1. Draw the classic feedback control system in canonical form. Identify the roles of the controller,
plant, and sensors.
2. Draw the feedback control system with a digital controller implementing the summation and
control blocks.
3. Use Simulink to model a digital controller for the Quansar plant.

CLASSIC FEEDBACK CONTROL SYSTEM

Figure 1: Feedback control system in canonical form

The circuit shown in Figure 1 is the classic feedback control system. A controller generates a control signal
for actuators in a plant based on the desired behavior specified with input, R, and the measured state of the
system reported on feedback signals from plant sensors. For example, the angular displacement of the
Quansar plant motor is one possible output variable, C, and the Quansar plant includes a position
potentiometer that converts the angular displacement to a voltage that can serve as the feedback signal.
During design, the plant and sensor transfer behavior is modeled and often placed in the reduced canonical
form shown in Figure 2. Here, the output variable of the sensor becomes the transfer variable of interest
representing the actuator behavior.

Figure 2: DC servomotor circuit theory model


The closed loop gain from Figure 2 is calculated as:

GF = GCONTROL * GPLANT
(1) V GF
T = SENSOR =
VS 1 m GF

Note that the standard form of closed-loop gain has a characteristic equation in the denominator that
includes the open-loop gain GF*H. But, H = 1 in the reduced form shown in Figure 2.
!
IMPLEMENTING THE CONTROLLER

The controller of Figure 1 can be implemented using analog or digital techniques. An analog controller is
generally constructed using operational-amplifiers configured to implement the controllers gain equation.
Analog controllers are low-cost solutions but are hard to change once a design has been completed and
components have been wired to circuit boards. Digital controllers, on the other hand, offer the convenience
of software re-programmability. In a digital controller, the entire control system to the left of the plant is
implemented by software executing on an embedded computer system. Figure 3 illustrates how analog-to-
digital converters are used to sample sensor data and convert it to binary numbers for computer processing.
The figure also illustrates how calculated control values are converted back to analog form by digital-to-
analog converters. Sensor and actuator data in digital form is easily manipulated by standard software
techniques.

Figure 3: The feedback control system with digital controller

BUILDING SIMULINK DIGITAL CONTROLLERS IN THE CONTROL SYSTEMS LAB (S312)

Digital controllers are created using Simulink in the control systems lab. A basic set of steps on the lab
computer is:

1. Start Matlab.
2. Type simulink at the Matlab prompt to start Simulink.
3. Make a new model in Simulink. Push the new button or choose File:NewModel.
4. Add a signal function generator block to create the input signal. This block is located in the
Sources library. Set the signal generator parameters -- shape, amplitude, and frequency -- by
double-clicking the block.
5. Add a summation node. This block is located in the Commonly Used Blocks library. The
feedback sign can be changed by double-clicking the summation node.
6. Add a gain block or transfer function block for the controller. These blocks are located in the
Commonly Used Blocks and Continuous libraries respectively. Set the gain or transfer function
by double-clicking the block.
7. Add the DAC Analog Output block for the controller. This block is located in the Quansar
Consulting MQ3 Series library. Set the DAC channel to use by double-clicking. Note on the
ADC/DAC motherboard that eight (8) analog output channels exist. Connect your output wire
from the selected DAC channel on the Analog-Out part of the ADC-DAC board to the Quansar
Plant. For example, a wire would be connected between channel 0 of the DAC and the From
D/A input to the power amp if the signal drives the motor. The cable will be a male RCA plug
on one end and a five-pin male DIN connector on the other end.
8. Add the ADC Analog Input block for the controller. This block is located in the Quansar
Consulting MQ3 Series library. Note that the block orientation can be changed by flipping it
using the format menu. Set the ADC channel to use by double-clicking. Connect your input
wire from the Quansar Plant sensor output called To A/D to the selected ADC channel on the
Analog-In part of the ADC-DAC board of the Quansar Plant computer. For example, a wire
could be connected between the position potentiometer and channel 0 of the ADC. The cable will
be a four-wire male RCA system on one end and a five-pin male DIN connector on the other end.
9. Wire all system components by clicking on one block and control clicking on the other block.
10. Save the controller model.
11. Set the Solver to ode4 (Runge-Kutta) in the Simulation:Configure Parameters dialog box.
12. Build the controller using the WinCon:Build menu option. This takes significant time as Matlab
compiles the controller software.
13. Start the system by pushing the Start button after compilation completes. Note that double-
clicking the blocks while the system is running can change parameters dynamically. Note that
rewiring the circuit requires a rebuild.
14. Verify operation of the system.

Das könnte Ihnen auch gefallen