ramdor / Thetis

The main working repo for changes to Thetis for the Apache Labs line of radios. Find us here : https://discord.gg/6fHCRKnDc9
https://discord.gg/6fHCRKnDc9
GNU General Public License v2.0
55 stars 14 forks source link

[BUG] ATT button/function loads incorrect attenuation level into front-end attenuator on RX1 in 20dB position #511

Closed K1VF closed 1 month ago

K1VF commented 2 months ago

Describe the bug. INCORRECT ATTENUATION LEVEL on RX 1 When using the "ATT" button drop-down menu, selecting "-20dB" on RX 1 loads the incorrect attenuation level into the Mini-Circuits 31dB attenuator. This appears to happen under multiple versions of Thetis.

To Reproduce Set RX1 to 40m, Rx ANT to port 2 (no external ANT) and inject a -73dBm signal at 7.020Mhz to ANT port 2 (that you would use to perform a Level CAL). Note the following observations in three columns below:

ATT S-Meter Noise Floor dB dBm dBm

0 -73.0 -157

-10 -72.9 -147

-20 -62.7 -128 (these are incorrect levels)

-30 -72.6 -127

Expected behaviour ATT S-Meter Noise Floor dB dBm dBm

0 -73.0 -157

-10 -72.9 -147

-20 -73 -137

-30 -72.6 -127

Operating Conditions-Versions: Anan 7000DLE MK II, Thetis v2.10.3.6 07/11/24, FW v2.0.0 Protocol 2 dev_5b

Additional context I believe that the "ATT" button/function is simply a "preset" that recalls 0, -10, -20, -30 as a "shortcut" to using S-ATT To manually select attenuation level using S-ATT, double-click the "ATT" text and manually select +10, +20 or +30dB in 1-dB steps.

NOTEs:

  1. Setting S-ATT to +20dB on RX 1 corrects the problem, and therefore it appears that this is a Thetis or Firmware bug.
  2. Performing the identical procedure on RX 2 works correctly with either/both ATT and S-ATT functions/buttons
  3. Even though RX 1 and RX 2 each have their own independent mini-circuits attenuators on their front-ends, the ATT and S-ATT buttons/functions sets both RX 1 & RX 2 simultaneously, even though the hardware is intended for them to each have their own independently controlled attenuation levels. For example, RX 1 should be able to be set to -10dB and RX 2 -30dB, if desired by the user.
  4. Identical testing on a G2 with Thetis 2.10.0 (6/19/23) FW v2.0.0 Protocol 2 does not exhibit this problem

This apparent bug has been around for quite a while (on the 7000DLE Mk II) but I can't tell if it's in Thetis or the Firmward build. Any suggestions on how to further isolate would be welcomed. However, in the mean time, it should be easy to replicate, and has been verified on other 7000DLE MK II's.

ramdor commented 2 months ago

I have just done some extensive tests and I am seeing the same anomaly, with exception to your point 2. above. I see the same anomaly if using ATT or S-ATT on RX1 at -20dB. I have checked the Thetis client code and there does not seem to be an issue. The results are here : https://docs.google.com/spreadsheets/d/1I2EYlQacaUgzXJZ6llnDNS2NFZ2ZQMIbgAn-dYn_yOE

Image for posterity in-case I remove the sheet at some point.

image

K1VF commented 2 months ago

Ramdor: Thank you for the fast reply. Your setup and input source/level are not quite the same as what I used, but using strictly your noise floor measurements, it appears at first glance that you do NOT have the same issue. Possibly the difference is the much later FW version you're using, v2.2.2 vs v2.0.0. I'll have to revisit how to use whatever the correct boot loader is for the 7000DLEMkII to update to FW v2.2.2 w/o bricking the radio and then report back. K1VF

ramdor commented 2 months ago

yes i do not have a calibrated source, but the signal from the gpsdo will be consistent, and it does show that on my setup there is an unexpected deviation when using -20, for both S-ATT and ATT, which is different to you only viewing it when using ATT and not S-ATT. I didn't want to bother changing all the input cables to my system so just used the 'general pickup' from the gpsdo being close by.

ramdor commented 2 months ago

also, remember that the NF readings are 'averaged' over the viewable zoomed in spectrum, and will tend to ignore the signal in that scenario. The real important values to look at are the dBm readings, and you can see the red highlighted ones are not exactly where they are expected to be.

ramdor commented 2 months ago

what it does show, is that there is a disparity between the behaviour of using ADC0 and ADC1 and -20dB of attenuation, when using either ATT or S-ATT, at least on my radio.

K1VF commented 2 months ago

Thank you again Richie. I have tried flipping assignment of ADC0 and ADC1 between RX 1 and RX 2 no difference. The issue only happens on RX 1 in the ATT = -20dB position, regardless of which ADC is assigned.

I will need to try FW v2.2.2, but I need to find that file, as well as the boot-loader procedure, as it has been five or so years since I've used it. I will report back.

K1VF commented 2 months ago

Hi Richie:

Can you try to take a look at RX1 vs RX2 again, at 0, 10, 20, 30dB ATT positions i.e., the noise floor, but this time with the ANT port terminated to a 50-ohm load? This will prevent the AGC from skewing the result.

My 7000DLEMkii-015 has the anomaly only on RX1 and only in ATT=-20dB, while S-ATT works perfectly. It's looking more like Thetis is sending the wrong ATT into from the 20-dB drop-down menu.

Also, just curious, is there any reason that the ATT and S-ATT functions/buttons can't be isolated for RX1 & RX2, so that RX1 can be set to 0dB and RX2 to -20, for example. I see no reason that the software needs to lock these together, as the hardware supports setting them independently.

Thank you.

ramdor commented 2 months ago

i will test this tomorrow, busy atm. However, the locking, as much as I can remember without testing and looking at the code, is that they become locked only if rx1 and rx2 use the same adc

laurencebarker commented 2 months ago

Hi Richie

I can’t look at the code this week but wouldn’t they also be locked if diversity was selected?

Laurence Barker G8NJJ

@.***

From: Richie @.> Sent: 23 September 2024 22:08 To: ramdor/Thetis @.> Cc: Subscribed @.***> Subject: Re: [ramdor/Thetis] [BUG] ATT button/function loads incorrect attenuation level into front-end attenuator on RX1 in 20dB position (Issue #511)

i will test this tomorrow, busy atm. However, the locking, as much as I can remember without testing and looking at the code, is that they become locked only if rx1 and rx2 use the same adc

— Reply to this email directly, view it on GitHub https://github.com/ramdor/Thetis/issues/511#issuecomment-2369390560 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEXTXZZDRYP7JR6LQYVWT5LZYB7M3AVCNFSM6AAAAABOUW4O3CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRZGM4TANJWGA . You are receiving this because you are subscribed to this thread. https://github.com/notifications/beacon/AEXTXZ2S6ME3PHDOTUTWML3ZYB7M3A5CNFSM6AAAAABOUW4O3CWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUNHID6A.gif Message ID: @. @.> >

ramdor commented 2 months ago

they are locked yes, unless the option is chosen to unlock them in diversity form iirc. A user needed that option somewhere along the line, but that is not the issue here really, it is the rx1 anomaly on -20db att. I will test again later this evening.

rz3qs commented 2 months ago

For information. I have the first protocol. H/W select Anan-7000DLE. Everything works correctly. When calibrating the level of the ATT RX1 the value of 0, -20, 0 dB changes. In the S-ATT and ATT mode, everything is fine.

ramdor commented 2 months ago

some more tests, with an actual signal. Results: no issues observed. Vid below.

https://youtu.be/34DGQ63spdw

rz3qs commented 2 months ago

Also recorded a ATT check. For information, a keepsake. https://drive.google.com/file/d/1rk-nNzgcQw4AlmO71ZFUG9psDXJnhp7-/view?usp=drive_link

w-u-2-o commented 2 months ago

Hello all,

One other thing to make note of: the specific 10/20/30 settings are there based on the presence of discrete 10 and 20 dB attenuators in designs prior to the 8000 (which came before the 7000 even though it is the 8000 😉). The 8000 and all 7000 derivatives (including Andromeda and G2) do not have these discrete attenuators on their RF boards. There is only the 31dB step attenuator on the SDR board (Orion MK-something, depending on the variant), one for each ADC.

This begs the question of why the additional complexity of two different attenuator control modes are maintained in Thetis? Even on the older hardware (200D and prior) is any more than 31dB of attenuation ever really necessary?

73!

Scott/wu2o

On Tue, Sep 24, 2024 at 7:21 AM rz3qs @.***> wrote:

Also recorded a ATT check. For information, a keepsake.

https://drive.google.com/file/d/1rk-nNzgcQw4AlmO71ZFUG9psDXJnhp7-/view?usp=drive_link

— Reply to this email directly, view it on GitHub https://github.com/ramdor/Thetis/issues/511#issuecomment-2370980369, or unsubscribe https://github.com/notifications/unsubscribe-auth/AX4YGS6MGRE3SOSN2DOLKDLZYFDMXAVCNFSM6AAAAABOUW4O3CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZQHE4DAMZWHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

K1VF commented 2 months ago

Thank you for all of the feedback.

The following has been confirmed on two other 7000DLE's using FWv2.0.0 as well as v2.2.2

Used REVO to remove Thetis v2.10.3.6 (07/11/24) (FW v2.0.0 Protocol 2)dev_5b on S/N 70000DLEMKII-015. Renamed database folder.

Installed a fresh thetis v2.10.0 6/19/23 from W5WC github releases site fixes the ATT problem at -20dB on RX1. Problem fixed.

Removing v2.10.0 and re-installing v2.10.3.6 and the ATT at -20dB on RX1 problem reappears.
Fresh database used in both cases no importing of old databases was performed.

Setting RX1 to ADC0 and RX2 to ADC1 separates the ATT buttons so that ATT can be set separatly to different levels for RX1 and RX2, as would be expected.

Regarding Scott's question about ATT and S-ATT modes, I thought the programmers choice to make the ATT button a drop-down shortcut in the case of a 7000DLE (with programmable 1-dB step enumerator) was pretty clever. I like that it has both ATT and S-ATT functions, if only the bug could be fixed.

QUESTION-REQUEST Can anyone fix the ATT at -20dB issue on RX1 in current releases of Thetis, please?

Thank you.

Vince K1VF

ramdor commented 2 months ago

@K1VF another follow up video : https://youtu.be/Mu_QNHWOVkY

note: I have removed my previous posts which were not using an injected signal

ramdor commented 1 month ago

closing this as I do not believe there is an issue. Will reopen if any more feedback/info is provided. No one else is reporting this either and they have specifically tested -20db att and -20sa