Potential field overview
Potential field methods treat the robot's environment like a landscape of virtual forces. The goal pulls the robot toward it (attractive force), while obstacles push the robot away (repulsive forces). The robot simply "rolls downhill" through this combined force field, producing smooth, collision-free motion.
This approach is popular because it's computationally cheap and works in real time. The robot doesn't need to compute an entire path upfront; it just responds to the forces at its current location. The main trade-off is that the robot can get stuck in local minima, which we'll cover below.
Attractive vs. repulsive fields
- Attractive fields pull the robot toward the goal. The force vector always points from the robot's current position toward the goal location.
- Repulsive fields push the robot away from obstacles. The closer the robot gets to an obstacle, the stronger the repulsive push.
The robot's actual motion at any moment is determined by the sum of all these forces acting on it.
Mathematical representation
The environment is modeled as a scalar potential function that assigns a numerical value to every point in the robot's configuration space. Think of it like a topographic map:
- Low potential = desirable locations (near the goal)
- High potential = dangerous locations (near obstacles)
The goal sits at the global minimum of this function, while obstacles create "hills" of high potential around them.
Gradient descent approach
The robot navigates by following the negative gradient of the potential function. The gradient points in the direction where potential increases fastest, so the negative gradient points downhill, toward lower potential.
At each time step, the robot:
- Computes at its current position
- Moves in the direction of
- Repeats until it reaches the goal (where at the global minimum)
This is directly analogous to gradient descent in optimization.
Attractive potential fields
Attractive potential fields ensure the robot always feels a pull toward the goal. They're designed so the goal position is the global minimum of the attractive potential.
Goal position and attractive forces
The goal is a fixed point in configuration space. The attractive force at any position depends on the distance :
- Magnitude is proportional to how far the robot is from the goal (farther away = stronger pull)
- Direction always points from the robot toward the goal
Quadratic potential functions
The most common choice for attractive fields. The potential increases with the square of the distance from the goal, creating a smooth parabolic bowl:
Here is a positive gain that controls how steep the bowl is. The resulting force grows linearly with distance, which means the robot accelerates when far from the goal and slows down as it approaches. This is nice for smooth convergence, but the force can become very large when the robot is far away.
Conic potential functions
An alternative where potential increases linearly with distance, forming a cone shape:
The resulting force has constant magnitude regardless of distance. This avoids the large-force problem of quadratic potentials when the robot is far from the goal, but the force is not smooth at the goal itself (the gradient is undefined at the cone's apex).
A common practical approach combines both: use a conic potential when far from the goal and switch to a quadratic potential when close.
Repulsive potential fields
Repulsive fields create virtual barriers around obstacles. Their potential is high near obstacles and drops off with distance, so the robot feels a strong push when it gets too close.
Obstacle avoidance and repulsive forces
Each obstacle generates its own repulsive field. The force depends on the distance between the robot and the obstacle:
- Magnitude increases sharply as the robot approaches the obstacle
- Direction points directly away from the obstacle surface
Most implementations only activate the repulsive field within a certain influence radius . Beyond that distance, the obstacle exerts no force, which saves computation and prevents distant obstacles from interfering with navigation.
Inverse potential functions
These produce a repulsive potential that's inversely proportional to distance:
This is the standard formulation from Khatib's original work. When , the repulsive potential is set to zero. The term means the potential shoots up rapidly as the robot nears the obstacle, creating a strong repulsive force.

Exponential potential functions
Another option where the repulsive potential decays exponentially with distance:
Here controls the strength and controls how quickly the field falls off. Exponential fields produce smoother force transitions than inverse functions, which can lead to less jerky robot motion near obstacles.
Local minima problem
This is the biggest weakness of potential field methods. A local minimum is a point where all forces cancel out (net force = zero), but the robot hasn't reached the goal.
Definition and implications
Local minima occur where at a point that isn't the goal. The robot stops moving because it feels no net force, even though it hasn't arrived at its destination.
A classic example: an obstacle sits directly between the robot and the goal. The attractive force pulls the robot forward, but the repulsive force pushes it straight back. These forces balance out, and the robot gets stuck.
Saddle points and oscillations
Saddle points are locations where the gradient is also zero, but the curvature is positive in some directions and negative in others (like the center of a horse saddle). A robot at a saddle point is technically unstable and may oscillate back and forth rather than getting permanently stuck. Narrow corridors are a common source of oscillation, where repulsive forces from walls on both sides compete.
Techniques for avoidance
Several strategies can help the robot escape or avoid local minima:
- Random perturbations: Add small random noise to the robot's velocity to "jolt" it out of a trapped state
- Harmonic potential fields: A mathematically guaranteed way to eliminate local minima (see Extensions below)
- Wall-following heuristics: When stuck, switch to a wall-following behavior until the robot can resume gradient descent
- Hybrid planning: Combine potential fields with a global planner (like RRT or A*) that handles the big-picture path while the potential field handles local obstacle avoidance
Superposition of fields
The total potential field is built by adding up all the individual attractive and repulsive fields. This is the superposition principle: each field contributes independently, and the robot responds to their sum.
Combining attractive and repulsive fields
At every point , the total potential is:
There's one attractive field (from the goal) and repulsive fields (one per obstacle). The robot computes and moves accordingly.
Weighted sum approach
You can assign weights to control how much each field influences the robot:
Increasing makes the robot more cautious around obstacles. Increasing makes it more aggressive about reaching the goal. Getting these weights right is a balancing act: too much repulsion and the robot won't enter tight spaces; too much attraction and it'll clip obstacles.
Normalization and scaling
Before combining fields, it's common to normalize them so they have comparable magnitudes. Without normalization, a single strong repulsive field could dominate the total potential and override the attractive pull entirely. Scaling also lets you adjust the effective range of each field to match the physical dimensions of your environment.
Path planning with potential fields

Gradient-based path generation
The robot generates its path incrementally through these steps:
- Compute the total potential at the current position
- Calculate the gradient
- Move by a small step in the direction of , with step size proportional to the gradient magnitude (or capped at a maximum)
- Repeat from step 1 until the robot is within a threshold distance of the goal, or a maximum number of iterations is reached
Real-time obstacle avoidance
One of the biggest advantages of potential fields is that they work online. The robot doesn't need a complete map upfront. As sensors detect new obstacles, new repulsive fields are added to the total potential on the fly. This makes the method well-suited for dynamic environments where obstacles move or appear unexpectedly.
Limitations and drawbacks
- Local minima: The robot can get stuck (see above)
- Oscillations in narrow passages: Competing repulsive forces from walls on both sides can cause the robot to jitter or freeze
- Parameter sensitivity: Performance depends heavily on choosing good values for , , weights, and influence radii
- No global optimality: The resulting path is reactive, not optimal. The robot may take a longer route than necessary
Extensions and variations
Harmonic potential fields
Harmonic potentials satisfy Laplace's equation (), which mathematically guarantees no local minima exist except at the goal. This eliminates the biggest problem with standard potential fields. The trade-off is that computing harmonic functions is more expensive, often requiring numerical methods over the entire configuration space.
Dipole potential fields
Dipoles pair a positive and negative charge to create directional force patterns. They're particularly useful for modeling elongated obstacles or guiding the robot through narrow passages where simple point-source repulsive fields would create local minima. The directional nature of dipole fields can steer the robot around obstacles more effectively.
Anisotropic potential fields
Standard potential fields treat the robot as a point and only care about position. Anisotropic fields also account for the robot's orientation, assigning different potential values depending on which way the robot is facing relative to goals and obstacles. This matters for robots with non-holonomic constraints (like cars that can't move sideways), where orientation directly affects which paths are feasible.
Implementation considerations
Discretization and grid resolution
Potential fields are usually computed on a discrete grid overlaid on the workspace. Finer grids give more accurate force calculations but cost more memory and computation. For a 2D environment, doubling the resolution quadruples the number of grid cells, so there's a direct trade-off between precision and speed.
Computational efficiency
For real-time performance, you don't want to recompute the entire field every cycle. Practical strategies include:
- Using spatial data structures (k-d trees, octrees) to quickly find nearby obstacles
- Only updating repulsive fields locally when the environment changes
- Precomputing the attractive field if the goal is fixed
Parameter tuning and optimization
The key parameters to tune are the gain constants (, ), obstacle influence radius (), field weights, and grid resolution. Start with small values and increase gradually while testing in simulation. Automated approaches like evolutionary algorithms or Bayesian optimization can search the parameter space more systematically, and some systems use adaptive methods that adjust parameters on the fly based on the robot's progress.