SIMULINK – Module 2

Let’s consider the following.

  1. Integrate a sine function.

. The answer is = 2

This could be visualized as a circuit

To do this:

  1. Go to Simulink library.
  2. Open a new workspace.
  3. Click on Commonly used blocks under Simulink
  4. On the right column, find the integrator block, select it and drag it into the workspace.
  5. Go to sources (left column) under Simulink, find a sinusoidal source, select it and drag it into the workspace at the left of the integrator block.
  6. Go to sink (left column), find a scope and drag it in at the right of the integrator.
  7. Connect them as shown

The output on the scope appears to be

If we want to change the initial starting value of the integral, we double click the integrator and change it in the parameter list.

How about changing the input source to a step function?

The view on the scope1 shows the input step function

And its integration is shown at the output scope (marked scope):

How about using a single pulse function as an input? The pulse function should appear as

To produce this signal, we add two step functions.

Step function 1 would be a normal step function rising at time = 1 of height 3.

Step function two would be a step function rising at time = 5 of height 3, but added to the first one with reverse sign (in effect, step function 2 is subtracted from step function 1).

The two functions are added via a summing node (polarities have to be changed). The entire system would look like

The view on scope1 shows the input pulse:

The output on scope shows the integration of this function.

Another example.

Solve with and

.

This can be written as:

Note that

The analog computer for this equation is:

The posted gain on gain1 a = 0.01, and on gainb= 0.2, respectively.

The output on scope appears to be:

Lets make and

What if we switch these parameters? Now and . With these,

PID controller.

The issue is: Control of a dynamic object (Plant)

Plant is supposed to generate a signal in response to signal . Three types of control are envisaged:

■ Proportional control:

■ Integral control:

■ Differential control:

The sum total control at time is therefore

Note that the three control features are not independent. Changing one affects the other.

Suppose we have a dynamic system with a system equation

as follows:

with the following parameters:

and

Our objective is to find out its

● rise time response (minimize)

● magnitude of the overshoot (minimize)

● magnitude of the steady state error (minimize)

We don’t know our system solution but we assume its Laplace transformation exists and is obtained as

Some typical transforms

(

Time Domain / Frequency Domain
Linearity / f(t) +g(t) /
Function / x(t) /
1stDerivative / x'(t) /
2ndDerivative / x"(t) /
nthDerivative / xn(t) /

Also note some specific cases below

(

Time Functionf(t)
f(t) =-1{F(s)} / Laplace Transform off(t)
F(s) ={f(t)}
1 /
t(unit-ramp function) /
tn(n, a positive integer) /
eat /
sin ωt /
cos ωt /
tng(t), forn= 1, 2, ... /
tsin ωt /
tcos ωt /
g(at) / Scale property
eatg(t) / G(s−a) Shift property
eattn, forn= 1, 2, ... /
te-t /
1 − e-t/T /
eatsin ωt /
eatcos ωt /

Thus, in our case, Laplace transformation of the equation leads to (assuming all initial conditions are zero)

LT(model equation):

or, in terms of transform function

The function is the response solution to the input . Thus, the transform function determines the profile of system response.

We try some approaches.

Case A: Open-loop solution (no feedback).

With output

Suppose we introduce proportional control only. Now the transfer function changes to

Suppose, we let . Then the steady state solution would be 300/316 = 0.95.

The output would appear as

With a significant overshoot. What if we accept it and introduce the differential control on it? The transfer function now changes to

Suppose we let . Our system now changes to

With the scope output as

Note the improvement in response behavior. If we introduce proportional integration error, our transform function changes to (no derivative control)

Let . Then our system would appear as

With the scope output (note the scale change)

With all the three controls in effect leads to the following TF.

With , we get

Not much improvement. But we note what we need to do.

Consider the following with a PID controller.

The following diagram shows the activity with effectively three integrators.

The output on the scope depicts a forced damped harmonic oscillation.