Simulation of Feedback Control System with Controller and Second-Order Plant

This Demonstration simulates a second-order linear system represented as a mass-spring-damper and analyzes the effect of adding a controller on the step response of the overall system in a closed loop. You can select one of four types of controller: P, PI, PD, or PID. You can simulate the plant with and without the controller to see the effect on the step response. Bode and Nyquist plots of the open-loop transfer functions are plotted and the gain and phase margins are shown, as well as the locations of the closed-loop poles. You can change the simulation time and speed as well as the controller parameters using sliders.



  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


A feedback control system is simulated using a controller and a second-order plant. The controller operation can be proportional, proportional-integral, proportional-derivative, or proportional-integral-derivative. Mathematica 8 control system functions are used in all the computation.
To determine relative stability of the closed loop, the gain margin in db and phase margin in degrees of the open loop are shown above the Bode plots. For the case of multiple crossover frequencies, the highest frequency is used. The plant and closed-loop transfer functions are shown above the step response plot. For analysis of the absolute stability, the closed-loop poles' locations on the -plane as well as their coordinates are displayed below the plot in the left side. The closed loop is unstable when the real part of any pole is positive. SI units are used throughout.
The plant transfer function is given by , where is the DC gain, is the damping ratio, is the natural frequency, is the Laplace transform of the output of the plant, and is the Laplace transform of the input to the plant. The controller used in the parallel form is given by , where , , and are the proportional, derivative, and integral parameters, respectively. The open-loop transfer function is and the closed-loop transfer function is .
[1] J. J. D'Azzo and C. H. Houpis, Linear Control System Analysis & Design, 3rd ed., New York: McGraw–Hill, 1988.
[2] R. C. Dorf and R. H. Bishop, Modern Control Systems, 11th ed., Englewood Cliffs, NJ: Prentice–Hall, 2007.
[3] K. Ogata, System Dynamics, 4th ed., Englewood Cliffs, NJ: Prentice–Hall, 2003.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2018 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+