• Tidak ada hasil yang ditemukan

Robot drive controls

Dalam dokumen Designing Autonomous Mobile Robots (Halaman 86-90)

‘Limit the output accumulator and flag the integrator

‘if the output goes out of range. (In a properly tuned

‘control, this should never happen).

If OutputAccum > 9999 Then OutputAccum = 9999

IntegralHold = -1 ‘Allow only down integration ElseIf OutputAccum < 0 Then

OutputAccum = 0

IntegralHold = 1 ‘Allow only upward integration Else

IntegralHold = 0 ‘Allow both directions.

End If

DoPIDs = CInt(OutputAccum) End Function

‘---

‘Prevent Terms from exceeding integer range for logging.

Private Function LimitTerm(Term As Single) If Term > 9999 Then

LimitTerm = 9999 ElseIf Term < -9999 Then

LimitTerm = -9999 Else

LimitTerm = Term End If

End Function

Figure 5.5. A band-limited hybrid control with integral hold-off

Drive-brake asymmetry

There are two basic categories of drive gear reduction: back drivable and non-back drivable. The first category includes pinion, chain, and belt reducers, while the sec- ond includes worm and screw reducers. Servos using non-back drivable reducers are easier to control because variations in the load are largely isolated from the motor.

Back-drivable reducers are much more efficient, but more difficult to control because load fluctuations and inertial forces are transmitted back to influence the motor’s position.

The response of either type servo is usually very nonlinear with respect to driving and braking. To achieve a given acceleration may require very significant motor cur- rent, while achieving the same magnitude of deceleration may require only a minute reverse current. For this reason, asymmetric gains are usually required in both cases.

Quadrant crossing nonlinearity

Most drives are either two or four quadrant. A two-quadrant drive can drive in one direction and brake. A four-quadrant drive can drive and brake in both directions.

The term quadrant thus comes from these four possible actions of the drive. A nasty phenomenon that appears in the back drivable servos is that of nonlinear regions in a servo’s load. A drive motor using a pinion gear box is an excellent example. When the power transitions from forward to reverse (called changing quadrants), the servo will cross a zero load region caused by the gear backlash. If the control does not take this into account, it may become unstable after freewheeling across this region and slamming into the opposite gear face. One trick for handling this discontinuity is to sense that the control has crossed quadrants and reduce its total gain after the crossing. This gain can then be smoothly restored over several ticks if the control remains in the new quadrant.

Natural deceleration

Any servo will have its own natural deceleration rate. This is the deceleration rate at which the servo will slow if power is removed. If the programmed deceleration is lower than the natural deceleration, the servo never goes into braking and the re- sponse is usually smooth.

Thus, during normal operation the ugly affects of quadrant crossing may not be no- ticed. If, however, the robot must decelerate unexpectedly to avoid a collision, the servo may react violently, and/or the robot may tip over forward. For this reason, a

maximum deceleration is usually specified, beyond which the robot will not attempt to brake. In this way the robot will slow as much as possible before the impact. If a mechanical bumper is designed into the front of the robot, it can be made to absorb any minor impact that cannot be avoided by the control system.

Freewheeling

Perhaps the most difficult control problem for a drive servo is that of going down a ramp. Any back drivable drive servo will exhibit a freewheeling velocity on a given ramp. This is the speed at which the robot will roll down the ramp in an unpowered state. At this speed, the surface drag and internal drag of the servo are equal to the gravitational force multiplied by the sine of the slope. The freewheeling speed is thus load dependent.

If a robot attempts to go down a ramp at a speed that is greater than its natural free- wheeling speed for the given slope, then the servo will remain in the forward driving quadrant. If the robot attempts to go slower than the freewheeling speed, then the servo will remain in the braking quadrant. The problem comes when the speed goes between these two conditions. This condition usually occurs as soon as the robot moves over the crest of the ramp and needs to brake.

Under such transitions, both the quadrant discontinuity and drive/brake nonlin- earity will act on the servo. This combination will make it very difficult to achieve smooth control, and the robot will lurch. Since lurching will throw the robot back and forth between driving and braking, the instability will often persist. The result roughly simulates an amphetamine junky after enjoying a double espresso. If the gain ramping trick described above is not adequate, then it may be necessary to brake.

My dearly departed mother endeared herself to her auto mechanic by driving with one foot on the gas and the other on the brake. When she wished to go faster or slower she simply let up on the one while pushing harder on the other. This method of control, however ill-advised for an automobile, is one way of a robot maintaining smooth control while driving down ramps.

One sure-fire method of achieving smooth control on down ramps is to intentionally decrease the freewheeling velocity so that the servo remains in the drive quadrant.

To accomplish this, one can use a mechanical brake or an electrical brake. The simplest electrical brake for a permanent magnet motor is to simply place a low va-

lue braking resistor across the armature. While a braking resistor or other form of braking will reduce the freewheeling speed of the robot, it will waste power. For this reason, brakes of any sort must be applied only when needed.

The ideal way to reduce the freewheeling velocity of a drive servo is through the use of circuitry that directs the back EMF of the motor into the battery. In this way, the battery recovers some energy while the robot is braking. The common way of doing this is through the use of a freewheeling diode in the motor control bridge.

I have not found simple freewheeling diodes to provide an adequate amount of braking in most downhill situations. This is because the back EMF must be greater than the battery voltage and the effective braking resistance includes both the battery internal resistance and the motor resistance. Thus, voltage-multiplying circuits are usually required if this type of braking is to actually be accomplished.

Drag variations

A robot drive or steering servo is usually position commanded. The moment-to- moment position error of a cruising mobile robot is usually not critical. As long as the robot’s odometry accurately registers the movements that are actually made, the position error can be corrected over the long term. For this reason, drag variations are not usually critical to normal driving.

However, sometimes a robot will be required to stop at a very accurate end position or heading. One such case might be when docking to a charger. In these cases, the closing error becomes critical.

Variations in drag caused by different surfaces and payloads can also cause another significant problem. If a robot’s drive system is tuned for a hard surface, and it finds itself on a soft surface, then the servos will not have adequate gain to close as accu- rately.

If the robot stops on such a surface with its drive servo energized, then the position error may cause the servo to remain stopped but with a significant current being applied to the motor. This type of situation wastes battery power, and can overheat the motor. If the robot’s gains are increased for such a surface, it may exhibit insta- bility when it returns to a hard surface.

One solution to this situation is to ramp up the error proportional gain of the servo as its speed command reaches zero. When the P-gain has been at its upper limit (typi- cally an order of magnitude higher than its base value) and long enough for the

closing error to be minimized, the gain is smoothly reduced back to its base setting. I have found this technique quite effective.

Dalam dokumen Designing Autonomous Mobile Robots (Halaman 86-90)