Controlling your car's position on the road

As you drive down the road, you attempt to keep your car more-or-less centered in its lane despite the effects of disturbances. But how do you accomplish this? A simple model based on proportional control would seem to work well: Forces that tend to push the car away from the centerline (your reference level for perceived position on the road as viewed through the windscreen), an error develops between your reference and perceived positions, and this error drives an output function that adjusts the car’s steering-wheel position. This turns the car’s front wheels to produce a counter-force that opposes the disturbance.

With a proportional controller, the output is error-driven, so the system can produce a counteracting force only if error is present. The magnitude of the output depends not only on the size of the error, but also on the loop gain of the system: As loop gain increases, the amount of error needed to generate a given level of output gets smaller and the perception more closely matches the reference.

Let’s assume there is a strong, steady crosswind from the right. This generates a force on the car tending to push the car toward the left side of the lane. In our proportional control system model, this will generate an error, causing you to turn the steering wheel clockwise, which angles the front wheels toward the right, thus generating a counterforce to oppose the force of the wind. In the steady state, the proportional system will keep the wheels turned as needed to oppose the wind-force, but the car will not return to the centerline as there needs to be some error between perceived position and reference if the counteracting output is to be maintained. If the gain of this system is low, there may be a relatively large remaining positional error.

Of course, we don’t drive that way, or at least I don’t. I continue to keep the wheels turned until the car returns to the centerline despite the continued force of the wind acting on the car. So a pure proportional control system does not provide an adequate model of human car-steering behavior.

To correct this flaw, we can add integral control. With integral control, the error between reference and perception cumulates over time (integrates). As with proportional control, this error, which in the case of our constant wind-disturbance would be growing rapidly, produces as before an output proportional to the error, an output that opposes the effect of the disturbance (wind-force) on the perceived position of the car. However, with integral control, the system can decrease the error only by producing an opposing error (error of the opposite sign) that when added to the integral error, reduces it. To accomplish this as a driver, you would have to continue keeping the wheels turned to the right until your car crossed the center of the lane (your reference position), then correct in the other direction to bring the car back to center. This will allow the simulated car to return to the center (as the human driver does) despite the continued effect of the disturbance.

But is this a good model of a human driver’s control of perceived car position? I myself do not perceive myself to be acting in this way unless I have inadvertently over-corrected. Instead, I turn the steering wheel to produce a relatively steady return toward the center and then reduce the steering wheel angle as the car approaches my reference position for it, until the car stops moving toward the right just as I reach the reference position. Perhaps proportional-integral control can accomplish this with the right gains for the proportional and integral terms. Rupert has done modeling of car-steering: Rupert, what are your thoughts on this? (Comments from others are welcome as well.)

I think that, in order to get a good model of the driver you have to have a good model of the feedback connection from the last output the driver produces (torque force on the wheel) to the output that affects the controlled variable (position in the lane). This feedback function would include the amount of steering wheel movement per unit torque applied and the amount tire movement per steering wheel movement and the amount of car movement per tire movement, taking into account variations in resistance to this movement due to variations in road surface conditions.

So there’s a lot of physics between the driver’s output (muscle-produced torque) and the direction of the car relative to the lane lines (the controlled variable) and this physics probably involves integrals that reduce the amount of integration needed in the driver’s output function. This seems like exactly the kind of problem that you, Bruce, should be able to solve easily, physics expert that you are. Rupert and Adam should be able to help out as well.

I also think that Adam’s nice linear regression method for extracting the controller’s output gain (Ko) independent of the feedback gain (Kf) might help us learn how real controllers (such as a car driver) actually work. I’ve been doing a little work testing Adam’s model and I’ve found that it works quite well, even when the feedback function is non-linear (but monotonic).

Adam’s method, if it works for the kinds of behaviors I’ve modeled, would be a great contribution to PCT methodology because it would make it possible to separate the controller’s gain from feedback (environmental) gain. These two contributions to loop gain are confounded when I fit my models to data, resulting in some puzzling variations in the loop gain parameter. I’d like to know the degree to which these variations are the result of variations in environmental conditions (Kf) versus variations in conditions of the controller (Ko).

Best, Rick

Well, partially. You can make the integral gain low so that the overshoot is small. Apparently, a lot of people use standard PID to simulate this, meaning they add the derivative term to proportional and integral that you mention: Controlling Self Driving Cars - YouTube

In that video, they use the distance between the center-bottom of the car to the center of the road, but when you look at the road while driving, sitting in the car, you are looking somewhere in front of the car. There is a lot of research in this area, since J.J. Gibson in the 30’s (or thereabouts). In the research on the perceptual basis of human driving and steering, one important factor is what they call ‘preview’, or a point some distance in front of the car, where the car will end up if you keep going straight. The error is then the difference between the projected point and the road.

I was playing with the idea that following a line with a pen could be perceptually similar to following the road while driving. It’s not quite done yet, missing some experiments too, but the model does slow down in curves, for example, just from having the projected error connected to speed control (if I adjust the gains correctly).

The red line is the projected error, the big middle circle is a reference point for a standard tracking model, and the final little circle is the car or the cursor; the line is the current direction of moving.


Good to know!

Yes, the derivative term provides a bit of phase advance, which helps to compensate for the phase delay inherent in integral control. Something I else I didn’t mention about integral control (in addition to phase delay) is that it can lead to “windup,” which refers to the integral error building up to a huge value (which can occur if the compensatory actions produced by the control systems occur slowly relative to the speed at which the integral error builds.) Windup can degrade control, so artificial control systems usually set limits on how large the integral error is allowed to be.

My subjective experience when driving is that I change positions relative to the lane by turning the steering wheel to a position that generates a constant rate of change in position, then moving the wheel back to center as the car gets close to its new reference position in such a way that the side-motion diminishes to zero just as the car reaches its reference position. (I am assuming here that there are no disturbances acting.) I can control the rate of drift left or right depending on circumstances. For example, I may need to quickly change lanes if I encounter an obstacle in my path. Proportional control will always produce a rate of change proportional to the size of the perceived error, which does not seem to capture my behavior very well.

Capturing how real drivers control car-position probably cannot be done completely accurately if data are collected using “virtual reality” displays of the road as seen by the driver. My intuition is that proprioceptive/vestibular perceptions of forces and accelerations are important inputs to the control system. For example, the driver may try to limit perceived accelerative forces produced by lane changing in order to maintain comfort, although these limits would be ignored in an emergency maneuver. So the best strategy for researching this issue would be to collect data on accelerations-velocities-positions in addition to the view through the windscreen during real driving. A problem to be addressed is how to measure the disturbances that act on the car to produce deviations from its desired position on the road. Because the driver’s control actions tend to compensate for those disturbances, measures of car side-accelerations would not yield the size of disturbance effects that would have occurred in the absence of control.

Love the simulation!

As I recall, with an integral controller, I would squash (sigmoid) the amplified gain to avoid windup. Overshoot could be avoided by choice of gain.

I probably did this with a two-level controller of position and velocity, though can’t recall a particular implementation at the moment.

Thanks, Rupert. The sigmoid function is a sensible solution to the windup problem with integral control as it effectively limits the growth of the integral error.

However, my concern in starting this thread is my sense that the PID model does not capture how I (and presumably other drivers) actually control a car’s position on the road. Consider the case in which I have not been able to correct immediately for displacement from my reference position in the lane because of an increasing side-wind. Eventually I do bring the car back to the desired position, but I don’t seem to experience anything like windup as a result of having been left of reference for some time. I just keep adjusting the steering wheel as needed until the car reaches the reference position and then readjust the steering wheel to zero out the sideways velocity component. I don’t feel any compulsion to keep to right of the reference position in order to zero out an integral error.

A PID controller may perform well in steering a simulated car around a track. However, if I’m right about this, then a simple PID control system does not adequately model my brain’s car-steering control system. The behavior of a PID controller just doesn’t match my subjective steering experience while driving.