Glossary · Robotics and control

Low-pass filter

Also called action filter, exponential moving average, EMA, smoothing filter, cutoff frequency

A filter that lets slow changes through and smooths away fast ones. Used on a policy's actions to stop twitching.

A low-pass filter passes low frequencies (slow changes) and weakens high ones (fast changes). On a controller’s output, it turns a jittery signal into a smooth one.

The exponential moving average

The simplest digital low-pass filter mixes each new input ata_t with the previous output:

ft=α ft−1+(1−α) at,0≤α<1f_t = \alpha\, f_{t-1} + (1 - \alpha)\, a_t, \qquad 0 \le \alpha \lt 1

With α\alpha near 1 the output changes slowly (strong smoothing). With α=0\alpha = 0 there’s no filtering at all.

The cutoff frequency, where the filter halves the signal’s power, depends on α\alpha and the sample rate fsf_s:

fc=fs2πarccos⁡ ⁣(1−(1−α)22α)f_c = \frac{f_s}{2\pi}\arccos\!\left(1 - \frac{(1-\alpha)^2}{2\alpha}\right)

At 50 Hz, α=0.8\alpha = 0.8 gives about 1.8 Hz: slow sways pass, twitches are smoothed out. α=0.2\alpha = 0.2 gives about 18 Hz, almost no smoothing.

The cost: lag

Smoothing always delays. An EMA’s output trails its input by about α/(1−α)\alpha/(1-\alpha) samples, which is 4 steps (80 ms) at α=0.8\alpha = 0.8. In a calm stance that doesn’t matter. After a shove, 80 ms of extra delay can be the difference between catching the fall and not.

In this project

The action filter is adaptive: α=0.8\alpha = 0.8 in balance and 0.2 off balance, with the balance gate blending between them. The body is smooth when calm and can react fast when it stumbles. The filter state is part of the policy’s observation, so the policy knows what the filter is about to do.

Related terms

Used in

← All terms