Description
Controllability and State Feedback
1. The motion of a robot arm with one revolute joint can be described in state-space form as
x˙ =
0 1
0 −b/m
x +
0
1/m
u
y =
1 0
x
where the state elements are the angle (x1) and the angular velocity (x2) of the joint, the
input u is a torque applied to the arm at the joint, and
m = 5 b = 1
are parameters.
(a) Show that this system is controllable.
(b) Consider an input of the form
u = −Kx + kreferencer
where
K =
k1 k2
and r is a reference signal that you may assume is constant.
• Feedback design. Compute the gains k1 and k2 that would place the closed-loop
eigenvalues at −σ ± jω. You may assume that both σ > 0 and ω > 0.
• Feedforward design. Compute the gain kreference so that y = r in steady-state.
(c) EXTRA CREDIT:
• Show that the time to peak amplitude of the step response (i.e., the time that it
takes for y(t) to reach its first peak) is
tp = π/ω
• Show that the peak overshoot of the step response is
Mp = e
−πσ/ω
(d) Lines of constant time to peak. Use part (c) to compute eigenvalue locations that would
result in tp = 0.5 and Mp = 0.1. Use part (b) to compute the corresponding gains. Use
any method of simulation you want to compute the step response. Create a figure with
two axes (e.g., subplot(1,2,1) and subplot(1,2,2) in MATLAB). On the first set of
axes, plot the step response. On the second set of axes, plot the eigenvalue locations.
Repeat for Mp = 0.2 and Mp = 0.3, keeping tp constant and putting your results on the
same two axes. What happens to the step response? What happens to the eigenvalue
locations? (In what direction do they move with increasing Mp?)
1
(e) Lines of constant peak overshoot. Use part (c) to compute eigenvalue locations that
would result in tp = 0.5 and Mp = 0.1. Use part (b) to compute the corresponding
gains. Use any method of simulation you want to compute the step response. Create a
figure with two axes (e.g., subplot(1,2,1) and subplot(1,2,2) in MATLAB). On the
first set of axes, plot the step response. On the second set of axes, plot the eigenvalue
locations. Repeat for tp = 1.5 and tp = 2.5, keeping Mp constant and putting your
results on the same two axes. What happens to the step response? What happens to
the eigenvalue locations? (In what direction do they move with increasing tp?)
(f) Suppose you are given a performance specification that requires tp < 1 and Mp < 0.15.
• Sketch the region of the complex plane within which the eigenvalues must be located
in order to meet this spec.
• Choose eigenvalue locations in this region (anywhere you want) and compute the
corresponding gains.
• Compute and visualize the response of the closed-loop system to a reference signal
r(t) = π/2 for all t ≥ 0
using the script hw3prob01.m. (This is exactly the same as the step response, but
with a reference signal of magnitude π/2 instead of magnitude 1.) Submit only
the lines of code you added to this script and a snapshot of the figure after the
simulation has ended.
(You could, of course, use this same code to visualize the step responses you computed
in the earlier parts of this problem, if you wanted.)
2. The rotational motion of an axisymmetric spacecraft about its yaw and roll axes can be
described in state-space form as
x˙ =
0 λ
−λ 0
x +
1
0
u
y =
0 1
x
where the state elements x1 and x2 are the angular velocities about yaw and roll axes, the
input u is an applied torque, and the parameter λ = 9 is the relative spin rate.
(a) Show that this system is controllable.
(b) Consider an input of the form
u = −Kx + kreferencer
where
K =
k1 k2
and r is a reference signal that you may assume is constant.
• Feedback design. Compute the gains k1 and k2 that would place the closed-loop
eigenvalues at −σ1 and −σ2. You may assume that σ2 ≥ σ1 > 0.
• Feedforward design. Compute the gain kreference so that y = r in steady-state.
(c) Dominant first-order response. Use part (b) to compute the gains that place both closedloop eigenvalues at −1. Use any method of simulation you want to compute and plot
the step response. Repeat for eigenvalues at −1 and −5, then once more for eigenvalues
at −1 and −10. Put all your results on the same axes. On these same axes, plot
yfirstorder(t) = 1 − e
−t
What happens to the step response as one of the eigenvalues moves farther out? Why
would it make sense to say that, when σ1 = 1 and σ2 = 10, the system has a dominant
first-order response with time constant 1/σ1 = 1?
(d) Suppose you are given a performance specification that requires a dominant first-order
response with time constant 1/2.
• Choose eigenvalues that meet this spec and compute the corresponding gains.
• Compute and visualize the response of the closed-loop system to an initial condition
x(0) =
10
0
using the script hw3prob02.m. Note that this script does everything for you—all you
need to do is put hw3prob02.m in your working directory and call hw3prob02(K,x0)
with an appropriate choice of gain matrix K and initial condition x0. Submit only a
snapshot of the figure after the simulation has ended.
Although not required, you might consider the relationship between the step response
(computed by you) and the response to initial conditions (computed by hw3prob02.m).
How are these two things related?
3. Previously, we have studied the following model of the relationship between the applied torque
τ and the pitch angle θ of a spacecraft:
¨θ = τ.
This week, you will begin by looking at the alternative model
Jpitch ¨θ = τ, (1)
which is exactly the same but which includes a parameter describing the moment of inertia
about the pitch axis. Suppose Jpitch = 15 kg · m2
. Then, just like before, the system can be
expressed in state space form as
x˙ =
0 1
0 0
x +
0
1/15
u,
where
x =
θ
˙θ
and u =
τ
(a) Show that this system is controllable.
(b) Consider the application of state feedback
u = −Kx
where
K =
k1 k2
.
Compute the gains that would place the closed-loop eigenvalues at −10−1 and −10−2
.
(c) Suppose the torque is generated using a reaction wheel. Any torque applied to the
spacecraft is also applied, in the opposite direction, to the wheel. The relationship
between the torque and the angular velocity ν of the wheel can be approximated by
Jwheelν˙ = −τ,
where τ is the same torque as in our model of the spacecraft and where Jwheel = 1 kg·m2
is the moment of inertia of the wheel about its axis of rotation. Redefine the state as
x =
θ
˙θ
ν
and rewrite the system in state space form.
(d) Show that the system in part (c) is not controllable.
(e) Suppose the state feedback that you designed in part (b) were applied, unchanged, to
the system that you derived in part (c):
K =
k1 k2 0
Use whatever method you like to simulate and plot x(t) given an initial condition of
θ(0) = 0, ˙θ(0) = 0.01, and ν(0) = 0. Be sure to use a long enough time horizon. What
happens to the pitch angle? What happens to the angular velocity of the wheel?
(f) If the spacecraft is in “low Earth orbit” (LEO), its motion about the pitch axis will be
subject to a gravity gradient torque. Instead of (1), the dynamics become
Jpitch ¨θ = τ + 3n
2
(Jyaw − Jroll) θ,
where n = 0.0011 rad/sec is the orbital angular velocity and where Jroll = 15 kg · m2
and Jyaw = 5 kg · m2 are moments of inertia about the roll and yaw axes, respectively.
Modify your answer to part (c) and rewrite this system—including both the spacecraft
and the reaction wheel—in state space form.
(g) Show that the system in part (f) is controllable.
(h) Consider the application of state feedback
u = −Kx
to the system in part (f), where
K =
k1 k2 k3
Compute the gains that would place the closed-loop eigenvalues at −10−1
, −10−2
, and
−10−4
.
(i) Use whatever method you like to simulate and plot x(t) given an initial condition of
θ(0) = 0, ˙θ(0) = 0.01, and ν(0) = 0. Be sure to use a long enough time horizon. (To
get a sense of what this time horizon should be, ask yourself—how many seconds does
it take a spacecraft in LEO to orbit the earth once?) What happens to the pitch angle?
What happens to the angular velocity of the wheel?
4. In this problem, you will see how to discretize a state space system and how to use this
discretization to do trajectory generation.
(a) EXTRA CREDIT: Consider a general state space system
x˙ = Ax + Bu. (2)
Assume that the matrix A is invertible. Suppose the input is constant on time intervals
of length h > 0. In other words, for each non-negative integer k ∈ {0, 1, 2, . . . }, we have
u(t) = u(kh) for all t ∈ [kh,(k + 1)h). Prove that
x((k + 1)h) = Adx(kh) + Bdu(kh).
for
Ad = e
Ah Bd = A
−1
e
Ah − I
B.
Note that Ad and Bd depend on h, A, and B, but not on k. Finding Ad and Bd is called
“discretizing” the system (2). We often write the resulting “discrete-time” system as
xk+1 = Adxk + Bduk.
(b) Suppose that x ∈ R
n
(i.e., that the state has n elements). Assuming x0 = 0, find the
matrix Wdiscrete for which
xn = Wdiscreteudiscrete, (3)
where
udiscrete =
un−1
un−2
.
.
.
u1
u0
Note that (3) computes the state of the system (2) after n time intervals of length h,
assuming the constant input uk is applied during each interval k + 1.
HINT: the matrix Wdiscrete should look very familiar to you.
(c) Suppose you want to achieve a given state xn = xgoal, starting from x0 = 0. What must
be true of Wdiscrete in order for this to be possible, and what sequence of inputs udiscrete
should you choose?
5
m1
k1
b1
m2
k2
b2
f
(d) A model of the spring-mass-damper system shown above is
m1p¨1 = −k1p1 − b1p˙1 + k2(p2 − p1) + b2( ˙p2 − p˙1)
m2p¨2 = −k2(p2 − p1) − b2( ˙p2 − p˙1) + f,
where f is an applied force and where p1 and p2 are absolute displacements of each mass
from their equilibrium positions. Put this system in state space form, assuming that
m1 = m2 = 2 k1 = k2 = 8 b1 = b2 = 1.
You may choose states however you like, but make sure the inputs and outputs are
u =
f
and y =
p1
p2
.
(e) Show that the system in part (d) is controllable.
(f) Suppose
p1(0) = 0 p2(0) = 0 ˙p1(0) = 0 ˙p2(0) = 0
and you want to achieve
p1(4) = 1 p2(4) = 4 ˙p1(4) = 0 ˙p2(4) = 0
with inputs that are constant over time intervals of length h = 1. Apply your results
from parts (a)-(c) in order to find these inputs (i.e., in order to find udiscrete).
(g) Simulate the response of the spring-mass-damper system to the inputs you chose in
part (f) using the script hw3prob04.m. Submit only the lines of code you added to this
script and a snapshot of the figure after the simulation has ended.
5. EXTRA CREDIT: In the first three problems, you were asked to compute gains that placed
eigenvalues in specific locations “by hand” (i.e., by computing the characteristic equation and
by choosing gains that make this equation look like what you want).
This process can be made
systematic. In particular, go back and repeat every such computation by transformation to
controllable canonical form (see videos on piazza). Note that the MATLAB function acker
uses exactly this method, and is a good way to check your work, whether or not you do this
extra credit problem.
6