Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the $DTS command in order to remotely set some data fields before computation #63

Open
GrazianoCapelli opened this issue Jan 12, 2018 · 7 comments
Assignees

Comments

@GrazianoCapelli
Copy link
Member

With the $DTS string we could set some useful data, like the external temperature.
The firmware could use the status matrix to choose between two behaviors (in acquisition phase):

  • Read the sensor and write the value into the appropriate field
  • Put the last value (received by the $DTS string) into the appropriate field
@GrazianoCapelli GrazianoCapelli self-assigned this Jan 12, 2018
@GrazianoCapelli
Copy link
Member Author

Implementation started (commit 315e132).
Now it is possible to disable the external temperature sensor (using $STS,-1,-1,-1,0,-1,-1,-1,-1,-1) and then force the External Temperature value (using $DTS,0,0,0,0,0,0,0,0,300,0 to force 300 [K] for example).

@GrazianoCapelli
Copy link
Member Author

The implementation now includes the absolute and the differential pressure, with their relative temperatures (commit 0255e11).
The overall character to leave fields as is is changed, now is the =.
Thus, we can use $DTS,=,=,=,=,=,=,=,=,300 to force the external temperature to 300 [K].

@GrazianoCapelli
Copy link
Member Author

GrazianoCapelli commented Jan 16, 2018

One observation about the external temperature:

When the temperature sensor is not present, the value can be regularly updated via the $DTS command. But the assignment can also be a one-time operation, in case there are no devices that can keep updated the value.

In the second case we could compensate with the altitude drop considering the standard ISA Environmental lapse rate of 6.49 [K/km]?
Maybe it will be a better approximation (in a good range and with a given initial value) than leave the temperature constant.

@JLJu
Copy link
Member

JLJu commented Jan 16, 2018

Right, and the possibility of transfer data between the ADC and the attached devices is useful.

ISA altitude(with standard troposphere temperature lapse) can be calculated using AirDC::ISAAltitude(int mode=1). That calculation, as standard, does not use temperature as input data. This attitude is considered as a baseline.

On the other hand, ground pressure and ground temperature can be used to obtain a better altitude measurement.

ISAAltitude(int mode=2) uses ground pressure(#60) to get better altitude readings. See https://www.basicairdata.eu/projects/barometric-altimeter/ (Altitude compensated by pressure at sea level). This method is used on full-size aircraft.

Mode=3 includes temperature and pressure correction; I will paste the method into the code as soon as possible

The use of outside temperature impacts directly on the calculation of the true airspeed

@JLJu
Copy link
Member

JLJu commented Jan 17, 2018

The idea to handle temporary or permanent measurements unavailability is good too. We can also think of cope with basic sensor failure detection and reconfiguration. However, I rather postpone that kind of task until implementation and test of basic features are completed.

@GrazianoCapelli
Copy link
Member Author

It would be a great task to implement more sophisticated and accurate way to calculate the altitude using the temperature and the pressure too.

However, I would now to bring the focus on the temperature in input:

The external temperature could be measured by the ADC using the external temperature sensor.
As alternative it could be set by the $DTS command, as yet implemented.

In the second case, the temperature should be kept updated at a good rate, but this is not always possible. In the extreme case, the user could set the external temperature once at the start (let me say, once every flight).

Thus, if we consider the following known data:

  • _Tinput = The last temperature [K] received by the $DTS command;
  • ISAAltitude_old = The ISA altitude [m], stored at _Tinput time;
  • ISAAltitude = The current ISA altitude [m];

I wondered if it could be a good idea (in case the sensor is not present) to compensate the external temperature in input this way (when a new value is not available):

_TAT = _Tinput - (ISAAltitude - ISAAltitude_old) * 6.49e-3

This could be a very easy job to do for the main sketch before every computation.

@JLJu
Copy link
Member

JLJu commented Jan 17, 2018

Of course that can be implemented into the main sketch
Within the standardized troposphere the temperature lapse rate is -6.5°K/1000 m. You formula will provide a way to get a verosimile value of temperature when there is no available a local measurement temperature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants