mSparks43 / XPlane-11-AutoATC-plugin

C/C++ Source code for Xplane AutoATC plugin
GNU Lesser General Public License v3.0
16 stars 7 forks source link

Reduced radio range for ground frequencies #92

Closed EaNa09 closed 3 years ago

EaNa09 commented 3 years ago

Many airports in the US use identical ground frequencies, even airports that are within 25 nm of each other. This is creating a conflict where tuning in a ground freq. is raising response from another nearby airport even while at ground level.

For example, KLVK and KSQL are 23 nm from each other and share the same Ground freq. (121.60). More often than not, an aircraft at ground level at KLVK elicits a response from KSQL. This happens even when the cell app scanner is used to tune the frequency by selecting KLVK ground. These airports are 23 nm apart from each other as the crow flies, so ideally the radio range should be less than half of that. Alternatively, the radio should be able to discriminate based on aircraft location and altitude.

EaNa09 commented 3 years ago

Noticed by comparing changes between v0.9.4.3 and v0.9.4.6 that on Jun 14, 2020 there was an increase in freq. support from 50 to 350. Pointing this out as a possible source of the issue.

mSparks43 commented 3 years ago

Hmm, this shouldn't be an issue even before the new frequencies are loaded in. Range of reception depends upon altitude, on the ground at KLVK the 121.6 of KSQL shouldn't be in range at all. can you give more details of when this is happening? About the only way I can think of recreating receiving both is being tuned into 121.6 at a highish altitude

EaNa09 commented 3 years ago

I assume that the altitude you use to discriminate is AGL, not ASL. ASL at KLVK is 400' whereas KSQL is 8'. These are the altitudes that appear to be loaded in the atclog files. Livermore sits in a valley at 400' whereas San Carlos is at sea level but there are mountain ranges in between, there is no way that UHF or VHF radio can propagate past them and this is (in the real world) the only reason the two airports can have the same frequency and not interfere with each other. Could this be the problem?

I was experimenting yesterday and I had an interesting case where on first launching the sim w/ the ac at ground level at KLVK radio was latching on to KSQL ground. I moved the ac to KSQL with XP's map and then back to KLVK. Upon doing this it temporarily latched on to KLVK ground but I was never able to replicate this again. About 90% of the time while at KLVK it will pick up KSQL Gnd. The atclog file is attached. Notice at first that "San Carlos" (KSQL) appears in the loaded frequency list whereas in the last load after moving the ac back to Livermore it does not. When "San Carlos" does not appear on that list everything works as it should. If "San Carlos" appears on the list then it will always pick up KSQL Gnd while at KLVK.

When the line below appears in the log I pick up San Carlos Gnd (KSQL), even though the ac is at gnd level in Livermore: ATCDATA:{"altitude":"402.88794","ATC mode":"unknown\ncat:D LIVERMORE CLASS D F0->F2900\nTime:17:37\n121.60:((San Carlos Airport - ground) San Carlos Ground):((Livermore Municipal Airport - ground) Ground)\n\n","squawk":"6104","latitude":"37.695393","com1":"12160.0","longitude":"-121.82274"}

When that line appears as below I pick up Livermore (KLVK): ATCDATA:{"altitude":"402.86948","ATC mode":"unknown\ncat:D LIVERMORE CLASS D F0->F2900\nTime:17:47\n121.60:((Livermore Municipal Airport - ground) Ground)\n\n","squawk":"6104","latitude":"37.695393","com1":"12160.0","longitude":"-121.82274"}

Notice that both cases are w/ the ac at the same location, coordinates and altitude are for Livermore (KLVK).

The atclog file is attached below.

EaNa09 commented 3 years ago

2021-01-04--09-31-22 ATCLog.txt

mSparks43 commented 3 years ago

I suspect whats happening here is its interpreting the altitude as meters instead of feet. There was one or two of them knocking around

EaNa09 commented 3 years ago

Whatever is going on seems random, sometimes it works, most of the time it doesn't. To be honest, I'm more than perplexed why two airports that close to each other would have the same frequency, even though like I said, because of mountains in between they don't interfere with each other.

mSparks43 commented 3 years ago

->two airports that close to each other would have the same frequency,

Its a ground frequency. at ground level even on flat terrain the range is only about 4 or 5 miles.

400 meters would be 1,300 feet, still dont think that would be enough for 23miles (but might be) I tested this on the standalone phone app and I don't get any San Carlos frequencies in range spawning into KLVK

On KLVK, do you Have San Carlos in range when just using the plugin Have San Carlos in range when connected via the android app

EDIT: recreating here, looks meters/feet related.

EaNa09 commented 3 years ago

400 m even at 5W output from the radio can go quite a distance (line of sight). I know this because I am a ham radio operator also and operate in that band.

I'm a bit confused when you say "plugin", does it give you the option to select freq. from it? I have not used it that way. I either select the freq. from the ac radio or from the app.

The android app scanner is showing both airports as options. Even when I use it to select KLVK gnd I have the problem.

EaNa09 commented 3 years ago

The ac radio would never pick up San Carlos while at Livermore. Only the phone app. It gives me GND options for airports which are even farther away but San Carlos is the only one that shares 121.6

EaNa09 commented 3 years ago

If I need to buy the Pro version to resolve this that's Ok by me. I would want to support the development effort regardless. Whatever you suggest, although if I have the problem with the free app then others will as well.

mSparks43 commented 3 years ago

->does it give you the option to select freq. from it? I have not used it that way.

There are commands to go next/back frequency on com1 standby and a log/pad window showing frequencies, plugin will work without the phone app to receive and draw aircraft.

image

But this looks like a basic bug, completely agree it shouldn't pick up San Carlos, it was a bug in the reception code that was being over zelous with the range, this should be fixed when I push updates tomorrow.

EaNa09 commented 3 years ago

Awesome! Thanks for the quick turnaround! There may be no need to disable KSQL GND in that case.

mSparks43 commented 3 years ago

Next update puts mountains in the way as well (just testing that bit now)

EaNa09 commented 3 years ago

Awesomest !!!