Replies: 2 comments 2 replies
-
Have you logged the engine thrust to confirm that the engines are actually running and producing thrust? You seem to have missed the jsbsim/scripts/B737_Runway.xml Lines 26 to 32 in 8fb7741 |
Beta Was this translation helpful? Give feedback.
-
In general, think what a human pilot would do. So for the In terms of the 737 and holding altitude, think again what a human pilot or an auto-pilot has to do to hold altitude. They basically have to adjust the throttle and the elevator in order to trim the aircraft, and keep it in trim since as you fly fuel will be burnt off so the mass of the aircraft will decrease and the cg will shift, so you'll need to keep adjusting both throttle and elevator to keep it in trim. So either you need to make use of an existing auto-pilot implementation, or write your own. Your only other option is to get JSBSim to perform a trim operation, which will be valid for a while until the fuel burn starts to make a noticeable difference. |
Beta Was this translation helpful? Give feedback.
-
Hi:
Thanks for your great work in JSBSim. I am trying to get a real-time simulation. In my project, I setup a workbench program named
wbControl
by Qt, which could send commands toJSBSim.exe
in the form ofset fcs/elevator-cmd-norm 1
,set propulsion/engine[0]/set-running 1
,set fcs/throttle-cmd-norm
etc. My purpose is sending commands to control a take off activity, I want to control its take-off just by commands when the plane is on the ground and at rest.1, I choose jsbsim/aircraft/737/737.xml as the test aircraft, jsbsim/aircraft/737/reset00.xml as my initial files.
2, I write commands in the order below, these will be send to
JSBSim.exe
via socket(IP:5139) in time order :Time 5.0 s:
Send "set fcs/steer-cmd-norm 0.5"
Send "set fcs/elevator-cmd-norm 0.5"
Time 7.0 s:
Send "set fcs/steer-cmd-norm 0.0"
Send "set fcs/elevator-cmd-norm 0.0"
Time 15.0 s:
Send "set propulsion/starter_cmd 1"
Time 20.0 s:
Send "set fcs/throttle-cmd-norm[0] 0.6"
Send "set fcs/throttle-cmd-norm[1] 0.6"
Time 50.0 s:
Send ""set fcs/steer-cmd-norm 1.0"
Time 55.0 s:
Send "set fcs/steer-cmd-norm 0.0"
Commands above is extract from B737_Runway.xml. But when these commands are sent to JSBSim.exe, the vc-kts always stays ZERO and position/h-agl-ft stays 49.0 inches all the simulation process. it isn't meet my need, some log file is below:
----------------------JSBSim Execution Beginning----------------------
Start: Monday November 21 2022 15:25:56 (HH:MM:SS)
simulation elapsed time: 0.0083 vc-kts: 0.1589 Distance: 0.0000 ASL: 1.2446
simulation elapsed time: 5.0000 vc-kts: 0.0000 Distance: 0.0081 ASL: 1.1247
Receive() returns: set fcs/steer-cmd-norm 0.5
[set] [fcs/steer-cmd-norm] [0.5]
ready to reply successful.
Receive() returns: set fcs/elevator-cmd-norm 0.5
[set] [fcs/elevator-cmd-norm] [0.5]
ready to reply successful.
Receive() returns: set fcs/steer-cmd-norm 0.0
[set] [fcs/steer-cmd-norm] [0.0]
ready to reply successful.
Receive() returns: set fcs/elevator-cmd-norm 0.0
[set] [fcs/elevator-cmd-norm] [0.0]
ready to reply successful.
simulation elapsed time: 10.0000 vc-kts: 0.0000 Distance: 0.0081 ASL: 1.1247
simulation elapsed time: 15.0083 vc-kts: 0.0000 Distance: 0.0081 ASL: 1.1247
Receive() returns: set propulsion/starter_cmd 1
[set] [propulsion/starter_cmd] [1]
ready to reply successful.
simulation elapsed time: 20.0083 vc-kts: 0.0000 Distance: 0.0081 ASL: 1.1247
Receive() returns: set fcs/throttle-cmd-norm[0] 0.6
[set] [fcs/throttle-cmd-norm[0]] [0.6]
ready to reply successful.
Receive() returns: set fcs/throttle-cmd-norm[1] 0.6
[set] [fcs/throttle-cmd-norm[1]] [0.6]
ready to reply successful.
simulation elapsed time: 25.0083 vc-kts: 0.0000 Distance: 0.0081 ASL: 1.1247
simulation elapsed time: 30.0083 vc-kts: 0.0000 Distance: 0.0081 ASL: 1.1247
simulation elapsed time: 35.0083 vc-kts: 0.0000 Distance: 0.0081 ASL: 1.1247
simulation elapsed time: 40.0167 vc-kts: 0.0000 Distance: 0.0081 ASL: 1.1247
simulation elapsed time: 45.0083 vc-kts: 0.0000 Distance: 0.0081 ASL: 1.1247
simulation elapsed time: 50.0083 vc-kts: 0.0000 Distance: 0.0081 ASL: 1.1247
Receive() returns: set fcs/steer-cmd-norm 1.0
[set] [fcs/steer-cmd-norm] [1.0]
ready to reply successful.
simulation elapsed time: 55.0083 vc-kts: 0.0000 Distance: 0.0081 ASL: 1.1247
Receive() returns: set fcs/steer-cmd-norm 0.0
[set] [fcs/steer-cmd-norm] [0.0]
ready to reply successful.
simulation elapsed time: 60.0167 vc-kts: 0.0000 Distance: 0.0081 ASL: 1.1247
In here:
ASL is taken from function
FDMExec->GetPropagate()->GetAltitudeASLmeters()
,Distance is taken from function
FDMExec->GetAuxiliary()->GetDistanceRelativePosition()
,vc-kts is taken from
FDMExec->GetAuxiliary()->GetVcalibratedKTS()
.so :
1, how can I take the 737 off manually by commands?
2, how to write the correct command to take the plane off when an aircraft type be specified next time?
Sincerely looking forward to your help, thank you.
Beta Was this translation helpful? Give feedback.
All reactions