11
1 CARWIN42: EVOLUTION OF ARTIFICIAL INTELLIGENCE CONTROLLER AND AEROMECHANICAL SETUP IN SIMULATED RACE CARS ING. PAOLO PINTO, PHD Dipartimento di Progettazione e Gestione Industriale, Università Federico II di Napoli; ([email protected]) ING. MAURO DELLA PENNA Department of Control and Simulation, Faculty of Aerospace Engineering, Delft University of Technology ([email protected]) ING. EMANUELA GENUA Department of Aerodynamics, Faculty of Aerospace Engineering, Delft University of Technology ([email protected]) ING. MAURIZIO MERCURIO Dipartimento d Informatica, Sistemistica e Comunicazione, Politecnico di Milano ([email protected]) ING. PASQUALE MEMMOLO Dipartimento di Elettronica e Telecomunicazioni, Università Federico II di Napoli ([email protected]) A racecar simulation software allowing evolution of driver AI and aerodynamic and mechanical setup parameters is presented. The fundamental requisites for this kind of AI are outlined, as well as several implementations used in the simulator. Major challenges posed by race cars peculiarity, such as instabilities caused by ground effect are described. The paper also shows preliminary results in the investigation of the relative importance of AI and setup towards laptime performance. 1. Introduction Race cars change almost each time they are used. Suspension, gears, aerodynamics, are continuously played around with, in search of a track dependant optimum that also varies with the driver’s capabilities and predilections. The present work describes some preliminary results obtained by CARWIN42, a software developed by a team led by Dr. Pinto and based

paper 20

Embed Size (px)

DESCRIPTION

paper 20

Citation preview

  • 1

    CARWIN42: EVOLUTION OF ARTIFICIAL INTELLIGENCE CONTROLLER AND AEROMECHANICAL SETUP IN

    SIMULATED RACE CARS

    ING. PAOLO PINTO, PHD Dipartimento di Progettazione e Gestione Industriale, Universit Federico II di Napoli;

    ([email protected])

    ING. MAURO DELLA PENNA Department of Control and Simulation, Faculty of Aerospace Engineering, Delft

    University of Technology ([email protected])

    ING. EMANUELA GENUA Department of Aerodynamics, Faculty of Aerospace Engineering,

    Delft University of Technology ([email protected])

    ING. MAURIZIO MERCURIO Dipartimento d Informatica, Sistemistica e Comunicazione, Politecnico di Milano

    ([email protected])

    ING. PASQUALE MEMMOLO Dipartimento di Elettronica e Telecomunicazioni, Universit Federico II di Napoli

    ([email protected])

    A racecar simulation software allowing evolution of driver AI and aerodynamic and mechanical setup parameters is presented. The fundamental requisites for this kind of AI are outlined, as well as several implementations used in the simulator. Major challenges posed by race cars peculiarity, such as instabilities caused by ground effect are described. The paper also shows preliminary results in the investigation of the relative importance of AI and setup towards laptime performance.

    1. Introduction

    Race cars change almost each time they are used. Suspension, gears, aerodynamics, are continuously played around with, in search of a track dependant optimum that also varies with the drivers capabilities and predilections. The present work describes some preliminary results obtained by CARWIN42, a software developed by a team led by Dr. Pinto and based

  • 2

    (during the two years of its initial development phase) at the Industrial Design and Management Department of University Federico II, Napoli. CARWIN42 includes an Eulerian simulator of racecar physics, an AI engine to drive the car and an evolution engine which acts both on AI parameters and on the cars aeromechanical setup in order to reduce laptimes. While some papers about racecar setup optimization were published [7,8], to the Authors knowledge this may be the first attempt to study its interactions with a driving AI.

    2. Racecar physics

    Racecar physics are dominated by extremely non-linear phenomena, and are also supposed to operate usually in regions where nonlinearities are most evident

    2.1. Tyres

    Tyres generate a force in the ground plane, the magnitude of which varies with vertical load, slip angle (angular difference between the direction of tyre speed and the tyres equatorial plane) and slip coefficient (measure of difference between tyre peripheral speed and road speed) . Variation with these factors is non linear; most notably, increasing the vertical load gives a less than linear increment in forces. Strong negative correlation exists between longitudinal and lateral component. A model to calculate tyre forces is Pacejkas Magic Formula [2].

    2.2. Aerodynamic setup

    Racecars are usually designed to provide downforce, in order to augment the vertical load on tyres, thus increasing the forces they are able to produce and improving cornering, braking and low-speed acceleration. Front-rear downforce distribution heavily influences the cars behavior, the more as speed increases. Wings generate downforce at the price of an increment in aerodynamic drag. A given wing will produce more downforce (at a diminishing rate) and drag ( at an increasing rate) as its angle of attack is increased. Modern racecars derive about 40% of their downforce from ground effect. Ground effect is more efficient than wings; that is, a given quantity of downforce will cost less in terms of drag. This downforce is obtained by shaping the car bottom in such a way that the air under the car is accelerated, therefore reducing its pressure. The magnitude of this force increases as ground clearance decreases (a role is also played by the cars pitch angle). At a critical distance from the ground, anyway, it will drop.

  • 3

    Static ride height selection should be such that ground clearance is minimized yet the critical value is never reached despite suspension movements. The application point of ground effect downforce is affected by the cars pitch angle too. This has unpleasant consequences in some circumstances. Under braking, infact, the cars nose gets nearer to the ground, while the rear lifts; this produces a sudden advance of the center of pressure, and a tendency for the car to spin [5].

    2.3. Mechanical setup

    Mechanical setup includes suspension tuning, front-rear brake force distribution and gear ratios selection. A critical factor in suspension tuning is roll stiffness distribution. When a car negotiates a bend, it experiences an overturning moment that tends to load the outside tyres more than the inside tyres. The front-rear distribution of this moment is dependant on the roll stiffness of each end. Due to the nonlinear relationship between vertical load and lateral force generated by tyres, the end with greater roll stiffness will experience a greater decrease in adherence than the other. This will influence the behaviour of the car, influencing it towards oversteer, if rear end has less adherence, or understeer in the opposite case. A similar pehenomenon, longitudinal load transfer, causes, with most suspension geometries, the car to dive under braking and squat under acceleration. A racecar suspension is designed to tackle two tasks: provide a reaction to road irregularities that is small enough to minimize adherence loss caused by varying loads, and provide a front-rear load transfer that will maximize cornering capabilities. Springs also control ground clearance variations induced by load transfer and downforce (see 2.4). While several formulas exist to calculate an ideal gear ratios distribution for production cars, nothing of the sort applies to racecars. This happens because their more powerful engines easily cause low speed wheelspin , rendering too short gears useless, and because the optimum balance between top speed and acceleration varies with aerodynamic drag and also from a racetrack to another. Harder braking will shift more load on the front wheels and require more forward-biased brake distribution. Yet on twisty tracks it can be helpful to have more braking on the rear to help the car turn in.

    2.4. Aeromechanical interactions

    In order to minimize height variations, ground effect cars require stiffer springs than normal. Alas, these cause a sizeable reduction (10% and more) of the time averaged adherence coefficient in a given condition.

  • 4

    3. Racecar driving

    A race driver will always attempt to extract maximum forces from tyres, balancing their lateral and longitudinal component. Steering is required to keep the car as near as possible to optimal trajectory. An optimal trajectory for a single corner is, in first approximation, an arc that starts on the track side corresponding to the external of the corner, touches apex at mid corner and then goes wide again at the corner exit. This path will have a radius much greater than the corners, allowing the car to travel faster through it.

    Figure 1. A racecars trajectory. The car enters from top-right , using all the tyres force to steer, and progressively accelerates until exit, bottom left (image taken from [1]) Very often, anyway, optimal trajectories end up not being circular arcs traveled at constant speed, but more complex curves the first part of which is traveled under braking while in the last part the car is accelerated. Drivers tend to favor understeering setups on faster tracks.

    4. Software implementation

    CARWIN42 has been developed in Fenix language (http://fenix.divsite.net). Fenix is an open source freeware programming language with elements from C and Pascal; it has very good and easy to use graphic libraries which were useful to reduce development time, and outweighted the languages greatest shortcoming i.e. the lack of a double precision data type.

    5. Physical Models

    CARWIN42 can employ three different physical models for vehicle dynamics, of different accuracy and proportionally high computational effort. All models share the same aerodynamics calculation module, which includes ground effect. Single track model is based on the assumption that both wheels have the same slip angle [3,6]. Tyre forces on the same axle are added together in axle

  • 5

    characteristics. These are usually calculated by point interpolation. In CARWIN42 it was decided to approximate them by Pacejkas Magic Formula. The coefficients are found by Genetic Algorithms. The use of this vertical load sensitive formula allows fast calculation of downforce effects [4]. A more accurate model computes forces for each tyre, taking into account their distance from the cars centerline. Springs are modeled in a quasi static way; that is, they instantly reach an equilibrium position under a given load. Tyre adherence coefficient is decreased as spring stiffnesses increase This model was used in the test runs shown in the present work. The computationally heaviest and most accurate model includes dynamic behavior of springs, stabilizer bars and dampers, and transient tyre response.

    6. Driver AI

    Several AI controllers have been developed for CARWIN42 in the course of time. Albeit more advanced ones are now implemented, we will describe Controller Mk3, which was used in the experiments here presented. Mk3 would only use information collected in 5 points inside a 30 wide cone ahead of it or anyway in the cars immediate surroundings (Fig. 32) . This information should be only of the kind this pixel is track this pixel is grass and it would be used to decide how much to steer, brake or accelerate. Mk3 uses a fixed gearchange algorithm, that commands an higher gear if engine rpm goes above maximum power rpm, and a lower gear if it goes below maximum torque rpm. The car is trailed by 4 sensors which are constantly kept at the track-grass interface. These determine (Fig.2) distance d from grass ahead of the car and an approximate calculation of next corner radius R , as well as its direction.

    When the quantity d

    vRkv 2, where v is speed and k is an evolvable

    constant, falls below or exceeds a given value, acceleration or braking are commanded . Acceleration braking will be limited if wheelspin exceeds given thresholds. The desired steering angle is determined by the cars distances a,b, from the track sides and their increments over last calculation steps , a, b, as well as by evolvable constants p, c. ( ) cbapapb ++= ))1()1(( The steering angle change rate is also an evolvable parameter.

  • 6

    Mk3 made the car quite good at preparing turns, and at negotiating chicanes, but it was still sub-optimal in corner exit. Also, it allowed for soft braking in a straight line, in most situations an anathema to racing . The corner radius calculation system proved to give inconsistent readings, causing sudden changes in car speed. Moreover, the system was incapable of discerning between two corners having the same radius but different lengths, and therefore different optimal trajectories. Another shortcoming was inability to take into account the increasing adherence caused by downforce as speed increases. The resulting driving was thus overconservative at high speeds.

    Figure 2. Sensors on AI Mk3. Sensor 1 determines distance to grass ahead of the car; sensors 3,4 determine distance a,b from the tracks sides; the circumference passing through sensors 1,2,3 provides an estimate R of corner radius. Interestingly, the software showed constant evolution of oversteering setups when this AI was used. We subsequently discovered that, this way, the car could see a longer free distance, thus allowing the controlooer to command faster speeds in corners. The phenomena was more evident in faster corners, where downforce effect, the beneficial influence of which was neglected by controller design, became more important.

    7. Evolution engine

    CARWIN42 starts by generating a car population with random parameters starting from the same position. Parameters are encoded in two linear chromosomes, one for setup and one for AI controller. After all cars have completed a lap or went off track, their genomes are evaluated. Fitness is a

  • 7

    diminishing function of laptime; cars that did not complete a lap get a fitness proportional to the distance traveled. The slowest of the cars that completed a lap will always have a fitness greater than the best one of non-finishers.

    Figure 3. Learning to drive. At generation 0 cars cannot make it through the first corner. By generation 8 most of the population is selecting a racing trajectory of sort (AI Mk4, 101 cars) Tournament selection, double point crossover, Gaussian crossover and mutation are then used to obtain a new generation. Best individual is retained. Gear ratios are evolved in a way that made sure that no impossible configurations (i.e. these having less teeth in inferior gears) were used. In order to obtain this, it has been deemed convenient to evolve the number of teeth in highest gear and the increase in this number from each gear to the next.

    8. Tests and results

    Preliminary tests were carried on 3 different tracks: an High Speed Oval (HSO), a Low Speed Oval (LSO) and an half scale version of Monza track called MiniMonza (MM). We show here some examples of the results.

    Figure 4. Circuits (same scale): High Speed oval, Low Speed Oval , MiniMonza

    8.1. Decreasing laptimes

    All tests showed a constant decrease in laptimes with generations. On the most twisty and difficult track, Minimonza, usually it took a while to generate at least

  • 8

    one individual able to complete a lap; the selection therefore initially rewarded the individuals able to complete the most meters before leaving the track.

    Figure 5. Best individual laptimes (antifitness at MiniMonza), population of 90 cars, AI Mk3 Once these were found, a decrease of laptimes with generations was observed here too, yet with a less gradual decrease due to the higher chance for an innovative individual to crash .

    8.2. Realistic setups

    CARWIN42 evolved setups consistent with theoretical requirements:

    Table 1. Evolved setups for three different tracks Setup Parameter HSO LSO MM Setup Parameter HSO LSO MM

    Front Wing Angle 5 9 20 % rear braking 29% 19% 44% Rear Wing Angle 3 14 12 1st gear teeth 51 53 65 Front Springs (KN/mm) 2.19 1.39 2.48 2nd gear teeth 40 45 52 Rear Springs (KN/mm) 0.56 0.61 1.08 3rd gear teeth 33 36 42 Front Ride Height (mm) 25 21 27 4th gear teeth 24 27 33 Rear Ride Height (mm) 15 12 19 5th gear teeth 19 20 27

    The faster the track, the higher gears and the smaller the selected wing angles. The cars consistently showed much stiffer springs at the front than at the rear, as expected to tackle ground effect. Evolved ride heights were higher at the front than at the rear, allowing for higher downforce and lessening aerodynamic instability phenomena. It is also evident, though, that the AI controller behavior dictated some setup choices not in line with what would have happened with a proper driver. While it would have been expected to see an increase in rear wing angle versus front wing angle on faster circuits, this did not happen. Actually, an oversteering setup was developed on HSO to compensate for controller shortcomings (see

  • 9

    6). Also, front-rear braking distribution does not appear to follow a discernible path.

    8.3. Is it in the car or in the driver?

    It was also attempted to find a measure to understand if decreasing laptimes depended more on setup or AI evolution. This was done by applying a formula that measured an average variation V of parameters from lap to lap:

    =

    JNi i

    ii

    J PGPGP

    N 1

    )1()(1

    Where N is the number of cars, Pi (G) is the i-th parameters value at lap G, and Pi the difference between the allowed maximum and minimum of that parameter.

    Figure 6. Cumulated function of relative variations (compared to the lap before) of setup, AI and laptime ( example taken from Low Speed Oval tests, AI Mk3) It was found out, as shown in Fig.6, that a given decrease in laptime always involved smaller relative variations of AI controller parameters than of setup parameters. This was interpreted as a greater relative influence of AI controller parameters.

    9. Future work

    Work is ongoing on a series of tests (enough to draw statistic inferences) using a wider variety of racetracks and new Mk4 AI controller, the which is based on a

  • 10

    Finite State Machine and is completely different from (and far more efficient than) its predecessors. One of the main problems encountered by our AI controllers is robustness. Even if good parameters are found, changing the starting position by just a few meters would more often than not produce an accident. Therefore subsequent work will be aimed at robustness, trying to evolve cars and AIs insensitive to starting conditions. This might be achieved by putting more copies of the same car in each generation, having each start in a slightly different position. Competition between different AI concepts will also be tested.

    Acknowledgments

    The Authors would like to acknowledge the assistance provided by a number of Professors from Federico II University, Naples, namely Prof. Antonio De Iorio and Prof. Esamuele Santoro, Department of Industrial Design and Management and Prof. Carlo Sansone, Department of Computer Sciences and Systems. A thanks goes also to Prof. Carlo De Nicola, Department of Aeronautical Design, for the continued encouragement. Our gratitude also goes to Eng. Ricardo Divila (Nissan Motorsport) and Ben Michell for invaluable technical tips.

    References

    1. C. Smith, Tune to win Motorbooks International, (1978). 2. H. Pacejka, Tire and Vehicle Dynamics, Butterworth-Heinemann (2005). 3. W.F. Milliken, D.L. Milliken, Racecar Vehicle Dynamics, SAE (1994). 4. P. Pinto, Tecniche di Ottimizzazione applicate ai Trasporti, PhD Thesis,

    XVIII Ciclo di Dottorato, Universit di Napoli Federico II, (2005). 5. P. Pinto, L evoluzione aerodinamica delle vetture di Formula Uno, Atti

    del I Congresso Nazionale di Storia dell Ingegneria, Napoli, (2006) 6. M. Guiggiani, Dinamica del Veicolo, Ed. Citt Studi (2006) 7. E.M. Kasprzak, K.E. Lewis, D.L. Milliken Steady-state Vehicle

    Optimization Using Pareto Minimum Analysis, Motorsport Engineering Conference Proceedings, Vol1, P340-1 (2006)

    8. C.D. McAllister, T.W. Simpson, K. Hacker, K. Lewis, Application of multidisciplinary design optimization to racecar analysis AIAA 2002-5608, 9th AIAA-ISSMO Symposium, Atlanta, Georgia (2002)

    9. E. Genua, M. Della Penna Sviluppo di un simulatore di vetture da competizione dotato di pilota artificiale ed ottimizzazione genetica dei parametri di messa a punto e di guida Graduation Thesis in Aerospace Engineering, Tutor E. Santoro, Co-Tutor. P. Pinto, Universit Federico II di Napoli, AA 2005/2006

  • 11