Add AirspeedFit#330
Conversation
IamPete1
left a comment
There was a problem hiding this comment.
This is what Claude thinks:
I'll leave you to decide how much you care about those issues. I have had a play about and I have not been able to get it to break, and its in dev, so I'm inclined to just merge it.
I thought there was a python script for this somewhere, but I have looked in AP and in pyMAVLink and I can't find it. I was just thinking to run the same log and make sure the result is similar to this.
| return isFinite(v) ? v : null | ||
| } | ||
|
|
||
| // Carbonix-specific behaviour, sneaked harmlessly into upstream: our GCS sends |
There was a problem hiding this comment.
I have spotted the sneaking, but as the comment says, I think its harmless.
63a4b98 to
c924ef6
Compare
Yeah, never was one to my knowledge. I've wanted one for years and made several of my own but was never quite happy enough with them to PR to pymavlink. My latest one I was finally happy with but then decided to vibe-port it to a web tool. In terms of the Claude review, I've taken about half of the suggestions. I know you posted it casually as a "take it or leave it", but I've written up full responses to each point:
|
|
I was wondering, is it correct to use a temperature from a outside source? Doesn't that mean that the calibration will be a bit off when used in flight because AP is not using that temperature. That is to say, would we be better to have the ratio a little off the "true" value such that the airspeed still comes out right because AP is using the "wrong" temperature. There was some discussion about getting a accurate air temperature on board, even boards without heaters the flight controller temperature is usually much too high. One suggestion was to use the lowest temperature out of all the various things that report temperatures. |
Short answer, yes, it's very correct to use an outside source during calibration. After that, ArduPilot basically doesn't rely on EAS2TAS anymore. The Full AnswerA pitot naturally reads EAS once it's calibrated, it doesn't have to be converted. Once the ratio is set, it will always read the correct EAS regardless of air density. Every major consumer of airspeed wants EAS anyway: cruise speed, min/max speed, Q_ASSIST_SPEED; they are all EAS. The only real consumers of EAS2TAS are the in-flight auto-calibration (because it's using ground speed as the truth source, which is a true speed) and the TECS (because energy calculations need true speeds). The TECS still takes its set point input as EAS but converts to TAS and uses that everywhere internally for the energy calculation. If you calibrate your airspeed ratio using a good EAS2TAS, but fly with a really bad EAS2TAS, you are having a small impact on your TECS tune (and that's true no matter how you calibrate your airspeed sensor; what really matters is matching the EAS2TAS you tuned your TECS with), but it won't impact the actual EAS it tries to hold. I've always recommended people manually set BARO_GND_TEMP before using the in-flight airspeed cal, and then they can let it autoset afterward if they want (because it doesn't matter nearly as much after cal), but I just recently learned that ArduPilot/ardupilot#26915 actually broke BARO_GND_TEMP (and all temperature measurement/setting in AP_Baro); the new I've given a lot of thought about better OAT measurement, but apart from having a dedicated OAT sensor or manually setting the temperature, I don't know any great guesses. BUT the good news is that the temperature is hard-coded to ISA on all our F7/H7 boards, so the temperature measurement literally doesn't feed anything. "All devices that report temperature" is pretty tough. I'd hate to learn that one of my 16 CAN nodes is reporting a hard-coded 0 or -273 or was supposed to report kelvin but reports c because the manufacturer didn't read the spec right. |
|
Thanks for the explanation! Are you happy for this to be merged? |
|
Yup, I'm happy if you are! |
Log-based airspeed calibration tool, inspired by the built-in autocal.
I've been testing this out for about a week and it's working great.