100% found this document useful (1 vote)
907 views

Solutions For Exercises: Introduction To Embedded Systems 2nd Edition by Lee & Seshia

Dive deeper into embedded system design with comprehensive solutions from the 2nd edition of Introduction to Embedded Systems. This resource is tailored for students and professionals mastering embedded technologies.

Uploaded by

industriale82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
907 views

Solutions For Exercises: Introduction To Embedded Systems 2nd Edition by Lee & Seshia

Dive deeper into embedded system design with comprehensive solutions from the 2nd edition of Introduction to Embedded Systems. This resource is tailored for students and professionals mastering embedded technologies.

Uploaded by

industriale82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Contact me in order to access the whole complete document. Email: smtb98@gmail.

com
WhatsApp: https://wa.me/message/2H3BV2L5TTSUF1 Telegram: https://t.me/solutionmanual

2
Continuous Dynamics
— Exercises

1. A tuning fork, shown in Figure 2.1, consists of a metal finger (called a tine) that is displaced by striking
it with a hammer. After being displaced, it vibrates. If the tine has no friction, it will vibrate forever. We
can denote the displacement of the tine after being struck at time zero as a function y : R+ → R. If we
assume that the initial displacement introduced by the hammer is one unit, then using our knowledge of
physics we can determine that for all t ∈ R+ , the displacement satisfies the differential equation

ÿ(t) = −ω20 y(t)

where ω20 is a constant that depends on the mass and stiffness of the tine, and where ÿ(t) denotes the
second derivative with respect to time of y. It is easy to verify that y given by

∀ t ∈ R+ , y(t) = cos(ω0t)

is a solution to the differential equation (just take its second derivative). Thus, the displacement of the
tuning fork is sinusoidal. If we choose materials for the tuning fork so that ω0 = 2π × 440 radians/second,
then the tuning fork will produce the tone of A-440 on the musical scale.

(a) Is y(t) = cos(ω0t) the only solution? If not, give some others.

Solution: The following is a solution for any constant α:

y(t) = α cos(ω0t) .

(b) Assuming the solution is y(t) = cos(ω0t), what is the initial displacement?

Solution: y(0) = cos(ω0 × 0) = 1.

(c) Construct a model of the tuning fork that produces y as an output using generic actors like Integrator,
adder, scaler, or similarly simple actors. Treat the initial displacement as a parameter. Carefully label
your diagram.

5
SOLUTIONS

Solution: The following model will do the job:

Here, i is the initial displacement.

displacement restorative force

tine

Figure 2.1: A tuning fork.

6 Lee & Seshia, Introduction to Embedded Systems, Solutions


2. CONTINUOUS DYNAMICS

2. Show that if a system S : AR → BR is strictly causal and memoryless then its output is constant. Constant
means that the output (S(x))(t) at time t does not depend on t.

Solution: Since the system is memoryless, there exists a function f : A → B such that for all x ∈ X,

(S(x))(t) = f (x(t))

We need to show that for all a1 , a2 ∈ A, f (a1 ) = f (a2 ).


Since the system is strictly causal, for all x1 , x2 ∈ X and τ ∈ R,

x1 |t<τ = x2 |t<τ ⇒ S(x1 )|t≤τ = S(x2 )|t≤τ

Using the function f , this becomes

x1 |t<τ = x2 |t<τ ⇒ f (x1 (t)) = f (x2 (t))

for all t ≤ τ. The left side of this expression imposes no constraint at all on the values of x1 (τ) and
x2 (τ), so these can be arbitrary values a1 , a2 ∈ A. Hence, the right hand side asserts that f (a1 ) = f (a2 )
for all a1 , a2 ∈ A.

Lee & Seshia, Introduction to Embedded Systems, Solutions 7


SOLUTIONS

3. This exercise studies linearity.

(a) Show that the helicopter model defined in Example 2.1 is linear if and only if the initial angular
velocity θ̇y (0) = 0.

Solution: The input Ty and output θ̇y are related by

Zt
1
θ̇y (t) = θ̇y (0) + Ty (τ)dτ.
Iyy
0

First, we need to show that if θ̇y (0) = 0, then superposition applies. Then we need to show if
θ̇y (0) 6= 0, superposition does not apply. For the first problem, if θ̇y (0) = 0 then we have

Zt
1
θ̇y (t) = Ty (τ)dτ.
Iyy
0

Suppose the input is given by


Ty = aT1 + bT2
where a and b are real numbers and T1 and T2 are signals. Then the output is

Zt
1
θ̇y (t) = (aT1 (τ) + bT2 (τ))dτ
Iyy
0
Zt Zt
a b
= T1 (τ)dτ + T1 (τ)dτ.
Iyy Iyy
0 0

It is easy to see that the first term is a times what the output would be if the input were only T1 ,
and the second term is b times what the output would be if the input were only T2 . That is, if the
system function is S, the output is

θ̇y (t) = a(S(T1 ))(t) + b(S(T2 ))(t).

Next, assume that θ̇y (0) 6= 0. With the same input as above, we get the output

Zt
1
θ̇y (t) = θ̇y (0) + (aT1 (τ) + bT2 (τ))dτ
Iyy
0
Zt Zt
a b
= θ̇y (0) + T1 (τ)dτ + T1 (τ)dτ.
Iyy Iyy
0 0

We can now see that the output is

θ̇y (t) = a(S(T1 ))(t) + b(S(T2 ))(t) − θ̇y (0),

so superposition does not apply.

(b) Show that the cascade of any two linear actors is linear.

8 Lee & Seshia, Introduction to Embedded Systems, Solutions


2. CONTINUOUS DYNAMICS

Solution: Given an actor with function S1 and another with function S2 , the cascade composition
is an actor with function S1 ◦ S2 , the composition of the two functions. If S1 and S2 both satisfy
the superposition property, then

S2 (S1 (ax1 + bx2 )) = S2 (aS1 (x1 ) + bS1 (x2 ))


= aS2 (S1 (x1 )) + bS2 (S1 (x2 )).

Hence, the composition also satisfies superposition.

(c) Augment the definition of linearity so that it applies to actors with two input signals and one output
signal. Show that the adder actor is linear.

Solution: A system model S : X1 × X2 → Y , where X1 , X2 , and Y are sets of signals, is linear if


it satisfies the superposition property:

∀ x1 , x10 ∈ X1 and ∀ x2 , x20 ∈ X2 and ∀ a, b ∈ R,


S(ax1 + bx10 , ax2 + bx20 ) = aS(x1 , x2 ) + bS(x10 , x20 ).

The adder component is given by


S(x1 , x2 ) = x1 + x2 .
Hence

S(ax1 + bx10 , ax2 + bx20 ) = ax1 + bx10 + ax2 + bx20


= a(x1 + x2 ) + b(x10 + x20 )
= aS(x1 , x2 ) + bS(x10 , x20 ).

Lee & Seshia, Introduction to Embedded Systems, Solutions 9


SOLUTIONS

4. Consider the helicopter of Example 2.1, but with a slightly different definition of the input and output.
Suppose that, as in the example, the input is Ty : R → R, as in the example, but the output is the position
of the tail relative to the main rotor shaft. Specifically, let the x-y plane be the plane orthogonal to the
rotor shaft, and let the position of the tail at time t be given by a tuple ((x(t), y(t)). Is this model LTI? Is
it BIBO stable?

Solution: In this case, the system can be modeled as a function with two output signals,

S : (R → R) → (R → R)2 ,

where
(S(Ty ))(t) = (x(t), y(t)),
where (x(t), y(t)) is the position of the tail in the x-y plane. This model is clearly not linear. If the
input torque doubles, for example, the output values will not double. In fact, the output values are
constrained to lie on a circle centered at the origin, regardless of the input. For this reason, the model is
BIBO stable. The output is always bounded. Thus, while our previous model was linear and unstable,
this one is nonlinear and stable. Which model is more useful?

10 Lee & Seshia, Introduction to Embedded Systems, Solutions


2. CONTINUOUS DYNAMICS

5. Consider a rotating robot where you can control the angular velocity around a fixed axis.

(a) Model this as a system where the input is angular velocity θ̇ and the output is angle θ. Give your
model as an equation relating the input and output as functions of time.

Solution:
Zt
∀ t ∈ R, θ(t) = θ(0) + θ̇(τ)dτ,
0

where θ(0) is the initial position.

(b) Is this model BIBO stable?

Solution: The model is not BIBO stable. For example, the input

θ̇(t) = u(t)

is bounded but yields an unbounded output.

(c) Design a proportional controller to set the robot onto a desired angle. That is, assume that the initial
angle is θ(0) = 0, and let the desired angle be ψ(t) = au(t), where u is the unit step function. Find
the actual angle as a function of time and the proportional controller feedback gain K. What is your
output at t = 0? What does it approach as t gets large?

Solution: A proportional controller has the same structure as the helicopter controller:

Just as with the helicopter controller, we can solve the integral equation to get

θ(t) = au(t)(1 − e−Kt ).

The output at zero is θ(0) = 0, as expected. As t gets large, the output approaches a.

Lee & Seshia, Introduction to Embedded Systems, Solutions 11


SOLUTIONS

6. A DC motor produces a torque that is proportional to the current through the windings of the motor.
Neglecting friction, the net torque on the motor, therefore, is this torque minus the torque applied by
whatever load is connected to the motor. Newton’s second law (the rotational version) gives

d
kT i(t) − x(t) = I ω(t), (2.1)
dt
where kT is the motor torque constant, i(t) is the current at time t, x(t) is the torque applied by the load at
time t, I is the moment of inertia of the motor, and ω(t) is the angular velocity of the motor.

(a) Assuming the motor is initially at rest, rewrite (2.1) as an integral equation.

Solution: Integrating both sides, we get


Z t
(kT i(τ) − x(τ))dτ = Iω(t).
0

Solving for ω(t) we get Z t


1
ω(t) = (kT i(τ) − x(τ))dτ.
I 0

(b) Assuming that both x and i are inputs and ω is an output, construct an actor model (a block diagram)
that models this motor. You should use only primitive actors such as integrators and basic arithmetic
actors such as scale and adder.

Solution: A solution is shown below:

(c) In reality, the input to a DC motor is not a current, but is rather a voltage. If we assume that the
inductance of the motor windings is negligible, then the relationship between voltage and current is
given by
v(t) = Ri(t) + kb ω(t),
where R is the resistance of the motor windings and kb is a constant called the motor back electro-
magnetic force constant. The second term appears because a rotating motor also functions as an
electrical generator, where the voltage generated is proportional to the angular velocity.
Modify your actor model so that the inputs are v and x rather than i and x.

Solution: A solution is shown below:

12 Lee & Seshia, Introduction to Embedded Systems, Solutions


2. CONTINUOUS DYNAMICS

Lee & Seshia, Introduction to Embedded Systems, Solutions 13


SOLUTIONS

K1

K2

Figure 2.2: A PI controller for the helicopter.

7. (a) Using your favorite continuous-time modeling software (such as LabVIEW, Simulink, or Ptolemy
II), construct a model of the helicopter control system shown in Figure 2.4. Choose some reasonable
parameters and plot the actual angular velocity as a function of time, assuming that the desired
angular velocity is zero, ψ(t) = 0, and that the top-rotor torque is non-zero, Tt (t) = bu(t). Give your
plot for several values of K and discuss how the behavior varies with K.

Solution: A Ptolemy model for the P controller is shown below:

With the controller gain set to K = 10 and the top-rotor torque at Tt (t) = 0.5u(t), we see that
the angular velocity settles quickly to a constant 0.05 = 0.5/K. Increasing K to 100 reduces this
steady-state error to 0.005. Since the steady state error is in the angular velocity, the angle of
the helicopter slowly increases (i.e., the helicopter rotates despite a desired angular velocity of
zero).

(b) Modify the model of part (a) to replace the Controller of Figure 2.4 (the simple scale-by-K ac-
tor) with the alternative controller shown in Figure 2.2. This alternative controller is called a

14 Lee & Seshia, Introduction to Embedded Systems, Solutions


2. CONTINUOUS DYNAMICS

proportional-integrator (PI) controller. It has two parameter K1 and K2 . Experiment with the
values of these parameters, give some plots of the behavior with the same inputs as in part (a), and
discuss the behavior of this controller in contrast to the one of part (a).

Solution: A Ptolemy model for the PI controller is shown below:

With the controller gains set to K1 = 10 and K2 = 10 and the top-rotor torque at Tt (t) = 0.5u(t),
we see that the angular velocity settles eventually to zero. Increasing K1 results in a smaller peak
error. Increasing K2 results in fast settling, but also some overshoot.

Lee & Seshia, Introduction to Embedded Systems, Solutions 15

You might also like