Escolar Documentos
Profissional Documentos
Cultura Documentos
The goal of this lab is to understand fundamental limits on how quickly and
accurately the robot can move from one location to another. We will find that
achieving either speed or accuracy is easy, but achieving both simultaneously is
difficult (or impossible). In this and the next two labs, we will explore increasingly sophisticated control schemes to improve performance.
1 Proportional controller
We wish to program the robot to move toward (or away from) a wall, so as to adjust its position to be
half a meter from the wall. One strategy (which is called bang-bang control) is to move forward
(with a fixed velocity V ) when the distance is greater than half a meter, and to move backward
(with the same speed but opposite direction) otherwise.
Check Yourself 1. What is good about this strategy? What is bad about it?
A more sophisticated strategy is proportional control. In this strategy, the robots velocity is made
proportional to the difference between its desired distance to the wall and its actual distance to the
wall. We will call the proportionality constant K the gain.
Implement a proportional controller by completing the definition of the step procedure in
wallFinderBrain.py. Test your code with soar in the wallFinderWorld.py. When you stop
the simulation, soar will plot the sequence of distances to the wall during the run.
Find three different values of K: one for which the distance converges monotonically, one for which
it oscillates and converges, and one for which it does not converge.
monotonic convergence
oscillatory convergence
K =
Make plots for each of these K values. Email your code and plots to your partner.
Checkoff 1.
Show your controller code and plots to a staff member, and discuss which
gains generate which results, and speculate why.
1
Design Lab 4
error
controller
command
plant
sensor
Figure 1 Structure of Control System.
For todays lab, the controller is the robots brain, the plant is the part of the system that is being
controlled (i.e., the robots locomotion system, whose input is an io.Action and whose output is
the robots position), and the sensor is the robots sonars.
Make a mathematical model of the wall finder system as follows. Let do [n] (the o stands for
output) represent the current distance from the robot to the wall, and let di [n] (the i stands for
input) represent the (current) desired distance to the wall. Also let v represent the forward velocity
of the robot. Let T = 0.1 seconds represent the time between steps.
di [n]
do [n]
When the robot receives a new command, we assume that the robot immediately changes its velocity and then holds the new velocity constant until it receives the next command (i.e., the robot
accelerates so fast that we can ignore the acceleration time).
Check Yourself 2. Given the following conditions, what is the distance to the wall on step 1?
v[0] = 1
do [0] = 3
v[1] = 2
do [1] =
Assume the system has the structure shown in Figure 1. Assume that the sensor measures the current distance do [n] and generates the sensed distance ds [n], which is equal to the current distance
delayed by one step time. Let e[n] = di [n] ds [n] represent the error signal, which is the difference between the input distance di [n] and the sensed distance ds [n]. On each step, the controller
commands a forward velocity v[n] in proportion to the error so that v[n] = Ke[n].
Check Yourself 3. Fully label the following diagram. Include do [n], di [n], ds [n], v[n], e[n].
plant
controller
sensor
Design Lab 4
Determine difference equations (using constants T and K) to relate the input and output signals of
the following system components.
the controller
the model of the plant
the model of the sensor
Make block diagrams for each of the elements in the system. Use only delays (R), gains, and
adders. Enter your diagrams in the boxes below.
plant
controller
Di
0.1
Do
sensor
Combine these equations to derive a single difference equation for the system. Solve the difference
equation for the current output do [n] in terms of
previous values of the output (do [n 1], do [n 2], ...) and
current and previous values of the input (di [n], di [n 1], ...).
do [n] =
+
Checkoff 2.
do [n 1]+
do [n 2]
di [n]+
di [n 1]+
di [n 2]
Design Lab 4
Simulate the behaviors for the same gains you used in Checkoff 1. In what ways are the state
machine simulations similar/different from results from soar?
Explain your plots for the state machine simulations to a staff member. Explain how these plots are similar/different from those from soar (Checkoff
1). Speculate on why the results might differ.