Skip to content

Subaru longitudinal control

martinl edited this page Dec 14, 2022 · 11 revisions

Overview

The project is currently proof of concept in early experimental stages and not safe for testing in public roads.

Openpilot longitudinal control for Subaru global platform works by controlling engine power request (rpm), cruise throttle and cruise brake signals:

  • [ES_Status][Cruise_RPM] - (0...4000) Cruise RPM output for ECM/TCM
  • [ES_Distance][Cruise_Throttle] - (0..4000) output, related to [Throttle][Throttle_Cruise]
  • [ES_Brake][Brake_Pressure] (0..400) - Cruise brake pressure

With openpilot longitudinal control activated, Eyesight remains in ready state, so PCB/AEB and FCW safety features signals are passed through.

It is currently possible to do basic acceleration and braking control by linearly scaling openpilot gas and brake actuators outputs.

TODO

  • acceleration control modeled after stock acc outputs (rpm and throttle output signals)
  • acceleration limits enforcement (min -3.5 m/s2, max 2.0 m/s2)
  • longitudinal PID tuning

Details

Openpilot model acceleration outputs (m/s2)

  • actuators.gas (0..1)
  • actuators.brake (0..1)

Related brake signals

  • [Brake_Pedal][Brake_Lights] (0/1) - 1 when brake pedal is pressed or cruise brake active

  • [Brake_Pedal][Brake_Pedal] (0..500) - brake pedal pressure

  • [ES_Brake][Brake_Pressure] - (0..400) Hold: 394 - electric brake pressure

  • [ES_Brake][Cruise_Brake_Lights] - switch on brake lights

  • [ES_Brake][Cruise_Brake_Active] - cruise brake on

  • [ES_Brake][Cruise_Activated] - cruise control activated

  • [ES_Status][Brake_Lights] (0/1) - 1 when brake pedal or electronic brake on

  • [ES_DashStatus][Brake_Lights] (0/1) - 1 when brake pedal or electronic brake on

Related gas/acceleration signals

  • [Throttle][Throttle_Cruise] (0..140)

  • [Throttle][Throttle_Pedal]

  • [Throttle][Throttle_Combo]

  • [Throttle][Engine_RPM]

  • [Transmission][RPM]

  • [ES_Distance][Cruise_Throttle] (0..4000) input for [Throttle][Throttle_Cruise]

  • [ES_Status][Cruise_RPM] - Eyesight RPM output for ECM/TCM

  • [ES_DashStatus][Cruise_State] (0 = normal, 1 = hold+driver brake, 2 = ready, 3 = hold)

Related Eyesight distance outputs

  • [ES_DashStatus][Far_Distance] (0..15) medium distance to object in front @ 10Hz ( Far_Distance Scaling )
  • [ES_Distance][Close_Distance] (0..255) 20Hz close distance to object in front (0..255 = 0..6m) @ 20Hz
  • [ES_Distance][Distance_Swap] (0/1) close distance trigger