JSBsim: Piston Engine aircraft not taking off

I’m running JSBsim though ardupilot as outlined in the instructions below.
http://ardupilot.org/dev/docs/setting-up-sitl-on-linux.html

I’ve built a few aircraft through JSBsim’s Aeromatic program, and all the electrical engine variants work as intended. Whenever I load up a model with a piston engine, the model aircraft successfully arms, but the aircraft does not move. From the data logs, its clear the throttle is maxed, but there is no propulsion from the engine. I’ve tried it with one of JSBsim’s default aircraft like the L17 model, and ran into the same problem. Has anyone else experienced this problem? I’m only using the files generated by Aeromatic in Tools/autotest/aircraft and running the program through “sim_vehicle.py -f jsbsim”.

EDIT: Got the piston engine up and running! There is a folder in ardupilot under libraries/SITL that writes a script file for JSBSim and reads it. I added a few extra lines of code to start the engine and now the plane is flying. Plane is still taking off right as the simulation starts, so still need to work that out.

Does the petrol engine need a starter run or similar?

Could you put a branch up on github which we can test?

I can’t put a branch up, but I can provide the output data from JSBSim. I am getting some weird readings from the engine parameters. The horsepower is constant and negative, and the power is negative. Manifold pressure is hovering around 30 Hg and I have no thrust from the propeller. I’m also not seeing the second engine I’ve installed.

I’ve found the problem! There is a property called “propulsion/starter_cmd” that turns the engines on in JSBSim. This flag is not triggered through MAVProxy’s “arm throttle” command, so the engine just doesn’t start up. According to the reference manual, I should be able to access the parameter by manually flipping it on, or by executing a script file.

Problem is I don’t know how to access those features through sim_vehicle.py. How can I feed the startup information to the program?

I’ve found the problem! There is a property called “propulsion/starter_cmd”
that turns the engines on in JSBSim. This flag is not triggered through
MAVProxy’s “arm throttle” command, so the engine just doesn’t start up.
According to the reference manual, I should be able to access the parameter
by manually flipping it on, or by executing a script file.

Great stuff!

Problem is I don’t know how to access those features through sim_vehicle.py.
How can I feed the startup information to the program?

Dropping it somewhere in here should work, presumably:

Seriously advanced, over the top solution: plumb in our ICEngine support
and support passing script fragments into JSBSim…

Adding a few lines to the script file forces the engine to start, and it worked on my end. I don’t like altering the source code if I can help it, but sometimes that’s the only way to access whats needed.

I created a aircraft by aeromatic++ I would like to know how you did because when I try to get it’s catalog or simulate it I get errors.

my_aircraft --catalog > my_aircraft_catalog.txt

In file aircraft/my_aircraft/my_aircraft.xml: line 105
Tank capacity must not be zero. Reset to 0.00001 lbs!

In file aircraft/my_aircraft/my_aircraft.xml: line 452

Error loading aerodynamic function in aero/moment/Pitch_propwash:
FGTable: row lookup is not monotonically increasing
in row 3 of table in aero/moment/Pitch_propwash:
0<=0
Aborting.

Aircraft aerodynamics element has problems in file Path “aircraft/my_aircraft/my_aircraft.xml”
JSBSim could not be started

FGPropertyManager::GetNode() No node found for propulsion/engine[0]/thrust-coefficient

I tried getting the catalog out by script but I get error.
~/ardupilot/Tools/autotest$ JSBSim --aircraft=my_aircraft --catalog > my_aircraft_catalog.txt

In file aircraft/my_aircraft/my_aircraft.xml: line 105
Tank capacity must not be zero. Reset to 0.00001 lbs!

In file aircraft/my_aircraft/my_aircraft.xml: line 452

Error loading aerodynamic function in aero/moment/Pitch_propwash:
FGTable: row lookup is not monotonically increasing
in row 3 of table in aero/moment/Pitch_propwash:
0<=0
Aborting.

Aircraft aerodynamics element has problems in file Path “aircraft/my_aircraft/my_aircraft.xml”
JSBSim could not be started

FGPropertyManager::GetNode() No node found for propulsion/engine[0]/thrust-coefficient

@peterbarker @Deafro

I know this is a very old post, but it does not look like this issue has been fixed. I modified the SIM_JSBSim.cpp file as follows (line 111):

"    <event name=\"start engine\">\n"
"      <condition> simulation/sim-time-sec le 0.01 </condition>\n"
"      <set name=\"propulsion/engine[0]/set-running\" value=\"1\"/>\n"
"      <set name=\"propulsion/starter_cmd\" value=\"1\"/>\n"
"      <notify/>\n"
"    </event>\n"

This new starter_cmd was taken from the discussion above. I recompiled, and it does write the new line to the start script. I then run the following command to start the sim:

../Tools/autotest/sim_vehicle.py -w --console -f jsbsim:c182

Everything starts up normal. I then connect to the sim with QGC. In this scenario, I don’t launch the any SIM, just QGC and the mavproxy console. Using QGC, I can upload a mission and launch it.

Prior to adding the new starter command, the throttle on the C182 would go to 100%, but the A/C stays put. After adding the starter command, the A/C rotates in a 360 circle on the ground. I then ARM and launch the QGC mission. The throttle again goes to 100%, but the A/C does not move. I am wondering if I need something else in the starter section, or if these changes are in the wrong place. Is there such a thing as a parking break in JSBSim? Does that need to be released as well?

Well, I am about ready to give up on this. I can get everything working to the point that the throttle goes to 100 but the aircraft does not move. I tried this with the C172p and get the same results. It won’t move. I even added additional sections like I saw for the B737 to include take-off roll… nothing works. I know the engine starts, because I can have JSBSim dump the engine RPMs but still no movement. I am at a loss at what to do other than try and build a very old version of JSBSim that is mentioned in the docs. the RC version of the Rascal works fine but that is the only one that works.