Real-Time Workshop User's Guide    

Rapid Prototyping for Control Systems

Rapid prototyping for control systems is similar to digital signal processing, with one major difference. In control systems design, it is necessary to develop a model of your plant prior to algorithm development in order to simulate closed loop performance. Once your plant model is sufficiently accurate, the rapid prototyping process for control system design continues in much the same manner as digital signal processing design.

Rapid prototyping begins with developing block diagram plant models of sufficient fidelity for preliminary system design and simulation. Once simulations show encouraging system performance, the controller block diagram is separated from the plant model and I/O device drivers are attached. Automatic code generation immediately converts the entire system to real-time executable code. The executable can be automatically loaded onto target hardware, allowing the implementation of real-time control systems in a very short time.

Modeling Systems in Simulink

The first step in the design process is development of a plant model. The Simulink collection of linear and nonlinear components helps you to build models involving plant, sensor, and actuator dynamics. Because Simulink is customizable, you can further simplify modeling by creating custom blocks and block libraries from continuous- and discrete-time components.

Using the System Identification Toolbox, you can analyze test data to develop an empirical plant model; or you can use the Symbolic Math Toolbox to translate the equations of the plant dynamics into state-variable form.

Analysis of Simulation Results

You can use MATLAB and Simulink to analyze the results produced from a model developed in the first step of the rapid prototyping process. At this stage, you can design and add a controller to your plant.

Algorithm Design and Analysis

From the block diagrams developed during the modeling stage, you can extract state-space models through linearization techniques. These matrices can be used in control system design. You can use the following toolboxes to facilitate control system design, and work with the matrices that you derived:

Once you have your controller designed, you can create a closed-loop system by connecting it to the Simulink plant model. Closed-loop simulations allow you to determine how well the initial design meets performance requirements.

Once you have a satisfactory model, it is a simple matter to generate C code directly from the Simulink block diagram, compile it for the target processor, and link it with supplied or user-written application modules.

Analyzing Results, Parameter Tuning, and Signal Monitoring
Using External Mode

You can load output data from your program into MATLAB for analysis, or display the data with third party monitoring tools. You can easily make design changes to the Simulink model and then regenerate the C code.

Simulink's external mode allows you to change parameters interactively, while your algorithms execute in real time on the target hardware. After building the executable and downloading it to your hardware, you tune (modify) block parameters in Simulink. Simulink automatically downloads the new values to the hardware. You can monitor the effects of your parameter changes by simply connecting Scope blocks to signals that you want to observe.


 Rapid Prototyping for Digital Signal Processing Open Architecture of the Real-Time Workshop