Profile image

how this code work?

6,065 upperflat  12 days ago

jet 1(pitch really smooth like butter but unstable and shake up down when reach 1,000 mph)

P IAS<10&AltitudeAgl<10?smooth(clamp01(Activate1)-2.5,1):(aoa-Pitch(1+x)(1-y)+PitchRate0.02+PP)

aoa AngleOfAttack/15

PP PID(smooth(PitchAngle,(abs(Pitch)>0.01|(abs(RollAngle)>45&abs(RollAngle)<135)|abs(AngleOfAttack)>20?100:0)),PitchAngle,(abs(RollAngle)<45?0.1:(abs(RollAngle)>135?-0.1:0)),0,0)*(1-clamp(IAS/300,0,0.6))

x PID(abs(Pitch)*12,AngleOfAttack,0.005,0,0.000)

y clamp01((VerticalG-12)/40)

in motor clamp(P,-1,1)-Roll*0.2

jet2(can go more then 1000mph but pitch not smooth)

PP clamp(smooth(PID(smooth(PitchAngle,0.01clamp01(abs(Pitch)+abs(Roll)>0)100000)clamp01(AltitudeAgl>3&Pitch=0),PitchAngleclamp01(AltitudeAgl>3&Pitch=0),0.1,0,0.01),0.3)clamp01(AltitudeAgl>3&Pitch=0)cos(RollAngle)*clamp01(Activate8=1),-0.5,0.5)

in motor Pitch1 + Roll-0.5 + Trim*0.2 - PP

how to make jet1 can reach 1000mph without shaking?