Profile image

SOLVED Cruise control via auto pitch help

2,507 OrderlyHippo  2.4 years ago

I have a hover plane. It has the ability to adjust its pitch via a VTOL engine in the front. I need help to have the trim control the planes cruise speed when hovering. Basically, you trim up say 30%. The plane takes that as 30mph and pitches forwards or backwards to maintain 30mph velocity. No more, no less.

I think using a PID controller would work best to adjust the pitch automatically, but it’s confusing me so much.

P.s. I should note the plane I’m using has built in pitch stabilization. I can deactivate it when I want cruise control.
*
*
*
Solution:

Basically I set the max speed I want times Trim for speed control. Subtract ground speed from that and make this positive or negative if moving forwards or backwards. If positive, pitch forward according to the difference in speeds. If negative, pitch back by same value.
All of that is contained in another PID controller to set the planes pitch because this controls an engine I placed in the front of a plane, pointing down.

clamp(PID(

sign(Trim)*
clamp((PID( (sign((22* Trim)-(sign(cos(AngleOfSlip))* GS))<0?-1:1)* -((22* Trim)-(sign(cos(AngleOfSlip))* GS)), (((GS)* Trim)/22* 4)* (-sign(cos(AngleOfSlip))), sign(Trim)* ((22* Trim)-(sign(cos(AngleOfSlip))* GS))/110, 0, 0)),-4,4)

, PitchAngle, .2, 0.1, 0.1), 0, 1)

  • Log in to leave a comment
  • Profile image
    2,507 OrderlyHippo

    @tomlin5412 I read in a post of yours you like to code. Do you know the answer to this?
    I’ve been attempting to replicate the F-35B’s automatic controls with this plane: https://www.simpleplanes.com/a/ABPzHu/Rolls-Royce-LiftSystem-V2. It’s such a satisfying coding challenge.
    Some good sources for F-35B’s real world functions are this video and article if your interested:
    https://australianaviation.com.au/2018/08/jump-jet-flying-the-f35b-simulator/
    https://youtu.be/JSy8DcLaRDo

    2.4 years ago