Solutions For Exercises: Introduction To Embedded Systems 2nd Edition by Lee & Seshia
Solutions For Exercises: Introduction To Embedded Systems 2nd Edition by Lee & Seshia
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
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.
y(t) = α cos(ω0t) .
(b) Assuming the solution is y(t) = cos(ω0t), what is the initial displacement?
(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
tine
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))
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.
(a) Show that the helicopter model defined in Example 2.1 is linear if and only if the initial angular
velocity θ̇y (0) = 0.
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
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
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
(b) Show that the cascade of any two linear actors is linear.
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
(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.
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?
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
Solution: The model is not BIBO stable. For example, the input
θ̇(t) = u(t)
(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
The output at zero is θ(0) = 0, as expected. As t gets large, the output approaches a.
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.
(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.
(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.
K1
K2
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.
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
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).
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.