Adaptive cruise control calculator: time gap, braking and Stateflow logic

Turn an ACC time gap into metres, see whether the car can stop when the vehicle ahead brakes within the ISO 15622 braking limit, and paste a Stateflow transition table to find guards that fire when they should not. Free, no sign-up.

ISO 15622:2010 · MathWorks Stateflow operator precedence and transition order · exact braking maths checked by simulation · Updated 20 Nov 2026

Clearance is bumper to bumper. ISO 15622 defines the gap as τ = c / v with no standstill term; many controllers add a few metres d₀ so the car does not stop nose to tail.

Clearance to hold41.7 md₀ + τ v
Time gap now1.08 sclearance ÷ speed
Time to collision5.4 sclosing at 20 km/h
Time gapClearanceNote
0.8 s22.2 mISO 15622 shortest allowed
1.0 s27.8 m
1.5 s41.7 mISO middle range starts
1.8 s50.0 m
2.0 s55.6 mtwo-second rule
2.2 s61.1 mISO middle range ends

    How ACC keeps its distance

    Adaptive cruise control holds a time gap, not a fixed distance. ISO 15622 defines it as the clearance (bumper to bumper) divided by your speed, so the distance grows with speed:

    The 2010 edition of ISO 15622 sets the shortest selectable time gap at 0.8 s or more and requires at least one setting between 1.5 and 2.2 s. At 100 km/h (27.8 m/s) that is 22.2 m at the shortest setting and 41.7 to 61.1 m in the middle range. The driving-school two-second rule is 55.6 m at the same speed.

    The standard also limits how hard ACC may act on its own: automatic acceleration up to 2 m/s², average automatic deceleration up to 3.5 m/s² over 2 s, and negative jerk up to 2.5 m/s³. These are comfort limits. ACC is a convenience system; harder braking is the job of the driver or of automatic emergency braking.

    When the car ahead brakes hard

    Take both cars at 100 km/h, 41.7 m apart (a 1.5 s gap). The lead car brakes at 6 m/s². Your ACC needs 0.5 s to see it and build up braking, then brakes at the 3.5 m/s² limit. With constant decelerations the two positions are:

    The lead car stops after 4.6 s and 64.3 m. You reach it 5.2 s after it started braking, still doing 41 km/h. To stop 2 m short you would need 4.28 m/s², or a gap of 61.8 m (2.2 s) at 3.5 m/s².

    • Lead brakes at 3.5 m/s² too: the closest approach is 27.8 m. With equal braking you lose exactly the distance covered during the delay, v × 0.5 s = 13.9 m.
    • The 0.8 s minimum gap (22.2 m) with the same hard stop: impact after 3.6 s at 39 km/h.
    • 50 km/h, 1.5 s gap (20.8 m): the car stops 2.4 m short. Braking distance grows with v², the gap only with v, so the same time gap is safer at low speed.

    This is why ACC systems give a take-over warning: the time gap keeps you out of trouble in normal traffic, not in an emergency stop.

    What 554 student models of the ACC logic share

    Skill-Lync's model-based development project "Adaptive Cruise Control" gives a requirement document and asks for a Simulink model: lead and drive vehicle subsystems, a Stateflow chart with OFF, STANDBY and ON modes and six ON sub-states, a data dictionary, Model Advisor checks and Embedded Coder code. 554 reports are public. We counted what they quote and loaded the requirement's ON-mode transitions into the checker above (as of 20 Nov 2026).

    FindingReportsWhat happens
    (LeadVehicle_Detected == 1) && (LeadVehicle_Speed < Set_Speed) || (Time_Gap < Set_Gap)334Read with Stateflow's precedence this is (A && B) || C. From Not_Detected, with no lead car and Time_Gap below Set_Gap, the chart goes to "lead slower than set speed" (mode 4). No report adds the brackets for A && (B || C).
    Two more guards out of Speed_equal mix && and || without brackets332 / 231Their first branches can never be taken anyway: see the next row.
    Speed_equal tests (LeadVehicle_Detected == 0) || (DriveVehicle_Speed <= Set_Speed) first332It is true whenever the drive speed is at or below the set speed, so the branch (DriveVehicle_Speed < Set_Speed) && … to Detected_Resume never fires. Both later guards only fire above the set speed with a lead car.
    LeadVehicle_Not_Detected_Resume has no transitions out415A dead end inside ON: mode 1 until SetSwitch or CruiseSwitch drops. Speed_lessthan → Speed_equal (drive below set speed) → Not_Detected_Resume on the next step if the inputs do not change, then stuck.
    DriveVehicle_Speed == Set_Speed412Works on the uint8 test signals; with a real vehicle model the speed passes the set speed between samples and the guard never fires. Use a band, as the requirement already does with 0.75 / 1.25.
    Time_Gap == 0.75*Set_Gap243An exact match with a scaled value. With Set_Gap = 2 it needs Time_Gap = 1.5, which a uint8 input never is; depending on how the chart types 0.75*Set_Gap it never fires or fires at a rounded value. Use a band.
    Guard text broken by the report editor (&&="")79The report's copy of a guard is not valid any more; the checker flags this if you paste it.

    482 reports show a Model Advisor run and 372 list the uint8 signal table, but only 18 show a test signal or simulation result, and none mention transition priority. Model Advisor checks style, not whether a guard means what the requirement intends. Two plain tests expose the first four rows: no lead car with a short time gap, and a lead car matched in speed below the set speed.

    What this calculator does not cover

    • Jerk and brake build-up. Braking starts at full rate after the delay. A jerk-limited ramp (2.5 m/s³) needs a little more distance, so treat a narrow escape here as a collision.
    • Sensors and cut-ins. The lead car is detected from the start and nobody changes lane.
    • The 2018 edition. The ISO values are from ISO 15622:2010; check the current edition before you quote them in a specification.
    • A full Stateflow semantics. The checker treats one level of states, uses real (not uint8) arithmetic and samples a grid of small integers. It finds counterexamples; it does not prove a chart correct.
    Learn ADAS and model-based development

    Requirements, Stateflow logic, Model Advisor and code generation are how ACC, AEB and lane-keeping features are built in industry. Skill-Lync's MBD and ADAS courses cover them with projects.

    How we checked the calculator

    The independent Python script scripts/verify/acc.py runs 48 checks. This page recomputes its results with the browser code at build time and refuses to build if they differ.

    • Braking: the exact piecewise solution agrees with a 0.1 ms time-step simulation on 7 scenarios; two hand cases (equal braking loses v × delay; a stationary obstacle needs v td + v²/2a) match to 1e-9 m.
    • Guards: a separate Python parser with C precedence; A && B || C checked by hand; the "never fires" result for the Speed_equal branch recounted by a direct loop over all 3,22,102 grid points.
    • The project chart: findings, examples and the Step trace (Speed_lessthan → Speed_equal → Not_Detected_Resume, then stuck) match the browser code exactly; 7 small test charts cover a clean chart, =, copied HTML, a typo, a contradiction and a fully hidden transition.

    Frequently asked questions

    What time gap does adaptive cruise control use?

    A time gap τ is the clearance to the car ahead divided by your speed. ISO 15622:2010 requires the shortest selectable gap to be at least 0.8 s in steady following and at least one setting between 1.5 and 2.2 s. At 100 km/h, 0.8 s is 22.2 m and 1.5 s is 41.7 m.

    How hard can adaptive cruise control brake?

    ISO 15622:2010 limits automatic braking to an average of 3.5 m/s² over 2 s, negative jerk to 2.5 m/s³ (over 1 s) and automatic acceleration to 2 m/s². That is roughly a third of what the tyres can do on a dry road, so ACC warns the driver to brake when more is needed.

    Can ACC stop in time if the car in front brakes hard?

    Not always, and it is not meant to. At 100 km/h with a 1.5 s gap and a 0.5 s system delay, a lead car braking at 6 m/s² is hit at 41 km/h if the follower brakes only at 3.5 m/s². The follower needs 4.28 m/s² to stop 2 m short, so the driver or the emergency braking system has to take over.

    What is the difference between ACC and cruise control?

    Cruise control holds a set speed. Adaptive cruise control also measures the car ahead with radar or a camera and slows down to keep a set time gap, then returns to the set speed when the lane is clear.

    Why does my Stateflow transition fire when it should not?

    Check the order of && and || first. In Stateflow, as in C, && binds tighter than ||, so A && B || C means (A && B) || C: C alone fires it. Then check the execution order: the chart takes the first outgoing transition whose guard is true, so a broad guard with a low number hides the ones after it.

    What does the checker do with my chart?

    It parses each guard with Stateflow's C precedence and evaluates every outgoing guard of a state on a grid of input values (0 to 10 plus your constants, booleans 0 and 1). It reports guards whose meaning depends on && / || precedence, transitions that can never be taken or are partly hidden by an earlier one, exact == tests on speeds and gaps, states with no way out and probable typos in signal names.

    Is this calculator free?

    Yes. It runs in your browser, needs no sign-up and sends nothing anywhere, including the chart you paste.

    Related on Skill-Lync

    Sources

    Free counselling

    From a Stateflow chart to ADAS jobs.

    Requirement-based modelling, testing and code generation are what MBD and ADAS interviews test. A Skill-Lync counsellor can map the program that fits the role you want.

    Talk to a course counsellor

    Free. We call you back, usually the same day.

    By submitting you agree to our Terms and Privacy Policy.

    Talk to a career counsellor

    Talk to a career counsellor

    Free 20-minute call. We'll map the right course to where you want to work.

    By submitting you agree to our Terms and Privacy Policy.