| Simulink® Control Design™ | ![]() |
| On this page… |
|---|
The first step in the linearization or compensator design process is to create or open a Simulink® model of your system. The model can have any number of inputs and outputs (including none), and any number of states. The model can include user-defined blocks or S-functions. Your model can involve multiple compensators in addition to the plant, multiple feedback loops, and any number of subsystems.
This section introduces an example model, the magnetic ball system, that the remaining sections and chapters use to illustrate the process of linearizing a model or designing a compensator.
The electronic circuit in the following figure consists of a voltage source, a resistor, and an inductor in the form of a tightly wound coil. An iron ball beneath the inductor experiences a gravitational force as well as an induced magnetic force (from the inductor) that opposes the gravitational force.

A differential equation for the force balance on the ball is given by
![]()
where M is the mass of the ball, h is the height (position) of the ball, g is the acceleration due to gravity, i is the current, and β is a constant related to the magnetic force experienced by the ball. This equation describes the height, h, of the ball due to the unbalanced forces acting upon it.
The current in the circuit also varies with time and is given by the following differential equation
![]()
where L is the inductance of the coil, V is the voltage in the circuit, and R is the resistance of the circuit.
The system of equations has three states:
![]()
The system also has one input (V), and one output (h). It is a nonlinear system due to the term in the equation involving the square of i and the inverse of h.
Due to its nonlinearity, you cannot analyze this system using methods for linear-time-invariant (LTI) systems such as step response plots, bode diagrams, and root-locus plots. However, you can linearize the model using theSimulink® Control Design™ software to approximate the nonlinear system as an LTI system. Linearization also occurs automatically when designing a compensator. This linearized system can then use the LTI Viewer for display and analysis and the SISO Design Tool for compensator design. Refer to Purpose of Linearization for a discussion of the uses of linearized models and Linearization of Simulink® Models for a discussion of the linearization process.
To open the model for the magnetic ball example, type
magball
at the MATLAB® prompt. The magnetic ball system opens in the Simulink model viewer as shown in this figure.

The magball model consists of
The magnetic ball system itself, within the subsystem labeled Magnetic Ball Plant.
A Controller subsystem that controls the height of the ball by balancing the forces acting on it.
A reference signal that sets the desired height of the ball.
A Scope block that displays the height of the ball as a function of time.
Double-click a block to view its contents. The Controller block contains a zero-pole-gain model. The Magnetic Ball Plant block is shown in this figure.

The input to the Magnetic Ball Plant system, which is also the output of the Controller subsystem, is the voltage, V. The output is the height of the ball, h. The system contains three states within the three integrators: height, dhdt, and Current.
Values of the parameters are given as M=0.1 kg, g=9.81 m/s2, R=2 Ohm, L=0.02 H, and β=0.001.
![]() | Beginning a Project | Beginning a New Linearization Task | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |