A car can generate downforce using wings. The amount of downforce depends on some parameters of the wing.
size
profil
angle of attack (AoA)
Up to now Speed Dreams uses a very simple way to calculate the downforce. It does not fit the reality very well. The issues are:
A real wing has a profile that generates downforce even at AoA of zero. The maximum of the downforce is reached at lower level of AoA (about 15° - 20°) and decreases down to an asymptotic level for larger AOA.
A reference for a real wing can be found here reference diagram.
To avoid working for the trash while creating the setups of new car types I decided to create a new optional formula for calculation of the downforce. As cars can have different wings with different profiles, the resulting formula will depend on some parameters.
The parameters have to be taken from references like the one above.
The new formula was designed to be easy to use and implement, as this has to be done in the simulation code and the robots code. The parameters needed can be taken easily from reference diagrams for the coefficient of lift (Clift):
The resulting diagramm has some additional parameters to make the decreasing curve match the reference. This part starts at the AoA at peak value (Apv). It is calculated using a weibull Distribution F(a).
The angle a used in this part is
a = AoA - Apv - 90°
F(a) = 1 - exp( -(a/b)c )
The parameter b defines the delay of decreasing (larger values mean slower decreasing). The parameter c defines the curvature at start of decreasing (1 means getting an edge here, values > 1 make a smooth curve)
To make the increasing part of the formula fit the reference an offset angle Aoff can be defined. The calculation is done in two separate ranges. The first is the increasing part (AoA < Apv).
First some factors for scaling are calculated from the parameters:
f = 90/(Apv + Aoff) // Scale factor from AoA at peak value and angle offset
phi = f * Aoff
d = 1.8 * (sin(phi) * sin(phi) * Cliftmax - Cliftatzero)
To get the Clift for an AoA we use
a = f * (AoA + Aoff) // scaled angle
s = sin(a/180*PI)
Clift(AoA) = s * s (Cliftmax + d) - d
For the decreasing part (AoA > Apv) we use:
a = AoA - Apv - 90°
Clift(AoA) = (Cliftmax - F(a) * (Cliftmax - Cliftasymp)
Using the reference above we take the parameters as:
Apv = 17.3°
Cliftmax = 1.723
Ao0 = -5
Cliftatzero = 0.55
Cliftasymp = 1.35
Comparing the calculated curve with the reference diagram leads us to the remaining parameters
Aoff = 15°
b = 17
c = 1.9
d is calculated as 2.7863
f is calculated as 0,3876
The curve fits the reference as shown in the diagramm below. The old coefficient used by SD is shown as magenta line. The interactivly generated Excel diagramm compares the calculated coefficient of lift (orange line) with the reference (red line). The Excel sheet with the interactiv diagram can be used while setting the parameters. This makes it very easy to find the correct parameters.
The calculation of the coefficient of lift can be done once while initialising the aero model, while simulation it is used as constant (for wings with constant angle of attack).
The new calculation will be implemented as option in simuV4. The parameters will be part of the car type setup. This way different car types can use different sets of parameters to fit references found for the real world cars or their wings. For the robots there will be helper functions in the robottools to calculate the downforce same as the simulation will do it. These functions can be called from all robots and avoid repeated implementation in different robots.