Features:
- Terrain-following autopilot and cruise autopilot
- Automatic aerial refueling
- Fully functional cockpit
- Pitch and roll rate controls
Instructions:
AG1: Cockpit open/close
AG2: Autopilot on/off
AG3: If autopilot on, cycle between altitude (MSL) and terrain following (AGL) pitch modes
AG4: If autopilot on, cycle between flying level, to a target, or to a heading
AG5: Refuel / formation autopilot (only throttle and pitch, use AG2 to toggle automatic or manual turning)
AG6: Master arm weapons
AG7: Eject
AG8: Engine on/off
VTOL: Adjust autopilot heading
TRIM: Adjust autopilot altitude (whichever mode is active will adjust, toggle AG3 to switch)The status screen in the cockpit reminds you how each thing is being controlled if you forget. If you run into problems, you can always eject and try again.
Examples:
- Low altitude bomb run: Takeoff toward the carrier near Wright Airport and target one of the destroyers. Activate AG6 to arm bombs and AG2 / AG3 to turn on autopilot. The jet will track the target while automatically maintaining altitude above any terrain or water. Use the targeting camera on the front of the jet to zoom in and fine-tune your bomb drop.
- Tanker connection: start on any runway. Spawn a tanker flying roughly in front of you at any bank angle you like, just make sure the speed is relatively fast so your jet doesn't stall. Give the tanker a head start then take off. Set Air-to-Air mode and target the tanker. Activate AG5 and AG2 to automatically form up on the tanker. Enjoy formation, then turn off AG2 to give yourself some turning control to connect to the fuel hose. To disconnect, activate brakes and turn off AG2 and AG5 before you turn away. (This mode is great for flying formation with other random aircraft too)
- Bumpy ride: fly toward some uneven terrain and activate AG2 and AG3. The jet will maintain the terrain height you set.
- Cruise: Set a desired heading and altitude using VTOL and TRIM. Activate AG2.Coding stuff if you want to add to your own airplanes:
-Terrain Following Radar:
Sample the terrain height beneath you, then sample it again a short time later (h1, h2, and their slopes m1, m2 over dt). Depending on the steepness of the terrain, fit a line or a parabola through your two known points and extend it to a third point ahead of you (agl-cur). Control your pitch attitude to avoid hitting terrain at this hypothetical future point. The math for this is in the variables h1 through h3-poly.-Rate Controls:
The aircraft is slightly unstable in pitch, but this controller did a good job of making it fairly agile without stalling and spinning any time you try to turn. It also avoids the need for D > 0 in PID controllers which makes planes very shaky in this game. This also allows you to replace pitch-command with anything (the autopilots here use a PID(difference-between-target-and-current-altitudes, vertical-velocity, P, I, D) for pitch-command)PID(pitch-command x sensitivity-multiplier x pitch-rate-limiter,PitchRate/25,0.35,0,0)
pitch-command [-1,1]: (Pitch, or replace with autopilot i.e. a controller that matches vertical velocity to the difference between current and target altitude)
sensitivity multiplier (i.e. less sensitive when landing or refueling)
pitch-rate-limiter [0,1]: proportion of the commanded pitch that gets sent to the control surface, gives it 100% response for some proportion of the AOA range, then it drops linearly to prevent stall - mine was (abs(AngleOfAttack)>split x aoa-stall?-(1/((1-split) x aoa-stall)) x abs(AngleOfAttack)-split x aoa-stall)+1):1)
Specifications
Spotlights
- OrderlyHippo 7 days ago
- Kendog84 10 days ago
- C47skytrain 9 days ago
- CripplingADHD000 5 days ago
General Characteristics
- Predecessor Wasp
- Created On Windows
- Wingspan 34.1ft (10.4m)
- Length 53.0ft (16.2m)
- Height 20.0ft (6.1m)
- Empty Weight 20,191lbs (9,158kg)
- Loaded Weight 24,692lbs (11,200kg)
Performance
- Power/Weight Ratio 2.047
- Wing Loading 43.1lbs/ft2 (210.3kg/m2)
- Wing Area 573.2ft2 (53.3m2)
- Drag Points 4533
Parts
- Number of Parts 174
- Control Surfaces 9
- Performance Cost 1,321
@Kendog84 thanks for checking it out! If you make it smoother, faster, or lower altitude it works but you'll hit the ground more, because you're right all this does is predict future terrain based on points behind and directly under the aircraft. Its designed to perform ok over the different types of terrain in the map, so that's why it ended up with the fast control rates, aircraft speed limiter, and default height of 300 m. But for example if you takeoff from Maywar takeoff and fly south, it performs very well at 75m, 900km/h, and with smoother controls. Let me know if you've got specific questions but here's a few things you can change:
1) The engine input uses a variable called apautothrottle that has a speed limit of 150 right now, you can set your own or just use Throttle instead
2) The easiest way to adjust control rate is to add a smooth function to the pitch variable. I replaced pitchcmd with smooth(pitchcmd,1) and it worked good
F-111 would be cool, I'd love to fly it when it's done!
I hardly understand the math that goes into achieving terrain following (I understand it predicts the height of "third point" based on (the rate of change of?) previous two points?), but do you think this can be adapted as it is, or easily for..
1)faster flight, eg 900km/h (noticed the plane slows down to about 500-600km/h when the terrain following is enabled), and
2)smoother pitch adjustment?
I would love to try and adapt the system (if that's ok) to something like an F-111, if it's possible to fly faster & make the pitch adjustment smoother. Though, I'm guessing these are both hard to achieve with the terrain of the vanilla maps with steep & sudden ups and downs and how altitude AGL works (it only records the point right below the cockpit I'm guessing).
.
PS
Sorry if you've already explained this in the description or elsewhere, I posted this comment before finished reading/fully understanding it.
I just searched for "simpleplanes terrain following" in DuckDuckGo for a possible future project, and this post/plane was the second top in the results. Glad I did that.
Really cool tech demonstrator, if that's the right word here. Honestly it's kinda criminal that there's very little recognition as yet.