EV·ENGINESTART THE SIMULATOR

Throttle without a pedal

A speedometer needle above a road forking into a flat straight and a downhill slope.

EV·ENGINE has no pedal to read. It infers engine load by differentiating GPS speed: rising speed means load, falling means lift-off. That arithmetic breaks in one place, because a coasting car rolling downhill and a car being driven gently on the flat can produce the identical speed trace, and the two states sound nothing alike in a real engine.

Reading load from a speed trace

EV·ENGINE never touches the car's own pedal. There is no OBD link and nothing plugged into the accelerator; the only input is a position from the browser's Geolocation API, turned into a speed. The gearbox module, src/vehicle/Drivetrain.ts, smooths that speed over 130 milliseconds to shave off GPS jitter, then differentiates the smoothed trace to get an acceleration figure. That acceleration stands in for throttle position, because nothing else is available. See how the pipeline fits together for the rest of the chain, from speed to gear to note.

Full load is defined at an acceleration of 2.5 metres per second squared. Reach that and the engine is treated as pressed hard; fall short and the load figure scales down smoothly rather than snapping between two states. A gain of 1,500 rpm per metre per second squared then pushes the upshift point outward as acceleration climbs, so mashing on for a full-load run holds a gear longer than easing into the same speed.

Light throttle gets its own shift point rather than a fraction of the full-load one guessed on the fly: cruising upshifts arrive at 62% of the loaded figure. On the muscle V8, whose full-load shift point is 2,900 rpm, that puts a gentle cruise change well below 2,000 rpm, long before the lope in that engine has anything to say. Listen for it: the same car sounds almost sedate pulling away gently and completely different holding a gear under load.

Braking and coasting get separate rules

Two more numbers govern what happens once the driver backs off rather than presses on. If the car is coasting and engine speed drifts down to 1,500 rpm, the box drops a gear to keep the note alive rather than letting it sag towards idle. If the car is braking, the target is 2,750 rpm instead, so the downshift lands higher and holds the engine nearer its working range, the way engine braking sounds in a real car rather than a slow coast to a stop.

Braking is the one load state the system reads with real confidence. A firm negative acceleration cannot be mistaken for anything but the brake, so the higher downshift target is reliable in a way the throttle inference is not.

Shifts of any kind are held apart by a cooldown of 500 milliseconds, so a jittery acceleration reading near a shift point cannot flip the gearbox back and forth on successive frames. That cooldown exists because an earlier version of the box did exactly that, as covered in the post about a gearbox that shifted four times in half a second.

Downhill coasting and a light throttle look the same

The failure mode sits in the arithmetic itself rather than in any bug. A driver who lifts off completely on a downhill stretch can still see their speed hold steady or creep up, purely from gravity. A driver on the flat holding a gentle amount of throttle produces the same speed trace: steady or slowly rising. Both arrive at the differentiator as the same small positive acceleration, and the gearbox has no way to ask which one happened, because there is no pedal to check the number against.

The effect is audible wherever the sound reacts to lift-off specifically. The turbo hot hatch preset carries an overrun pop probability of 70, tuned to crackle when the driver comes off the throttle hard. Coast down a hill at the right rate and that same code path can fire, producing pops from an engine that, in a real car freewheeling downhill, would most likely be silent under no load at all. Listen to the turbo hot hatch and imagine it running that pop pattern on a descent rather than a lift-off; the sound is identical either way because the input is identical either way.

This sits alongside the other honest limits the project lists on the comparison page: a browser reading GPS speed will never carry the information a wire into the accelerator pedal would. Gravity and throttle both change speed, and once they are folded into one derivative there is no way back to the two separate causes.

None of this makes the inference wrong most of the time. Genuine hills that exactly cancel a lifted throttle for more than a second or two are rare, and the moment the gradient changes or the driver's actual input changes, the speed trace changes with it and the gearbox catches up. The ambiguity is real, it is narrow, and it is the direct cost of building an engine model on a signal the car never volunteers.

More notes

All notes