Profile image

Simple planes ain't simple nomore

364 Dy4me  14 days ago

Not sure If this will even be seen but here goes nothing, it's probably gonna be a long thread but please bear with it.

So I just recently started building my own crafts and after learning PID basics I felt that they were a bit lacking so I delved deeper into it, and damn I went so deep that I don't understand nothn nomore.

So what I wanted help on is this code specifically:

Activate8 ? ((PID(Pitch,PitchRate/((IAS<222? (clamp(IAS,64,222)0.1433): (48.09-clamp(IAS,222,423)0.0742))(1+0.236(clamp(inverselerp(1,0,Fuel),0,1)))),1.5,1.5,0.5))*clamp(inverselerp(250,110,IAS),0.1,1)+ Trim/4) : Pitch

Values inputed there are approximated limits on E-M graphs (on statshark) for my F-16, as you can tell they are not quite accurate representation since they are linear approximations, and a basic multiplier to get rid of the oscillation at high speed.

So the first thing wrong was that when any stall occurs the FT basically gets lost and returns an infinite corrective measure leading to overcorrection or unrecoverable vertical spins, hence why I made it return pitch when Ag-8 is deactivated.

So I wanted some help to find if there was a way to basically negate any memory to the PID whilst maintaining the correction at level flight (the trim benefit of PID correcting Pitch rate to zero)

And lastly is there a way to add a glimiter to it.

  • Log in to leave a comment
  • Profile image
    364 Dy4me

    What do you mean by "make your own" like do I need to make Kp,Ki,Kd variables that depend on the flight condition?

    14 days ago
  • Profile image

    You cannot reset the memory of the integrator on the PID function. To gain that feature, you must make your own PID.
    I don't know anything about fly-by-wire though

    14 days ago