CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches
The Detector Bias

Managing of the detctor bias

SUMMARY:

Detector bias: general



Every channel has one quad-trimmer chip, the AD5263 datasheet, to set the positive and negative bias applied to the load resitor in simmetric way. A scheme of the AD5263 is in figure Figure_Trimmer_AD5263.
The bias channels are 2 to allow to power in asymmetric way the 2 OAs: from +5 V up to +30 V and -5 V the OA for positive generation and from -5 V down to -30 V and +5 V the OA for negative generation of the bias. The amount of generating bias depends on the value of the pair of trimmers, coarse and fine, used at the input of each channel. The function to use is detector_scrittura_lettura_trimmer_bias() (refer to the Trimmer page for datail). Here an example:

detector_scrittura_lettura_trimmer_bias( scheda_su_scheda_giu_provvisorio, canale_, detector_trimmer_bias_coarse_pos, 118, 1);
detector_scrittura_lettura_trimmer_bias( scheda_su_scheda_giu_provvisorio, canale_, detector_trimmer_bias_coarse_neg, 138, 1);
void detector_scrittura_lettura_trimmer_bias(uint8_t scheda_su_scheda_giu, uint8_t canale, uint8_t trimmer, uint8_t valore, uint8_t scrivi_1_leggi_0)
Setting the value of any trimmer for detector biasing, the contents of the trimmers are stored in the...
Definition: Trimmer.c:238


From the example above we can extract 2 important rules. The first is the selection of the trimmer to use that can be done by the definitions, the value of the definition is its bullet:

  1. Detector_trimmer_coarse_bias_pos
  2. Detector_trimmer_coarse_bias_neg
  3. Detector_trimmer_fine_bias_pos
  4. Detector_trimmer_fine_bias_neg



The second regards the value that the trimmers should take. The middle value is at 128. The coarse trimmer has a negative gain so for positive output voltages the trimmer must take values smaller than 128, the inverse happens for negative output volatges.
Considering the present hw setting we expect that the wiper, as a consequence of the trimmer attenuation (1k + 1k with the 20k trimmer, detector_trimmer_attenuation_x_1000), a step of about 35 mV. This gives, at the OA output a valu of (the gain is 2M / 270k, detector_OA_inverting_gain_x_1000) 0.2604 V per step.
Now the effect of the fine trimmer, starting with an example:

detector_scrittura_lettura_trimmer_bias( scheda_su_scheda_giu_provvisorio, canale_, detector_trimmer_bias_fine_pos, 148, 1);
detector_scrittura_lettura_trimmer_bias( scheda_su_scheda_giu_provvisorio, canale_, detector_trimmer_bias_fine_neg, 108, 1);


This trimmer has an attenuation at its output of 101 ( 10K over 1M, its inverse is this: detector_fine_trimmer_attenuation). It is applied to the non-inevrting input of the OA and therefore, its gain is one unit larger than that for the coarse gain (= 2M/270K +1, detector_OA_non_inverting_gain_x_1000). Important: for obatining a positive variation of the output voltage the trimmer value must exceed 128, the opposit for obtaining a negative output voltage.
Every wiper step is expected one hundred smaller than before, or 0.378 mV, while the OA output 2.96 mV per step.
Summary:


Table slopes and trimmers
Reading node Detector bias slope trimmer /gain
Bias positive corse: 0.264 V/step Detector_trimmer_coarse_bias_pos / negative gain
fine: 2.99 mV/step Detector_trimmer_fine_bias_pos / positive gain
Bias Negative corse: 0.2604 V/step Detector_trimmer_coarse_bias_neg /negative gain
fine: 2.99 mV/step Detector_trimmer_fine_bias_neg / positive gain
Note
The OA outputs are read with an attenuation of 16k / 100k or 1/7.25, detector_attenuazione_della_lettura_x_1000. The same attenuation is applied to the reading of the external bias.

FigureTrimmer_AD5263: simplified

User use with CAN bus of the detector bias



Every channel can have adjusted its detector bias with 4 trimmers. The bias is given differential and the positive value equals the absolute negative value. For each branch 2 trimmers are dedicated, the MS 8 bits and the LS 8 bits for each. The resolution is almost 16 bits. The content of each trimmer is in the matrix 12 x 4 contenuto_trimmer_detector[12][4]. There is another vector where the content of the target voltage to be set, in mV, are stored. This is the Detector_bias_target[12]. In both the matrix and the vector the positions are 12 to account for the lower and upper board.
When we need to set a bias we have to consider 2 instructions. The first allows to set the target voltage for each channels. This voltage can be the same or different for each channel. The function to do this is instr_detector_Vbias_we_want_to_set_function():

286uint8_t canali_ , canali_input=vettore_istruzioni[istruzione_byte_4_e_scelta_canale];
287 uint8_t scheda_su_giu = ((canali_input >> 7) & 1)*6;
288 uint8_t offset_scheda=0;
289 int32_t bias_to_apply,ADC_max_bias_pos, ADC_min_bias_neg;
290 if (scheda_su_giu){
291 offset_scheda=6;
292 }
299 bias_to_apply=(( *(uint16_t *)vettore_istruzioni ) & 0xFFFF) *1000;
300
301 if(ADC_max_bias_pos > ADC_min_bias_neg){
302 ADC_max_bias_pos=ADC_min_bias_neg; //prendiamo la pi\'u piccola delle 2 tensioni
303 }
304
305 if(bias_to_apply > ADC_max_bias_pos){
306 bias_to_apply=ADC_max_bias_pos;
307 }
308 ADC_max_bias_pos =bias_to_apply/1000;
309 tx_data[0]= ADC_max_bias_pos & 0xff;
310 tx_data[1]= (ADC_max_bias_pos >>8) & 0xff; //Ritorniamo il valore effettivo impostato
311
312
313 for( canali_=0; canali_ <6; canali_ ++){
314 if( (canali_input >> canali_) & 1){
315// Detector_bias_target[offset_scheda + canali_]= (( *(uint16_t *)vettore_istruzioni ) & 0xFFFF) *1000 ;
316
317 Detector_bias_target[canali_ + scheda_su_giu]= bias_to_apply ; //Lasciamo il limite a 6
318 }
319 }
321}
int32_t ADC_misura_differenziale_con_media_generico(uint8_t scheda_su_scheda_giu_, uint8_t preamplifier_externalADC_1_onboardADC_0, uint8_t nodo_da_misurare, uint8_t differenziale_1_single_0)
This function sets the original gain when a few LSb have to be determined. The umber of bits is bit_t...
Definition: Adc.c:899
volatile uint16_t ADC_medie_per_misura
the number of ADC readings to average, the maximum is 400
Definition: Adc.c:206
volatile bool ADC_non_leggi_lo_offset_se_true
if not necessary, the ADC input offset from buffer is not read
Definition: Adc.c:200
uint8_t tx_data[8]
Transmission data vector.
Definition: Can.c:321
int32_t Detector_bias_target[12]
Detector bias target values.
void instr_detector_Vbias_we_want_to_set_function(void)
#define Detector_max_limit_to_rail
Definition: Detector_Bias.h:24
#define istruzione_byte_4_e_scelta_canale
Definition: Istruzioni.h:24
volatile int8_t vettore_istruzioni[8]
This is a copy of the received 8 bytes from the CAN.

The bias, stored in the first 2 Bytes of the instruction data received, is applied to the channel(s) for which there is a "1" in the corresponding position at Byte6.
After that the target bias have been set it must be adjusted. This can be done by calling the function instr_Vbias_to_be_set_function(). These 2 commands are called in sequence over the CAN.
Trimmer contents can be readback with the CAN command da instr_detector_scrittura_lettura_trimmer_bias.

The approach to the detector bias setting



The approach to the bias setting considers independent the positive and negative branches of the bias, and avoids suddend voltages changes typical of the Successive Aapproximation procedure.
One of the OA feedback resistances and the load resistances have a good relative matching, but a few % of absolute matching. There are 2 fed backed OAs, Figure_detector_bias_setup, and, to minimize common mode settings, the bias for them is provided in an independent way and the detector resistances, RLxy in Figure_detector_bias_setup are calibrated.

Figure_detector_bias_setup 1: Bias setup system for detector bias.

br


The branch that provides the positive bias, VHV+, or more generically called Vbias, is supplied from -5 V up to 30 V, while the that providing the negative bias, VHV-, or more generically called Vbias, is supplied from +5 V down to -30 V.
The trimmers are biased from a precise pair of ±5 V and the setting of the wiper is independent from the OA power supplies.
The resistance, hence the slopes at the wipers, are previously calibrated and stored in the preamplifier EPROM. If calibration is not already provided it is measured, once, before the bias setting.
The knowledge of the slope is important to limit the use of the Successive Approxiamtion Registre, SAR, technique. The first step for setting the bias is to calculate the gues value for the trimmer. Then the residual error is measured and the SAR is applied to 2 or 3 bits only. This avoid the first steps of the classical SAR that consist of try with half the full scale of the ouput value, that can be 15 V even if the bias to apply is a few hundreds of mV.
The adjusting is done by a function that has embedded 2 other static functions. They are:


  1. instr_Vbias_to_be_set_function() sets some starting value for the parameters to use and retrieve the calibrations for the load and refernce resistors from the preamplifier EPROM. If the calibrations have not yet done they are evaluated at this moment and stored in the EPROM at the proper location. After that this initial procedure ends the Detector_aggiusta_offset_SAR() is called.

  2. The fisrt step Detector_aggiusta_offset_SAR() does is to call misura_il_valore_trimmer_detector() for evaluating the gues values and the erros, namely the minimum number of LS bits to evaluate in SAR, for the MSB of both the positive and negative branches. At this point the SAR is applied to thebits, minimum 2, of the MSB. At the end of this procedure misura_il_valore_trimmer_detector() is called again to find the gues value for the LSB. To the LS bits from the residual error, minimum 2, the SAR is applied. In this way the SAR is applied to a minimum of 4 bits, against 16 bits.

  3. misura_il_valore_trimmer_detector() determines the gues value for the MSB and LSB. It measures the bias a fisrt time and determines the gues value for the trimmer, either MSB or LSB. Then a new measure is done to evaluate the residual error.
See also
instr_Vbias_to_be_set_option is the CAN isntruction to set the bias voltage value and instr_Vbias_to_be_set_option is the CAN isntruction to adjust the bias at the target value set with the previous instruction.

The codes for managing the bias are: