Optimising Gain

Presently piaware 6.1 running on Pi 3b+ buster is set with AGC on results in approx 11-14% of messages > -3dbfs

I ran optimize-gain.py and got the following results
Not sure whether to leave on AGC - appears to have gain at 49.6
If not which gain setting would be best - it’s rather confusing

TIA

test 1 of 5
gain= 49.60 messages= 54,661 positions= 2,746 planes= 57
gain= 48.00 messages= 52,748 positions= 2,590 planes= 59
gain= 44.50 messages= 48,169 positions= 2,308 planes= 56
gain= 43.90 messages= 49,875 positions= 2,451 planes= 57
gain= 43.40 messages= 46,902 positions= 2,318 planes= 59
gain= 42.10 messages= 46,433 positions= 2,287 planes= 52
gain= 40.20 messages= 46,175 positions= 2,288 planes= 52
gain= 38.60 messages= 43,013 positions= 2,259 planes= 49
gain= 37.20 messages= 44,168 positions= 2,307 planes= 49
gain= 36.40 messages= 46,145 positions= 2,257 planes= 46
gain= 33.80 messages= 42,327 positions= 2,018 planes= 48
gain= 32.80 messages= 39,686 positions= 2,034 planes= 50
gain= 29.70 messages= 42,365 positions= 2,284 planes= 49
gain= 28.00 messages= 46,034 positions= 2,496 planes= 45
gain= 25.40 messages= 42,605 positions= 2,274 planes= 45
gain= 22.90 messages= 39,285 positions= 2,144 planes= 44
gain= 20.70 messages= 38,644 positions= 2,119 planes= 51
test 2 of 5
gain= 49.60 messages= 41,193 positions= 2,252 planes= 51
gain= 48.00 messages= 42,596 positions= 2,235 planes= 54
gain= 44.50 messages= 42,345 positions= 2,113 planes= 52
gain= 43.90 messages= 41,633 positions= 2,045 planes= 52
gain= 43.40 messages= 41,603 positions= 2,230 planes= 55
gain= 42.10 messages= 42,987 positions= 2,273 planes= 56
gain= 40.20 messages= 45,086 positions= 2,481 planes= 52
gain= 38.60 messages= 46,126 positions= 2,553 planes= 53
gain= 37.20 messages= 50,541 positions= 2,843 planes= 55
gain= 36.40 messages= 50,039 positions= 2,806 planes= 55
gain= 33.80 messages= 48,125 positions= 2,788 planes= 58
gain= 32.80 messages= 47,244 positions= 2,676 planes= 55
gain= 29.70 messages= 49,429 positions= 2,839 planes= 61
gain= 28.00 messages= 50,832 positions= 2,823 planes= 61
gain= 25.40 messages= 53,873 positions= 2,949 planes= 61
gain= 22.90 messages= 56,442 positions= 3,150 planes= 57
gain= 20.70 messages= 53,847 positions= 2,926 planes= 61
test 3 of 5
gain= 49.60 messages= 55,600 positions= 2,904 planes= 64
gain= 48.00 messages= 55,856 positions= 2,915 planes= 68
gain= 44.50 messages= 58,439 positions= 2,980 planes= 70
gain= 43.90 messages= 59,170 positions= 3,073 planes= 73
gain= 43.40 messages= 57,225 positions= 2,883 planes= 73
gain= 42.10 messages= 59,060 positions= 2,959 planes= 76
gain= 40.20 messages= 59,550 positions= 2,943 planes= 80
gain= 38.60 messages= 62,489 positions= 3,105 planes= 76
gain= 37.20 messages= 58,711 positions= 2,862 planes= 78
gain= 36.40 messages= 60,633 positions= 2,989 planes= 76
gain= 33.80 messages= 62,804 positions= 3,111 planes= 76
gain= 32.80 messages= 65,260 positions= 3,406 planes= 80
gain= 29.70 messages= 65,811 positions= 3,423 planes= 78
gain= 28.00 messages= 64,502 positions= 3,312 planes= 73
gain= 25.40 messages= 65,806 positions= 3,343 planes= 72
gain= 22.90 messages= 65,192 positions= 3,313 planes= 64
gain= 20.70 messages= 61,706 positions= 3,135 planes= 62
test 4 of 5
gain= 49.60 messages= 60,285 positions= 3,147 planes= 71
gain= 48.00 messages= 59,860 positions= 3,094 planes= 68
gain= 44.50 messages= 59,108 positions= 3,122 planes= 74
gain= 43.90 messages= 62,337 positions= 3,213 planes= 65
gain= 43.40 messages= 61,017 positions= 3,087 planes= 66
gain= 42.10 messages= 60,478 positions= 3,157 planes= 66
gain= 40.20 messages= 62,396 positions= 3,151 planes= 69
gain= 38.60 messages= 61,857 positions= 3,240 planes= 68
gain= 37.20 messages= 58,730 positions= 3,093 planes= 65
gain= 36.40 messages= 58,454 positions= 3,135 planes= 64
gain= 33.80 messages= 57,823 positions= 3,091 planes= 69
gain= 32.80 messages= 58,009 positions= 3,198 planes= 68
gain= 29.70 messages= 53,719 positions= 2,902 planes= 61
gain= 28.00 messages= 54,794 positions= 2,944 planes= 60
gain= 25.40 messages= 54,796 positions= 2,876 planes= 57
gain= 22.90 messages= 54,243 positions= 2,765 planes= 64
gain= 20.70 messages= 53,466 positions= 2,706 planes= 59
test 5 of 5
gain= 49.60 messages= 54,462 positions= 2,745 planes= 67
gain= 48.00 messages= 53,028 positions= 2,758 planes= 66
gain= 44.50 messages= 52,630 positions= 2,766 planes= 68
gain= 43.90 messages= 54,776 positions= 2,805 planes= 64
gain= 43.40 messages= 53,891 positions= 2,735 planes= 65
gain= 42.10 messages= 57,845 positions= 2,864 planes= 67
gain= 40.20 messages= 60,469 positions= 3,167 planes= 68
gain= 38.60 messages= 60,304 positions= 3,007 planes= 68
gain= 37.20 messages= 58,741 positions= 2,988 planes= 66
gain= 36.40 messages= 56,910 positions= 3,057 planes= 64
gain= 33.80 messages= 57,049 positions= 2,975 planes= 69
gain= 32.80 messages= 56,665 positions= 2,912 planes= 62
gain= 29.70 messages= 54,026 positions= 2,760 planes= 61
gain= 28.00 messages= 55,041 positions= 2,779 planes= 56
gain= 25.40 messages= 50,043 positions= 2,575 planes= 56
gain= 22.90 messages= 45,426 positions= 2,270 planes= 54
gain= 20.70 messages= 39,123 positions= 1,948 planes= 53
===Totals===
Gain, Messages, Positions, Aircraft
49.6 266,201 13,794 266
48.0 264,088 13,592 266
44.5 260,691 13,289 272
43.9 267,791 13,587 269
43.4 260,638 13,253 270
42.1 266,803 13,540 272
40.2 273,676 14,030 267
38.6 273,789 14,164 260
37.2 270,891 14,093 262
36.4 272,181 14,244 250
33.8 268,128 13,983 259
32.8 266,864 14,226 255
29.7 265,350 14,208 253
28.0 271,203 14,354 246
25.4 267,123 14,017 252
22.9 260,588 13,642 245
20.7 246,786 12,834 250

Jun 14 13:45:22 piaware dump1090-fa[30797]: adaptive: available dynamic range (33.7dB) >= required dynamic range (30.0dB), continuing upw
Jun 14 13:45:22 piaware dump1090-fa[30797]: adaptive: changing gain from 48.0dB (step 27) to 49.6dB (step 28) because: probing dynamic ra
Jun 14 13:45:22 piaware dump1090-fa[30797]: rtlsdr: tuner gain set to 49.6 dB (gain step 28)
Jun 14 13:45:32 piaware dump1090-fa[30797]: adaptive: available dynamic range (33.6dB) >= required dynamic range (30.0dB), continuing upwJun 14 13:45:32 piaware dump1090-fa[30797]: adaptive: changing gain from 49.6dB (step 28) to 58.6dB (step 29) because: probing dynamic raJun 14 13:45:32 piaware dump1090-fa[30797]: rtlsdr: tuner gain set to about 58.6 dB (gain step 29) (tuner AGC enabled)
Jun 14 13:45:42 piaware dump1090-fa[30797]: adaptive: available dynamic range (23.3dB) < required dynamic range (30.0dB), switching to do
Jun 14 13:45:42 piaware dump1090-fa[30797]: adaptive: changing gain from 58.6dB (step 29) to 49.6dB (step 28) because: probing dynamic ra
Jun 14 13:45:42 piaware dump1090-fa[30797]: rtlsdr: tuner gain set to 49.6 dB (gain step 28)
Jun 14 13:45:52 piaware dump1090-fa[30797]: adaptive: available dynamic range (33.3dB) >= required dynamic range (30.0dB), stopping downw

1 Like

I don’t like AGC controlling my gain. I am in central florida and have the luxury of flat terrain surrounding me with some nearby tall oaks that are out of my control. My Vinnant antenna is 35 foot above ground level and above the peak of my single story ranch style house. I run a fixed gain of 43.9 and it keeps me within the 5% messages threshold that is advised. Everyone is different but maybe that could be a starting point for you with a fixed gain setting.

2 Likes

It is hard to get any conclusive gain setting using optimize-gain.py.
This script was created several years ago, and subsequently updated, as an initial attempt to find optimum gain.

I have stopped using this script since several years. After quitting use of this script, I resorted to manually best setting by trial-and-error. I will set gain to 49.6 and leave it there for a day or two, then from graphs1090, note the plane count, message rate, and messages > -3 dBFS. Next reduce gain to 46, and repeat above excercise. Kept on reducing gain in steps of say 3 dB, till I could find the best setting.

Recently, I have started using “Adaptive Gain” setting given in file `/etc/default/dump1090-fa. I am very satisfied with the results. Please see screenshots below.

 

dump1090-localhost-misc-24h

 

&nbs;

 

3 Likes

applied advised settings re adaptive gain. results in 13.3 % of messages > - 3dbfs…


should I leave as per your image or make further changes. trying maximise feed contribution. TIA

1 Like

The screenshot of your graph was taken how many hours after making changes & restarting dump1090-fa?

You have to wait for at least 24 hrs after making changes and restarting dump1090-fa. Then only graph will show the affect of the changes.

2 Likes

left it another 20+ hours now down to 12.5%…

1 Like

(1) Reduce Maximum gain to 49.6.
The method depends on which image you are using (Piaware SD Card or Raspberry Pi OS?)

(1-a) If using Raspberry Pi OS image, edit file /etc/default/dump1090-fa, and change:
ADAPTIVE_MAX_GAIN=
TO
ADAPTIVE_MAX_GAIN=49.6

Save file after making above changes, then restat dump1090-fa

sudo systemctl restart dump1090-fa

(1-b) If using piaware sd card image issue following commands:

sudo piaware-config adaptive-max-gain 49.6

sudo reboot

 

(2) Please post screenshot of graph “Misc”.
Mine is given below for your reference.

dump1090-localhost-misc-24h

 

3 Likes

am using piaware sd image. Will apply change as advised and post upgated graph in 24 hours. I only updated your graphs app today so only have last few hours in misc

1 Like

This is not my graphs app, it is @wiedehopf’s graph app.

 

4 Likes

oops apologies no offence meant. :flushed:

1 Like

left it 20+hours now down to 11.4% pi was rebooted around 12 utc


1 Like

my adaptive gain wants to stay at the max…

2 Likes

This normally happens when ADAPTIVE_BURST is NOT set to yes

Check file /etc/default/dump1090-fa

 

1 Like

:woozy_face::woozy_face::woozy_face:spot on. thought I had done that as instructed. Will report again in 24. Ty ty

1 Like

Do you use vanila Raspberry Pi OS or Piaware SD card image?

If you are using piaware sd card image, then changes made to file /etc/default/dump1090-fa will disappear on reboot. In case of piaware sd card image, issue following commands:

sudo piaware-config adaptive-burst yes

sudo reboot

 

1 Like

I use piaware sd card image. burst is now set. thank you. Will post new graphs in 24

1 Like

last 24 hours graphs below now down to 3.4% with gain auto set to 37.2. what do you think?


1 Like

Messages > -3 dBFS (3.3% of messages) is good.

If adaptive-gain is used, then the gain=37.2 or any other value (for example gain=60) is just the starting point. Once adaptive-gain starts controlling the gain, the gain=xxx setting has no impact.

1 Like

I found that using adaptive gain, the range was noticeably reduced. That was because the gain gets adjusted too far down (about 15 dB in my setup). But you can set an adaptive minimum gain in /etc/default/dump1090-fa. So I set that to 20 dB.
ADAPTIVE_MIN_GAIN=20. I’m trying that now. May even need to be set a little higher.

2 Likes

I hope it’s OK if I jump into this thread, as ‘gain’ is currently on my plate.

On or about June 12, my gain jumped from 49.6 to something in the 50’s. It’s done this before, and then after a period of time, reverted back to 49.6.
Here’s a 90 day look at that graph.
image
When my gain increases like that, it causes the red area on this graph to go up to +30%,and I read recently that I want my red area below 3%.
Here’s a 14 day look at that.

So, upon reading this thread today, I decided to give adaptive gain an audition. Here is the result after a few hours.
image
And my red area has gone way down, to less than 1%. Is that OK?

Thanks,

Jay