Questions about general process of the simulation #897
Replies: 11 comments 12 replies
-
You haven't provided much information regarding the type of aircraft being used, and how they're being used. So in general you would copy whatever inputs a pilot would use, so in addition to the ones you listed it would typically include things like flap selection, gear selection, brakes etc. But as I said it really depends on the aircraft type, e.g. maybe you're only using aircraft with fixed gear, then there is no need input the gear selection. Plus, maybe your simulation only ever flies the aircraft up and away so no need for flaps selection or brakes. Rather provide more background information on what you're doing and what you're trying to achieve. We're not mind readers.
Again, not enough context. Slowly relative to what? Do you know the specific aircraft type and you know it should accelerate faster than it is in JSBSim? Or do you want to provide some sort of 'slew' mechanism to unrealistically get the aircraft up to some operating speed? |
Beta Was this translation helpful? Give feedback.
-
Then the only other potential input I can think of off-hand would be a speed-brake input. |
Beta Was this translation helpful? Give feedback.
-
So are you saying that if you set the initial |
Beta Was this translation helpful? Give feedback.
-
Try and remove the FCS from the equation and see if you see similar results. Simplest approach would be to say use the A-4 aircraft model in the JSBSim repo which doesn't have an FCS with FBW command laws etc. |
Beta Was this translation helpful? Give feedback.
-
No, I meant take the complicated FBW command law implementation out of the equation, e.g. in the F-16 stick input commands a particular g rather than simply commanding a particular elevator deflection. So I was suggesting that you use the A-4 which has a basic direct connection FCS, i.e. like in a Cessna, stick command is mapped to a particular control surface angle. And then perform your same test, i.e. trim and then apply full throttle and full back stick to start your loops. |
Beta Was this translation helpful? Give feedback.
-
Also for some background on F-16 FCS issues we've looked into in the past - #814 |
Beta Was this translation helpful? Give feedback.
-
Just to be 100% clear. So the A-4's outputs with the same control inputs but different starting
No, I meant that by switching to an aircraft like the A-4 you remove the whole FBW command law implementation that you see in the F-16's FCS section. Have you compared the FCS sections of the A-4 with the F-16? And if you saw the same issue with the A-4 then it means that it isn't an issue with the FCS implementation that someone created, but possibly an issue with the core EOM (Equations Of Motion) in JSBSim. You can then focus further investigation into the relevant portion of code. So let's take the A-4's FCS section dealing with pitch. It's really trivial, it basically scales the pilot's input of the longitudinal inceptor modelled by the property So Lines 202 to 217 in 02b4e25 Now compare that to the F-16's FCS, it's a lot more complicated. Follow how the property That's because the pilot's input Did you look at discussion #814 to see how even starting off in a straight and level trim the FCS has issues maintaining that? |
Beta Was this translation helpful? Give feedback.
-
Yes your current assignment is correct. Just mentally remember that in the case of an aircraft like the F-16 with a FBW command law that the names |
Beta Was this translation helpful? Give feedback.
-
Some JSBSim users for some JSBSim aircraft models have implemented these sorts of FBW command laws in the FDM's XML file. Also remember not every JSBSim aircraft model exists in the JSBSim repo.
Hmm, having a quick initial glance I see at least 1 difference between the C++ version you coded up and the Python version. jsb->Setdt(0.02); I don't explicitly set it in my Python example, which means the Python version is using the default of
Yes, you can't assume that every FCS implementation in the JSBSim repo is perfect. Now it also depends how the model is being used in terms of whether these sorts of imperfections are an issue or not. If you have a human pilot actually flying the aircraft model then they will often cancel out any of these sorts of imperfections, e.g. as I mentioned in the other discussion a pilot would notice a slight roll and correct it periodically. |
Beta Was this translation helpful? Give feedback.
-
"does not..." - so if you remove the call to set dt to 0.02 in your C++ example do you see the same output as the Python version? |
Beta Was this translation helpful? Give feedback.
-
Hmm, would be interesting/useful to figure out the difference between the C++ and Python versions. |
Beta Was this translation helpful? Give feedback.
-
I use JSBSim inside a large simulation program, and I have written the
copy_inputs_to_jsbsim
andcopy_outputs_from_jsbsim
. I wonder which variables are usually used as inputs? I useaileron_cmd
,rudder_cmd
,elevator_cmd
andthrottle_cmd
as inputs. What else should I use?Reference Manual said that
throttle_cmd
should be set (0.0, 1.0), but the pace changes slowly when I set to 1.0, and I found that larger throttle value will also run. So if I want to speed up quickly, should I set a larger value tothrottle_cmd
?The basic process code is shown below.
Any ideas would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions