[From Bruce Abbott (2018.08.28.1800 EDT)]
[Martin Taylor 2018.08.28.13.45]
[From Bruce Abbott (2018.08.28.1215 EDT)]
[Martin Taylor 2018.08.27.14.34]
MT: I found myself in the strange position of having reasons to accept both sides of an opposition. On the one side, following Bruce, is a notion that after the wheels hit the rocks a permanent offset is added to the output, but its effect is reduced by the control gain, while on the other, following Rupert, is that it is obvious that if the driver took the steering wheel off the post and put it back at some random angle relative to where it was, that would make no difference at all to the ability of the driver to keep to the middle of the lane. So why should the misalignment caused by the rocks make any difference? It has the same relation to the angle of the steering wheel as does taking the wheel off and putting it back differently.
BA: As I noted to Rupert, a human driver would have no problem in either case, but the standard PCT controller with a leaky integrator output function would set the steering wheel position to the former “straight aheadâ€? position, and this would result in the car turning. The control system would compensate by turning the steering wheel in the opposite direction. In the misalignment case this would rebalance the steering forces so that the car would track straight ahead – a net zero steering angle. In tthe steering wheel resetting case this would change the steering wheel position so that the steering angle is zero.
MT: This, I don’t understand. You seem to be saying that the controller is controlling for perceived heading direction with a reference value of “straight head”. I don’t remember that requirement ever being part of the situation.
I never mentioned anything about the car in the video perceiving (let along controlling!) a heading.
MT: My understanding was that the only controlled variable (in the environment, and therefore in the perceptual controller, in the controller) was distance from the lane centre. Heading direction is a side-effect available to the outside observer, not to the position-in-lane (PIL) controller. When the road is straight ahead, and if control is good, the heading direction will generally be close to straight ahead, but if the road is curved, a straight ahead heading reference value conflicts with keeping in the lane centre. So why is your car controlling for going straight ahead?
It is not controlling for going straight ahead. This idea is a reversion to the idea (which I have been disputing) that the PID controller in the video is controlling steering angle. It sets the steering angle as the means of controlling the car’s position relative to the reference. The video shows a straight road, so once the car is running parallel to the road and at its reference position, maintaining a straight-ahead heading keeps the car’s position from drifting away from its reference position.
Of course, if the road curves, then to keep the car centered on its reference position, the controller will have to change the steering angle from straight ahead to a value that will cause the car to follow the curve. As the road starts to curve, the straight-ahead steering angle will cause the car to depart from its center position, producing an error that will cause the steering angle to be changed in a direction that reduces the error.   When the car returns to center, the steering angle will adjust so that the rate of turn matches the curve in the road. In this way the controller handles curves as well as straight roads.
BA: But where does this change in output come from? In the standard, single-level PCT controller it comes from the offset between reference position and sensed position, the position error. Thus, the standard PCT controller must maintain some degree of position error in order to generate the change in steering wheel angle that will compensate for this error. Thus the car will not reach its reference position, although one can get the sensed position as close to the reference as one likes by raising the loop gain sufficiently.
MT: This is true of any controlled variable in the absence of variation in the reference and disturbance. But as I pointed out before, in the standard (leaky integrator) PCT controller there is no concept of loop gain as such. There is a ratio between integration gain rate g and leak rate r (slowing factor, if you like), which lead to an effective steady state gain G=g/r if you are interested in steady-state conditions. But the point you make is true of ANY controller, not just a standard PCT controller.
Not so. The integral term in the PID output function allows the position error to be reduced to zero in the steady state. What IS true is that the residual integral error will remain large enough to produce a the steering angle that opposes the effect of the disturbance. Picture the driver holding the wheel at an angle to keep the car tracking the center of its lane against a strong sidewind that otherwise would push the car away from center.
MT: You can’t allow the PID controller to use an idealized leakless integrator (r=0) and not allow that capability to the PCT controller with which you compare it. The problem with infinite G in a PCT controller is entirely caused by the phase angle change over a transport lag, which with any non-zero transport lag finally becomes 180° at some frequency where the absolute gain exceeds unity. But in the idealized reference situation of the video there is no loop transport delay at all, so there’s no need for any leak in the PCT output integrator. The error will reach zero, if only after infinite time (but we have an idealized driver who is immortal and an infinite road, so we can sweep that under the rug.)
I see the PID controller as one possible version of a PCT controller, not a competitor to it. As proportional controllers, both will develop an offset from reference in response to a constant disturbance. Adding the non-leaky integral term will allow both to eliminate this constant offset.
I should mention that real-world non-leaky integrator outputs suffer from possible integrator “wind-upâ€? if the error is not corrected soon enough – the error cumulates to such a degree that it takes an excessively long time to “unwind itâ€? through an opposing output. This can make the controller sluggish or even unstable due to the induced phase lag. Engineers have developed strategies to deal with this problem, such as limiting the size of the cumulated error
BA: Is this what the human driver does? As I see it, no. The human driver will put the car wherever she wants it to be, including exactly on her reference position. The PID controller can put the car’s position at the reference position, too, by employing the integral term. Is that what the human driver does? Maybe, but I rather doubt it.
MT: So do I, and since we are talking about real conditions and finite time to get close, lets talk about another aspect of realism, which is tolerance. The human driver does not even try to be exact. The human driver get close enough to be functional, and if exactness is wanted, gets it on average by drifting the reference value slightly back and forth around zero if there isn’t a varying disturbance (engineers call this “jitter”), and correcting for disturbance variation if there is.
I have been keeping this “deadband� in mind but did not want to bring this additional complexity into the picture until we reached agreement on how the PID controller in the video actually works. There is a tolerance region within which some drift away from the nominal center will produce no attempts at compensation. But this is a side issue.
[More below the extended quote]
BA: Â I suspect that the human driver uses lateral velocity (relative to the road) control as a means of controlling position. The car is made to drift leftward or rightward until the car reaches its reference position. This is accomplished, of course, by changing the steering angle. Lateral velocity is set proportional to position error, so as the lateral velocity reaches zero when the car is at its reference position.
MT: For my own peace of mind, I had to figure out (or be persuaded) which view is wrong. Intuitively, right now, when we think of simple perceptual control it is Bruce’s that is wrong (and mine, as I originally thought of it). That would mean that there really is a difference between the PID and the PCT controller, because the PID controller would have to do something permanent to correct for the re-alignment of the wheels, whereas to the PCT controller it would be only a transient effect.
MT: As Bruce said, for simplicity we should ignore the car’s mass, but I don’t think we should ignore the question of how the road wheel angle affects the car’s position in the lane. For starters, the road wheel angle can have any value mechanically possible wherever the car is with respect to the lane. The position-in-lane (PIL) is the controlled variable for both PID and PCT controllers, and it is uncorrelated with the road wheel angle.
MT: Both before and after the car hits the rocks or the driver takes the steering wheel off and replaces it at possibly a different angle, the road wheel angle is perfectly correlated with the steering wheel angle (apart from mechanical slop). It’s also uncorrelated around the moment of realignment, since one or other of the steering or road wheels remains constant while the other changes. So the steering wheel angle is uncorrelated with the PIL perception. Here’s a sketch of the car in three states. In each, the car starts with zero PIL error.
MT: The effect of changing the road wheel angle is not to change the PIL, or even to change the PIL error. It is to change the rate of change of PIL error. But even that is uncorrelated with the error value. From inside the car, the perceived rate of change of the car’s direction of travel is constant, and the car travels in a circle. The PIL error increases and decreases sinusoidally as a function of time.
MT: Why are these causally related phenomena uncorrelated in principle? It is because that is what differentiation (and integration) do. Heuristically, if the value of a variable is x right now and it is increasing, the next time it is (or the last time it was) x it will be (or was) decreasing (discounting the physically unrealizable possibility of discontinuous variables). Over time, these increasing and decreasing passages through any value of the variable will cancel out. Slightly more mathematically, if a waveform can be described by a Fourier series or transform, it can be decomposed into additive sinusoidal components. The time derivative of each of these sinusoids is the corresponding cosine, which is uncorrelated with the sinusoid.
MT: Why go into this? Because the derivative of a constant is zero, and so long as the steering wheel and road wheels maintain their relative alignment, the ability to control the PIL is unaffected by the absolute value of their alignment. If the driver can control the PIL perception before the realignment by the rocks, she can do it equally well afterwards. The step change in the steering-to-road-wheels alignment causes only a transient effect on the PIL error, and has no influence on the control performance of the driver. In particular, it does not cause a lasting offset in the PIL.
MT: Thinking of the problem this way leads me to side with Rupert rather than with Bruce in saying that control is unaffected by the steering realignment, but the argument applies to any kind of controller, so it is irrelevant to whether a PID controller is inherently different from a PCT controller according to the description of the PID controller in the video. Whether they are truly different depends on the interpretation of what the author of the video actually intended, largely in the statements around 3:23 about “the controller designed so so far”. Of course, we could go to other sources, but Rupert’s original question was about the controller described in the video, and we interpreted it, each initially unambiguously, differently.
MT: However, since I now believe Rupert rather than Bruce about whether the realignment causes a lasting offset in the PIL, and the video says it does, I tend to think that the PID controller being described is indeed different from a PCT controller, which doesn’t care about the realignment other than controlling away the transient in the same way it would control away the effects of a change in the road camber.
MT: I have a nagging feeling that I have missed something on which Bruce will correct me.
BA� Correction in progress: The “lasting offset in the PIL� in both the PCT and PID controllers is due to the way proportional controllers work. They cannot generate a change in steering wheel angle so as to compensate either for the misalignment or the changed steering wheel position unless there is a positional error that will drive the change in steering wheel angle. It is this change in steering wheel position that allows the car to run parallel to the lane, although with a small offset from the reference position. In the video, the loop gain is apparently rather low, probably so the viewer can easily see the offset.
BA: The human driver might deal with the problem by changing her grip on the steering wheel, which is to say adding a constant offset between hand position and steering wheel position, so that her “straight ahead� hand position keeps the steering wheel turned so as the compensate for the steering misalignment or steering wheel repositioning. Effectively, this is rebuilding the control system to remove the constant disturbance to steering angle.
MT: You really do seem to be treating the perceived heading as a controlled variable.
To keep the car in its reference position on the road as it travels down the road, the controller’s actions have to result in a heading that matches the road’s heading. If the car reaches the centerline but is traveling at a steep angle across the road, the car will immediately pass the centerline. Only by bringing the car’s heading into alignment with the road’s will the controller manage to keep the car at its reference position as it moves along. But its heading is a side effect of the control process that gets the car tracking along the centerline. As the positional error reduces, the steering angle reduces (because it is proportional to the error) and because the rear wheels follow the front wheels, the car’s heading becomes more parallel to the road. Only when the car’s heading is parallel to the road’s heading will the car continue to accurately track the reference position.
Your next three paragraphs below do not require a response from me, because they argue from a false premise.
MT: What benefit is there in doing so? I see only potential conflict between PIL control and heading control if both are independently controlled. If they are not, as in a PCT 2-level hierarchy with heading reference set by the output of the PIL control unit, “straight ahead” will be the reference only accidentally, when the PIL error integrates to zero (has averaged zero over a time determined by the integrator lag). I suggest it is better to ignore the idea that heading direction might be controlled, and to think only of the PIL control loop, including everything else as a black-box environmental feedback path.
MT: Even the equations of the PID controller don’t mention heading direction, except implicitly because the derivative of PIL error happens to be he actual heading direction relative to the local direction of the lane centre. That derivative is proportional to the road wheel angle. To control it with reference value zero would be a mistake, but does the PID controller do that? I think not. The factors for current and the first derivative of PIL error (and for its integral) are all simply added together to produce a reference steering wheel angle, in the way that multiple higher-level signals combine to form the reference input for a next lower-level unit in Rick’s spreadsheet hierarchy. None of them individually is controlled, and that’s different from a PCT controller that controls only PIL with one reference value, zero.
MT: One way of looking at the PID controller that is described in the video is that it uses control error to reorganize the system (specifically the relationship between steering wheel angle and road wheel angle), and the resulting PIL control is simply a side-effect result of that reorganization. The PCT controller has no need for that reorganization, since its minimum-precision output can always be characterized as “do more (less) of whatever you are doing”, depending on which is the error reducing direction. It is agnostic as to what the “whatever” might be (though the Artificial Cerebellum" does learn he dynamic characteristics of the “whatever”). In the example, the corresponding PCT controller neither perceives nor controls heading direction, steering wheel angle, or anything else other than PIL. And nor should it.
I think I’m going to rest my case. I simply don’t know what else I can say to make my position clear.
Bruce