TUDelft-CNS-ATM / bluesky

The open source air traffic simulator
GNU General Public License v3.0
359 stars 241 forks source link

Aircraft overshoot turn waypoints if there is a flyover waypoint right before #290

Closed andubadea closed 3 years ago

andubadea commented 3 years ago

Within the Metropolis 2 project, we are trying to use road networks to navigate between buildings. Due to this, in order to ensure that drones follow the road curvatures, we need to provide drones with many waypoints to approximate such curvatures.

The problem comes when the road is curved before an intersection (example below).

image

In this case, the drone needs to turn at waypoint D3004, which is defined as a turn waypoint. Waypoints D3002 and D3003 are defined as flyover waypoints. Thus, because the distance between D3003 and D3004 is so small, the drone doesn't have time to slow down for D3004 and thus overshoots it.

One way to solve this is from the pre-processing, to put speed constraints on waypoints ahead of a turn waypoint. However, this would be a complex task as the drone type and its performance parameters would need to be taken into account. Thus, I think this could be solved from within Bluesky, which already does the performance calculations.

Bluesky would have to calculate the distance to the next turn waypoint at any time, not only when the turn waypoint is the active waypoint. Thus, aircraft would be able to take turns ahead of a turn waypoint even if there are several other waypoints defined in between. This way, the aircraft would be able to decelerate in time (for example, at the red mark in the picture below).

image

ProfHoekstra commented 3 years ago

Yes, a FLYOVER waypoint does indeed have the effect that the aircraft flies over it. ;)

The problem is partly the specific design of the fight plan: having legs shorter than the turn radius/distance. The guidance logic is only concerned with the active waypoint for a reason: The actual speed can be unknown so it not possible to calculate this beforehand. This is also the reason that other performance calculations are restricted to the active leg (or use speed constraints when given).

To maintain this adaptability, using the current speed might be possible, when no speed is given. This might have quite an effect on the computation speed of all guidance, also for more regular flight plans, as calculations currently only done for the active leg and to achieve the behaviour you mention, they would have to be expanded to future legs as well.

Also in some situations it might be unexpected and even unwanted that the autopilot decides to skip a waypoint before a turn because of later turns, especially using the current speed, and especially with a waypoint specified as FLYOVER. e.g. when the user controls the speed tactically and it is not necessary to skip it. So I'm not fully sure whether adding this logic as a universal change is actually a good idea for all use cases. Only if I can think of a way that works for all use cases. And it seems rather specific to this type of design. Could this also be solved by adapting the flight plan design to cope with this? That might still be a better solution to avoid adverse behaviour in flight plans with more standard layout, despite being more work for this specific case.

ProfHoekstra commented 3 years ago

P.S. Thinking about the flight plan changes: the most obvious solution would be to adapt the speed so that it does not overshoot. This can be done in many ways, also without adding extra waypoints. Note e.g. that ATDIST will also work on non-active waypoints.

andubadea commented 3 years ago

Thanks for the suggestion! I will try to use ATDIST for each turn waypoint.

ProfHoekstra commented 3 years ago

Maybe even an ATDIST in combination with a DIRECT command?

jooste commented 3 years ago

A related question: is ATDIST carried over to earlier waypoints in the same way as the TOD calculation when there isn't enough distance between adjacent waypoints?

andubadea commented 3 years ago

By using ATDIST combined with a speed command, it has the unfortunate side effect of not changing the speed back after the aircraft is past the waypoint, even if all the subsequent waypoints after the turn waypoint have a speed constraint (which makes sense, a SPD command deactivates waypoint speed constraints, right?).

What other option would I have to make sure aircraft do not overshoot their turns while travelling with their cruise speed over flyover waypoints? Just as an example, this is how I currently define an aircraft (which has this problem) in the scenario file:

00:00:00>CRE D8 M600 48.2261538 16.3316802 -67.54264955955497 25 30
00:00:00>ADDWPT D8 48.2262811 16.3312179 15.0 30

#This previous waypoint is too close to the next turn waypoint
00:00:00>ADDWPT D8 48.2263942 16.3308796 15.0 30 

#Add a turn waypoint
00:00:00>ADDWPT D8 FLYTURN 
00:00:00>ADDWPT D8 TURNSPEED 10
00:00:00>ADDWPT D8 48.2264173 16.3308107 15.0 30

#Add an ATDIST command to make drone slow down 100m before turn waypoint
00:00:00>D8 ATDIST 48.2264173 16.3308107 0.05399568034557235 SPD D8 10 

#Continue defining flyover waypoints with speed constraint "30"
00:00:00>ADDWPT D8 FLYOVER
00:00:00>ADDWPT D8 48.2264269 16.3308169 10.0 30
00:00:00>ADDWPT D8 48.2264999 16.330864 10.0 30
00:00:00>ADDWPT D8 48.2267728 16.3310255 10.0 30
00:00:00>ADDWPT D8 FLYTURN
00:00:00>ADDWPT D8 TURNSPEED 10
00:00:00>ADDWPT D8 48.2272904 16.3313451 10.0 30
00:00:00>D8 ATDIST 48.2272904 16.3313451 0.05399568034557235 SPD D8 10
00:00:00>ADDWPT D8 48.2267511 16.3331633 20.0 30
00:00:00>D8 ATDIST 48.2267511 16.3331633 0.05399568034557235 SPD D8 10
00:00:00>ADDWPT D8 FLYOVER
00:00:00>ADDWPT D8 48.2266847 16.3331215 10.0 30
00:00:00>ADDWPT D8 48.2259436 16.3326549 10.0 30
00:00:00>ADDWPT D8 48.2258864 16.3326189 10.0 30
00:00:00>ADDWPT D8 48.225835 16.3325873 10.0 30
00:00:00>ADDWPT D8 FLYTURN
00:00:00>ADDWPT D8 TURNSPEED 10
00:00:00>ADDWPT D8 48.2251083 16.3321398 10.0 30
00:00:00>D8 ATDIST 48.2251083 16.3321398 0.05399568034557235 SPD D8 10
00:00:00>ADDWPT D8 FLYOVER
00:00:00>ADDWPT D8 48.2246616 16.3330155 20.0 30
00:00:00>ADDWPT D8 48.2244419 16.3334638 15.0 30
00:00:00>ADDWPT D8 48.224264 16.3338278 15.0 30
00:00:00>ADDWPT D8 48.2242549 16.3338464 15.0 30
00:00:00>ADDWPT D8 48.2242314 16.3338945 15.0 30
00:00:00>ADDWPT D8 48.2238029 16.3347658 15.0 30
00:00:00>ADDWPT D8 48.2232586 16.3358738 20.0 30
00:00:00>ADDWPT D8 48.2228454 16.336713 15.0 30
00:00:00>ADDWPT D8 48.2222744 16.337882 15.0 30
00:00:00>ADDWPT D8 48.2220189 16.3384038 20.0 30
00:00:00>ADDWPT D8 48.2217434 16.3393645 20.0 30
00:00:00>ADDWPT D8 48.2216922 16.3395494 20.0 30
00:00:00>ADDWPT D8 48.2213039 16.3409478 20.0 30
00:00:00>ADDWPT D8 FLYTURN
00:00:00>ADDWPT D8 TURNSPEED 10
00:00:00>ADDWPT D8 48.2211786 16.3420779 15.0 30
00:00:00>D8 ATDIST 48.2211786 16.3420779 0.05399568034557235 SPD D8 10
00:00:00>ADDWPT D8 FLYOVER
00:00:00>ADDWPT D8 48.2220367 16.3426137 10.0 30
00:00:00>ADDWPT D8 48.2221155 16.3426396 10.0 30
00:00:00>ADDWPT D8 FLYTURN
00:00:00>ADDWPT D8 TURNSPEED 10
00:00:00>ADDWPT D8 48.2221284 16.3426438 10.0 30
00:00:00>D8 ATDIST 48.2221284 16.3426438 0.05399568034557235 SPD D8 10
00:00:00>ADDWPT D8 FLYOVER
00:00:00>ADDWPT D8 48.2222061 16.3421236 20.0 30
00:00:00>ADDWPT D8 48.2222561 16.3417948 20.0 30
00:00:00>ADDWPT D8 48.2222694 16.3417257 20.0 30
00:00:00>ADDWPT D8 48.2222852 16.3416439 20.0 30
00:00:00>VNAV D8 ON
00:00:00>LNAV D8 ON
ProfHoekstra commented 3 years ago

There are many relatively simple ways in which this can be achieved. Conditional commands work with triggers and can be sequenced. The first ATDIST can set a next ATDIST or you can enable VNAV again.

ProfHoekstra commented 3 years ago

A related question: is ATDIST carried over to earlier waypoints in the same way as the TOD calculation when there isn't enough distance between adjacent waypoints?

Note: ATDIST is independent of flight plans. So that means yes but in a different way: it does look further but it does use real distance, so not along track distance.

ProfHoekstra commented 3 years ago

P.S. Outside this context, but just for info: In additon to ATDIST I'm also planning an ATDISTAC command where the reference position is continually update with the aircraft position in the command.