-
Notifications
You must be signed in to change notification settings - Fork 432
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
Fixed inertia matrix error #502
Conversation
Under the assumption that in the structural frame the: - X-axis is directed afterwards, - Y-axis is directed towards the right, - Z-axis is directed upwards, And then a 180 degree rotation is done about the Y axis so that the: - X-axis is directed forward, - Y-axis is directed towards the right, - Z-axis is directed downward. The original ixx,iyy,izz,ixy,ixz,iyz in structural frame. So, When transform the inertia products from the structural frame to the body frame, ixy and iyz should be reversed.
@likangbei have you taken a look at this issue - #125 |
Ixz defined by DHC6 XML is wrong, it should be positive. It is recommended to consult the book《Airplane Flight Dynamics and Automatic Flight Controls part1》,It contains a large number of other aircraft ixz data。Of course, many flight dynamics books contain a large number of aircraft ixz data, many of which are actual values. If the ixz error of dhc6 is regarded as correct, it is not difficult to understand the error of inertia matrix. Is the ixz data source of dhc6 reliable? Or is it calculated using a non-standard structural coordinate system? As an aviation engineer, I think it is very likely to be wrong. |
Following the discussion we had in #125, I'd also suggest that we take opportunity of this PR to allow supplying the inertia tensor in either the structural or the body frame. @likangbei you could modify this PR to allow JSBSim:
This could be achieved by adding options to
Or any other option that you might think of. |
Some further insight, as @aarondewindt mentioned in #440 that some sources assume So the parameter naming might not be |
@bcoconni while I was refreshing my memory in terms of products of inertia I came across the Wikipedia page - https://en.wikipedia.org/wiki/Moment_of_inertia#Inertia_tensor Which in particular mentions both conventions.
But in the end the sign is either in the definition of the product of inertia or in the inertia matrix. |
@seanmcleod thanks for refreshing my memory as well 👍. Since the topic is a recurring one, I'd guess this is a candidate for the FAQ ? |
@bcoconni Yea, using the name I've seen people refer to JSBSim's current convention as In the meantime I think this page from Mathworks explains the issue quite nicely. JSBSim and Simscape use the same convention, so adding a similar (or same) explanation to the JSBSim's docs with a link in the FAQ would help people with the same issue. |
@bcoconni Many people with basic knowledge of flight dynamics cannot realize this problem when using jsbsim. They often use jsbsim in professional research fields, which often require accurate simulation. Of course, if you mistake the sign of ixz, you naturally don't care much about such simulation errors for flight games such as FlightGear Adding additional tags is not a good idea. The best way is to be compatible with the standard definitions in the field of flight dynamics. After all, jsbsim is a professional flight simulation software In some current aircraft XML files, for example, ixz of B737 is defined according to the flight dynamics standard. Obviously, the author of XML does not realize that ixz in jsbsim is different from the standard definition Adding options to <mass_balance> is Not a good idea . If it is not changed to the default standard definition, at least remind all users clearly |
@likangbei Yea, I get what you're saying and the same happened to me a while back. However JSBSim has been under development for a long time, so changing convention will most likely cause more issues than solve anything. Adding the documentation will at least give a explanation of the issue and the new option should draw the attention of those filling the xml to it. |
@bcoconni another way to solve the issue is to allow users to fill in the inertia matrix directly simmilar to how tabels are filled in, there is no ambiguity on the sign convention there. This could be the new recommended way and the current method can be depreciated and left there for backwards compatibility. |
However if we did that without the use of additional tags etc. then we would break existing models, both models used by enthusiasts, some of whom may well not notice, but also models by professionals who went to the trouble to get the sign right etc. and who will now see different results when installing a new version of JSBSim. I'd suggest going with @bcoconni's suggestion of two optional tags, i.e. to specify the sign convention and to specify the frame of reference, i.e. structural or body. Plus adding some documentation, along the lines of a subset of the Mathworks page, adding some specific documentation with regards to the structural versus body frame. |
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 am agree to your opinion.
I suggest |
@seanmcleod @bcoconni @aarondewindt
Adding options to <mass_balance>: The default is |
|
Yes Take non-professional users for want of a better description, who may not even be aware of the two different conventions for the cross products of inertia, they glance at existing models when creating their own etc. and potentially think the negation refers to all the inertia values they need to supply, based on some JSBSim requirement etc. So I'd rather err on the side of verbosity/clarity. |
There is such code in the file:
It is easy for developers to confuse the definition of ixz. Fortunately, it will not cause errors |
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.
Thanks for the update @likangbei ! 👍
I have suggested a few changes for the documentation part of your PR. Comments and suggestions are welcome.
I agree. I guess the JSBSim project should lead as an example meaning we should update all the models in the |
Is it easy for us to understand such notes? Are there any better suggestions and comments
Yes, I've thought about it too. I think it's necessary to modify all aircraft configuration files. Many people will learn or modify based on the existing aircraft configuration file. Adding "negative_crossproduct_inertia" will help remind users to pay attention to the sign of ixz, which may be more effective than FAQ to reduce errors. |
PR merged to the codebase. Thanks @likangbei ! For information the build fails for MSVC but the cause of this failure is unrelated to @likangbei's PR. |
Indeed and this change can easily be done via a script. |
…am#502) By setting this option to false, the cross product inertia can be specified with the sign convention used in classical flight dynamics textbooks such as Steven & Lewis' or Etkin's.
Folowing the PR JSBSim-Team#502, JSBSim now allows to specify how the sign of cross product inertia is interpreted. In order to educate users to this new parameter, all the aircraft models with cross product inertia are updated with the new parameter `negated_crossproduct_inertia` set to `true` (which is the default).
This is now done in the commit 9a1b7db. I also pushed to the repo the Python script |
Folowing the PR JSBSim-Team#502, JSBSim now allows to specify how the sign of cross product inertia is interpreted. In order to educate users to this new parameter, all the aircraft models with cross product inertia are updated with the new parameter `negated_crossproduct_inertia` set to `true` (which is the default).
Under the assumption that in the structural frame the:
And then a 180 degree rotation is done about the Y axis so that the:
The original ixx,iyy,izz,ixy,ixz,iyz in structural frame.
So, When transform the inertia products from the structural frame to the body frame, ixy and iyz should be reversed.