Diff. Eqns with Inputs and Proportional Control
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
Crane Control with Inputs

Let us return to the cargo crane traveling on a track above a buried beacon, as shown in the figure above. Let us assume that the crane measures the distance to a beacon every \Delta T seconds, with negative distances to the left of the beacon and positive distances to the right. In addition, we will assume that we can set the crane's velocity, though that likely requires the crane to have an internal velocity feedback loop (not unlike a car with cruise control, where one can specify a speed and the car adjusts its acceleration to maintain that speed).
If we try to control the crane's position by adjusting its velocity, and the crane has an internal velocity controller, the combination can be summarized in the block diagram below.

To model how the crane moves along its track, we will represent the crane's measured distance and specified velocity as sequences, d and v respectively, where d[n] and v[n] are the n^{th} measured distance and specified velocity. We can relate d to v with
We denote the desired crane position, also the input to our position controller, as the sequence d_{in}, and a proportional feedback approach to control would be to set the crane velocity proportional to the difference between the desired and measured crane positions, as diagrammed in the figure above. Then the velocity is given by
In order to determine the performance of this proportional-feedback approach as a function of gain, we substitute the control formula into the distance-velocity relation for the crane,
We know how to solve homogeneous LDEs (LDEs with no external input), but we now need to learn how to include inputs.
First-Order LDEs with Inputs
For any system we are trying to control, we will presumably try to influence its outputs by changing its inputs, so we will need to add an input to the homogeneous LDE models we already know. In the first-order case, the general form of an LDE with an input is
General Solution
Performing a process known as "plugging and chugging", we can write
ZIR, ZSR and Linearity
We can easily see the linearity of the difference equation from the above general form. First, suppose we have three "building-block" solutions to our general first-order equation:
an equation with zero input,
Now suppose
Note that y_a has a nonzero initial condition and its difference equation has zero input, so y_a is referred to as a ZIR (for zero-input response). Also note that the difference equations for y_b and y_c have nonzero inputs, but their initial conditions are both zero, so we refer to them as ZSRs (for zero-state response). In general, one can determine the responses to complicated inputs by decomposing those inputs into sums of simpler inputs whose ZSRs you might already know. It is helpful to have a library of ZIRs and ZSRs for several "building-block" inputs, and in the sections below we calculate a few common ones: the ZIR, the ZSR to a unit-sample input, and the ZSR to a unit-step input.
Zero Input Case
A robot that measures obstacle distances ten times a second is placed five meters from a wall. The robot is programmed to move with a velocity negatively proportional to the distance from the wall. We set the velocity negatively proportional to distance to the wall because a robot moving with a positive velocity is moving away from the wall. As the robot gets closer to the wall, it should slow down, but what really happens?
To model how the robot moves toward the wall, we start by representing its distance measurements as a sequence, d, where d[n] is the n^{th} measured distance and d[0] = 5. The difference between d[n] and d[n-1] can be related to the robot's velocity and the time between measurements,
Since the robot's velocity was programmed to be negatively proportional to its distance to the wall,
If we do not want the robot to crash into the wall, or, equivalently, if we do not want d[n] to become negative, we now know that the first-order LDE's natural frequency must be nonnegative. In addition, if we want d[n] to decay to zero (so that we end up next to the wall), the natural frequency must be less than one. Ensuring that 0 \le \lambda \lt 1, or, equivalently, that 0 \le \left( 1 - 0.1 K_p \right) \lt 1, yields constraints on K_p as in:
Consider the following questions carefully before moving on to the next section:
- What happens if K_p is very near but \gt 0?
- What happens if K_p is exactly 10?
- What happens if K_p is 11?
Unit Sample Input Case
A delayed unit sample with delay n_0 is given by
As a formal matter, systems described by LDEs are completely characterized by the output due to a unit sample input, referred to as the unit sample response, but that is a digression for us. Formality aside, we can reason about systems by examining their response to a unit sample.
If y[0] = 0, and the input is a delayed unit sample, u[n] = \delta[n-n_0], then y[n] has a familiar power series form that can be derived in a few steps.
For n \le n_0, y[n] = 0, and for n = n_0+1,
For n > n_0+1, u[n] =0 and therefore y[n] = \lambda y[n-1], the generating difference equation for the power series. Iterating yields
In the stable case, that is if |\lambda| \lt 1 ,
Unit Step Input Case
A delayed unit step with delay n_0 is given by
for which we use the compact notation u[n] = u_s[n-n_0]
Given a unit step input, u[n] = u_s[n-n_0], and y[0] is still zero, then y[n] = 0 \;\; n \le n_0 and y[n_0 + 1] must equal \gamma \; u[n_0] = \gamma \; u_s[n_0-n_0] = \gamma \;. For n > n_0+1, u[n] =1 and therefore
If we write out the terms, we can see the pattern,
Iterating yields a representation of y as a power series sum,
In the stable case, that is |\lambda| < 1 ,
which can be seen by summing the series.
Determining the large N limit
For the stable case, |\lambda| \lt 1, if the input eventually becomes constant, such as in the delayed unit step, we are often only interested in behavior for large n. If so, there is an easier approach to determining y[{\infty}] , a surprisingly useful trick more generally.
Suppose u[n] =1 for n > n_0 and |\lambda| \lt 1. In this stable, constant input case, y[n] and y[n-1] both approach y[{\infty}] for large n, so
There are many ideas hidden in the above simple formula, and they are best exposed by answering questions.
Questions:
- Given \gamma \; > 0 and u[n] = u_s[n], if \lambda = -1 does y[n] remain bounded?
- For the \lambda = -1 case, does y[{\infty}] exist?
- Does y[n] remain bounded if \lambda = 1?
- Given \gamma \; > 0, and u[n] = u_s[n], what value of \lambda minimizes y[\infty] when it exists, and what is that minimum value.
Answers:
- Yes, y[n] is bounded.
- No, y[{\infty}] does not exist as y[n] alternates between 0 and \gamma \; forever.
- If \lambda = 1, y[n] is unbounded, and y[{\infty}] does not exist.
- Setting \lambda very close to -1 minimizes y[\infty], which is bounded from below by \frac{\gamma \;}{2}. But then y[n] oscillates and decays very slowly.
And one last use of y[{\infty}], we use it to construct the entire step response. If y[0] = 0, u[n] = u_s[n-n_0], and |\lambda| \lt 1, then y[n] = 0 for n \le n_0 and
In the figures below we show the behavior of the step response for several different values for \lambda. Notice the large n values in the plots. For example, even if \lambda \lt 0, the large n value is still positive.




Exercises
For the following problems,
A:![]() |
B:![]() |
C:![]() |
D:![]() |
E:![]() |
F:![]() |
For what value of \lambda is the limit as n \to \infty of v[n] equal to:
A model for a proportional feedback system is given by the difference equation
A:![]() |
B:![]() |
C:![]() |
D:![]() |
E:![]() |
F:![]() |
G:![]() |
H:![]() |