VW MQB: work around standstill limit
goal
MQB cars without an EPB (often referred to as 'ACC Low') generally will not hold at a standstill for more than a few seconds before faulting. This works around that fault to get full stop-n-go capability without an EPB.
why it works
Stock ACC will only hold at a stop for about 1 second before disengaging ACC and rolling. As stock ACC disengages, it sends a short burst of 'start request' to inform the car that it should start rolling. We copy this request with a few changes to reset the timer without moving.
- we send two requests with an accel of
0.01. This resets the timer without any noticable effect, but only works on relatively flat ground. On hills, the start request must be longer than a single frame. We know the timer was reset ifesp_hold_confirmationflips toFalse. - if both of those requests fail, send an extended request with an accel of
0.0. The steeper the hill, the longer the request must be to reset the standstill timer. Sending a positive acceleration here would create torque, which isn't what we want. - If we are on a steep hill, its possible we just don't have time to send a long enough accel request. In this case, send a 3-frame pulse of roll request and then stop sending commands. This will release
esp_hold_confirmationbut will not reset our timer.
other related tweaks and notes
- when preEnabled at standstill ACC would fault after 1 second. we can't send our reset pulse because the brake is pressed, so send acc disabled instead. doesn't affect dashboard display, which is handled separately. Ideally, we would engage a few moments before the user releases the brake, but I didn't do that here.
- the sequencing of
ACC_Anforderung_HMSdid not match the stock ACC when approaching a stop. When approaching a stop, stock ACC transitions 0 -> 3 -> 1. The previous logic would transition 0 -> 4 -> 1 -> 3. (possible states are 0 none, 1 hold, 2 park, 3 hold‑standby, 4 drive‑off, 5 ramp‑release)
todo
- [x] fix takeoff faults
- [x] fix preEnable faults
- [x] investigate RPM variations and audible feedback at standstill
- [x] fix cruise faults when hold request is ignored (pesky!)
- [x] fix cruise faults when holding uphill
- [ ] record new validation route on latest code version
Longitudinal Maneuvers Route (Outdated) (has lots of standstill, great for seeing the new behavior)
- Dongle ID:
a3d353f2254caee4 - Route:
a3d353f2254caee4/00000016--544d9e5e69
Validation (Outdated)
- Dongle ID:
a3d353f2254caee4 - Route:
a3d353f2254caee4/0000000f--3a1c287356
before merge the openpilot long controller will have to be adapted to work with PQ as well, the current implementation may not function properly with PQ vehicles running stock openpilot
I've been doing some fairly extensive tests on this over the last month or so to try and improve the behavior and reduce faults. The biggest problem right now is hills.
If we're on a hill (specifically uphill), we have to send a longer 'start request' before the car will acknowledge. If the signal is too long, the car may press the gas and the brakes at the same time, which is a tad uncomfy. If we're on a very steep hill, the request might be impossible to send as we don't have enough time before faulting.
I'm looking for some kind of workaround, but I'm leaning toward just doing the best we can while also asking the user to press brake on steeper hills. (The dashboard has a 'press brake' alert we can use for that)
I've been doing some fairly extensive tests on this over the last month or so to try and improve the behavior and reduce faults. The biggest problem right now is hills.
You may find this challenging. One of the differences between FtS and SnG cars is bidirectional rear wheel speed sensors, for detecting when the wheel is rolling backwards, to protect against rollback on hill starts. Essentially the same problem you're having. With that info, I suspect the ESP is able to keep the car still until the powertrain develops enough force to overcome the hill. Same basic thing happens with manual trans hill-hold. I don't know how well FtS cars deal with this.
I'm looking for some kind of workaround, but I'm leaning toward just doing the best we can while also asking the user to press brake on steeper hills. (The dashboard has a 'press brake' alert we can use for that)
Not exactly Plan A, but we do have longitudinal pitch data available in carcontroller. I wouldn't trust the car's road-grade signal for this.