I'm trying to limit my aircraft's G-force to +7G's and -3.5G's, I'm using this code
clamp(Pitch*smooth(clamp01(GForce<7, -<3.5),0.5),-1,1)
I tried making several changes to the code but none of them worked.
I need help with this, I'm not good with Funky Trees
Pitch*0.5+Pitch*smooth(clamp01(VerticalG
<7)*clamp01(VerticalG>-3.5),1)*0.5
Try this formula, it uses only the vertical component and turns off only half of the input at maximum overload, This significantly improves stability.
You can increase the multiplier of the first term (currently set to 0.5) and decrease the multiplier of the second term (0.5 too) to improve stability.
or
you can reduce the first multiplier and increase the second one for a more stringent limit.
Important
The sum of the multipliers must be equal to 1 (for the output to be complete)
Tested on an airplane "Wasp (Simple)".
Found it lol
is a bit hard, my method is from the start that your plane cannot exceed your desired G's at its corner speed, for example, if you want to replicate a F-16 this one have to reach 9G's at 320-400 knots without stores and half internal fuel, is easier if your plane has high AoA manuevering, ingame your corner speed must be reached with around 20-30 degrees of alpha with flat bottom airfoil, when you have all of this done limit your control surfaces with a pitchRate or a G force input.
if you dont have one of this adjustements in your plane this will make a lot of weird things, for example the horrible pitch movement at high speeds, or just ridicously exceed the desired G in your plane if it use a low alpha when your wing clearly can have more angle without stall.
i recently made a F-14 that can make 7-9G turns and dont exceed this numbers (except if i do some ridiculous dive or something) but in a biplane that im creating is much harder to limit that because at low speeds dont turn, but at high speed turns like a damn fly, or starts woobling for the controls delay
the input that i generally use is Pitch - PitchRate/100 in a rotator or a wing block with a maximun angle of 20 degrees, but is not the same for all models, for big elevators or if you have your CoM too forward it may not work (in that case is useful add an AngleOfAttack/20 or 50
@Grimi Thanks mate, this really worked, you will get my credits when my build is completed
@ollielebanania How do they work?
Clamp01()
limits the output between0
and1
and if I remember correctly, it only takes only one input. For exampleclamp01(VTOL)
. What you are supposed to use here isclamp()
. An example would beclamp(VTOL,-0.5,0.8)
. Here the output is locked between-0. 5
and0.8
(or-50%
and+80%
if you will).I do have codes that work great