> On Fri, 20 Sep 2002 05:05:42 GMT, "Matthew V. Jessick"
> ...
>>TWICE DIFFERENTIABLE PATHS ARE GOOD
>>SEQUENTIAL STRAIGHT LINE SEGMENTS ARE EVIL
>>I don't like this system because it basically is a
>>heading command system.
> Interesting to keep your writing for later rereads, as I'm not that
> deep into the matter yet. :)
Well, it really was just catharsis for a couple hundred thousand
dollars of I Told You So. I feel so much better now ;)
If you have a desired path and you can determine that you are
2 meters to the left of it, your crosstrackError is -2 m.
lateral acceleration =
-(crosstrackError * Kp + crosstrackRate * Kd)
The above is a simple "Proportional Derivative" controller.
The Kp is the proportional gain and Kd the derivative gain.
the Kp acts like a spring and the Kd gives damping.
With a gain of Kp = 2, you would have decided to command
4 m/s^2 (approx half a G) of lateral acceleration to the right.
As you start gaining positive crosstrack rate,
it starts to reduce the command to keep you from
overshooting.
When the controller is in the loop with the dynamics,
the overall system will then have some natural frequency and
damping just like a spring mass damper. The values of the
two gains let you adjust the natural frequency and
damping in crosstrack.
If you assume small angles (pointed almost downtrack),
crosstrackAcceleration is your cars lateral acceleration.
You could build a little simulator and try it out and
look for good gains. There is a straight
forward method to solve for gain values for a simple system
like this that would provide particular frequency and
damping ratio but it would take some study in control
system design to get up to speed on how to do it.
But with this simple a system,
Assuming your vehicle reacts instantly,
the differential equation with the controller is:
X_dotdot = -( Kd X_dot + Kp X)
or:
X_dotdot + Kd X_dot + Kp X = 0
which should be familiar as the same as that for
a spring mass damper system. You can determine
your gains for particular damping and frequency
by inspection:
Kp = omega^2, Kd = 2 zeta omega
If the gains are too high such that the
commanded acceleration is higher than your
capability then that is a clue that you are trying to
make the vehicle respond faster than is possible.
that is "saturation" - the acceleration is at
max and it isn't enough. Hitting that limit is
a non-linearity and the linear analysis theory
breaks at that point (and so does your car ;)
If you know you are trying to follow a circle
that takes 8 m/s^2 of acceleration to follow perfectly,
then you can change the controller to:
lateral acceleration =
-(crosstrackError * Kp + crosstrackRate * Kd)
+ feedForwardAcceleration
with feedForwardAcceleration = 8 m/s^2
Using the feedforward means the controller doesn't
wait until crosstrack and crosstrack rate errors build up
before commanding acceleration to correct them.
You can start commanding instantly. This would help keep
you from sliding wide at the start of a turn.
Of course when turning near your max capability,
you have very little capability left to edge
closer in toward the apex. So that is why it is very
useful to use the feed forward. It lets you follow the
rough shape of the curve and lets smaller gains handle
disturbances from it hoping you don't saturate.
That's a crosstrack controller.
But it starts with a particular desired path to follow.
If you know exactly where you want to be, you can then
try to get there ;).
- Matt