# Proportional control

The first and most basic part is the P, for proportional control. All this means is that if you have a reference you are trying to control to, you provide a control output proportional to the error from your reference. (note: K is commonly used to represent such gain factors, and is usually given with a subscript indicating which gain is meant. E.g . Ksteering )

As a standard robot example , if you are trying to follow a wall using a sensor that can measure the distance to the wall (e.g. sonar), you would turn your steering system to return you to the reference distance from the wall. If you are 2 inches to the right, you might turn your steering 4 degrees to the left. If 4 inches to the right, then turn the steering 8 degrees to the left. That is the proportional part.

A block diagram of this operation might look like: The drawing indicates that the actual sonar distance is subtracted from the reference distance (the distance from the wall that you want the robot to stay at) . This gives you an error signal showing the distance from where you want to be in inches (or feet or whatever you want). The "O" (with an X in it) where the two signals come together is called a summation point. The "+" indicates that the reference signal is added; and the "-" means that the sonar sensor is subtracted to get the error signal. That is:

error = reference distance – sonar distance.

The steering gain block represents just a multiplier to get the desired amount of steering per inch of error. The whole thing can be written as:

Steering angle command = Ksteering * (reference distance – sonar distance)

So what this equation does is to steer the robot back toward the reference distance. Sounds like a good idea, but in reality, this may not be enough. What will happen if we try to steer this way?

I'm going to use the two Example robot systems that I described on an earlier page.  If, you didn't read that page, I'd recommend you do it now.

Differential steering control:

If you have a differentially steering robot which starts out rolling along parallel a wall (on its right side) at a distance of 24 inches from the wall, it will TEND to continue to roll along parallel to the wall (until errors build up). The robot has a sonar or Infrared range sensor which continuously gives it the distance to the wall.  Let's say we pick the robot up and put it down again pointed in the same direction (parallel to the wall) but 12 inches closer to the wall..  The proportional equation above will subtract the measured distance from the wall (12 inches) from the reference value (24 inches) getting an error signal of 12 inches.  Multiplying this by the gain (Ksteering) gives a steering command of 24 degrees.  Obviously, the correction should be to turn left to get back to the 24 inch reference value.

This 24 degree command must be translated into a command to the two drive motors. The 24 degrees is equal to 0.42 radians, and using the distance between the two side wheels of 10 inches,  the right wheel should rotate forward 0.42 * 10 = 4.2 inches to turn 24 degrees.  This turn can be achieved by adding half of the 4.2 inches to the right motor control distance command and subtracting half from the left motor.  This turn will occur very quickly (as fast as the motors can drive the wheels) and I'll assume it is instantaneous.

The robot is now pointed back toward its reference distance, and as time goes by, it will get closer and closer.  As the error decreases, the steering command decreases proportionately.  and as the robot reaches the line, the steering error will be zero and the robot will drive parallel to the wall at the correct distance. Car type steering command:

Now, what happens if we do the same thing to a robot with car type steering?  If the robot is placed 12 inches closer to the wall as was done above, the robot will create the same steering command of 24 degrees.  The RC type servo will be instructed to move the front wheel to the 24 degrees to the left position.

As the robot moves forward, it will begin to turn to the left; and hence, it will begin to approach the reference line.  As it approaches, the calculated steering command begins to decrease.  So, the robot reduces the angle of the steering wheels, but they are still pointed toward the left and the robot continues to turn left...just more slowly.  When the robot reaches the reference distance, the steering command goes to zero and the front steering wheels go to center; but the robot is still pointed toward the left and continues past the line.  As it goes out to the left of the reference distance, it will begin to turn the steering wheels back to the right.  Eventually, it will get back to the line again, but will overshoot it again and go out on the right side. So, what's going on here?  Why do the two robots behave differently?  The difference is that with the differentially steering robot, your steering command directly controls the angle of the robot relative to the line.  With the car steering robot, you are controlling the derivative of the angle of the robot.  That is, for a given forward speed, the angle of the robot is the integral of the angle of the front steering wheel.   And integrators, as we'll discuss later, tend to be unstable.

The lesson is that the P, I and D equations do not always do the same thing.  It depends how you apply them to your robot's control   Try to consider what you are controlling when you select the equations, and how the application may affect the results when things aren't working properly. We'll talk about this more later.

GAIN

The only variable in the proportional equation (after you've calculated the error) is the gain, Ksteering.  What is the effect of changing that gain?

Basically, increasing the gain will make things happen more rapidly.  Since an increased gain makes the steering of the differential robot point the robot more toward the reference line, it turns more abruptly and gets on the line sooner For the car type steering, it oscillates back and forth across the line but does it at a higher frequency. Later in this paper, there will be a computer simulation of a robot steering system where you can try different gains and see the performance.

Return to the Control law menu to select the next subject