Profile image

F-22 (Black VR Edition)

6,592 cosman  1.5 years ago
170 downloads

EDIT: 1.02 version released
https://www.simpleplanes.com/a/C898ON/F-22-VR-Black-1-02

Introducing the F22 Raptor. This is based off the F22 by GuyFolk although I have heavily reworked the physics of the flight model to be able to achieve what the real Raptor can accomplish and what its airframe and thrust vectoring should theoretically be capable of.

I have worked hard to cut the parts down so it is smooth on mobile and oculus quest 2. Feel free to peruse the variable setters and funky trees code to understand how I have coded the engines, control surfaces and thrust vectoring nozzles.

My Goal with this release was not accurate replication but rather a low part, ergonomic, VR friendly and functional cockpit with good forward visibility and an aircraft which does not compromise on capabilities or flight physics.

Weapons also reflect this ethos as the traditional armament of x2 sidewinders and x6 AMRAAMS is replaced with x2 sidewinders, x2 AMRAAMs, x4 Air to Ground Missiles.

Notable achievements with this model include:

1) Corrected YawRate Expression
This corrected YawRate variables which account for gravity and naturally promote coordinated turns. It allows the zero point for YawRate to correlate with the zero point for Angle Of Slip during stable flight AND now also during banked turns.

2) Reworked logic for control surfaces
Using Guyfolk's code as a solid foundation, I have reworked the majority of surfaces. Now the aircraft better responds to Roll and Yaw inputs even at the extremes of high alpha flight. This was quite challenging.

3) AoA limiter
AoA limit is dynamic and aimed at providing maximumum performance at all speeds and thrust levels. You rarely need to turn off the limiter unless you want to perform exorbitant post stall maneouvres.

4) G limiter
Code is not perfect but generally limits Vertical G to 9-11G. I preferenced a smooth limiter than an accurate hard limiter with oscillations and instability.

5) Differential Thrust Activator
Use this to drop power to the inside engine when extreme rudder is applied. Use this with or without AoA Limiter to perform impressive aerobatics maneouvres. ALSO whether mode is active or inactive, the aircraft will also apply differential thrust when there is yaw instability to help stabilise the aircraft (unless this is requested by the pilot).

6) Landing Auto Throttle
This is enabled by default. Just keep the airbrake on approach and use the stick to adjust your glideslope. a PID controller will keep the Engines active to maintain a 120knot approac. Flare before touch down to a Pitch Angle of ~12 degrees and plane will slowly kiss the runway.

7) Suspension
Reworked Spring and damper rates to cope with uneven bumps

8) Taxi control
Use Roll or Yaw controls whilst on the ground. Tire slip angles are calculated to feedback to steering system for smooth steering. at higher speed whilst on the ground, control surfaces automated to provide roll stability to resist wing strikes.

9) Variable setters for Pitch, Roll, Yaw, and Throttle.
This allows adjusting exponential gains for each input axis. Sensitivity slider (VTOL) controls the sensitivity of the flight controls.

10) Throttle Thumbstick Disable
Throttle control from keyboard or thumbstick is disabled by default to allow for smooth independent rudder control in VR without inadvertent engine shutoff or afterburner activation. It also allows simultaneous Throttle and air brake application for tight min radius turns.

Note this aircraft is an process of evolution and there are some redundant sections in the code for various control surfaces aimed as mental triggers for future improvements.

If there is interest, I have a different more complex cockpit and HUD I can release but they severely impact performance.

Enjoy this best in VR and If you find a smoother flying aircraft please let me know as I am always interested in improving the flight model.

If you perform any cool maneouvres, please take a video and link in the comments!

Spotlights

General Characteristics

  • Created On Windows
  • Wingspan 45.1ft (13.7m)
  • Length 61.8ft (18.8m)
  • Height 17.2ft (5.2m)
  • Empty Weight 42,333lbs (19,202kg)
  • Loaded Weight 57,238lbs (25,963kg)

Performance

  • Power/Weight Ratio 3.273
  • Wing Loading 69.1lbs/ft2 (337.3kg/m2)
  • Wing Area 828.5ft2 (77.0m2)
  • Drag Points 3015

Parts

  • Number of Parts 462
  • Control Surfaces 4
  • Performance Cost 1,930
  • Log in to leave a comment
  • Profile image
    105k GuyFolk

    @cosman
    I'll check it out.

    1.4 years ago
  • Profile image
    105k GuyFolk

    @Khanhlam
    Well...
    This plane was built back when variable system wasn't a thing so I have to jam the entire code in one spot.
    Also, the update 1.11 version, I tend to touch the old code as little as possible so it get even more spaghetti.
    Also, I didn't know that using "enter" button will affect the logic or not so I just don't use it.

    1.4 years ago
  • Profile image
    76.9k MrCOPTY

    @cosman Keep It Up, I'm Supporting You

    1.4 years ago
  • Profile image
    6,592 cosman

    @Khanhlam @MrCOPTY
    Thank you so much for the kind words!
    @GuyFolk
    No worries mate, cant wait to see what more creations you come up with, keep up the good work!

    also new version released if you guys are interested!

    +2 1.4 years ago
  • Profile image
    2,101 Khanhlam

    @GuyFolk
    It feels like this guy code so simple yet so well or he just doesn't make it spagetti like yours lol.
    Still, i don't know what's inside your and his head to make the FBW.
    @cosman
    For a new user, you're way beyond most of users here, including me.

    1.4 years ago
  • Profile image
    105k GuyFolk

    @cosman
    Interesting way to calculate the gravity vector.
    And thanks for explaining it to me.
    I've never though of using rate(-AngleOfSlip) before, I'll think about that with my next build.
    And I'll follow so I'll don't miss anything cool.

    +1 1.5 years ago
  • Profile image
    6,592 cosman

    @GuyFolk

    I might just create a new post to explain it better but in the meantime, fly my plane in a gentle manner with minimal pitch input and no rudder input. compare the values of:

    "YawRate" and
    "YawRate + cos(PitchAngle) * sin(RollAngle) * 561.5/max(5,TAS)" and
    "rate(-AngleOfSlip)".

    You are correct about keeping AngleOfSlip at 0 will make it yaw to the ground under high bank angles but thats the whole point of a coordinated turn is to keep AngleOfSlip at 0.

    A really simple replacement for "YawRate" when controlling your rudder would be "rate(-AngleOfSlip)" but that has its own set of problems during PSM as the value goes crazy when abs(AngleOfAttack) approaches 90.

    My final iteration of an expression which approximates rate(-AngleOfSlip) without the above issues is:

    "
    (4/3) * clamp01(IAS>0.2)
    *
    (
    YawRate * cos(AngleOfAttack) - RollRate * sin(AngleOfAttack)
    +
    clamp01(cos(AngleOfAttack))
    *
    clamp01(cos(AngleOfSlip))
    *
    cos(PitchAngle)
    *
    sin(RollAngle)
    *
    561.5/max(TAS,5)
    )
    "

    try all 4 values in the console simultaneously whilst flying and tell me your thoughts.

    PS made some changes since this version and I'll release an update soon.

    +1 1.5 years ago
  • Profile image
    76.9k MrCOPTY

    Very Good Work, Nice Body & I Love The Cockpit, It's Simple But Cool.

    +1 1.5 years ago
  • Profile image
    105k GuyFolk

    This definitely feels difference.
    Good job.
    And I just don't understand the "1) Corrected YawRate Expression", you can make yaw rate and angle of slip be 0 at high bank angle?
    Or am I missing something lol, from my exp, I can keep yaw rate 0 but angle of slip will increase at high bank angle and if I keep angle of slip 0, the plane will yaw toward the ground like a dart at high bank angle.

    +3 1.5 years ago