For test
Fork of MyTest by
Embed:
(wiki syntax)
Show/hide line numbers
cal_const.cpp
00001 // CalConst.c 00002 // Calibration constants management 00003 // Real calibration values gotten from Charley on 2005-11-25. 00004 // OSC, PSBatTh, TempSLow, TempSHigh, PSd1_T1Max, PSd2_T2Max use theoratical cal constants not real calibration value. 00005 00006 // Version history 00007 // Version Date Author Remarks 00008 // -------------------------------------------------------------------------------------------------------------------------------- 00009 // 1.0 07-01-25 Frank Lu Original version for Codfish 00010 // 1.20 09-03-27 Kaiyuan Lv Add Gain and Offset into count 00011 00012 #include "cal_const.h" 00013 00014 00015 00016 #define amp_gain (222.0) 00017 #define Vofs_ir (3.0*10/(75000+10)) 00018 #define Nofs_ir (Vofs_ir*amp_gain*65535.0/3.0) 00019 00020 #define USE_CALIBRATION_CONSTANTS 20140925 00021 00022 00023 const struct CalibrationConstants CalConst_1M = { 00024 00025 #if USE_CALIBRATION_CONSTANTS == 0 //Default calibration constants 00026 // Td0 oC 00027 25.0, 00028 // Ofs 00029 -1212.0, 00030 // En[] 00031 {31364,45150,64897,93134,133437,190850,272476,388286,552245,783857,1110290,1569282,2213097,3113909,4371084,6121002,8550263,11913371,16556330,23188312,32059315,44200899,60770031,83314411,113897978,155264800,211052702,286071377,386664326,521180134,700587203,939278150,1256127582,1675892699,2231085089}, 00032 // ToS[] 00033 {65790,67945,70194,72544,75000,77570,80260,83078,86033,89135,92394,95820,99427,103229,107239,111475,115955,120699,125732,131078,136766,142829,149303,156231,163661,171647,180253,189552,199631,210591,222551,235656,250077,266023,283752}, 00034 // TempCo 00035 {0.0, -25.0}, 00036 // GainOfs 00037 {149.1055, 505.652}, 00038 // TempSHi 00039 273600.0, 00040 // TempSLo 00041 66600.0, 00042 #elif USE_CALIBRATION_CONSTANTS == 20140925 00043 // calibration constants 20140925 00044 // Td0 oC 00045 25.0, 00046 // Ofs 00047 -1212.0, 00048 // En[] 00049 {31364,45150,64897,93134,133437,190850,272476,388286,552245,783857,1110290,1569282,2213097,3113909,4371084,6121002,8550263,11913371,16556330,23188312,32059315,44200899,60770031,83314411,113897978,155264800,211052702,286071377,386664326,521180134,700587203,939278150,1256127582,1675892699,2231085089}, 00050 // ToS[] 00051 {65790,67945,70194,72544,75000,77570,80260,83078,86033,89135,92394,95820,99427,103229,107239,111475,115955,120699,125732,131078,136766,142829,149303,156231,163661,171647,180253,189552,199631,210591,222551,235656,250077,266023,283752}, 00052 // TempCo 00053 {0.0, -25.0}, 00054 // GainOfs 00055 {149.1055, 505.652}, 00056 // TempSHi 00057 273600.0, 00058 // TempSLo 00059 66600.0, 00060 00061 #else 00062 #error USE_CALIBRATION_CONSTANTS invalid! 00063 #endif 00064 00065 }; 00066 00067 const struct CalibrationConstants CalConst_2M = { 00068 00069 #if USE_CALIBRATION_CONSTANTS == 0 //Default calibration constants 00070 // Td0 oC 00071 25.0, 00072 // Ofs 00073 -11859.0, 00074 // En[] 00075 {79224,107010,144522,195140,263399,355386,479252,645900,869889,1170636,1573989,2114296,2837124,3802810,5091091,6807144,9089421,12119813,16136797,21452414,28474157,37733151,49920395,65933368,86935938,114435468,150382217,197297851,258442289,338031569,441524477,576003290,750685602,977622450,1272667230}, 00076 // ToS[] 00077 {39060,40443,41890,43405,44994,46660,48409,50247,52180,54215,56360,58623,61014,63542,66219,69058,72073,75280,78698,82346,86248,90430,94922,99760,104983,110638,116782,123479,130806,138856,147743,157604,168609,180970,194959}, 00078 // TempCo 00079 {16.0, -64.0}, 00080 // GainOfs 00081 {69.7778, 467.953}, 00082 // TempSHi 00083 183600.0, 00084 // TempSLo 00085 39600.0, 00086 #elif USE_CALIBRATION_CONSTANTS == 20140925 00087 // calibration constants 20140925 00088 // Td0 oC 00089 25.0, 00090 // Ofs 00091 -11859.0, 00092 // En[] 00093 {79224,107010,144522,195140,263399,355386,479252,645900,869889,1170636,1573989,2114296,2837124,3802810,5091091,6807144,9089421,12119813,16136797,21452414,28474157,37733151,49920395,65933368,86935938,114435468,150382217,197297851,258442289,338031569,441524477,576003290,750685602,977622450,1272667230}, 00094 // ToS[] 00095 {39060,40443,41890,43405,44994,46660,48409,50247,52180,54215,56360,58623,61014,63542,66219,69058,72073,75280,78698,82346,86248,90430,94922,99760,104983,110638,116782,123479,130806,138856,147743,157604,168609,180970,194959}, 00096 // TempCo 00097 {16.0, -64.0}, 00098 // GainOfs 00099 {69.7778, 467.953}, 00100 // TempSHi 00101 183600.0, 00102 // TempSLo 00103 39600.0, 00104 00105 00106 #else 00107 #error USE_CALIBRATION_CONSTANTS invalid! 00108 #endif 00109 00110 }; 00111 00112 00113
Generated on Tue Aug 2 2022 11:31:31 by
1.7.2
