during CLGC configuration I found the following values:
adi,clgc-tx1-desired-gain -2000 (value = 100 * dB (valid range -32768 to 32767) - total gain and attenuation from Mykonos Tx1 output to ORx1 input in (dB * 100)
adi,clgc-tx2-desired-gain -2000 (value = 100 * dB (valid range -32768 to 32767) - total gain and attenuation from Mykonos Tx2 output to ORx2 input in (dB * 100)
described here: https://wiki.analog.com/resources/tools-software/linux-drivers/iio-transceiver/ad9371-customization
The default value I can read at system startup before configuration is the following: -200My questions are:
1) The dB value I calculate from -200 is 2 dB, is it correct even if the default value is supposed to be -20 dB?2) How should I change this value? I have a variable attenuator between TX1 Output and ORX1 input, setted at 20 dB. Should I use -2000 (-20 dB) ?3) If I understand correctly, by configuring this, I am comunicating to the clgc actuator my attenuation/gain between the tx1 output and orx1 input. I am not setting any extra gain/attenuation. Right?
CLGC maintains output power constant by monitoring ORx feedback power with respect to input power. For the CLGC to understand what Orx power corresponds to the nominal rated output power , you need to enter loop gain (desired gain).
Once this value is set the CLGC tracking will continuously adjust TX attenuation to maintain constant output power..
1. Yes correct. Value given by 100 × (Desired Gain in dB).
2. This value should be your loop gain from Tx output to Orx input to get rated output power. Yes if after PA gain and Orx attenuation your total gain is -29 dB , you can set this as -2000.
Thank you.Sorry few more clarificatitons:
1) Is 'adi,clgc-tx1-desired-gain' the starting point for 'out_voltage0_clgc_desired_gain' ?
About out_voltage0_clgc_desired_gainIf I use the nominal value of my loop gain, I will have a +11.5 of gain coming from 54.5 dB gain of RF -43 dB attenuation for feedback. And I am not adding the -8.5 dB of TX attenuation in the hardware gain section.
2)If I set this value the CLGC changes completely my output value on spectrum analyzer.The value that allows me to have the output I would reach without CLGC enable is -8. Is it how I am supposed to work?Do I have to find manually the level even if it is very different from my loop gain?
3) Is it correct to not include the tx hardwaregain of transceiver tx in the out_voltage0_clgc_desired_gain calculation?
For Loop gain you may need to consider Tx and Orx attenuation as well theoretically.
Loop gain = ORx Rms power / Tx Rms power. These powers are measured in digital domain . (before Tx atten and after Orx atten).
So to calculate loop gain you can do the following. .
Before enabling CLGC tracking , set Tx attenuation and digital power to get rated output power. Now measure Tx power (digital, using below API) and Orx power using below functions and calculate Loop gain.
Once you set loop gain , you can enable CLGC and it will adjust Tx attenuation to maintain same ORx power/Tx power ., (Output power).
thank you for your reply.I don't have access to API since I have a custom board with OS integrating Driver from AD.For the same results I checked the following:
But to do so I have to enable tracking that is the only way I know to enable CLGC.So the ratio here is going to provide me -6.7, that is pretty close to the -8 i found empirically.1) The Rx RMS and Orx RMS are slightly changing with power levels, but is the ratio supposed to stay the same in every working condition?2) should I provide a mechanism for Desired Gain update if I experience a variation on the ratio?
MarinaCibin said:1) Is 'adi,clgc-tx1-desired-gain' the starting point for 'out_voltage0_clgc_desired_gain' ?
I am not that familiar with the above Driver API function. Please post your query in Linux Software driver forum.