JSBSim-Team/jsbsim

Set the elevator, rudder, aileron, and throttle to zero on c172x, and the aircraft is spiraling down vertically

xiaominy opened this issue · 4 comments

I set elevator, rudder, aileron command (normalized to -1 ~1), and throttle command (normalized to 0 ~1) to zero on c172x, and the aircraft is spiraling down vertically, do you know why?
Initial state of c172x aircraft: ic/u-fps = 100, ic/h-sl-ft=15000, other initial states are zero.
image

So you've set all the control positions to 0 then? Is your assumption that having all the control positions at 0 will result in a trimmed state?

If you want the aircraft to fly level at the airspeed you've chosen and the altitude you've chosen then you need to set those as the initial conditions as you have, but then you need to execute a trim solution. The trim solution code will then determine the required control positions, which won't be all of them set to 0, to achieve trimmed flight if possible.

I have the same problem. I start c172x on the ground. Psi changing at 40 deg. for first 30 seconds after engine start. What force can do this? All fcs props = 0
output.csv

@eeeewwqq Sean already answered this. Your output shows you have zero input control and zero trim.
It's very common in single engine aircraft to pull to the left during takeoff and even once in flight can bank/roll to the left while in flight, without pilot input or trim.

See this answer in this post that applies to most single engine aircraft.
https://aviation.stackexchange.com/questions/91636/why-do-some-planes-drift-to-the-left-in-flight-simulators

That being said, there was discussion/debate that the stock c172 included in the jsbsim, pulls too strongly compared to real life experience from an actual c172 pilot. But the consensus was that in real life some c172 are all tuned and balanced differently, some pull hard and require noticeable pilot input adjustment, while other c172s required very little if any pilot adjustment.

You can look at the runway test script, and the other scripts, for the c172 and see if that helps you if you need to run JSBSim without pilot input, as the test scripts shows some autopilot abilities.
https://github.com/JSBSim-Team/jsbsim/tree/master/scripts