Example: Inverted Pendulum Experiment - Digital Control

Problem setup

For the detailed description of the problem setup, have a look at http://www.engin.umich.edu/group/ctm/examples/pend/invpen.html
You will find there also all the steps of the paper-and-pencil procedure necessary for the equation formulation and transformation
before MATLAB can be used to compute the open-loop response.

Modeling using DYNAST

When using DYNCAD, you need not to deal with any equations at all. You can easily set up the system model in graphical form
from a kit of dynamic elements. Open the following system model in DYNCAD and see its Help for more details.


Impulse response computation

To compute the open-loop impulse response of the system using DYNCAD

  1. pull-down the menu DYNAST
  2. click Compute analysis
DYNCAD will send the request across the Internet to DYNAST - a simulation package based on a server in the Czech Technical University in Prague.
In a while, an applet should display the following response on your screen.


Transfer function computation

DYNAST can also provide linearization and semisymbolic analysis of the system model. To see the following list of poles and zeros of the system transfer function(s)

  1. pull down the menu Results in DYNCAD
  2. click Textual
You can even find in the listing the following semisymbolic expression for the impulse response


Digital control of DYNAST model by MATLAB

Following the procedure given on  http://www.engin.umich.edu/group/ctm/examples/pend/digINVSS.htmlyou can design a digital PID controller for the plant using the transfer function computed by DYNAST.
To avoid copying the transfer function data manually it is posibble to export the data in an M-file for MATLAB sent to you by e-mail. To recieve it

  1. log in yourself in the pull-down menu File after clicking Login
  2. click New account if you have not set yet your private account in DYNCAD
  3. click Export-Matlab in the pull-down menu File
Now you can control the plant model in DYNAST across the Internet by the designed control loop implemented in SIMULINK on your computer. To do this, you need to download and install very easily three DYNAST-MATLAB interface files on your computer (if you haven't installed it already).

To provide the digital control follow these steps:

  1. Copy the designed SIMULINK model into the directory with the DYNAST-MATLAB interface files
  2. Run MATLAB and SIMULINK from this directory
  3. Open the file inverted_pendulum.mdl in SIMULINK
Then you should see the following SIMULINK model of the control configuration with the embeded DYNAST plant model.

Start the simulation in the SIMULINK Simulation menu to obtain the following closed-loop response.



Please, give us a feedback. It is anonymous, you need not include your e-mail address if you do not like it.

More information on our online tools.