-
Notifications
You must be signed in to change notification settings - Fork 467
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
Linear Actuator behaving strangely #485
Comments
This is a genuine bug: I've added a test |
Thanks @bcoconni Kind Regards, |
A tentative fix is pushed in If you plan to test it on FlightGear then please replace the content of the FlightGear source file |
Of course, let us know the outcome of your tests 😃 |
@bcoconni Kind Regards, PS: and hah, I just noticed too I forgot to rotate the airplane symbol. Guess its a good thing I had to check the HSI closely haha. |
@bcoconni @Octal450 <linear_actuator name="systems/gauges/radio/Collins-331-C4/indicated-bearing-deg-la">
<input>systems/gauges/radio/ADF-Marconi-8283/indicated-bearing-deg</input>
<module>360</module>
<reset>systems/gauges/radio/TACAN-NAV-ARN-21/isNot-Active</reset>
</linear_actuator>
<actuator name="systems/gauges/radio/Collins-331-C4/indicated-bearing-deg">
<input>systems/gauges/radio/Collins-331-C4/indicated-bearing-deg-la</input>
<lag>1.0</lag>
<rate_limit> 90.0 </rate_limit>
<deadband_width> 0.5 </deadband_width>
<hysteresis_width> 0.5 </hysteresis_width>
</actuator> Remember that the reset function allows the hand to position itself on zero when, for example, there is no power supply and / or signal. |
@abassign Thanks for the info and thanks for checking the patch. I almost managed to build FG and will finish up tomorrow and verify the bug is resolved on my end -> then I will continue the work and I will check out other parameters. Thanks. Kind Regards, |
Thanks @abassign 👍
OK we'll wait for your feedback @Octal450. |
Didn't get it building yet... will keep trying. (Windows) Kind Regards, |
@bcoconni Got FlightGear to build and run. I was using the wrong OSG version. Derf. OK, now inserted your file and rebuild the software. But I get a problem, the compilation is not successful.
Return the original file and it is successful. Based on the diff, I do not understand why he is doing that. Kind Regards, |
@Octal450 The version in FlightGear is obviously older than this, so it isn't as trivial as copying in the 1 file @bcoconni linked to. |
@seanmcleod I just cloned all the repos fresh yesterday -> should it not have the latest file? Anyways, I just applied the diff manually to the file. Great work @bcoconni , works perfect now! Thank you very kindly! Can be closed. Question, When that whole will planned to be added to FG next? (Reason, so that I know when I can enable linear actuator, as for now I must keep it not used) Kind Regards, |
Doesn't FlightGear include the JSBSim source within it's repo? I don't use FlightGear. My understanding is @bcoconni periodically pushes an update from the JSBSim repo into the FlightGear repo. So if he hadn't pushed from JSBSim to FlightGear after the 4 Dec 2020 then the JSBSim source within the FlightGear wouldn't have the changes based on that commit. Unless you were also pulling the JSBSim repo directly and overwriting the JSBSim source included in the FlightGear repo? |
I was using FlightGear source, not JSBsim. I used this to build: https://wiki.flightgear.org/Building_using_CMake_-_Windows Thanks for the infos. Kind Regards, |
Great ! Thanks for testing 👍
My mistake, I forgot that FlightGear is using JSBSim v1.1.5. Unfortunately the source code that I have suggested is based on the development branch
I was waiting for your feedback before proceeding (@abassign already confirmed that it's working for him as well). I'll take this opportunity to release a new version |
@bcoconni Great, thank you! Your efficiency and diligence is to be highly commended. Kind Regards, |
@bcoconni /* ***** Old code: ***** from line 185 *****
if ((versus == 0) || (versus == direction)) {
inputMem = Input;
if (direction != 0) {
if (abs(inputDelta) >= (module*rate)) {
if (direction > 0) {
countSpin++;
direction = 0;
} else if (direction < 0) {
countSpin--;
direction = 0;
}
}
}
} else if ((versus != 0) && (direction != 0) && (versus != direction)) {
inputLast += inputDelta;
}
***** end old code ***** */
/* ***** new code ***** */
if ((versus == 0) || (versus == direction)) {
inputMem = Input;
if (abs(inputDelta) >= (module*rate)) {
if (inputDelta < 0)
countSpin++;
else
countSpin--;
}
} else if ((versus != 0) && (direction != 0) && (versus != direction)) {
inputLast += inputDelta;
} I then recompiled everything and it worked perfectly. |
The fix has just been pushed to FlightGear |
Thanks very much @bcoconni ! Kind Regards, |
Discussed in #483
Originally posted by Octal450 July 16, 2021
Hi,
I am modelling an analogue HSI instrument by use of a linear actuator, followed by an actuator + lag filter.
I notice some really strange behavior in the linear actuator when there are quick movements about the changeover point specified by the module tag (in my case 359 -> 0 or 0 -> 359
I have observed this affect with the heading bug implementation as well as with the heading card showing current heading, showing the issue is not related to integers vs floating point values.
Properties to take note of:
heading-input
is magnetic heading inheading-linear-cmd
is the linear-actuatorIn this image it is working correctly, instead of jumping to 359, it went negative.
I will now kick the rudder left and right profusely to move the aircraft through the 359 -> 0 or 0 -> 359 transition several times and it works most of the time correctly, then sometimes, it does this:
Huh? it just jumped up to 720 from roughly 0. So now since I have an actuator following the linear actuator, the HSI card rotated (in this case) 2 full revolutions due to the jump from near 0 all the way to 720 (meaning the bug occurred twice, usually its just once) which is the exact behavior I was trying to avoid. This is very strange.
I will also point out it doesn't matter if the linear is currently negative, positive, or with a large number from built up revolutions, or still small near 0 or near +/- 360, the bug still happens.
My code is as follows:
Am I doing something wrong or did I uncover a bug :D
Kind Regards,
Josh
The text was updated successfully, but these errors were encountered: