-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Bulk gyro/acc reads, temperature sensor framework #2846
Conversation
src/main/fc/fc_tasks.c
Outdated
[TASK_TEMPERATURE] = { | ||
.taskName = "TEMPERATURE", | ||
.taskFunc = taskUpdateTemperature, | ||
.desiredPeriod = TASK_PERIOD_HZ(10), // 10 Hz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure it can go down to 1Hz and no one would notice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably. Temperature inertia is quite large.
Might also be used if no other alternative is available to compensate for changes in air density when reading airspeed with a Pitot tube. |
@shellixyz actually temperature compensation of pitot is not needed. Aerodynamically we are interested in mass air flow across our control surfaces which is dependent on air density and TAS. The combined measurement is called IAS (indicated airspeed) and this is exaclty what's measured by pitot tube. Stall speed is exactly the same at all altitudes/temperatures/air pressures if you look at IAS, however if you look at TAS - stall speed would be higher at high altitudes due to low air density. From https://en.wikipedia.org/wiki/Indicated_airspeed:
|
Very interesting. I didn't think about that. Learning every day 😃. Still could be used for compensating the TAS if displayed in the OSD. |
I think showing TAS in OSD could lead to confusion and complaints about stall happening at different airspeeds (TAS). Originally pitot driver was attempting to calculate TAS, but after I realized that IAS is more meaningful to the pilot (and by coincidence easier to calculate) - 1f70cb0 was merged to calculate IAS instead. |
Yes, IAS is all what is really required here |
src/main/sensors/temperature.h
Outdated
typedef enum tempSensor_e { | ||
TEMP_GYRO = 0, | ||
TEMP_COUNT | ||
} tempSensor_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't "tempSensor_e" be more 'enum-like' name? Like most other typedefs in codebase
Temperature http://www.analog.com/media/en/technical-documentation/data-sheets/TMP35_36_37.pdf A mate came up with this for minimosd lately ... |
@Pairan acc/gyro, MCU and baro have their own builtin temperature sensors, so most pilots won’t need any additional ones. The one you linked might be handy to monitor temperature for an specific component (eg a camera inside the fuselage). |
ah, I see ... considering myself educated for the moment :) |
1f0777f
to
eb74b6a
Compare
This PR changes gyro/acc drivers to read acceleration/temperature/gyro data in one transaction. This should save some bus overhead compared to reading acceleration/gyro separately.
Also introduced framework for temperature sensors. Currently only one sensor - gyroscope/MPU. This temperature readings could be shown in OSD or used in future to compensate for temperature drift of accelerometer.