Fixed f450 example: engine rpm is zero when low fps#1323
Fixed f450 example: engine rpm is zero when low fps#1323seanmcleod70 merged 4 commits intoJSBSim-Team:masterfrom
Conversation
scropions
commented
Aug 25, 2025
|
@scropions we need more context, at a minimum link to the original issue, since you can't assume everyone reviewing this PR would've seen and read the original issue that was submitted. Secondly, can you explain how or why the UE frame rate effects the original properties used in |
|
https://github.com/JSBSim-Team/jsbsim/tree/83e3df2c49c13eae78ab7853848cdd9e02c6c5ac its forked branch |
What you're trying to say is that this PR is related to issue - #1322
Okay, but then please state that. We're not mind readers. All we got was 3 screenshots and some modified code. If you don't fully understand the cause and the solution, but have stumbled across some combination of changes that appears to fix it, then just state that. I assumed you understood the cause and the fix, but just hadn't mentioned it. So before taking a more detailed look I was first waiting for some more details. We're not going to just merge in a PR if no one understands the cause and fix, just simply because it appears to work.
This particular model, added by @pbecchi 3 years ago, and has a fair amount of custom flight control systems and since quadcopters don't typically make up a large proportion of the aircraft models I'd guess most of the regular maintainers don't know it's implementation well. But based on your commit I've taken a bit of a closer look now and these are my initial comments. So It looks like instead there is a The various inputs are then mixed to finally generate ESC commands to the motors, e.g. jsbsim/aircraft/F450/Effectors.xml Lines 3 to 12 in 83e3df2 Now the output of this, i.e. And the So changing this to Now in terms of what was reported in the issue, I think what is happening is that during the UE loop the Lines 147 to 152 in 83e3df2 Line 163 in 83e3df2 So then during the first time step in JSBSim throttle pos is 1 and that's what the brushless engine code sees and uses. But, the effector code then overwrites Until there is another UE game loop, which resets I'll take a look at your changes to |
In my comments above, my references to what I saw in
So, I see now looking at your modified However, it looks like you've replaced a single heave command with 4 separate ones. I'm not sure that's typical for a quadcopter. I would expect to only have a single pilot input for heave. |
|
I didn't find any usage of Heave in the source code, and it seems like it's always empty. I also didn't find ThrottleCmd in the calculations, but ThrottlePos is used there. Line 163 in 83e3df2 For calculation is using Sorry for my English, but I don't know it well and I communicate with the help of a translator. In this example, cmd is also used for input and pos is output data. https://wiki.paparazziuav.org/wiki/AR_Drone_2 (flight control section) And we have 4 engines, which means the input power must be separate for each. |
You don't need to have 4 user inputs because there are 4 engines. The user can input a single heave/vertical velocity command etc. and the flight control system will then work out how much power to request from each of the 4 engines. The flight control system also looks at the other user inputs/commands like pitch rate, roll rate, yaw rate and then mixes all those with the single heave command to come up with particular power requests for each of the 4 engines. |
|
The Effectors.xml change is good. Even for just JSBSim standlone without Unreal Engine, this part of the PR makes sense. The FlightControl.xml technically doesn't need to change. The |
|
@gallonmate okay. I'll create tests. If we use fcs/cmdHeave_nd, it's not clear to the user whether it should be passed as a separate parameter? Such examples and models should be easily configurable and not require knowledge from the user. |
|
first diff: |
|
@scropions here is an example of the user inputs for DJI quadcopters. As you can see, there is only a single throttle/heave user input.
|
|
Its just input. In unreal engine we take and send only one input too |
You may have a single input in Unreal, but given your changes to Compared to, before your changes, you would only need to copy that single Unreal input to just one property, i.e. |
|
Yes the heave cmd should only be replaced with one throttle cmd. Do not use multiple numbered throttles. Do not use [0], [1], etc, even if it works, it's redundant and confusing. Replace As said before the Effectors.xml fixes the bug with the F450. No other changes are needed but if changing heave cmd, then only replace the heave cmd with this exactly: |
|
Done. Setting the value to 0 disables standard drone control. |
|
@scropions thanks, your PR has now been merged. |
Co-authored-by: PELENG/baturin_iv <baturin_iv@peleng.by>


