Skip to content

Commit 11da80a

Browse files
author
BasicAirData
committed
IASFix
90000 Pa, 988.49 m
1 parent f8c440a commit 11da80a

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

Software/Arduino/Libraries/AirDC/AirDC.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ AirDC::AirDC(int pid)
1919
_T=288.15;
2020
_RH=0.0;
2121
_qc=0.0;
22+
_AOA=0.17;
23+
_AOS=0;
2224
_IAS=0.0;
2325
//Uncertainty of measurements
2426
_uRho=0.0; //To be calculated, 0 default value
@@ -28,6 +30,7 @@ AirDC::AirDC(int pid)
2830
_uqc=5.0;
2931
_uIAS=0.0;//To be calculated, 0 default value
3032
_uTAT=0.0;//To be calculated, 0 default value
33+
3134
}
3235
//RhoAir(Pressure,Temperature,Relative Humidity,mode)
3336
//Mode 1 is the default BasicAirData routine
@@ -222,11 +225,12 @@ void AirDC::ISAAltitude(int mode)
222225
case 1:
223226
{
224227
double Ps,h;
225-
Ps=_p/133.3223684211/25.4;//Pa to inHg Conversion
228+
Ps=_p*0.000295299875080277;//Pa to inHg Conversion
226229
//Using Goodrich 4081 Air data handbook formula
227-
_h=(pow(29.92126,0.190255)-pow(Ps,0.190255))/0.000013125214; //US atmosphere 1962
230+
231+
_h=(pow(29.92126,0.190255)-pow(Ps,0.190255))*76189.2339431570; //US atmosphere 1962
228232
//Back to SI
229-
_h=h*0.3048;
233+
_h=_h*0.3048;
230234
_uh=0.057989724*pow(Ps,-0.809745)*258006317.725680592912*_up;
231235
}
232236
}
@@ -309,8 +313,8 @@ void AirDC::Viscosity(int mode)
309313
{
310314
case 1:
311315
{
312-
//Calculate viscosity. Sutherland's formula, note that unit of measurement [Pas] is multiplied by 10e3
313-
_mu= 18.27*(291.15+120)/(_T+120)*pow((_T/291.15),(3/2));
316+
//Calculate viscosity. Sutherland's formula, note that unit number multiplied 10e6
317+
_mu= 18.27*(291.15+120)/(_T+120)*pow((_T/291.15),(3/2))*1e-6;
314318
}
315319
}
316320
}

Software/Arduino/Libraries/AirSensor/AirSensor.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ void AirSensor::ReadDifferentialPressure(AirDC *out,int sensor)
105105
raw = analogRead(analogPin);
106106
Vread=5.0/1023.0*(raw);
107107
Pread=(Vread-2.5-offsetv)*1000;
108-
#if DEBUG==1
109108
Pread=1000;
110-
#endif
111109
out->_qc=Pread; //pa
112110
out->_uqc=50.0;//pa
113111
}

0 commit comments

Comments
 (0)