Real-Time Controller

This model shows how to build a simple closed-loop real-time controller using Real-Time Windows Target™. 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 CE152 Magnetic Levitation Model.

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. Build the model using Code->C/C++ Code->Build Model.

  4. Connect to the real-time code using Simulation->Connect To Target.

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

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

Was this topic helpful?