-
Notifications
You must be signed in to change notification settings - Fork 272
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
LXNav S10 incorrect ballast synchronization #1319
Comments
Please switch on debug on the serial port and attach the resulting log. |
Hi.
Here is the log. :)
… On 26 Dec 2023, at 19:21, Philipp Wollschlegel ***@***.***> wrote:
Please switch on debug on the serial port and attach the resulting log.
—
Reply to this email directly, view it on GitHub <#1319 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AZQYC3YMQLYOSUFTAQXBO43YLMIR3AVCNFSM6AAAAABBDEXSLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZG4YDGMZRGI>.
You are receiving this because you authored the thread.
|
The ballast is communicated as an overload factor. PLXV0,BA L,W,1.50 Please show us the configured plane profile. |
So according to src/ActionInterface.ccp overload is defined as: XCSoar/src/ActionInterface.cpp Lines 105 to 107 in f043720
However the LX Manual p.84 gives a different formula: @hjr Can you check please? |
Thank you. |
So this function is used centrally for several drivers. Therefore delicate testing is required. In Summary: Vaulter: Uses dry mass, would break with the change (would break) src/Device/Driver/Vaulter.cpp: So Vaulter would break changing this. CAI302 uses fraction, therefore not a problem. lx1600: According to current lxnavigation documentation:
<load_factor> float Total glider mass divided by polar reference mass Should be broken currently and the change would be appropriate LXNAV: Overload Wrong OpenVario: char buffer[20]; Wing Load: So also currently broken. XCVario: uses fraction therefore not affected. |
How is this formula different, and is this difference relevant for this bug? (Please do not use the term "weight" - it's about mass, not weight. It's sad to see that even instrument manufacturers mix this up.) The difference I see:
So it's just how much crew is accounted for? Right? Am I missing something? |
The difference lies in the denominator. XCSoar divides by dry mass which makes no sense as you want to get a scaling factor to rescale the glide polar which is calculated at the reference mass. So besides the incorrect use of the word weight the LX formula is the correct one. You can't get a scaling factor without the use of the mass used for the original calculation/measurement. |
@kobedegeest, so that's a "yes"?
It makes no sense only with your personal definition of "scaling factor", but it does make sense with a different definition. When we discuss how to change XCSoar's formula, we need to consider the definition of each and every user of the term "scaling factor". XCSoar and LXNAV have a different definition, so this is really a bug, but as @lordfolken said we must change this formula only for LXNAV S10 and no other product (unless other products also have a different definition, which so far nobody has pointed out). |
Only when it is talking to the drivers when updating the PutBallast(); It also uses the polar reference_mass for the glide polar calculation: XCSoar/src/Engine/GlideSolvers/GlidePolar.hpp Lines 78 to 79 in 227840b
The reference mass is the mass at which the polar was measured. So the first number from polarstore.hpp XCSoar/src/Polar/PolarStore.cpp Line 179 in 227840b
325kg for the ls8(15m). The overload factor is defined as the current total mass (crew + empty plane + water ballast) / (the polar reference mass) So basically if you had a 255 empty plane + a 70kg piloy = 325. So your overload factor towards the polar would be 1. |
Who exactly defines it that way, and which devices agree with this definition? Take this document for example: https://www.lx-avionik.de/wp/download/manuals/LXS3ManualEnglishVer0101.pdf page 20 So now we already have two documents by one manufacturer (LXNAV) with different definitions of "overload factor". Sh*t! |
I went through all the documentation i could find when i researched #1319 (comment) The overload factor is always divided by the reference_mass, for all mentioned products, except for the vaulter driver.
According to the vaulter manual, its the only one to use dry mass. |
The LXNAV LX9000 manual also uses "minimum glider weight", not "reference mass". |
Uh... that is indeed ugly. |
I don't think XCSoar should put a meaning in "overload factor". It's a bad metric, it's useless for calculations (you need to derive the ballast mass from it before you can do anything, so why not just use the ballast mass in the first place?), and there are (at least) three valid contradicting definitions for it. |
I´ll contact them and ask them whether this is a bug in the docs... |
Every's plane dry mass is different. For the polar it makes sense to take the weight at which a,b,c, is defined, and then transform it to the current total mass. How much of that is ballast / crew or else isn't really relevant. |
Of course, for glide path calculations, only the actual mass (or rather: weight! yes! .. which includes G load) of the glider is relevant, and knowing the amount of pilot mass vs water ballast doesn't matter here. But this misses the point I made, because the current mass of the glider is not a primary metric, but a calculated value. I was talking about primary metrics, and the ballast mass is a good primary metric (one that the user enters because they know how much water they filled into the wings); the overload factor is a very bad primary metric and also a very bad calculated metric. The overload factor should not be something that is entered by anybody or transferred to/from a device. It could be displayed if the user is curious about this value, but it's really not useful for anything. |
I have access to an S80, which runs the same firmware as the S100. Some testing just on the vario side and observing the NMEA traffic.
Some observations
|
I don't think vaulter would break if the formula gets changed in XCSoar. On page 27 they give an example of how the polar in vaulter works (hardly a polar rather best LD): So how I understand if you set the V_LD and LD of your glider at reference mass of your polar used by XCSoar. Then the overload factor defined by LXnav would be the correct value to transmit. The manual also does not say that that value need to be more then 100% (but of course that is no guarantee). Current users with working setup would have to go and change their settings but they would have to do this every time the pilot mass changes anyway with current implementation. |
So yes, all the weights have to be entered manually on both sides. The Vaulter vario uses the following command to set the overload factor:
According to the Protocol docs: "Set the wing loading factor (ratio of no-ballast to weight)" |
Oh, the fix for vaulter is easy. I use the fraction and add +1. |
Isn't fraction defined as ballast/max_ballast? At least according to the documentation of the CAI302 that is what fraction is defined as. How can fraction +1 be correct for vaulter? Unless for the rare case that you can exactly double your mass with water this will not give the correct value. Vaulter has no knowledge of max_ballast. It only knows best_LD and V_LD at some mass which it takes as 100%. If you are 35% heavier than this mass you send: What the user decides to be this 100% seems (soly based on the manual) not to strictly matter and then reference mass of the polar seems logical (since dry mass is not a constant as it changes based on the pilot). And if this weight/ wingloading factor cannot be smaller than 100% it is similar to S3 and S7 varios and you have to use min take off mass. |
So basically, using the overload as newly defined is correct, and no special provision is needed for vaulter. |
Out of curiosity and on the topic of syncing ballast. Is the polar info automatically synced between XCSoar and LX nav (like is the case for CAI302 for example) or does the user need to set this by himself manually? As currently XCSoar and LX nav input the polar data in a different way checking if both match is not as simple as checking if the numbers match. LX nav uses a,b,c coefs of the quadratic approximation and XCSoar uses 3 data points on the polar. (LXNav uses -W = a/10 000 *V^2 + b/100 *V + c, as a formula.) It is also not documented anywhere, at the moment, that both devices need to be using a polar calculated at the same reference mass for ballast to be synced, which is a non trivial requirement imposed by how LXnav receives this data. |
I'm finding more and more issues here... XCSoar/src/Engine/GlideSolvers/GlidePolar.hpp Lines 275 to 283 in 258b352
Why would you use the polar reference mass to determine a ballast fraction? |
ballast_ratio is defined set as plane.max_ballast / plane.polar_shape.reference_mass So the formula you show is mostlikly correct. But why even have or use a ballast_ratio is a better question everywhere that it is used it is multiplied by reference_mass. As far as i see. So it would make more sense to get ride of the ballast_ratio variable and use plane.max_ballast instead. |
So what is this then? XCSoar/src/Engine/GlideSolvers/GlidePolar.hpp Lines 76 to 77 in 258b352
The reference mass is the mass at which the glide polar was measured at. |
d726d38 is where that got introduced first (which was in 2009) so not sure if you should trust that in code documentation. It got used like this
which you can see after it got merched in 38193e0 So back then it did use empty mass but not anymore i think. (The code documentation should also say "ratio of max ballast to glider empty weight" to be correct) |
What do you do with this info?
Also stuff like this scares me:
All of this just happens to work, because in the unit test, reference mass was set to the same as drymass: XCSoar/test/src/TestGlidePolar.cpp Lines 32 to 35 in 9c217a0
@kobedegeest i updated my pr in overload2, to address some of this. Of course the unit tests fail at the moment. |
This is the "default polar". XCSoar/src/Polar/PolarStore.cpp Line 42 in 9c217a0
Imo .51 min sink? Did someone use the 18m polar, and rename it to 15m? Not even the manufacturer is that optimistic. |
Can't be right: XCSoar/src/Polar/PolarStore.cpp Lines 179 to 180 in 9c217a0
|
Indeed which is why it was multiplied with empty mass everywhere. So I agree balast_ratio should be removed.
So just to fill in my gap in knowledge how does unit test work? How does it know the formulas are wrong/correct? |
In short: You set the inputs to certain values, let the code run, and compare the outputs to what you (manually predetermined) what they should be. |
XCSoar versions having and not having the problem
Current version 7.38System information
Stefly Nav 7.0, Android 11.Steps to reproduce the behavior
It is not possible to match the water ballast setting of the LXNav S10 and XCsoar.Expected behavior
Ideally the settings for water ballast should match and drain at the same rate.Actual behavior
Currently when 100L of water ballast are set in XCsoar (flight setup-custom), the LXNAV S10 shows 70L
Do you have any idea what may have caused this?
noDo you have an idea how to solve the issue?
noThe text was updated successfully, but these errors were encountered: