SIM001

SIM001 › For developers › Flying by plan

What the envelope prevents

The safety envelope checks each demand of the executor before the plane flies it, 50 times a second. It keeps the plane inside the fence, above the floor and below the ceiling. It keeps the plane clear of other aircraft by the separation limit, and it keeps the plane above the stall margin. If the plan and the envelope disagree, the envelope wins.

The envelope applies its rules in this order: separation, fence, ceiling, floor and stall. A later rule wins over an earlier one. Thus the floor and the stall margin always win. Each step where the envelope changes the demand is an intervention. AG_ENV counts them.

Set the limits with the AGENT parameters: AGENT_FENCE_N, AGENT_FENCE_E and AGENT_FENCE_R for the fence, AGENT_CEIL, AGENT_FLOOR, AGENT_SEP and AGENT_ASPD_MRG. The bank, the pitch and the airspeeds come from ROLL_LIMIT_DEG, PTCH_LIM_MAX_DEG, PTCH_LIM_MIN_DEG and AIRSPEED_*. ardupilot/t1s.parm sets a fence of 85 m round a point 70 m north of home, a ceiling of 60 m, a floor of 12 m and a separation of 4 m.

We measured the results on this page in a simulation of the T1-S that uses the same executor. The console cannot start the plane in these states, and it does not show the distances or the heights.

Other aircraft and bad data tells you how the envelope keeps planes apart, and what the plane does when its data is bad.

The envelope leaves a safe plan alone

A plan that keeps clear of the limits needs no help. Thus AG_ENV stays the same, and a rise of AG_ENV shows a problem. A ground control agent that the envelope must often correct flies too near the limits.

The cruise airspeed of ardupilot/t1s.parm, 18 m/s, is well over the stall margin. At 15 m/s it was at the edge of it: the envelope changed the throttle and the pitch on about one step in three, and AG_ENV went up by hundreds each minute, also on a safe orbit.

If the reported primitive is orbit, type wait 600 in the console. In the last minute, AG_ENV does not go up.

If the reported primitive is orbit, type wait 600 in the console. In the last minute, AG_ENV does not go up.

The plane stays inside the fence

The envelope looks ahead. If a turn back that starts now only just stays inside the fence, the envelope starts the turn at full bank. It allows for the wind.

If the flight mode of the plane is AGENT, the start is a run at the fence and the other aircraft is far away, type wait 30 in the console. The plane never goes out of the fence, 85 m round the arena centre. AG_ENV is more than 0 (env= in the console).

If the flight mode of the plane is AGENT, the start is a run at the fence and the other aircraft is far away, type wait 30 in the console. The plane never goes out of the fence, 85 m round the arena centre. AG_ENV is more than 0 (env= in the console).

The plane stays above the floor

Near the floor, the envelope lifts the nose and opens the throttle. Below the floor, it also makes the bank smaller, and AG_FALL shows a recovery.

If the flight mode of the plane is AGENT, the start is a dive at the ground and the other aircraft is far away, type wait 30 in the console. The plane never goes down to the floor of 12 m.

If the flight mode of the plane is AGENT, the start is a dive at the ground and the other aircraft is far away, type wait 30 in the console. The plane never goes down to the floor of 12 m.

The plane stays below the ceiling

Near the ceiling, the envelope lowers the nose. A fast climb can take the plane up to 2 m over the ceiling before it comes back down.

If the start is a steep climb and the other aircraft is far away, type wait 30 in the console. The plane never goes more than 2 m over the ceiling of 60 m.

If the start is a steep climb and the other aircraft is far away, type wait 30 in the console. The plane never goes more than 2 m over the ceiling of 60 m.

Under the stall margin, the plane gets its airspeed back first

Below the minimum airspeed, the envelope lowers the nose, sets the wings nearly level and sets full throttle. Near the floor, it holds the nose level instead. The plane says "Agent: fallback 3" when the recovery starts. The recovery is often shorter than the 1 s between two AG_FALL reports.

If the start is a slow climb, type wait 1 in the console. The plane sends the message "Agent: fallback 3". The console counts these messages as recoveries. The executor sets the throttle.

If the start is a slow climb, type wait 1 in the console. The plane sends the message "Agent: fallback 3". The console counts these messages as recoveries. The executor sets the throttle.

After a recovery, the plane flies on

If the start is a slow climb and the other aircraft is far away, type wait 30 in the console. The airspeed is back to at least 14 m/s. The plane never goes down to the floor of 12 m. AG_FALL is 0 (fall=0).

If the start is a slow climb and the other aircraft is far away, type wait 30 in the console. The airspeed is back to at least 14 m/s. The plane never goes down to the floor of 12 m. AG_FALL is 0 (fall=0).