-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ford: Car Port for Edge 2nd Generation #30762
Conversation
# Occasionally on startup, the ABS module recalibrates the steering pinion offset, so we need to block engagement | ||
# The vehicle usually recovers out of this state within a minute of normal driving | ||
self.vehicle_sensors_valid = cp.vl["SteeringPinion_Data"]["StePinCompAnEst_D_Qf"] == 3 | ||
if self.CP.carFingerprint in CAN_EDGE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any idea why the EDGE is different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why. I checked with other Ford drivers and they confirmed that the F-150's have no data at ExtSteeringAngleReq2
. Likewise, my Edge has no data at StePinCompAnEst_D_Qf
or StePinComp_An_Est
. There's another Edge user that just bought a C3x. He has a different ABS fingerprint, the rest matches, and his data matches with mine. SteeringPinion_Data
shows up at a different ID in the Edges as well. I originally created a new DBC, changing ID from 7e to 85, but abandoned that once I found StePinComp_An_Est
has no data. That changed CAN ID may indicate a larger change to the PSCM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm this is working with my Ford Edge Titanium 2022. Stock openpilot:master did not work after fingerprinting and required these extra steps. I can provide logs if they would be helpful.
if self.CP.carFingerprint in CAN_EDGE: | ||
# Ford Edge calibrated steering wheel angle comes from the IPMA_ADAS instead of PSCM | ||
# Check for Ford Edge Unknown/Invalid steering wheel position | ||
self.vehicle_sensors_valid = cp.vl["ParkAid_Data"]["ExtSteeringAngleReq2"] < 32766 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saw your opendbc PR. If SteeringPinion_Data
is on this car, but is just on another ID (and that ID doesn't conflict with any existing message), we can add it to the DBC with a prefix such as Alt
, and detect the absence 0x7e to use the new alternate message. This is common for other brands, such as Hyundai where we support many different configurations by CAN fingerprint detection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can update the existing ford_lincoln_base_pt DBC with the alternate ID for documentation/future-use purposes. However, SteeringPinion_Data: StePinCompAnEst_D_Qf
and SteeringPinion_Data: StePinComp_An_Est
signals on the Edge are not used/available. They remain at 0:Faulty/-1600 deg, even when remapped to the new ID.
I initially tried using SteeringPinion_Data: StePinRelInit_An_Sns
, but this signal is not calibrated 0=center. The offset changed every time the vehicle was started. OP would only function if the offset was within paramsd.OFFSET_MAX
, which was very unreliable.
I found the signal ParkAid_Data: ExtSteeringAngleReq2
contains calibrated steering wheel angle on the Edge. I surveyed other drivers on the #ford Discord channel and no other models have any data at this signal. This leads me to believe the Edge has moved the calibrated steering wheel angle to the IPMA and it is not available in the PSCM. I was also able to confirm this with another 22' Ford Edge driver with a higher trim level and different ABS fwVersion (thank you @mikehundley). This is why I abandoned my new DBC since this data was already available in the original DBC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dang, that's unfortunate. What about BrakeSnData_6->StePinOffst_An_Est
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On our Bronco, when the Qf signal is invalid, StePinComp_An_Est
is 0 degrees (0b011111010010000), but yours is just zero'd out as bytes (hence the -1600), that is a meaningful difference, and perhaps tells us that it isn't a signal that will ever be filled out, so we can potentially ignore using that.
- Still should check that it never is not set across lots of Edge routes
Can you turn your car on and off repeatedly and then send the latest route? It took maybe 50 tries on our Bronco to get it into this state where the angle's offset was wrong. You can just turn the ignition to "on" you don't need to start the engine (as long as 3X goes onroad).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No data at BrakeSnData_6
Are you asking about getting a wrong angle offset at SteeringPinion_Data->StePinRelInit_An_Sns
? Reviewing a couple of routes, it looks like it's initialized to 0 at ignition so the offset is equal to steering wheel angle at ignition
The responses I mentioned receiving earlier from other Ford drivers on #ford Discord all seemed to be CAN_FD vehicles. I just found another route from a CAN vehicle, ParkAid_Data->ExtSteeringAngleReq2
was identical to SteeringPinion_Data->StePinComp_An_Est
. Does your Bronco have data at ParkAid_Data->ExtSteeringAngleReq2
, is that the common signal for all CAN vehicles rather than just EDGE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Still should check that it never is not set across lots of Edge routes
Wrote a script to analyze the rlogs (or qlogs if rlogs not uploaded) for StePinComp_An_Est
data for a list of routes. I ran this on about 500 miles worth of routes from my Edge. I also threw a couple of other Fords in as a control. Please let me know if you would like to see any more data
We've moved the car interfacing code to our PR_NUMBER=33045
curl -L https://github.com/commaai/openpilot/pull/$PR_NUMBER.patch | sed -e 's/selfdrive\/car/opendbc_repo\/opendbc\/car/g' | git apply -v --reject Simply replace the PR number with your own. Once done, add the files, fix any conflicts, and open a new PR. Alternatively, you may start a new PR from scratch if that is easier for you. |
Checklist
selfdrive/car/docs.py
to generate new docsStePinComp_An_Est
is never set across lots of Edge routesLink to all physical parts during installation
comma 3X
car harness kit
Ford Q3