zoompilot

zoompilot

a Mazda-optimized fork of sunnypilot.

Created to give you the best OpenPilot experience on your Mazda. Unlocks full steering performance and adds features like slowing down for curves, speed-limit assist, and both experimental and alpha longitudinal modes.

46G machine gray

01

steering improvements

Using a data driven approach I reverse engineered the steering hardware and developed features to utilize the EPS to it's full potential.

Speed-dependent torque
The EPS caps the steering torque it will deliver, and that cap changes with speed. We encode the whole curve, so openpilot knows the extra torque it has at low speeds and the reduced torque at high speeds. More confident in the neighborhood, fewer wobbles on the highway.
Speed-dependent tuning
Stock openpilot learns ONE lateral acceleration factor and ONE friction value for every speed. zoompilot learns across seven speed ranges instead, matching the EPS’s non-linear speed-dependent behaviour.
Rate-matched commands
The EPS accepts steering commands changing by up to 12 units a frame; stock asked for 10, leaving ~17% of that rate unused. We ask for the full 12, so torque ramps in faster.
Factory-matched specs
Steering ratio, mass, wheelbase, and steering lag, set to Mazda’s real figures and refined against thousands of miles of learned data, so commands land where the planner intends.

02

fix annoyances

OpenPilot threw warnings that should have only applied to pre-2022 EPS. I pulled the logs from many drivers and cut the false LKAS_BLOCK alerts. The real ones still fire.

Place hands on wheel alert
OpenPilot's Mazda port was developed on pre-2022 cars. On these models an LKAS_BLOCK signal meant steering control was lost. I analyzied thousands of miles of drives across many users and found LKAS_BLOCK does not disengage steering. Real faults disengage; I only touch the false one.
Steering override hysteresis
The same override filter Hyundai, Ford, Tesla, and Rivian run. It weighs more frames before deciding you’ve taken the wheel, so a pothole or rough patch no longer trips a phantom takeover.

03

wire up sensors

Your CX-5 ships with sensors the stock port never reads. We wire them in.

Forward radar
The radar behind your front Mazda emblem is read. It outputs distance, angle, and closing speed for up to four cars ahead.
Blind-spot monitors
We feed what they see into openpilot for blind spot visuals and optional checks before automatic lane changes.
Speed-limit signs
The LKAS camera can read speed signs if you have a navigation SD card. zoompilot uses these to detect speed limit changes and can optionally set your cruise speed for you. This feature is called SLA Speed-Limit-Assist.

04

radar cruise enhancements

SunnyPilot's ICBM, Speed-Limit-Assist, and Smart-Cruise are broken for Mazda. I have totally rewritten these features to work under one system. Each feature no longer fights independently for control over the cruise speed. One system manages all features and tracks YOUR set speed seperatly from zoompilots. Manage in the 'cruise' settings.

Intelligent-Cruise-Button-Management
This is a gating feature for the ones below. This allows zoompilot to manange your cruise set speed for you. You can enable features below to slow down for curves and adjust your set speed when you pass a speed limit sign.
Speed-Limit-Assist
zoompilot can change your cruise set speed when you pass a speed-limit sign if you have a navigation SD card (also using OpenStreetMap limits if you download maps in 'SunnyLink'). You may set a +/- percentage or mph to travel above or below speed limits. zoompilot can also just alert you when it detects a speed-limit change.
Smart Cruise
This reduces your cruise speed before a curve in the road and sets it back after. You can use vision or downloaded maps to determine when to slow down. I highly reccomend using with Deceleration Overshoot on Mazda.
Deceleration Overshoot (Smart Cruise)
An alpha feature to improve deceleration before a curve when using smart cruise. This lowers the speed faster and slightly below what model requests. This allows for a little more decceleration before the turn (it takes some time for MRCC to reach set speed)

05

alpha longitudinal alpha

openpilot takes the gas and brakes instead of Mazda’s stock radar cruise. An alpha feature in openpilot itself and even more unstable on Mazdas.

warning · safety features disabled

Due to how the Mazda radar works, the radar unit WILL BE DISABLED while alpha longitudinal is enabled. Automatic emergency braking, forward collision alerts, and Smart City Brake Support are all off, only while it is enabled. Same pattern other openpilot cars like Toyota use: longitudinal is enabled by disabling the radar. I am working on a dongle that plugs into the radar unit to allow both to work together.

Pair with experimental mode
I don’t recommend alpha longitudinal by itself: it simply disables the radar and follows traffic on vision, basically a worse Mazda Radar Cruise Control. Experimental mode is where the latest openpilot abilities live, using vision to attempt to stop for stop signs and stop lights with full control over the gas and brakes. I do not recommend it for daily driving; read the openpilot documentation first.
Enabling
settings → developer → openpilot longitudinal control (alpha), then experimental mode in toggles. Change these only before your drive, not during one.
Expect rough edges
Your dash may light up like a christmas tree and throw cruise, LKAS, and radar errors. If that happens, turn the car completely off for about 15 minutes and try again.

Credit where it’s due: Alex Frutkin (@yummydirt) did most of the reverse engineering and the implementation behind alpha longitudinal on Mazdas.

06

additional Mazdas covered

Not just the CX-5.

EPS swaps
If you have an older CX-5 or another Mazda, many users swap 22+ CX-5 EPS hardware in. This allows all zoompilot features to work and allows steering down to zero on these cars. zoompilot detects and supports these swaps.
CX-9
The CX-9 is also supported for all features, but speed-dependent-torque will require more time to learn as I only supply seeds for CX-5. We have also updated the CX-9 specs to match Mazda's official specs. (if you have a CX-9 let me know on discord)

07

on device settings

You can manage most all of the settings from the device itself. :D

08

recommended setup

  1. Factory-reset the device before you install. A clean device carries no stale settings from a previous fork.
  2. Pick a driving model. I run Firehose. DTRv6 is a favourite and CD210 is a great general model and works well with alpha longitudinal.
  3. Turn on torque control, self-tune, and speed-dependent self-tune. steering → torque control → self-tune → speed-dependent self-tune. I try to configure these for you on a fresh install, so they should already be on; just double check.
  4. Leave custom tune and manual real-time off. Let the car teach the software. That’s the point.

Want to slowdown for curves? Under cruise, turn on intelligent cruise button management, then pick smart cruise vision, maps, or both. Maps need a region downloaded through SunnyLink first.

09

install

custom software url

zoompilot/main

Type this when your comma device asks for a custom software URL during setup. Releases are built ahead of time, so your device installs them instead of spending the better part of an hour compiling.

This is experimental software. You drive the car, you follow the law where you live, and you carry the risk. It ships with no warranty and no liability for any damage or injury.

  1. First release on the zoompilot channel zoompilot has its own home, its own build, and the biggest batch of changes yet.
    • New home, new install URL. The fork lives at zoompilot/zoompilot and installs from zoompilot/main. If you are already running zoompilot you don’t need to do anything: your device repoints itself on its next start.
    • Prebuilt releases. Every release is built ahead of time on a real comma device, so installing no longer means sitting through the better part of an hour of compiling.
    • Alpha longitudinal on the CX-5. openpilot can drive the gas and brakes on the 2022+ CX-5. Read section 05 first: it shuts the stock radar down, which takes automatic emergency braking and forward collision alerts with it.
    • Torque control out of the box. Fresh installs on 22+ EPS Mazdas arrive with torque control, self-tune, and speed-dependent self-tune already on.
    • Fresher steering seeds. The CX-5 2022 starting values come straight off my car’s learned data, so a new install steers like a tuned car much sooner.
    • Cruise buttons, rebuilt. The speed you set is the speed you get back after every curve and speed zone, down to the exact number. Confirming a speed limit is one tap and the answer sticks. Press a button mid-adjustment and zoompilot hands control straight back. Big changes hold the button down the way you would.
    • Cruise features under one roof. Speed-limit assist and smart cruise now work the same way whether the stock radar or openpilot has the gas and brakes, and a speed limit prompt no longer nudges your set speed while you are still deciding.
    • Latest sunnypilot and openpilot. New alert sounds and softer driver monitoring nags. Lane changes arm right away if your blinker is already on. Map-based curve slowdowns are more accurate, map hiccups no longer trip false warnings, the false NO PANDA flash on screen wake is gone, and you can switch software branches from the device screen.
    • Leaner install. Setup no longer downloads a 1.8GB driving model the device never uses.
  2. Smart cruise and EPS swaps Curve slowdowns get usable, and older Mazdas with a 2022+ rack join in.
    • Smart cruise decel overshoot. New alpha toggle. The Mazda ECU is slow to obey a lower set speed, so this asks for more than the model wants and gets the deceleration the curve needs.
    • ICBM fixes. Fixed set-speed desync with the stock ECU and the target-chasing oscillation. Button presses are suppressed while you press yours, and pacing adapts to how far the target is.
    • EPS swap support. 2022+ racks in older Mazdas fingerprint by the rack’s firmware and steer to a stop.
    • Upstream sync. Merged sunnypilot master and the opendbc upstream into zoompilot.