This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Real-Time Controller

This example shows how to build a simple closed-loop real-time controller using Simulink Desktop Real-Time™. The output of the controlled plant is connected to the analog input of your data acquisition board. This signal is subtracted from the set point value generated by the signal generator and processed by a PID controller. The output of the controller drives the input of the plant using the analog output of your data acquisition board.

This model is a simplified version of the controller used for the http://www.humusoft.cz/produkty/models/ce152 CE152 Magnetic Levitation Model.

Note: To run this model, you must have a data acquisition board connected to your computer.

How to run this model in Normal Mode

  1. Open the Analog Input and Analog Output blocks and select your data acquisition board. If there's no board installed, install it using the Install new board button.

  2. Double-click the orange button to switch to Normal Mode if needed.

  3. Start the real-time execution using Simulation->Run.

How to run this model in External Mode

  1. Open the Analog Input and Analog Output blocks and select your data acquisition board. If there's no board installed, install it using the Install new board button.

  2. Double-click the orange button to switch to External Mode if needed.

  3. Start the real-time execution using Simulation->Run. The model will automatically build, connect to Simulink in External Mode and start.

Open the model

open_system(fullfile(matlabroot,'toolbox','sldrt','sldrtexamples','sldrtex_controller'));

Close open Scopes

close_system(find_system(gcs ,'BlockType', 'Scope'));

Clean up

clear
close all
bdclose all

See Also