source: Sophya/trunk/Poubelle/archediab.old/archediab.sources/c/mesures_bolo.c@ 637

Last change on this file since 637 was 637, checked in by ansari, 26 years ago

archediab version 24 initial import

File size: 3.9 KB
Line 
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
24void mesures_bolo(int fen,int carr,int tri,int flag)
25{
26double I,V,R,T,Pelec,Tcryo,Ptot,Pciel,tau;
27double a;
28def_gains;
29
30if(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 }
39else // 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
49if(!flag) return;
50
51if(!fenetre(fenetre_mesures_bolo)) nouveauT(fenetre_mesures_bolo,mesures_bolo_id,"mesures bolos");
52
53 //**************** tension corrigée du déséquilibre *******************
54
55if(I<0.000001) return;
56if(V<-1000000) return;
57if(V>1000000) return;
58
59
60Pelec=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
66a=1; if( (R>0) && (c(1) >0.01) ) a= log ( R / c(1) );
67T=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 ) //
72Tcryo=0.1;
73
74Ptot=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
81Pciel = 0; if( c(5)>Pelec) Pciel = c(5) - Pelec;
82a=1; if( c(6) >0.1 ) a = 1 - Pciel / c(6) ;
83tau=0; if( a>0 ) tau = - log ( a );
84
85
86
87ecritT(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
94ecritT(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
96if(T>0.01) ecritT(fenetre_mesures_bolo,fin_f," T=%6.1fmK ", T*1e3);
97
98if( 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
103ecritT(fenetre_mesures_bolo,fin_f,"\n");
104}
Note: See TracBrowser for help on using the repository browser.