• No results found

9. Simulation

9.4. Driver

9.4.1. Requirements

Whilst the rest of the simulation is concerned only with how the car responds to inputs, the driver must ‘decide’ what those inputs are and be able to make the ‘decisions’ similarly to how a real driver would. The simulation is one dimensional in that corners are simply areas of the track with a speed limit. Thus the driver has control only of the brakes and the engine, and must use these to ensure the correct speed through corners, and maximum speeds on straights. For this a means of finding the braking point prior to a corner is necessary, as well as means to know the cornering speed.

The fastest way to use the available traction to navigate a corner in a race would be to brake progressively less into the apex and then progressively apply the throttle after the apex. The simulated driver will not make mistakes, so to err on the side of caution and produce slightly lower than optimally achievable lap times, the driver will complete all braking prior to the corner and then complete the corner at a constant velocity. This also greatly simplifies the simulation, but retracts little from its usefulness as a design tool.

9.4.2. Velocity look up

In the same way that the engine torque is available on a look up table, so is the target velocity. The driver subsystem has inputs of velocity and position. The latter is used in a lookup table to find the target velocity of that section of the track. This target velocity is then the demand for a PI controller which uses the current velocity of the car as feedback (see Section 9.4.4). So that the car reaches

Engine Torque (Nm)

Engine speed (rpm)

the appropriate cornering speeds at the beginning of any corner, the look up table can be manually adjusted so that the demand is brought forward to an earlier position (and thus the speed is reached in time for the corner). This method was not used in the final simulation, for the braking point calculator see Section 9.4.3. As can be seen from Figure 9.8, which is an output made following some changes to the car, the manual braking point approach can result in braking far too early for the corners (or equally far too late!) thus requiring the braking points to be altered by trial and error every time something changes on the car. Whilst this was useful in the early stages of the project to get an idea of speeds and times, it does not serve well the purpose of the simulation which is to get quick results across several different setups so that parameters can be tuned.

Figure 9.8. Example of how manual braking points can result in inefficient use of track space

9.4.3. Braking point calculator

As explained in Section 9.4.2, there is a need for a means of calculating the braking point for each corner during the simulation. This was derived analytically by solving the differential equation:

Fresultant

=−drag−brakes−rolling resistance

(9.1)

Fresultant

= −1

2

ρ v2A Cd

−1.2mg−μ

rmg (9.2)

dv

To achieve an equation for braking distance in terms of current and upcoming corner velocities:

dx=

Figure 9.9. Braking distance required to approach a 10 m/s corner. This is equation (9.6) plotted with v1 = 10 m/s and v2 as the independent variable

The value for braking distance (9.6) is compared with the current distance to an upcoming corner and the driver will continue to accelerate so long as distance¿corner>braking distance . An example of the threshold is shown in Figure 9.9. This method enables the user to alter how the car is set up and run simulations without having to go through the process of first establishing the unique braking points. Notice how the braking points in Figure 9.10 are such that the speed limited corners are arrived at with the correct velocity but without wasting time before the corner travelling unnecessarily slowly. The simulations used to produce both Figure 9.8 and Figure 9.10 are

identical in all respects except from the method of establishing braking points. Although the manual method (Section 9.4.2) could be tuned to produce the same output as Figure 9.10, this process would typically take a few minutes and be required each time anything on the car was altered.

Figure 9.10. Example of how the analytical braking point solver uses track space efficiently

9.4.4. Velocity Control

With the desired velocity available from look up tables, the driver’s level of accelerating and braking are then determined through a proportional-integral (PI) controller in closed loop. The outputs are saturated and directed toward the engine subsystem (see Figure 9.2) for positive values and the brakes subsystem for negative values. For the chosen method of driver operation (all braking on straights), it is desirable that the driver either be demanding maximum acceleration or maximum braking in the straights. To achieve this a large proportional term was chosen in order to saturate the controls in the straights. Too large a proportional term would occasionally cause instability in the corners, where a constant speed must be held. To alleviate this a small integral term was added to reduce the error brought about by a smaller proportional term, although this was found to have minimal impact on lap times.

9.5. Brakes

9.5.1. Brakes subsystem

The brakes subsystem is simply a gain which maps the demand from the driver onto the braking force achievable from the brakes. The maximum braking force was decided to be

1.2 g

(see

Section 6.5.4) and this was achieved by saturating the output, although the total force slowing the car could be greater than this due to drag. A more substantial simulation of the tyres was covered in Section 6.4.5, and an anti-lock braking system was developed separately in Chapter 7.

In document Oxford Octane Formula Student Report (Page 173-177)