Skip to content

Ford Lateral

alan-polk edited this page Oct 10, 2024 · 4 revisions

Much like Comma the Ford system has three components, where there is a model, control code (lateral planner), and safety code. For the Ford system "The Model" is an output from the IPMA (image processing module A) to the lateral planner which is inside the PSCM (power steering control module), which is built into the steering rack and pinion unit. For most other manufacturers (Toyota, Honda, etc) the lateral planner lives in the IPMA, along with the model and the output is a direct signal to control the steering wheel. Since Ford's lateral planner is in the power steering rack itself, we cannot bypass it and control the steering wheel directly. This means that when OpenPilot is interfacing with a Ford vehicle, it is not providing a signal to control the steering wheel like every other manufacturer the system supports, it is translating the output of the comma model into a data structure that mimics what the output of the IPMA from Ford would be, so that the lateral planner in the PSCM will execute the movements that we desire.

To further complicate things, there is not a single signal from the IPMA to the PSCM, rather there are 7 signals that describe the path the vehicle needs to take, along with some toggles about how it should go about attempting to follow that path.

  • Curvature - A measurement of the radius of the road in front of the vehicle

  • Curvature Rate- A measurement of how quickly the radius of the road in front of the vehicle is changing

  • Path Offset- How far from the center of the vehicle is away from the center of the ideal path

  • Path Angle - The ideal angle for the vehicle to move along to reach a path offset of zero

  • Ramp Type - How quickly should the steering rack adjust to changes in control signals

  • Precision Type - How strictly should the steering rack attempt to follow the described path

  • Mode - Off, limited, extended.

By using the extensive data logging capabilities of the Comma3x, we have been able to monitor all 7 of these signals on BlueCruise and Lane Centering drives, and attempt to reverse engineer how Ford calculates each one. The first three are relatively easy to reverse engineer and calculate based on the names and a basic understanding of geometry. The last four however present a much bigger challenge. We do have a pretty good idea of when Ford toggles precision type and ramp type based on the planned path, and mode seems to be a variable that is designed for future use because it has no discernible effect on output. However the path angle variable is calculated using a proprietary model predictive controller algorithm that we cannot duplicate. In accordance with Murphy's Law, path angle is the most influential control signal at our disposal (and we don't know how to calculate it).

We were able to write some code that would read the signals Ford's model calculated out of the IPMA (because it does this 100% of the time, even when lane centering or BlueCruise is turned off) and write those out using the Comma3x so that we could force BlueCruise to be engaged 100% of the time, even on surface streets, neighborhoods, and really curvy roads. What we found is that Ford does not appear to have designed the system for non-interstate use, because it controls very poorly in those situations. Extensive testing is underway to see if there is a way to manipulate the PSCM into behaving in a way Ford didn't design it to so that we can have 100% hands free control in all situations.

Comma specific challenges for Ford lateral control:

Due to the unique nature of controlling Ford (see above), the bluepilot team has been forced to think outside the box to address ping pong on Fords. We will us this section to try and explain the issue and give some background on the solution.

We will first start with discussing what are predicted curvature and desired curvature. Predicated curvature describes the path that the road follows (assuming no lane changes). On a perfectly straight road (which rarely exists outside of drag strips), predicted curvature would be 0.0. Desired curvature describes the path the vehicle needs to follow to drive down the road. The key difference is that desired curvature accounts for error correction. Even perfectly straight roads are usually crowned to help with drainage, meaning that a curvature of 0.0 would cause the vehicle to drift off the road to the outside edge because there was no accounting for the road crown. In theory, this distinction is not a problem, but the application is where the issue arises.

There are very few vehicles designed for hands free driving. Ford (designed from the ground up for BlueCruise), Tesla's FSD, and Chevy SuperCruise are the major players. Some European cars are starting to go hands free as well but of these, only Ford is compatible with Comma (Supercruise Chevy's all have encrypted canbus). All of the other systems that Comma is designed around are designed for hands-on assistance by the ADAS. Since these systems are not designed for hands-free, the control is less than precise. The best analogy we have come up with, is that the ADAS in Hyundai, Kia, Toyota, etc is akin to an old muscle car with worn our steering components. If you have ever driven one, there is frequently slop in the steering wheel, where you can move the wheel 10-15 degrees and the front tires don't turn at all. The Ford system is like a brand new sports car having tight steering with no slop. This causes an issue for Ford as the Comma system is designed around these sloppy ADAS systems. If a human were to drive around in an old mustang with sloppy steering for a month, then hop in a 2024 mustang, the steering would feel twitchy. The result of this is that the commands coming out of the comma are exaggerated.

Below are two charts showing predicted curvature and desired curvature coming from the Comma. Predicted curvature is in blue, and desired curvature is in red. The first chart is in a curve, and the second chart is on a straight away:

Screenshot 2024-09-02 at 7 54 32 PM

Screenshot 2024-09-02 at 7 54 52 PM

In the first chart, which is for some curves, the desired and predicted curvature match really well. But in the second, you can see the desired curvature swinging positive and negative around the predicted curvature which stays very close to zero on the straightaway. This exaggerated swing of the desired curvature is what causes ping pong for Fords.

The only way this gets truly fixed 100% of the time is for Comma to update the models to output a smooth signal designed for hands-free vehicles. Until that happens, we are stuck with looking for a work around.

To address the issue, we first tried switching to predicted curvature. This did not work because there was no error correction, and the vehicle would just slowly drift to the outside of the lane and off the road due to the drainage slope.

Our current solution is to blend the two curvatures. There are two settings in the Ford-specific menu: "High Curvature PC" and "Low Curvature PC". These two settings are for what percentage of the signal should come from predicted curvature (the remaining percentage comes from desired curvature). High Curvature PC is applicable in curves, and Low Curvature PC is for straight aways. A higher percentage of PC will result in less ping pong, but always will result in less aggressive control, which could cause drifting out of the lane.

Clone this wiki locally