How it works

This expression reads the value of a Slider Control on a dedicated null layer called velocidad at every frame, accumulates the velocity over time, and adds it to the base value of whatever property it's applied to. The result is that you can animate speed directly — not position — which gives you precise, intuitive control over easing.

Setup

Create a Null layer and rename it exactly velocidad (case-sensitive).

Add an Effect > Expression Controls > Slider Control to that null. Leave it named Slider Control.

On the layer whose position you want to control, open the property (e.g. Position X), hold Alt / Option, click the stopwatch, and paste the expression below.

Keyframe the Slider Control on the null layer — this is now your velocity over time. A value of 0 means stopped; positive values move forward, negative move backward.

Expression

Position · After Effects
spd = thisComp.layer("velocidad").effect("Slider Control")("Slider");
accum = 0;
for (i = timeToFrames(inPoint); i <= timeToFrames(time); i++) {
  accum += spd.valueAtTime(framesToTime(i));
}
value + accum * thisComp.frameDuration

Further reading

For a deep-dive into this technique, see the original article at motionscript.com.