Alright, some progress! With the help of @TrackpadUser the collapsing beam problem has been sorted out. With that I learnt how to adjust the beams up front too.
Wing beams marked in Red
A bit hard to see here but reinforcement beams in yellow, and Hydro beams in cyan
With some study of how .lua and the electrics Streams work, I’ve managed to make some kind of active aero with independent front and rear flaps function more or less.
In the case of Mercury I had to actually test the behaviour of the car quite a bit as the relationship between traction and downforce changes markedly at around 240km/h, then at 320km/h, and especially between 400-450km/h where tyre traction in general goes extremely wonky…
A draft bit of logical arguments… my math and coding isn’t good enough to map out a set of values automatically so manual adjustments it is
In short, at 2130hp unless I mitigate how much front aero robs downforce from the rear, prodding the throttle will result in a spin at almost any speed, so I made it such that the further you depress the the throttle, the less the front wing activates. Right now though, this is causing problems if the car dips below 400km/h off throttle as suddenly the front wing goes from “closed” to “quite a bit open” and the car spins. I’ll have to work it out. Maybe I’ll slow the front hydros down, that will probably help a fair bit.
The only two things I haven’t worked out are:
- How to add my custom inputmap DRS button into the mix
- How to read the floating inputsteering value such that I can make the DRS cancel itself if the steering wheel is turned more than a few degrees (the wisdom of which I am debating, since this may in itself cause the car to suddenly destabilise). On that note if I work out inputsteering, then I can work out how to get 4 way aero working, which would be well wicked!
Work gradually continues.
because I’m one of the furthest things from an engineer you could get a physician with a humanities bent I stupidly forgot that the entire purpose of having .lua script is so you can put math in it.
So to smooth out the operation of the wing and make it truly adaptive, since this car’s stupid 2130hp means the behaviour is highly dependent on throttle input at varying speeds. Which means that what I should be doing is modelling the front wing angle as a function of the throttle.
isn’t going to be it, but I’ve verified that it works
look how it accelerates like a bad motherfucker lmao
EDIT 2: the steering input works!
So in short,
electrics.values.steering measures the steering angle. I’m not certain that this is in degrees of lock and I’m still too much of a noob at Beam’s UI to check this value in the console (anyone tell me how to do this I’d appreciate it).
math.abs is the absolute value, as steering left produces a positive value, and right a negative one.
This is exactly what I want to know when, in future, I’ll be working on 4 way independent aero. This means things like the Mitsubishi HSR, or the Pagani Huayra, or even the SRT Tomahawk X (for that I’ll need some mad slidenodes), or even the Zenvo TSR-S’s silly pivot wing (for this I’ll need perfect placement of the hydros).
For this first project though, all I want is for the steering angle and the throttle to affect the front wing. I’ve decided the rear wing angle will remain fixed except when DRS is activated. Under most conditions, this car really needs all the rear downforce it can get. The front wing however, is such that the wing should exert more downforce with more steering lock (to an extent), and less if the throttle is depressed. This is because the car has more than enough power to power oversteer at almost any speed (all the way up to 500km/h).
But with the wing being what it is, above 400km/h if it is up at the maximum angle below stall angle (about 15 degrees), then it will also have a tendency to oversteer. Furthermore the rear wheels lose quite a bit of grip at these speeds, making keeping it stable under acceleration harder.
To combat this, I need something like this:
Where the x-axis is speed in km/h, the y-axis is wing angle in degrees, the red line is the maximum angle of the wing and the blue line is the minimum (except when DRS conditions are met and the toggle is pressed such that
values.electrics.DRS = 1 or something).
To this end a suggestion from @ramthecowy later, and I might have something like this:
Where that e-x function may turn out to be something like this:
electrics.values.wheelspeed is measured in m/s.
More testing to follow this week.