Navigation · Theory · M6
M6-T2 — Potential Fields and Local Minima
A robot rolling downhill in an imaginary landscape reaches the goal quickly, unless it settles in a dip on the way.
The potential field is the shortest local planner you can write: pull towards the goal, push away from obstacles, add the two forces and move. It needs no search and no sampling. It also has one flaw that no choice of constants removes, and every robot that uses it eventually meets it, usually in front of a wall that is not on the path.
Learning objectives
After this lesson, you should be able to:
- Write the attractive and repulsive potentials and the forces that follow from them.
- Explain the influence distance and why the repulsive force must be zero beyond it.
- Show with numbers that the sum of the two fields can have a local minimum.
- List the usual escapes and cures: recovery rules, wall following, navigation functions and a global path.
The intuition
Imagine the floor of the hospital as a landscape. The goal sits at the bottom of a bowl, obstacles are tall spikes, and the robot is a marble. The marble rolls downhill: towards the goal because the bowl slopes that way, away from the spikes because they push. No planning is needed, only the slope under the marble. This is the idea of artificial potential fields that Khatib introduced for manipulators and mobile robots.
A marble can stop in any dip, not only at the bottom of the bowl. A long wall between the marble and the goal creates a dip in front of it: on one side the bowl pulls it forward, on the other the wall pushes it back, and where the two forces are equal the marble stays. That dip is a local minimum. The robot is not broken. By its own rules it has arrived.
The mathematics
Attractive potential
The force grows with the distance to the goal, which makes a fast start and a slow arrival but also a very strong pull far away. Many implementations switch to a constant-magnitude (conic) pull beyond some distance.
Repulsive potential
With ρ the distance from the robot to the surface of an obstacle and ρ₀ the influence distance:
- katt, η
- gains of the attraction and the repulsion.
- ρ
- distance from the robot to the surface of the nearest part of the obstacle (m).
- ρ₀
- influence distance: obstacles farther than this exert no force.
The cut-off matters. For ρ > ρ₀ the bracket (1/ρ − 1/ρ₀) is negative, so an expression applied without the test would pull the robot towards far obstacles (lab M6-L1, stage 1). The force is also unbounded as ρ → 0, which is intended: nothing may touch the obstacle.
Following the field
Why there are local minima
A point where F = 0 and the field curves upward in every direction is a local minimum. Where the attraction and the repulsion cancel exactly on the line to the goal, the robot stops. Koren and Borenstein listed the practical problems of the method: trap situations, no passage between closely spaced obstacles, oscillations near obstacles, and oscillations in narrow corridors.
Escapes and cures
| Approach | Idea | Cost |
|---|---|---|
| Recovery rule | Detect "stuck" from a window of positions, then move sideways, along the wall, or at random | Heuristic; may need several tries |
| Wall following | Switch to a tangent field along the obstacle until the way to the goal opens | More states; needs a leave condition |
| Navigation function | A field designed to have one minimum (Rimon and Koditschek, for known sphere worlds) | Needs a known, simple world |
| Global potential | Use a distance-to-goal field over the grid instead of the straight-line distance (lessons M2-T3 and M3-T1) | Needs the map and a wavefront; it is a global planner |
A worked example
A wall in front of the goal. Scout is on the line to the goal at x = 0, the goal is at x = 10 m, and a long wall crosses the line at x = 6 m. Take katt = 0.5, η = 1, ρ₀ = 1.5 m. On the line, ρ = 6 − x.
Far from the wall, only Fatt acts: at x = 0 it is 5.0, at x = 4 it is 3.0, and the robot accelerates towards the goal. The repulsion starts at x = 4.5 and rises fast. The two forces balance where Fatt = Frep:
This is a minimum, not a saddle: at x = 5.0 the net force is +2.17 (forwards), and at x = 5.6 it is −9.3 (backwards). The potential is 25.0 at the start, 9.0 at x = 4, 6.31 at x = 5, 5.78 at x = 5.37 and 13.8 at x = 5.8. The goal has potential 0, but the robot would have to climb from 5.78 to above 13.8 to get there.
Escaping. The wall extends 1.5 m on one side of the line and 5.0 m on the other, and the escape in the lab drives 3 m along the wall. On the short side 3 m clears the end and the field takes Scout to the goal. On the long side it does not, and the robot slides back into the same minimum. The rule is therefore not “move sideways” but “move sideways towards the nearer end” (lab M6-L1, stage 3).
Engineering implications and limitations
Potential fields are a component
As the only planner they fail at a wall. As a local planner that follows a global path, they are cheap and robust. The global path provides the direction in which the attraction acts, and the repulsion only bends it.
Detect stuck explicitly
Do not rely on the field to know it has stalled. Compare the position now with the position a few seconds ago, and check the distance to the goal, as in the lab. A progress checker with a distance threshold and a time window is the standard form (lesson M7-T6).
Mind the constants
Large η gives oscillation near walls, small η lets the robot touch them. In a corridor the pushes from the two walls cancel at the centre line but amplify any lateral error, which gives the weaving of the fourth problem in the list above. Limit the force, filter it, and scale the step with speed.
Narrow doors
Two obstacles closer than 2·ρ₀ push the robot out of the gap between them even though the robot fits. Use the inflated costmap, not raw obstacles, to decide whether a passage exists (lesson M2-T2).
Common misconceptions
“Better gains remove local minima.”
They only move them. A wall between the robot and the goal produces a minimum for every positive gain.
“Local minima only occur in complicated maps.”
A single straight wall across the line to the goal is enough.
“The robot that is stuck has a bug.”
It has followed its rules to a stable point. The rules are what is incomplete.
“A random push always solves it.”
It may need many tries, and unlucky pushes can return to the same dip. A push towards the nearer end of the obstacle is far more reliable.
Engineering takeaways
- The attractive force is katt·(goal − q); the repulsive force η(1/ρ − 1/ρ₀)/ρ² acts only inside ρ₀.
- The sum of the two potentials can have local minima where forces cancel, and no gain choice prevents it.
- A wall across the line to the goal gives a minimum at the point where Fatt = Frep.
- Detect stuck from position history and distance to the goal, then use an escape that heads for the nearer end.
- Navigation functions or a global distance field remove the minima, at the price of knowing the map.
References and further reading
The original potential-field papers and the standard critique.
- O. Khatib, “Real-Time Obstacle Avoidance for Manipulators and Mobile Robots”, International Journal of Robotics Research 5(1), 1986.
- Y. Koren and J. Borenstein, “Potential Field Methods and Their Inherent Limitations for Mobile Robot Navigation”, IEEE ICRA, 1991.
- E. Rimon and D. Koditschek, “Exact Robot Navigation Using Artificial Potential Functions”, IEEE Transactions on Robotics and Automation 8(5), 1992.
- J. Borenstein and Y. Koren, “The Vector Field Histogram: Fast Obstacle Avoidance for Mobile Robots”, IEEE Transactions on Robotics and Automation 7(3), 1991.
Knowledge check
Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
With katt = 0.5, what is the attractive force on a robot 6 m from the goal, and what is the repulsive force (η = 1, ρ₀ = 1.5) from a wall surface 2 m away?
Explanation
Attraction: 0.5 × 6 = 3.0, towards the goal. Repulsion: 0, because 2 m is beyond the influence distance 1.5 m.
Question 2
The repulsive expression is applied to an obstacle at ρ = 3 m with ρ₀ = 1.5 m, with no cut-off. Is the resulting force a push or a pull, and why?
Explanation
A pull. (1/3 − 1/1.5) is negative, so the force points towards the obstacle. The cut-off at ρ₀ is part of the definition.
Question 3
A stuck robot is 0.9 m from a wall that extends 1.5 m to its left and 4.0 m to its right. Which way should the escape go?
Explanation
To the left, along the wall: the nearer end is 1.5 m away, against 4.0 m on the right, so a fixed-length escape clears it.
What’s next
Next: choosing among velocities the motors can reach, and scoring them.
Related content
Nothing below is required to finish this lesson.
- BeforeM6-T1: Local versus Global Planning
Explain the roles of the global and local planners, the planning horizon, and what happens when they disagree.
- LabM6-L1: Escape the Local Minimum
Scout stops dead facing a wall that is not on the path: add a rule that gets it moving again.
Get notified when the next lesson and new labs are released.
One email per new lesson or lab.