<<

Lateral Prevention, Detection, and Recovery for High-Speed Autonomous Off-Road Driving

Thesis by: Haomiao Huang

In Partial Fulfillment of the Requirements For the Degree of Bachelor of Science

California Institute of Technology Pasadena, California

2005

2

Acknowledgments

I would like to thank Dr. Richard Murray for his patient guidance throughout this project, without which I would have been utterly lost. I would also like to thank Ole Balling of STI for providing me with the physics of how a car drives. I want to thank Lars Cremean for reading this thesis, and providing me with valuable feedback. I wish to thank the entire Caltech DARPA Grand Challenge team. Without their hard work on Alice and Bob, I would have no data to study and no research to do. Finally, I want to give a big shout out to Robbie Grogan, Laura Lindzey, and Jeff Lamb, who used their own precious spare time to see that I got to go out to the desert and take data, and then put up with my endless requests for “let’s do that one more time”. Thanks, guys!

Haomiao Huang May 18th, 2005

3

Abstract Driving off paved roads presents many difficulties and challenges, and one of the chief among these is lateral wheel slip. Lateral slip is constantly present when driving off-road, but during sharp turns or over surfaces such as gravel or sand high slip can lead to sideways drift or even spinning the vehicle. Just as human drivers must be taught to handle sideslip, an autonomous controller for an off-road robot must also be designed with such conditions in mind. This paper presents an analysis of the conditions leading to high lateral slip and simulation results of a controller designed to minimize slip and prevent spinning out. Recorded data from an off-highway vehicle sliding under human control is also presented and analyzed.

4

Table of Contents 1 Introduction...... 7 1.1 Definition of Terms...... 7 1.2 Slide Prevention...... 7 1.3 Detecting Lateral Slip and Sliding...... 8 1.4 Recovery from Sliding...... 8 2 Background...... 9 2.1 & Modeling ...... 9 2.2 Sliding & Off-Road Driving ...... 14 3 Slide Detection...... 17 3.1 Measurement of Wheel Slip Angles ...... 17 3.2 Human Controlled Driving Data & Results...... 17 3.2.1 Test Platform: Alice...... 17 3.2.2 Test Data & Analysis...... 18 4 Slide Prevention...... 32 4.1 Trajectory Generation for Slip Prevention...... 32 4.2 Throttle Control for Slip Prevention – Future Work ...... 34 5 Recovery from Sliding...... 35 5.1 PID Path Controller...... 35 5.2 Simulation of a Skid Controller ...... 36 6 Conclusions & Future Work...... 40 7 References...... 41

5

Table of Figures Figure 1. Vehicle coordinate frame and variable definitions...... 9 Figure 2. Vehicle dynamics diagram for dynamic bicycle model including forces... 10 Figure 5. Steering model verification on prior DGC Vehicle...... 14 Figure 6. Simple slide during turn...... 14 Figure 7. Wheel velocity vectors demonstration...... 15 Figure 8. Spinning or fishtail slide, coming out of turn...... 15 Figure 9. Maxing out friction circle...... 15 Figure 10. Alice ...... 18 Figure 11. Path of a single human driven turn used for data analysis ...... 19 Figure 12. Rear slip angles of all sliding and non-sliding turns superimposed ...... 19 Figure 13. Slip angles and steering from a single sliding turn...... 20 Figure 14. Slip angles and steering from a single non-sliding turn ...... 20 Figure 15. Body slip angles shown for a non-sliding turn...... 21 Figure 16. Body slip angles for a sliding turn...... 22 Figure 17. Rate of change of body slip angles for non-sliding turn...... 23 Figure 18. Rate of change of body slip angles for a sliding turn...... 23 Figure 19. Yaw deviation of a non-sliding turn...... 24 Figure 20. Yaw deviation of a sliding turn...... 25 Figure 21. Gaussian classifier...... 26 Figure 22. Gaussian representation of yaw deviation training data...... 27 Figure 23. Selection criteria on yaw deviation...... 28 Figure 24. Yaw deviation for a non-sliding turn...... 29 Figure 25. Yaw deviation and classification for a sliding turn...... 29 Figure 26. Another sliding turn...... 30 Figure 27. Max sideslip angle for a range of lateral accelerations ...... 32 Figure 28. Max sideslip for range of accelerations at lower friction...... 33 Figure 29. Simulated run over a path at high speed...... 33 Figure 30. Same path as previous, but at a lower speed to reduce lateral acceleration. .. 34 Figure 31. Lateral error of PID controller with vehicle running on asphalt ...... 36 Figure 32. Simulated turn without counter-steering controller...... 37 Figure 34. Simulated turn with counter-steering...... 38 Figure 35. Errors for turn with counter steering...... 39

6

1 Introduction Unwanted lateral motion is an important consideration when driving a car off road. Several kinds of conditions can occur, from a full 4-wheel slide (when the vehicle slides physically sideways) to over-steer-induced spinout, where the back wheels move sideways at a much higher speed than the front wheels, causing the vehicle to spin. Sliding occurs when the vehicle’s no longer grip the ground with sufficient force to prevent lateral motion. Such sliding usually occurs when high vehicle speeds are combined with a low surface coefficient of friction. A high frictional force is required to provide the lateral acceleration needed to corner at high speeds, and when tire forces are saturated the vehicle begins to slip sideways. The slide can also be caused by hitting a bump which lifts the vehicle’s tires off the ground, causing them to skid sideways. This can cause the vehicle to deviate substantially from a steered path or even spin out. These conditions can also give rise to high lateral velocities (at an angle perpendicular to the vehicle’s heading), causing tripped rollovers when the vehicle’s wheels hit an object such as a rock or a curb. These considerations are all common in off-road driving. Driving on dirt, gravel, and similar surfaces give a much lower coefficient of friction, thus reducing the amount of the tires can provide. There are bumps and dips in the road which can kick the wheels into a skid. Driving off-road also brings the vehicle in close proximity to rocks and other obstacles which can be avoided in normal driving but are highly dangerous if the vehicle spins or slides into them. The DARPA Grand Challenge, an off-road autonomous vehicle race, provides a unique opportunity to explore the problem of lateral slip. The race requires the vehicle to traverse desert terrain at high speeds, conditions under which sideslip is certain to be encountered. Since the steering characteristics of a vehicle with and without slip are very different, any steering control must both attempt to minimize lateral slip and adjust for it when it occurs. In the past, most slip control has been designed for vehicles operating on asphalt roads, thus implying either higher friction and/or the absence of significant terrain roughness and variations in surface friction [1]. These controllers typically assume small slip angles, and would be incapable of handling slip that arises from bumps lifting the vehicle off the ground [1][2]. Thus a new control system must be designed that both attempts to minimize slip a priori and recover from high-slip conditions.

The contributions of this thesis are threefold: 1. Presents a metric for determining whether the vehicle is sliding 2. Simulated results for constraints on trajectory generation to minimize sliding 3. Simulated results for a controller to recover from sliding

1.1 Definition of Terms It is important to make a distinction here between the terms slide and slip. Throughout this paper, sliding will refer to the undesired state where the vehicle is deviating from normal driving behavior, while slip will refer to the angular deviation between a vehicle or tire’s orientation and its velocity vector.

1.2 Slide Prevention The first goal of the project presented by this thesis is to give conditions on trajectory generation and control in such a way as to prevent sliding when driving under nominal conditions. In order to do this, several tasks must be accomplished: • Analyze and quantify the conditions under which sideslip occurs

7 • Set limits on the trajectories generated via a purely kinematic model of the vehicle such that the controller-vehicle system will not slip assuming flat ground.

1.3 Detecting Lateral Slip and Sliding Since prevention of sliding may not be always possible, it is also important to be able to detect when and how the vehicle is sliding. In order to do this, we must: • Be able to measure vehicle wheel and body slip angles • Find a measure that predicts or indicates sliding

1.4 Recovery from Sliding Finally, when sliding is inevitable, a controller must be designed to safely take the vehicle out of a slide. This will require us to: • Investigate the dynamics of the vehicle at high slip angles • Construct a model of the vehicle’s behavior at high slip angles • Be able to detect sideslip and obtain the slip angles at each wheel • Design a controller that brings the vehicle through the slip in a controlled fashion and back onto the trajectory

8 2 Background In order to perform control and analysis of a vehicle during sliding conditions, it is first necessary to understand the dynamics of a sliding vehicle. To that end, we will need to set up a mathematical model of a ground vehicle, and also investigate the behavior of actual ground vehicles being driven in desert terrain. This chapter will present the vehicle model used in the analysis of this thesis, and also present qualitative analysis of off-road driving.

2.1 Vehicle Dynamics & Modeling Since we are interested primarily in the dynamics of sliding, we will examine only the planar dynamics. In investigating the behavior of ground vehicles, the simplest model is the kinematic bicycle model. The global reference frame defined here is one commonly used in the vehicle dynamics literature [3]: q: yaw (measured clockwise from north) x: north y: east z: positive down (not used in our planar analysis) f: steering angle (positive right, from vehicle center)

x Θ

y φ

Figure 1. Vehicle coordinate frame and variable definitions

In the kinematic bicycle model, we abstract the vehicle as a bicycle: one forward wheel and one rear wheel. The equations of motion for the center of the front axle are

x† = Vcos q+f y† = Vsin q+f † V q = sinHf L L H L

9 where V is the vehicle speed and L the wheelbase (front axle to rear). The steering angle φ can be considered an input to the system, or its dynamics can be separately modeled. Due to the steering motor we use, we choose to model the steering dynamics as a first-order lag

f =−αφ+αu where u is the commanded steering angle and α is the time constant.

The kinematic model is the ideal manner in which we would like the vehicle to perform, and is accurate at low velocities or small steering angles. However, the kinematic model is clearly inadequate for investigating t he dynamics we are interested in, as the model explicitly assumes no lateral slip. The forward dynamics also need to be explicitly modeled. Thus, we require a model which explicitly contains the dynamics of sliding, which requires modeling the forces in the interaction of the tire with the ground.

We begin once again with a bicycle model, since we are concerned only with the planar dynamics of the vehicle:

x θ V y αr θ αf

Flonr Vlon Flatf φ Flatr Vlat Flonf Lr Lf

Figure 2. Vehicle dynamics diagram for dynamic bicycle model including tire forces

Where

Flatf = forward tire lateral force Flatr = rear tire lateral force Flonf = forward tire longitudinal force Flonr = longitudinal tire forces Vlat = lateral velocity of c.g. Vlon = longitudinal velocity of c.g. Lf = distance from front axle to c.g. Lr = distance from rear axle to c.g. θ = yaw rate

φ = steering angle

Neglecting air friction, these four forces dictate the dynamics of the car [ thesis paper]:

10 .. L F cos φ + L F sin φ − L F θ = f latf f lonf r latr I Flonf sin φ+Flatf cos φ+Flatr Vlat = + Vlon θ H m L Flonf cos φ−Flatf sin φ+Flonr Vlon = − Vlat θ H m L x = Vlon cos θ−Vlat sin θ H L y = Vlon sin θ+Vlat cos θ θ =θ

The generation of these tire forces deserves some consideration. Rolling tires develop lateral force based on several factors: , sideslip angle, and normal load (STI 1). Camber (the angle of the tire off vertical) is not considered, since unlike vehicles such as bicycles cars do not typically lean to turn. Sideslip angle is defined as the difference between the longitudinal direction of the tire and the velocity vector of the tire. We calculate the slip angles as follows [3]: θ − −1 Lf Vlat αf =φ − Tan Vlon θ − −1 Lr I Vlat M αr = Tan Vlon Typically, the cornering force (lateral force exerted by a tire) is linear with respect to at small angles, but eventually saturates at a peakI lateral force,M and decreases with further increases in slip angle until it reaches a minimum at 90 degrees slip. The slope of the cornering force and the peak cornering force are also related to the normal loading of the tire and the coefficient of surface friction [7]. Cornering Force as a Function of Slip Angle

F

Fz

a

Figure 3. Representative diagram of tire forces based on slip.

The exact nature of the tire-ground interface is not modeled, but a function can be empirically fit to measured tire data. The Magic Formula Tire Model is an empirical formulation

11 for the tire force profile dictated by five parameters which are found by experimental measurement [4]. The cornering force is defined as

−1 −1 Fy = Dsin CTan B α− E B α−Tan B α

The magnitude of the total force exerted by the tire on the ground cannot exceed total frictional force the tire can apply against theI surface.I Thus the forcesI from bothH lateralLMMM and longitudinal tire forces are projected onto the boundary of a circle defined by the maximum achievable friction force. In reality, the frictional limit is an ellipse, as the frictional properties of a tire are different in the longitudinal and lateral directions [3].

Friction Circle Concept Illustration

Nominal forces Actual forces

Figure 4. Friction circle concept illustration.

The longitudinal dynamics are modeled semi-statically, after STI's vDANL. The torque and drag from the engine is modeled as a quadratic function of the engine RPM [5].

2 T = Kf1 + Kf2 ω + Kf3 ω 2 D = Kd1 + Kd2 ω + Kd3 ω

The throttle then regulates between these forces in the following manner:

Teff = 1 −τ D +τT where Teff is the effective torque output and t is the throttle setting. The K constants are empirically measured constants which determineH theL shape of the parabolas. Most vehicles have a nonlinearity in the throttle that is modeled by the following equation:

K −Kt1 τ t2 τ' = 1 − e

12 where the K constants are again empirically measured.

This then defines the output torque of the engine, which is fed through the following gear ratios. The ratio of the wheel speed to the engine shaft speed

Re = Rtorque converter ∗ Rtransmission ∗ Rdifferential ∗ Rtransfer case where R_ denotes the gear ratio of t hat part, and the engine rpm can be estimated by the wheel speed by

V ωwheel = rwheel ωengine =ωwheel ∗ Re where rwheel is the wheel radius, and V is the velocity of the wheel (assuming no longitudinal slippage). The effective engine torque can then be calculated, and we get the force from the engine at the wheels by

Twheel = Teff ∗ Re Fwheel = Twheel ∗ rwheel

These equations now give us a complete description of the planar dynamics of the vehicle. For the purposes of this paper, a MATLAB model was created using these equations of motion. This model was verified using vehicle constants and state measurements from the 2004 DGC vehicle (Figure 5). The vehicle data for the current vehicle were taken from STI’s measurements of a 1996 Ford Club Wagon. Unfortunately, these measurements may not be completely accurate for the vehicle tested in this paper. Alice, our vehicle, has a diesel engine, whereas the parameters given were for a gasoline engine. The locations of c.g. and other measurements may also be slightly off. However, any errors present are mostly errors of scale, and while they may affect the accuracy of the numerical measurements and calculations they should not affect any of the qualitative results.

13

Figure 5. Steering model verification on prior DGC Vehicle.

2.2 Sliding & Off-Road Driving The shape of the tire force profile and the bicycle model give us a simple illustration of how and why a vehicle slides. A vehicle begins to slide when the lateral force hits its peak. During a continuous turn, as the vehicle continues to rotate, further increase in the slide angle does not give a correspondingly increasing cornering force. The vehicle begins to slide outwards, as shown in Figure 6. Such a turn tends to be fairly stable, as the front and rear tire forces are similar in magnitude and thus the vehicle does not go out of control. Many drivers will have experienced such a turn taking a corner too sharply or on a wet road. The tires can be heard squealing slightly, but there are otherwise no deleterious effects. Cornering Force as a Function of Slip Angle Vehicle sliding outwards F

Wheel velocity vector a Figure 6. Simple slide during turn. Front and rear tire forces are saturated.

A somewhat more dangerous situation arises when coming out of the turn. Since the vehicle is rotating during the turn, the forward wheel velocity vector and the rear wheel velocity vector are not aligned (Figure 7).

14 Pure Rotation Rotation With Forward Velocity

Wheel velocity vector Body velocity vector Figure 7. Wheel velocity vectors demonstration.

As the vehicle comes out of the turn, the front wheel, which is steered, begins to align with its velocity vector, thus causing its slip angle to move towards the peak of the tire force function (see Figure 8). This results in a much higher forward lateral force than rear, thus causing the vehicle to spin as it rotates. Such an effect is what causes fishtailing. Cornering Force as a Function of Slip Angle Vehicle spins as it slides F

Wheel velocity vector a Figure 8. Spinning or fishtail slide, coming out of turn. Since front wheel is steered, slip angle is much less, so force is greater.

A situation that can farther exacerbate the effect is the use of throttle during the turn. The use of throttle causes the rear tire to max out on the friction circle, hence further lowering the amount of lateral force the wheels can deliver (Figure 9). If there is an bias in the power-train towards the rear wheels, as there often is in large vehicles, the rear wheels will attempt to deliver more forward force, hence maxing out the friction circle faster. This can exacerbate the imbalance in forward and rear lateral forces coming out of a turn. This is why vehicles may spin out if throttle is applied during a turn. Friction Circle Cornering Force as a Function of Slip Angle

Nominal forces Actual forces a

Figure 9. Maxing out friction circle.

15

There are several ways that off-road driving exacerbates sliding. First, because the coefficient of friction tends to be much lower on dirt and gravel surfaces, the maximum lateral force that can be generated by the tires is much lower. A hard turn will quickly max out the lateral forces and take the car into a spin, since the wheels cannot generate the force required to hold the car in a steady turn. We will call this geometrically induced sliding, since the sliding is caused by turning too hard in order to follow some path geometry at a certain speed.

Secondly, the lower frictional force corresponds to a smaller friction circle, so the likelihood of maxing out the friction circle by use of the throttle is higher as well. We will call this a throttle-induced slide. This sort of sliding and geometric sliding can be simulated and accounted for in our dynamic model, and we will develop techniques for preventing such slip.

Third and perhaps most difficult to deal with is terrain-induced sliding. Obviously, off- road terrain is not flat, nor is the material being driven over always homogeneous. Sudden transitions from one surface to another during a turn, for example driving over a sandy corner while taking a turn, can cause the wheel lateral forces to suddenly max out. Bumps and imperfections in the terrain can also reduce the wheels’ contact surface with the ground, thus effectively lowering the surface of friction at higher speeds as the wheels “skip” over the ground and do not retain contact long enough to generate sufficient cornering forces. Slope of the ground can also significantly change the normal loading of the tires, which will significantly change the lateral force characteristics. These effects, while important, are difficult to model, and are therefore not considered in this thesis. Instead, we will focus on recovering from a slide after it occurs to deal with these issues.

During testing in the desert, the 2005 Caltech DARPA Grand Challenge vehicle, Alice, encountered a combination of all of these issues. While taking a sharp corner, Alice cut across a small sandy berm in the dirt road. This caused her to slow, so the controller increased throttle. The rear wheels, which were now raised on the sandy berm, now spun out, sending Alice into a fish-tailing near-spin. The steering controller (simple PID, to be discussed later) was able to keep Alice from going into a spin by steering back towards the proper heading, but because it was not designed with sliding in mind sent Alice off the side of the road. These issues will be addressed in the remainder of this thesis.

16 3 Slide Detection It is important to establish a metric for determining whether or not sliding is occurring or has occurred. The slip angles, which are determined by the angle of the velocity of a wheel with respect to its centerline, are one potential measure to determine sliding. When the slip angle increases to the point where the lateral force saturates, the vehicle begins to skid. However, this requires a certain amount of knowledge about the force profile and the parameters of the Pacejka function for the specific combination of tire and wheel, which is not always available. A possibly better metric is to measure the difference between the actual steering behavior of the vehicle versus the expected behavior under kinematic conditions.

3.1 Measurement of Wheel Slip Angles With the full state (position, orientation, and first two derivatives of each) of the front axle being measured, it is relatively simple to calculate the slip angles at the front and rear wheels from the velocities measured. From the equations of motion developed above, the states of the front axle are related to the states of the vehicle c.g. by the following equations:

xf = Vlon cos θ− Vlat + Lf θ sin θ yf = Vlon sin θ+ Vlat + Lf θ cos θ where xf and yf are the velocities of the center ofI the forward axle.M By solving these equations out for Vlon and Vlat we get I M

Vlon = xf cos θ+yf sin θ Vlat =−Lf θ + yf cos θ−xf sin θ thus allowing us to calculate the wheel slip angles

θ − −1 Lf Vlat αf =φ − Tan Vlon θ − −1 Lr I Vlat M αr = Tan Vlon 3.2 Human Controlled DrivingI Data & ResultsM Since a human driver is as yet the best controller for off-road vehicles, it is instructive to observe a vehicle under human control to see how a driver deals with sliding. The structure of human control may give us insight into how we should control an autonomous vehicle in similar situations. Moreover, such data gathering gives us valuable insight into the behavior of a vehicle under real-world, rough-terrain conditions that are not modeled by the bicycle model we are using. Data so collected can also help to verify our assumptions and ideas about how a vehicle behaves during a slide.

3.2.1 Test Platform: Alice The 2005 Caltech DARPA Grand Challenge vehicle was used for off-road testing and data-logging. Alice is a 2005 Ford E350 van modified for off-road driving (Figure 10). Alice is equipped with high-precision GPS and IMU units for state estimation. The GPS is a Navcom SF- 2050G which utilizes differential updates through the Starfire system to provide positioning at

17 sub-meter accuracy. The IMU is a Northrop Grumman LN-200 unit which provides integrated delta-theta and delta-v information at 400 Hz. The data from each sensor is fused using a Kalman Filter which provides full 6-DOF state estimation at 40 Hz to very high accuracy. Autonomous steering of Alice is implemented using a servo motor whose position encoder can be read during human driving to give the position of the steering wheel. Unfortunately, due to the limitations of the serial interface used by this particular motor the steering position can only be read at 3 Hz. The position of the steering wheel is assumed to be linearly related to the physical steering angle of the front wheels, and Ackermann steering is not accounted for. Brake position could also be recorded during human operation, but throttle position could only be logged during autonomous operation. No odometry was available, so longitudinal wheel slip could not be measured.

Figure 10. Alice

3.2.2 Test Data & Analysis A series of off-road driving tests were performed using Alice. She was operated by a human driver and taken through a repeated set of sharp turns around a corner on dirt at Stoddard Wells in Southern California. For each corner, two sets of runs were logged. During the first run, Alice was brought up to speed and then allowed to coast through the turn with little or no throttle/brake input. The second set of turns involved deliberately putting Alice into a slide. The driver would step on the gas through the final section of the turn, break , and start the vehicle sliding. Then he would counter-steer to bring the vehicle out of the slide. The vehicle was kept on the dirt path at all times. Figure 11 shows a picture of one of these turns.

18

Figure 11. Path of a single human driven turn used for data analysis

3.2.2.1 Wheel Slip Angles The state data logged from the tests was used to calculate the slip angles at the front and rear. Figure 12 shows the rear wheel slip angles for all turns superimposed, including both sliding and non-sliding portions of the turns with sliding. The results from two of the runs are shown in Figure 13 and Figure 14, one for a sliding turn with counter steer and one for a normal turn, with steering angles to give an idea of how the turn progressed.

Figure 12. Rear slip angles of all sliding and non-sliding turns superimposed

19

Figure 13. Slip angles and steering from a single sliding turn

Figure 14. Slip angles and steering from a single non-sliding turn

Figure 12 shows that the magnitude of the slip angles tends to peak higher for the sliding turns. However, this is not necessarily a good indicator for entry into sliding. Figure 13 and Figure 14 have similar magnitude of slip angles, but one is a sliding turn and the other is not. This is because stepping on the gas reduces the amount of lateral force the tire can apply, as per the friction circle. Since path geometry and speed are not the primary causes of this slippage, wheel slip angle is not a good indicator of sliding.

20 Since the steering angle data is low rate and somewhat high latency, it is desirable to perform some analysis with only the higher data rate state data. Instead of generating the tire slip angles, the body slip angles, defined as θ − −1 Lf Vlat βf =−Tan Vlon θ − −1 LIr Vlat M βr = Tan Vlon are calculated using solely the state data. Note that these are essentially the same as the wheel slip angles, but do not take into account the steeringI angle. ThisM gives a picture of the relative motions of the front and rear axles with respect to the centerline of the vehicle, and it can be seen that the profile of the two slip angles in sliding versus non-sliding turns is rather different. The plots of the same two turns from above are shown.

Figure 15. Body slip angles shown for a non-sliding turn. Note smooth end to turn.

21

Figure 16. Body slip angles for a sliding turn. Note how the two angles cross each other sharply instead of coming together smoothly as in the prior figure.

The cross-over point where the rear slip angle passes the front slip angle is clearly evident on the turns requiring counter-steer, and to the human eye at least the sliding turn is easily distinguishable from the non-sliding one.

Unfortunately, it is not so clear whether the profile of the slip angles seen here are the result of the sliding process or of the counter-steering that the human is putting in. It maybe that this profile is only seen when the human is already deliberately turning the wheel hard in the other direction. Moreover, while this metric is a good indicator of a sliding turn, it does not work so well as a predictor. The graphs above clearly show that this sharp crossover accompanies the end of the turn, when the driver is already beginning to come out of the turn, so it is not necessarily useful as an indicator of when the vehicle is starting to slide.

On initial inspection, it seems that the rate of change of the slip angles may be of interest, since the rate of change of the difference between the two slip angles d γ= βf −βr dt will dictate how the two slip angles cross each other. H L

22

Figure 17. Rate of change of body slip angles for non-sliding turn.

Figure 18. Rate of change of body slip angles for a sliding turn. Note smooth peaking around 18 s, indicating end of turn.

Figure 17 and Figure 18 show a clear peak that corresponds to the crossover point of the wheel slip angles. Once again, however, the peak corresponds to a point where counter- steering has already begun, so it is not useful as a predictor. There is also a very large amount of noise in the data. Some filtering should be done to see if the data is useful

23 3.2.2.2 Yaw Rate Analysis A more intuitive metric of deciding when the car is sliding is to measure the deviation of the actual yaw rate for a given steering angle from the expected kinematic yaw rate. The kinematic behavior is roughly what a driver would expect to see driving under ideal conditions with no sliding, so substantial deviation from this behavior would be indicate that the vehicle is sliding or otherwise not driving normally.

The kinematic equations define the expected yaw rate as

† V q = sin f L and so the deviation from the expected yaw rate is

V Dq= sinf-qmeasured L

The plots generated below are for the two turns we saw above.

Figure 19. Yaw deviation of a non-sliding turn. Note magnitude of the deviation.

24

Figure 20. Yaw deviation of a sliding turn. Note that magnitude of the yaw deviation is much higher than in Figure 19.

The difference of the two rates is used, rather than a ratio, because at small steering angles the numbers on a denominator would get fairly close to zero, so noise would cause any ratio to blow up. It is clear, even to the human eye, that the deviations from kinematic expectation are much higher during the sliding turns than during non-sliding turns.

3.2.2.3 Gaussian Classification Since there seems to be a marked difference in the magnitude of yaw rate deviation between sliding and non-sliding turns, it seems likely that some sort of probabilistic classifier can be used to determine the sliding state based on the yaw rate deviation. The problem we are solving is ideally suited for a class of classifier known as a Gaussian classifier.

In this classification problem, we assume that the object (or state) being classified belongs to a finite set {w} of known states. Assuming some set of sensors, taking a measurement during each state wk will give a mapping

M wk = zk

The classifier attempts to find a mapping H L −1 M zk = wk so that given some measurement vector zi we can identify which state wi this measurement was most likely taken in. H L

The Gaussian classifier assumes that the distribution of zk is gaussian with vector mean mk and covariance matrix Ck corresponding to each wk. The distributions are obtained from either prior analysis or a learning set. This information is used to set optimal thresholds for the

25 classifier. Measurements z on one side of the threshold belong to one set, and on the other side of the threshold belong to another, and so forth [6]. Distribution of Measurements Gaussian Classification in Measurement Space Boundary

z2 z2 C1 C1

C2 C2

m1 m1 m2 m2

z1 z1

Figure 21. Gaussian classifier

Mathematically, the Gaussian classifier makes a takes a measurement vector z, assumed to belong to some class wi ∈{w} and classifies it according to

w z = wi T T i = argmax vk1 + z vk2 + z vk3 z k=1,....,K H L T −1 vk1 =−ln Ck +2 ln P wk −μk Ck μk −1 9 = vk2 = 2Ck μk =− −1 vk3 Ck … … … H L… where Ck and mk are the covariance matrix and expectation vector, respectively, of the learning set of wk [6]. Since we have no information about the prior probability P(wk) for sliding and non- sliding, we assign them equal probability, so the constant offset for vk1 is equal for all sets. In this case, where there are only two classes and z is a one-dimensional vector, the classifier is simply finding an optimal threshold y, with one class corresponding to z < y and the other corresponding to z > y. The determination for z = y is essentially a coin toss, so in this case we will assign z = y to the non-sliding set.

The classifier was trained using half of the data obtained from the turning tests. There were a total of eight non-sliding, twelve sliding, and five slight sliding (labels determined by the human operators on the spot) turns. Four non-sliding and six sliding turns were used to train the classifier. Each sliding turn was segmented out into a sliding and non-sliding portion. The sliding portion was considered to be the final portion of the turn, where the human driver was known to have deliberately put the vehicle into a slide. Unfortunately, since we cannot objectively measure sliding, the “sliding” training set will invariably have some portions where the vehicle is not sliding, and the “non-sliding” training set will include sections where the vehicle might have been sliding, such as early in the turn. Nonetheless, the balance of each set will be correct, and the performance of the classifier so generated should be minimally affected.

26 The results of the analysis are summarized in Table 1. It is clear that even with the errors and noise introduced by lack of precision in the training set there is a very clear difference in the mean and variance of the yaw rate deviations. As we would expect, there is clearly a much higher rate deviation for the sliding turns, which indicates that a classifier based on thresholding of the rate deviation would give good results.

Table 1. Summary of Analysis of Yaw Rate Deviations Mean of yaw rate Variance of yaw rate Threshold deviation deviation Sliding 0.1772 0.0272 0.0519 Non-Sliding 0.0181 0.00021

Sliding Non-sliding

Figure 22. Gaussian representation of yaw deviation training data.

27 w1 w2

Figure 23. Selection criteria on yaw deviation. Point where the two curves cross is where the yaw deviation goes from non-sliding to sliding.

The classifier so developed was able to correctly identify the presence of sliding for all sliding turns on the testing set, which consisted of the remaining turn data. However, it also found sliding during all of the turns determined to be non-sliding by the human operators. Since there is no objective analytical method or measurement to determine sliding without knowing the tire properties on the terrain being driven over, there is no objective, quantitative way of evaluating the performance of the classifier. The miss-classification of non-sliding portions as sliding may be a result of error in the classifier, or they may

Figure 24 and Figure 25 show the results of the detection as performed on the turns we have been analyzing. The steering input is included not for comparison purposes, but to give structure to the timing of the turns. The classifier was able to pick out the entry into the sliding turn before the human driver’s counter-steering action, but it also picks out as sliding earlier sections of the turn. Sections of the non-sliding turn are also identified as being sliding. This miss-classification may be a result of classifier error, or they may represent sections of sliding which were not long enough or strong enough to be picked up by the human riders. This is a possibility because the “miss-classifications” tend to occur during the sharpest parts of the turns (where the steering angles peak).

28

Figure 24. Yaw deviation for a non-sliding turn. Note the sliding indicator indicates slipping towards the end.

Figure 25. Yaw deviation and classification for a sliding turn. Note that the sliding indicator goes to one for those portions identified as sliding.

29

Figure 26. Another sliding turn. This one is much cleaner and the classification is much clearer.

3.3 Conclusions and Future Work for Slide Detection The slip angle analysis is intriguing but so far inconclusive. The combination of the slip angle analysis and the yaw rate deviation may be used to develop a controller. It would be instructive to attempt to reconstruct a transfer function or some other representation of the relationship between the human steering position and the lateral and heading error relative to the centerline of the road. This could help the development of a controller that effectively minimizes lateral sliding.

The yaw rate deviation has shown itself to be a clear qualitative indicator of sliding, but the false positives in the non-sliding turns show that the exact value of the threshold is quite likely to be inaccurate. In addition, because data from only one corner was analyzed, it is likely that there are differences in numerical scaling which will show up going around different bends. The threshold calculated for this particular turn may not be an accurate predictor for sliding when driving around different turns on different terrain. A larger learning set is needed to give a clearer picture of how reliable a particular numerical threshold is, and also where to set that threshold.

The Gaussian classifier is limited in that it assumes the distribution of the measurement vector is Gaussian. This assumption is acceptable for a proof-of-concept in showing that yaw rate deviation is important, but may not correspond to the actual distribution of the rate deviation. Different classifiers, either using different probabilistic models for the measurement vectors or using non-parametric methods to characterize the measurement vectors, may give better results.

From a control standpoint, the controller should react differently to a vehicle that is sliding versus a vehicle that isn’t. The simplest way to approach this would be gain-scheduling, with different gains for the sliding versus non-sliding mode. This approach assumes that the estimation of sliding versus non-sliding to be accurate. An alternative to the simple binary threshold of sliding versus non-sliding would be a parameter that varies continuously rather than

30 discretely to determine how much the vehicle is sliding, and gain-scheduling or controlling around this continuous variable.

31 4 Slide Prevention Since sliding is inherently a very dangerous state to be in, the preferred way to deal with sliding when it concerns a half-million dollar vehicle such as Alice is to not slide at all. With this in mind, we can attempt to minimize slipping and sliding in two ways. The first way is to generate trajectories for the vehicle to follow which will not induce sliding through path geometry. The second would be to attempt to control the throttle to prevent throttle-induced sliding from spinning the wheels out. 4.1 Trajectory Generation for Slip Prevention In the Caltech DGC project, trajectories are generated using the kinematic model. The kinematic lateral acceleration is alat = Vθ This centripetal acceleration around curves must be provided by the tires, so in order for the vehicle to not slide this acceleration cannot exceed the cornering acceleration provided by the tires at maximum lateral force. Intuitively, since the maximum lateral force that the tires can provide is the maximum frictional force Ffriction =μmg then the maximum lateral acceleration should be amax =μg The intuitive approach is somewhat borne out by simulation. A series of curves was generated using the kinematic model, each of increasing lateral acceleration. The vehicle model was driven along these paths by the PID controller (to be discussed in section 5) with a range of frictional values. The maximum slip angle for each path is shown in the following plot.

Figure 27. Max sideslip angle for a range of lateral accelerations

32

Figure 28. Max sideslip for range of accelerations at lower friction. Note that sideslip increases much quicker than in prior figure.

We see that our intuition about the lateral accelerations is approximately correct. Thus, if path geometry is more or less dictated by obstacles or the necessity to stay on a road, then by setting an appropriate speed for the curve we can prevent sliding. Figure 29 and Figure 30 were generated by running the vehicle model and simple PID controller on a path generated by the DGC path generator. The initial path was generated by only attempting to satisfy a rollover constraint. This is clearly insufficient, as on lower friction surfaces such as dirt roads the vehicle slides before it rolls. Figure 30, showing the path with the speed set lower to meet the lateral acceleration constraints for sliding, shows much better performance.

Figure 29. Simulated run over a path at high speed. Note the high deviation due to vehicle spinning out.

33

Figure 30. Same path as previous, but at a lower speed to reduce lateral acceleration. Path following is now much better.

4.2 Throttle Control for Slip Prevention – Future Work The other way to prevent sliding is to prevent loss of traction by exceeding the limits of the friction circle. A limit can be set on the throttle so that the longitudinal force exerted by the engine does not cause the total force to exceed the friction circle. Since the exact characteristics of the engine and terrain are unknown, this would be best done in a feedback manner through odometry. The throttle would be controlled to minimize longitudinal slip as well as velocity error, thus helping to prevent the wheels from breaking traction.

If the coefficients of friction and mapping of throttle setting to wheel force is approximately known, then a prior limit on throttle can be calculated based on the curvature of the path such that the longitudinal force will not cause the lateral force to hit the frictional limit. These schemes have not yet been tested experimentally or in simulation, but throttle control in human driving is a key part of avoiding sliding, so I expect that these techniques, once implemented, will help autonomous driving as well.

34 5 Recovery from Sliding

However hard we try to prevent sliding, there are almost certain to be times when sliding will occur, whether it comes from suddenly running into a patch of sand on a turn or hitting a bump. In those circumstances, the controller must capable of acting in an appropriate way to guide the vehicle out of the skid without deviating too far from the path.

5.1 PID Path Controller The controller designed for Alice is a simple PID controller which attempts to simultaneously minimize the lateral and heading deviation from a defined path. The error value

e =αye + 1 −α β θe where ye is the lateral error from the path and qe is the heading error. The constants alpha and beta are used as weightings for the errors. Beta His chosenL such that the heading which causes no change in steering is p/2 at a distance ymax from the track line:

α y β= max π 1−α 2

Controlling around this error value using the control law H L de φ=φ0 + Kp e + Kd + Ki e t dt where f0 is the kinematically derived feed-forward steering value needed to follow the curve gives a globally stable controller for following the track line. ‡

Forward speed is controlled using a similar PID controller on throttle and brake. The control law is defined as dev τ=τ0 + Kpv ev + Kdv + Kiv ev t dt

There t0 is a feed-forward throttle position defined as the throttle setting needed to keep the vehicle at that speed in a steady state. A table of these values is ‡found experimentally for a range of speeds.

This controller setup is capable of following a path two within 1.5 meters of lateral error on paved roads and at relatively low speeds (~20 mph) (see Figure 31).

35 Lateral Error of Controller on Asphalt

L a t e r a l E r r o r - m

Controller Cycles

Figure 31. Lateral error of PID controller with vehicle running on asphalt

5.2 Simulation of a Skid Controller These controllers do not attempt to minimize skid, and as shown in chapter 2 they will not keep the vehicle on the road if a skid occurs. One method is to attempt to introduce counter- steer to minimize the wheel slip angles. Since the nature of the vehicle’s behavior with respect to the slip angle is highly non-linear due to the saturation, a linear gain on slip angle

∆φ = Ksf αf + Ksr αr did not work so well. However, a nonlinear control law of the form

∆φ = Ksf αf. αf + Ksr αr. αr where Ksf and Ksr are the gains, worked well in simulation at preventing the vehicle from spinning out. The major problem with a controller» » of this form» is that» the vehicle is not turning as sharply as it should be to follow the path, so there is substantial lateral deviation from the path. Nonetheless, this control scheme works better in simulation than a controller with no slip control.

A similar controller which limits throttle based on the slip angle was also tried. The control law

36 ∆τ = Ktf αf. αf + Ktr αr. αr was used to limit the throttle, but this produced little appreciable effect on the lateral error, and by itself was insufficient to prevent the vehicle from» »spinning out.» A possibly» more effective scheme would be to base the throttle saturation on the path curvature and speeds rather than on the current slip angle. Since this would be predictive rather than reactive, it may have a better chance of keeping the vehicle from getting into a slide.

Figure 32 through Figure 35 demonstrate the results of two simulated runs through a curve with and without the counter-steering controller implemented. The first set of plots shows the controller running with no counter-steering control. The vehicle steers too hard and spins out. The second set of plots shows the vehicle’s performance with the counter-steering put in.

Figure 32. Simulated turn without counter-steering controller. Note that vehicle spins out halfway.

37 Figure 33. Error plots of a simulated turn without counter steering. Note high heading error indicating spinout

Figure 34. Simulated turn with counter-steering. Vehicle is able to complete turn without spinning out.

38

Figure 35. Errors for turn with counter steering. Note that the vehicle actually has slightly higher lateral error deviation, but does not spin out.

39 6 Conclusions & Future Work There are several key conclusions of this work. First, the vehicle is a highly nonlinear object operating in a highly nonlinear environment, so there will always be a great deal of uncertainty about the values of parameter and therefore about how the vehicle will react to a given control input. This is demonstrated by the fact that similar slip angles can result in very different sliding characteristics, depending on terrain type and throttle. Accurate estimation of whether the vehicle has saturated the lateral force (and is thus sliding) is crucial, and may be aided by separating the sliding and non-sliding behavior of the vehicle into discrete modes. The Gaussian classifier demonstrated in chapter 3 shows that classification of the vehicle’s state into those discrete modes can be made. Feedback and possibly adaptive techniques should also be used to help account for these uncertainties. Future work on the discrete mode classification/estimation problem should include expanding the measurement vector used to make the mode determination. For example, odometry and the lateral slip angles, taken in combination with the yaw rate deviation, may provide a better picture of the current hybrid/discrete state of the vehicle than pure yaw rate deviation.

Second, as a result of the above conclusion, control of the vehicle would probably be better based around some sort of hybrid/discrete gain-scheduling scheme, rather than relying on something like the controller described in chapter 5. The controller as described in this paper works well in simulation, and demonstrates that counter-steering based on the slip angles helps can keep the vehicle from sliding out. However, the nature of the controller forces the vehicle to not turn as hard as it could, thus there is high lateral error. Future controllers should be designed which incorporate more knowledge of the vehicle state as gained from the hybrid analysis. For example, gain scheduling based on the vehicle’s sliding state may help minimize the lateral error, since the vehicle will only counter-steer when it is sliding out, and will not limit the steering angle otherwise.

Finally, more analysis should be done concerning the human steering data, hopefully with higher data rate steering. The human driver demonstrated very great ability to keep the vehicle on the road and minimizing lateral error even during very sharp, sliding turns with large slip. Greater insight into how the human controls the vehicle could provide insight into much better controller.

40 7 References 1. Toshihiro Hiraoka, et al. “Cooperative Steering System Based on Vehicle Sideslip Angle Estimation from Side Acceleration Data at Percussion Centers,” Vehicle Electronics Conference, 2001. IVEC 2001. Proceedings of the IEEE International Publication Date: 2001 http://ieeexplore.ieee.org/iel5/7612/20759/00961730.pdf

2. Ackermann, Jurgen, et al. “Linear and Nonlinear Controller Design for Robust Automatic Steering,” IEEE Transactions on Control Systems and Technology, Vol. 3, No.1, March 1995, p. 132

3. Johansson, Björn. Untripped SUV Rollover Detection and Prevention. Master’s Thesis, Lund Institute of Technology. February 17, 2004. www.s3.kth.se/~bjornj/papers/untrippedsuv_cdc2004.pdf

4. Pacejka, H.B., and Besselink, I.J.M. “Magic Formula Tyre Model with Transient Properties,” Vehicle Systems Dynamics Supplement 27 (1997). p. 234-249

5. Vehicle Dynamics Analysis, Non-Linear, Version 7.0 Drive-train Documentation. System Technologies Incorporated, 2003

6. F. van der Hejden, et al. Classification, parameter estimation, and state estimation : an engineering approach using MATLAB. Chichester, West Sussex, Eng. ; Hoboken, NJ : Wiley, c2004

7. Allen, R., et al. “The Effect of Tire Characteristics on Vehicle Handling and Stability”. Vehicle Dynamics and Simulation, 2000. SAE 2000 World Congress

41