openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

HKG Resume Bug

Open TK211X opened this issue 6 years ago • 9 comments

image

When using stock HKG SCC there is a 1 in 20 chance the ECU will fault and cancel SCC when OP sends resume command. It has come to my attention that this usually happens after OP sends a resume command multiple times but the lead vehicle creeps within 3.7 meters and the SCC logic does not resume because of this. I would try modifying the code so that it remains as is, but does not attempt to resume unless the lead vehicle distance is reported as more than 3.7 meters and increasing. This may help remedy the issue although it may not be the root cause. Sending resume at and below 3.7 Meters is pointless as SCC will not resume anyway.

Example logic:

ACC_ObjDist

Stationary at X.X climbs to 3.7 <--- DO NOT RESUME

Stationary at X.X climbs to 3.8 <--- SEND RESUME PAST 3.7 (3.8)

Stationary at 4.8 <--- DO NOT RESUME

Stationary at 4.8 then climbs <--- SEND RESUME ON INCREASE (Greater than 3.7)

TK211X avatar Jun 14 '20 00:06 TK211X

I am not sure that I get everything but this change to selfdrive/car/hyundai/carcontroller.py#L86 should help:

elif self.last_lead_distance < CS.lead_distance > 4.8 and (frame - self.last_resume_frame) > 5:

xx979xx avatar Jun 17 '20 16:06 xx979xx

Wouldn’t it be:

S.lead_distance > 3.7

@xx979xx

TK211X avatar Jun 21 '20 09:06 TK211X

a res hit is valid for 2 seconds, if the lead starts to move, hit res(spam), then we hope the lead moves > 3.7m with in 2 sec.

but right now we keep spamming as the lead distance keep changing.

xps-genesis avatar Jun 25 '20 22:06 xps-genesis

@TK211X what about this:

Stationary at 4.8 <--- DO NOT RESUME

I don't get it

xx979xx avatar Jun 26 '20 15:06 xx979xx

@xx979xx

The SCC has stopped and the lead vehicle is at 4.8 in the example and not moving forward so we would not hit resume.

TK211X avatar Jun 26 '20 17:06 TK211X

The resume bug appears to be due to the parity bit.

SCC appears to fault due to an improper parity bit and command being received in the message order.

TK211X avatar Jun 26 '20 17:06 TK211X

image

the difference between official and community branch, just adding to the discussion

xps-genesis avatar Jun 26 '20 17:06 xps-genesis

@xps-genesis is this not an issue on the community fork?

adeebshihadeh avatar Jul 07 '20 20:07 adeebshihadeh

i haven't seen this issue on the community branch. that said, this is a very random issue. so no idea if that change shown in the screenshot above really helps.

xps-genesis avatar Jul 07 '20 22:07 xps-genesis