1 | #include "diabolo.h"
|
---|
2 | #include "bolo.h"
|
---|
3 |
|
---|
4 | //********* coefficients pour les mesures bolo ***************************************************
|
---|
5 | // //
|
---|
6 | // -1- loi de reponse thermique des bolos avec R en ohms et T en Kelvin coef 0,1,2 //
|
---|
7 | // //
|
---|
8 | // T = coef2 * ( ln ( R / coef1) ** ( -1 / coef0 ) //
|
---|
9 | // //
|
---|
10 | // -2- fuite thermique du bolo coef 3,4 //
|
---|
11 | // //
|
---|
12 | // Ptot = coef3 * ( Tb ** coef4 - Tcryo ** coef4 ) //
|
---|
13 | // //
|
---|
14 | // -3- calcul empirique de Pciel et de tau coef 5,6 //
|
---|
15 | // //
|
---|
16 | // Pciel = V * I - coef5 coef5= I * Ai (tables xavier) //
|
---|
17 | // tau = - ln ( 1 + Pciel / coef6 ) coef6= I * Bi (tables xavier) //
|
---|
18 | // //
|
---|
19 | //******************************************************************************************************//
|
---|
20 |
|
---|
21 | #define c(i) (1e-4*(double)parametr.bolo[fen-1].coef[i])
|
---|
22 |
|
---|
23 |
|
---|
24 | void mesures_bolo(int fen,int carr,int tri,int flag)
|
---|
25 | {
|
---|
26 | double I,V,R,T,Pelec,Tcryo,Ptot,Pciel,tau;
|
---|
27 | double a;
|
---|
28 | def_gains;
|
---|
29 |
|
---|
30 | if(parametr.bolo[fen-1].bolo_diviseur) // BEBO normale ou MLPA
|
---|
31 | {
|
---|
32 | I = (double)tri / pt_micA(fen); // I en µA
|
---|
33 | V= (double) carr / pt_micV(fen); // V en µVolts
|
---|
34 | if(I>0.0000001) R=V/I; else R=0; // R en
|
---|
35 | if(R>=1e6) ecritD(fen,b_res,"%7.3fM %6.3fnA %7.3fmV",R*1e-6,I*1e3,V*1e-3);// R en M I en nA et V en mV
|
---|
36 | else ecritD(fen,b_res,"%6.2fK %6.3fnA %7.3fmV",R*1e-3,I*1e3,V*1e-3);// R en K I en nA et V en mV
|
---|
37 | V=V-xbolbrut(fen-1); // corrigée du déséquilibre en µV
|
---|
38 | }
|
---|
39 | else // pour carte BEBO modifiée (mesure temperature)
|
---|
40 | {
|
---|
41 | I = 1e-3 * (double)carr * 2441. / parametr.bolo[fen-1].bolo_capa; // I en µA
|
---|
42 | V=xbolbrut(fen-1); // V en µVolts
|
---|
43 | if(I>0.0000001) R=V/I; else R=0; // R en
|
---|
44 | if(R>=1e3) ecritD(fen,b_res,"%7.3fK %6.3fnA %7.3fmV",R*1e-3,I*1e3,V*1e-3);// R en K I en nA et V en mV
|
---|
45 | else ecritD(fen,b_res,"%6.2f %6.3fnA %7.3fmV",R,I*1e3,V*1e-3); // R en I en nA et V en mV
|
---|
46 | }
|
---|
47 |
|
---|
48 |
|
---|
49 | if(!flag) return;
|
---|
50 |
|
---|
51 | if(!fenetre(fenetre_mesures_bolo)) nouveauT(fenetre_mesures_bolo,mesures_bolo_id,"mesures bolos");
|
---|
52 |
|
---|
53 | //**************** tension corrigée du déséquilibre *******************
|
---|
54 |
|
---|
55 | if(I<0.000001) return;
|
---|
56 | if(V<-1000000) return;
|
---|
57 | if(V>1000000) return;
|
---|
58 |
|
---|
59 |
|
---|
60 | Pelec=V*I; // pW
|
---|
61 |
|
---|
62 | // -1- loi de reponse thermique des bolos avec R en ohms et T en Kelvin coef 0,1,2 //
|
---|
63 | // //
|
---|
64 | // T = coef2 * ( ln ( R / coef1) ** ( -1 / coef0 ) //
|
---|
65 |
|
---|
66 | a=1; if( (R>0) && (c(1) >0.01) ) a= log ( R / c(1) );
|
---|
67 | T=0; if( (a>0) && (c(0)>0.01) ) T= c(2) * pow( a , -1 / c(0) );
|
---|
68 |
|
---|
69 | // -2- fuite thermique du bolo coef 3,4 //
|
---|
70 | // //
|
---|
71 | // Ptot = coef3 * ( (10*Tb) ** coef4 - (10*Tcryo) ** coef4 ) //
|
---|
72 | Tcryo=0.1;
|
---|
73 |
|
---|
74 | Ptot=0; if( (c(4)>0.01) && (T>0.01) ) Ptot = c(3) * ( pow(10.*T,c(4)) - pow(10.*Tcryo,c(4)) );
|
---|
75 |
|
---|
76 | // -3- calcul empirique de Pciel et de tau coef 5,6 //
|
---|
77 | // //
|
---|
78 | // Pciel = coef5 - V * I coef5= I * Ai (tables xavier) //
|
---|
79 | // tau = - ln ( 1 + Pciel / coef6 ) coef6= I * Bi (tables xavier) //
|
---|
80 |
|
---|
81 | Pciel = 0; if( c(5)>Pelec) Pciel = c(5) - Pelec;
|
---|
82 | a=1; if( c(6) >0.1 ) a = 1 - Pciel / c(6) ;
|
---|
83 | tau=0; if( a>0 ) tau = - log ( a );
|
---|
84 |
|
---|
85 |
|
---|
86 |
|
---|
87 | ecritT(fenetre_mesures_bolo,fin_f,"%d %s :",fen,parametr.bolo[fen-1].bolo_nom);
|
---|
88 |
|
---|
89 | //ecritT(fenetre_mesures_bolo,fin_f,"%s (b%d) :"/* bebo=%d num=%d gain_pa=%d coef0=%g coef1=%g coef2=%g */,
|
---|
90 | // parametr.bolo_nom[fen-1],fen,parametr.bolo[fen-1].bolo_bebo,parametr.bolo[fen-1].bolo_num,parametr.bolo_gain[fen-1]
|
---|
91 | // ,parametr.coef[fen-1][0],parametr.coef[fen-1][1],parametr.coef[fen-1][2]);
|
---|
92 |
|
---|
93 |
|
---|
94 | ecritT(fenetre_mesures_bolo,fin_f," R=%7.3fM I=%6.3fnA V=%7.3fmV Pelec=%5.1fpW",R*1e-6,I*1e3,V*1e-3,Pelec);
|
---|
95 |
|
---|
96 | if(T>0.01) ecritT(fenetre_mesures_bolo,fin_f," T=%6.1fmK ", T*1e3);
|
---|
97 |
|
---|
98 | if( Ptot>0.1) ecritT(fenetre_mesures_bolo,fin_f," Ptot=%5.1fpW Pciel=%5.1fpW tau=%5.3f ",Ptot,Pciel,tau);
|
---|
99 |
|
---|
100 |
|
---|
101 | //ecritT(fenetre_mesures_bolo,fin_f,": C=%g ptmic=%g\n",capa(fen),pt_micA(fen));
|
---|
102 |
|
---|
103 | ecritT(fenetre_mesures_bolo,fin_f,"\n");
|
---|
104 | } |
---|