PID vs PCT

[From Bruce Abbott (2018.08.30.1000 EDT)]

Bruce Abbott (2018.08.29.1750 EDT) –

[Martin Taylor 2018.08.29.12.54]

MT: Yes, if g/r is finite, meaning that r > 0. The offset will asymptote at r/g times the maximum deviation of the PIL during the transport lag.

Martin, I need to correct something I wrote yesterday. I said in reply to the above,

Again, I fail to understand why you are bring transport lag into the picture. Over iterations the offset will grow until it produces a zero steering angle. In the above, I interpret you to be saying that the asymptotic offset will depend on how much deviation develops during the time required to complete one iteration. As I understand it, the offset will depend on the loop gain.

I think my brain must have been giving out when I wrote that. I awoke last night realizing that this is wrong. It’s not how much deviation develops during the time to complete one iteration, it’s the number of iterations required for a change to circulate around the loop. If it takes five iterations before a change in CV can feed back to affect the CV, and each iteration represents 0.01 seconds, then the transport lag is 0.05 seconds.

That said, I still don’t understand why transport lag should enter the computations giving the offset from reference that appears in the steady state when there is a constant disturbance.

If the disturbance is taken to be the effect of a given variable on the controlled variable, then in the steady state,

p = (rG/(G+1) + Gd/(G+1), where G is the loop gain.

In the car scenario, the reference, r is lane center, which we can identify as position = zero. The equation then reduces to

p = d* G/(G+1).

If the loop gain is 10 and the disturbance is 10 cm, then

p = 10*10/11 = 9.09 cm.

Given that the reference r = 0, this represents a 9.09 cm offset from reference. Transport lag (if not so large as to cause a significant phase lag) will affect how long it takes for stability to set in, but will have relatively little effect on the size of the stable offset. Am I wrong?*

(*Note: I suspect that you are bringing in transport lag to take the phase shift Into account?)

Bruce

[From Bruce Abbott (2018.08.30.1000 EDT)]

[Martin Taylor 2018.08.30.12.48]

Postscript. I think I may have found a train of thought that could lead to the

idea that the re-alignment event might be equivalent to a sustained
disturbance. It is that the current error value is translated by the
output function into a absolute rotation value of some marked radius
of the steering wheel relative to the car’s horizontal (say, the
dashboard). Is that it? If so, I would like to dispute it. If not, I
must try to find some other possibility.
If my guess is right, then my dispute would be that the output of
the driver to the steering wheel is a force that rotates the wheel
one way or the other, not a reference value for the steering wheel
angle. In the steady state, that force is proportional to the
steady-state road-wheel angle relative to the car axis, and is
unrelated to the actual steering wheel angle. Clearly, the road
wheel angle can be used determine the steering wheel angle, both
before and after the re-alignment event, but that relationship has
nothing to do with the need for a force to keep the road wheels
off-axis if that is what is needed to opposed a persistent sideways
disturbance to the car such as a side wind.
The message I was working on traces that relationship around the
loop and winds up with a differential equation, but there’s no point
in going into it if my guess here is wrong and you have some other
reason for thinking of the re-alignment as equivalent to a sustained
disturbance.
Martin

···

[Martin Taylor 2018.08.30.12.20]

[From Bruce Abbott (2018.08.30.1000 EDT)]

  I agree completely with everything you say in this message except

for the starred note at the end. But I remain mystified by the
reason you might consider the effect of the misalignment to be
equivalent to a sustained disturbance. Your message arrived as I
was re-composing a third draft of my endeavours to seek out
possible reasons for your thought, while at the same time trying
to put in a new way the reason why I think transport lag is
critical to the analysis. So far, I have failed to find a train of
thought that leads to your equating the re-alignment of the
steering-wheel to road wheel connection with a sustained
disturbance.

[Martin Taylor 2018.08.30.17.34]

Bruce, it occurred to me that the PID video always shows equations for computing the "correct" steering angle to bring the car's position in lane to the centre of the lane. Are you perhaps trying to get the PCT controller to emulate it so that we can make a close comparison between PID and PCT, while also getting the PCT controller to control a perception of the PIL in the usual way by varying the steering angle clockwise or anti-clockwise according to which direction reduces the current error?

When I sent my messages of the last few days I hadn't thought of that possibility for why you treat the absolute steering angle as important to the controlling. If that's what you have been doing, it's no wonder that we have been talking at cross purposes, because I was treating the PCT controller as solving a different problem: how to control the car's PIL by means of the steering mechanism despite a sudden re-alignment of the relationship between the steering and road wheels.

Martin

[From Bruce Abbott (2018.08.30.1815 EDT)]

[Martin Taylor 2018.08.30.12.48]

[Martin Taylor 2018.08.30.12.20]

[From Bruce Abbott (2018.08.30.1000 EDT)]

MT: I agree completely with everything you say in this message except for the starred note at the end.

Excellent!

But I remain mystified by the reason you might consider the effect of the misalignment to be equivalent to a sustained disturbance. Your message arrived as I was re-composing a third draft of my endeavours to seek out possible reasons for your thought, while at the same time trying to put in a new way the reason why I think transport lag is critical to the analysis. So far, I have failed to find a train of thought that leads to your equating the re-alignment of the steering-wheel to road wheel connection with a sustained disturbance.

Postscript.

I think I may have found a train of thought that could lead to the idea that the re-alignment event might be equivalent to a sustained disturbance. It is that the current error value is translated by the output function into a absolute rotation value of some marked radius of the steering wheel relative to the car’s horizontal (say, the dashboard). Is that it? If so, I would like to dispute it. If not, I must try to find some other possibility.

Yes, but let’s use clock positions. Before any realignment, let’s call 12 o’clock the steering wheel position that keeps the steering angle at the front wheels at zero degrees with respect to the car’s body. After the rotation, 12 o’clock will no longer produce a zero degree steering angle.

My reasoning:

Let’s go back to the original case, in which the simulated car hits some rocks, which cause a steering misalignment. This case eliminates the steering wheel, as there is none, just the steerable front wheels that the controller can set to some steering angle relative to the car’s body. I will also assume that the control system is a proportional one.

Before the encounter with the rocks, we have the following output function:

Steering angle = output gain * position error.

I will assume an output gain of 0.1 degrees/cm of error. When the car’s position matches the reference position, there is no error and therefore

Steering angle = 0.1 degrees/cm* 0 cm = 0 degrees. This is the steering angle that will keep the car going straight ahead in the absence of any disturbances.

Now the car hits the rocks, bending the left tie rod, so that the left wheel points further to the left than when the alignment was good. With the right wheel pointing straight ahead, the left wheel now points 2 degrees to the left. The net steering angle is the average of the two, or -1 degree. (Negative = left)

If the car is still at the reference position and heading straight down the lane, the error is still zero. Therefore the error is still zero. However, the misalignment has changed the output function:

Steering angle = (0.1 degrees/cm)(0 cm) – 1 degree = -1 degree.

Consequently, the car begins to turn to the left. The car’s position drifts to left of reference, causing a position error to develop. For example, when the car has moved 1 cm to the left, the error is 1 cm.

(Note: the error, although to the left, is positive because position is subtracted from reference in the comparator.)

Therefor

Steering angle = (0.1 degree/cm) (1 cm) -1 degree = 0.1 – 1 = -0.9 degrees.

What will the error need to be in order to get the steering angle back to zero, where it must be if the car is to track straight down the road? To track straight, the steering angle must be set to compensate for the misalignment of -1 degree, so it will have to be set at + 1 degree. Thus the error will have to be 10 cm:

Steering angle = 0.1*10 -1 = 1.0 – 1 = 0 degrees.

Taking the steering wheel off, rotating it, and replacing it without changing the steering angle likewise changes the output function. Whereas before, a certain steering wheel position (say, 12 o’clock) produced straight-ahead driving (zero steering angle at the front wheels), now that same position produces different steering angle when the position error is zero. To compensate for this change, the controller will have to rotate the steering wheel until the steering angle at the road wheels is once again zero. This can only be done in a proportional controller by maintaining a nonzero position offset.

If my guess is right, then my dispute would be that the output of the driver to the steering wheel is a force that rotates the wheel one way or the other, not a reference value for the steering wheel angle. In the steady state, that force is proportional to the steady-state road-wheel angle relative to the car axis, and is unrelated to the actual steering wheel angle. Clearly, the road wheel angle can be used determine the steering wheel angle, both before and after the re-alignment event, but that relationship has nothing to do with the need for a force to keep the road wheels off-axis if that is what is needed to opposed a persistent sideways disturbance to the car such as a side wind.

Are we still talking about a simple proportional controller?

I don’t see forces being exerted on the steering wheel as having anything to do with the problem beyond the obvious fact that forces need to be exerted to turn the wheel. The problem is that the self-steering car’s control system is designed with a certain relationship assumed between the steering wheel angle and the steering angle at the front wheels. If you want a proportional controller to change the steering angle to oppose a wheel misalignment, you have to let the controller develop an offset from its reference position. The same is true of the steering wheel example: The controller’s output function assumes that a certain steering wheel position will produce a zero steering angle at the front wheels. If you change that, the controller has no way of knowing about the change. All it “knows” after the steering wheel rotation is that the car is drifting away from the centerline when error is zero, and acts as it always does to reduce this error – by rotating the steering wheel to oppose the drift. But that rotation depends on the error, and the error has to be large enough to produce a zero steering angle if the car is to run parallel to the road.

The message I was working on traces that relationship around the loop and winds up with a differential equation, but there’s no point in going into it if my guess here is wrong and you have some other reason for thinking of the re-alignment as equivalent to a sustained disturbance.

I hope I have made my reasoning clear. If there’s something wrong about it, I await your correction!

Bruce

[From Bruce Abbott (2018.08.30.2230 EDT)]

[Martin Taylor 2018.08.30.17.34]

Bruce, it occurred to me that the PID video always shows equations for computing the “correct” steering angle to bring the car’s position in lane to the centre of the lane. Are you perhaps trying to get the PCT controller to emulate it so that we can make a close comparison between PID and PCT, while also getting the PCT controller to control a perception of the PIL in the usual way by varying the steering angle clockwise or anti-clockwise according to which direction reduces the current error?

When I sent my messages of the last few days I hadn’t thought of that possibility for why you treat the absolute steering angle as important to the controlling. If that’s what you have been doing, it’s no wonder that we have been talking at cross purposes, because I was treating the PCT controller as solving a different problem: how to control the car’s PIL by means of the steering mechanism despite a sudden re-alignment of the relationship between the steering and road wheels.

Well, yes, except that I view the standard single-level PCT controller as essentially the same as the proportional controller with which the video starts before adding the derivative and integral terms. Throughout have been describing the operation of that system as described in the video, which employs steering angle as the means of controlling the car’s PIL. That control system assumes that steering angle is set in the output function as a function of position error. So of course, anything that changes the relation between error and steering angle will cause the zero position error value to no longer produce a zero steering angle, and the car will drift out of position when the error is zero. The control system will then have to produce enough of a position error to bring the steering angle back to zero when the car’s heading is parallel to the road. After the rocks or steering wheel resetting, the system re-stabilizes with the car running parallel to the lane but offset from the reference position, as shown in the video. I seemed to me that you were arguing that this system would not behave this way, and giving what to me were incomprehensible reasons why it wouldn’t.

How does your “PCT” controller differ from this organization?

Bruce

[From Bruce Abbott (2018.08.30.2230
EDT)]

      [Martin Taylor

2018.08.30.17.34]

      Bruce, it

occurred to me that the PID video always shows equations for
computing the “correct” steering angle to bring the car’s
position in lane to the centre of the lane. Are you perhaps
trying to get the PCT controller to emulate it so that we can
make a close comparison between PID and PCT, while also
getting the PCT controller to control a perception of the PIL
in the usual way by varying the steering angle clockwise or
anti-clockwise according to which direction reduces the
current error?

      When I sent my

messages of the last few days I hadn’t thought of that
possibility for why you treat the absolute steering angle as
important to the controlling. If that’s what you have been
doing, it’s no wonder that we have been talking at cross
purposes, because I was treating the PCT controller as solving
a different problem: how to control the car’s PIL by means of
the steering mechanism despite a sudden re-alignment of the
relationship between the steering and road wheels.

        Well, yes,

except that I view the standard single-level PCT controller
as essentially the same as the proportional controller with
which the video starts before adding the derivative and
integral terms. Throughout have been describing the
operation of that system as described in the video, which
employs steering angle as the means of controlling the car’s
PIL. That control system assumes that steering angle is set
in the output function as a function of position error. So
of course, anything that changes the relation between error
and steering angle will cause the zero position error value
to no longer produce a zero steering angle, and the car will
drift out of position when the error is zero. The control
system will then have to produce enough of a position error
to bring the steering angle back to zero when the car’s
heading is parallel to the road. After the rocks or
steering wheel resetting, the system re-stabilizes with the
car running parallel to the lane but offset from the
reference position, as shown in the video. I seemed to me
that you were arguing that this system would not behave this
way, and giving what to me were incomprehensible reasons why
it wouldn’t.

        How does your

“PCT” controller differ from this organization?

Bruce

[From Bruce Abbott (2018.08.31.0915 EDT)]

[Martin Taylor 2018.08.30.23.32]

[From Bruce Abbott (2018.08.30.2230 EDT)]

[Martin Taylor 2018.08.30.17.34]

Bruce, it occurred to me that the PID video always shows equations for computing the “correct” steering angle to bring the car’s position in lane to the centre of the lane. Are you perhaps trying to get the PCT controller to emulate it so that we can make a close comparison between PID and PCT, while also getting the PCT controller to control a perception of the PIL in the usual way by varying the steering angle clockwise or anti-clockwise according to which direction reduces the current error?

When I sent my messages of the last few days I hadn’t thought of that possibility for why you treat the absolute steering angle as important to the controlling. If that’s what you have been doing, it’s no wonder that we have been talking at cross purposes, because I was treating the PCT controller as solving a different problem: how to control the car’s PIL by means of the steering mechanism despite a sudden re-alignment of the relationship between the steering and road wheels.

Well, yes, except that I view the standard single-level PCT controller as essentially the same as the proportional controller with which the video starts before adding the derivative and integral terms. Throughout have been describing the operation of that system as described in the video, which employs steering angle as the means of controlling the car’s PIL. That control system assumes that steering angle is set in the output function as a function of position error. So of course, anything that changes the relation between error and steering angle will cause the zero position error value to no longer produce a zero steering angle, and the car will drift out of position when the error is zero. The control system will then have to produce enough of a position error to bring the steering angle back to zero when the car’s heading is parallel to the road. After the rocks or steering wheel resetting, the system re-stabilizes with the car running parallel to the lane but offset from the reference position, as shown in the video. I seemed to me that you were arguing that this system would not behave this way, and giving what to me were incomprehensible reasons why it wouldn’t.

How does your “PCT” controller differ from this organization?

Bruce

Drastically.

I asked a while back why you seem to consider the heading to be a controlled variable, and later why you seem to consider the steering angle (by which I thought you meant the steering wheel orientation) to be a controlled variable. In this message, you seem to consider both heading direction and steering (road wheel) angle to be controlled. The PCT controller doesn’t. Here are a couple of differences.

Martin, neither steering angle or steering wheel angle are controlled variables in the controller I have described. I can’t fathom why you think they are. Those variables are located in the controller’s single output function, where their value depends only on the position error. That output function does not hide another, lower, level of control.

In the rocks example, the steering wheel isn’t even present; the controller’s output directly sets the steering angle. In your scenario that resets the steering wheel, the steering wheel is present but is rigidly connected to the steering angle such that the steering angle is directly proportional to the steering angle; resetting the steering wheel simply changes the steering angle set by a given steering wheel angle. In either case, steering angle is the variable that physically changes whether the car is turning left, turning right, or going straight. Its value is proportional to the positional error. It is not controlled, it is set in the error function, and its physical effect on the car’s heading, which, integrated, determines the car’s lateral position, provides the feedback on position that acts to reduce the error. Steering wheel angle is not controlled. Wheel angle of the car’s front wheels is not controlled. Heading is not controlled. Only lateral position is controlled.

Without getting into the actual physics, the control system I is essentially this:

p = lane position [perception]
e = r-p [comparator]
steering angle = ge [output function]
later velocity = k
steering angle * [environment; current heading determines lateral velocity]
lane position = integral of lateral velocity [environment; feedback function]

(*For simplicity, I have ignored the combined effects of the car’s speed and heading on lateral velocity – a matter of simple trigonometry. This simplification doesn’t alter the fact that these variables are part of the feedback function and not controlled variables.)

As you can see, the only controlled variable is lane position.

I’m heading off to Indianapolis and am not taking my laptop with me, so anything further from me will have to await my return over the weekend. Meanwhile, if you would comment on the above, I would appreciate your take on it, which I can read on my iPhone while away.

Bruce

Firstly, the standard PCT controller is not a proportional controller but is an integral controller, in that its output is the integral of the perceptual error (albeit leaky) and is not a function of the current error. Secondly and more importantly, the concept of zero steering angle means no more to it than the flight arrival time of the next passing angel means to an atheist. It’s a concept without content.

You say that the PID controller “assumes that steering angle is set in the output function as a function of position error”. In contrast, the PCT controller never assumes anything about the steering angle, or even that there is such a thing as a “steering angle” in the environmental feedback path. For all the difference it might make, its output could be sending signals to a community of gnomes who push and pull across the lane a set of flexible rails on which the car is running that set its heading and PIL.

Nothing in the entire single-loop system has a concept or a controlled perception of steering angle or car heading (a hierarchical PCT control structure might). All the PIL Elementary Control Unit outputs is a quantity that increases when the integrated error has one sign and decreases when the integrated error has the other sign. The greater the integrated error in absolute value, the greater the output of the appropriate sign becomes as the integration continues. That’s it. How the perceptual value of the PIL is mechanically caused to change is of no interest. No “steering angle” reference value is ever calculated or produced. If the car happens to be observed heading in any particular direction, including parallel to the lane centre, that’s a side effect available only to an external observer.

All the PCT controller “knows” is in the form of its structural connections, and that “knowledge” is restricted to the sign of the effect of the increase or decrease of its output. When it produces more output the car begins to turn more left, when it produces less output the car begins to turn more to the right. If the error value increases (it wants more leftward correction), its output begins to increase, no matter what its current value, if the error value decreases, it wants less leftward correction, which would turn into more rightward correction if the error went below zero. It has no concept of zero other than that of the PIL perception being equal to its reference value.

I ask again why you are so interested in heading direction, and in the concept of “zero steering angle”. Ignoring the PID controller entirely, in your version of a single loop PCT controller, why do those have to have independent but specific values set by the controller’s one and only output? As I see the PCT controller, the same values may fall out of its operation, but that’s of interest only to an external observer who might ask why they do, and make inferences about mechanism based on those observations.

You say I have been arguing that the PCT controller would not set the steering and heading angles the way that the PID controller does. I have not been arguing that at all. Rather, I have been arguing that if an observer sees those angles changing in the way the PID controller would make them change, that’s fine, but it is irrelevant to the operation of the PCT controller. If you think my reasons for making an argument I was not making were incomprehensible, that’s not a surprise. Might they be more comprehensible if you went back and tried to interpret them as attempts to describe the working of a bog-standard PCT controller in that mechanical environment?

Martin

[From Bruce
Abbott (2018.08.31.0915 EDT)]

[Martin Taylor 2018.08.30.23.32]

···

I asked a while back why you seem to consider the heading to
be a controlled variable, and later why you seem to consider
the steering angle (by which I thought you meant the steering
wheel orientation) to be a controlled variable. In this
message, you seem to consider both heading direction and
steering (road wheel) angle to be controlled. The PCT
controller doesn’t. Here are a couple of differences.

        Martin, neither steering angle or

steering wheel angle are controlled variables in the
controller I have described. I can’t fathom why you think
they are. Those variables are located in the controller’s
single output function, where their value depends only on
the position error. That output function does not hide
another, lower, level of control.