|
From: Jon S. B. <js...@ha...> - 2006-07-29 22:55:30
|
> The experiment is listed below and the result is that it really > descends to 7000 after maintaining the 8k level, but later on it > is not able to gain altitude to reach 8k (file altitude1.png). I > tried in the middle invoking the do_trim, but it does strange > things (see weird.png). That strange behavior was obtained by > invoking do_trim between two set altitude_point in telnet > console. The peak is really strange. I have made another longer run using the C172 autopilot in a scripted run. First the aircraft is commanded to 6000 ft, then 4000, then 7000. It seems to work well. Here are some plots of the results: www.jsbsim.org/Time_vs_Altitude.png www.jsbsim.org/Velocity.png www.jsbsim.org/Elevator.png www.jsbsim.org/Theta.png www.jsbsim.org/Alpha.png Here's the script I used: <?xml version="1.0"?> <runscript name="C172-01A takeoff run"> <!-- This run is for testing the C172 altitude hold autopilot --> <use aircraft="c172x"/> <use initialize="reset00"/> <run start="0.0" end="7200" dt="0.0083333"> <when> <parameter name="sim-time-sec" comparison="ge" value="0.25"/> <parameter name="sim-time-sec" comparison="le" value="1.00"/> <set name="fcs/throttle-cmd-norm" value="1.0" action="FG_RAMP" tc ="0.05"/> <set name="fcs/mixture-cmd-norm" value="0.87" action="FG_RAMP" tc ="0.05"/> <set name="propulsion/magneto_cmd" value="3"/> <set name="propulsion/starter_cmd" value="1"/> </when> <when> <!-- Set Heading when reach 5 ft --> <parameter name="position/h-agl-ft" comparison="ge" value="5"/> <set name="ap/heading_setpoint" value="200"/> <set name="ap/attitude_hold" value="0"/> <set name="ap/heading_hold" value="1"/> </when> <when> <!-- Set Autopilot for 20 ft --> <parameter name="aero/qbar-psf" comparison="ge" value="4.0"/> <set name="ap/altitude_setpoint" value="100.0" action="FG_EXP" tc ="2.0"/> <set name="ap/altitude_hold" value="1"/> <set name="fcs/flap-cmd-norm" value=".33"/> </when> <when> <!-- Set Autopilot for 6000 ft --> <parameter name="aero/qbar-psf" comparison="ge" value="5.0"/> <set name="ap/altitude_setpoint" value="6000.0"/> </when> <when> <!-- remove flaps at 50 ft --> <parameter name="position/h-agl-ft" comparison="ge" value="100.0"/> <set name="fcs/mixture-cmd-norm" value="0.69" action="FG_EXP" tc ="400.0"/> <set name="fcs/flap-cmd-norm" value="0"/> </when> <when> <!-- Set Autopilot for 4000 ft --> <parameter name="sim-time-sec" comparison="ge" value="1500"/> <set name="ap/altitude_setpoint" value="4000.0"/> </when> <when> <!-- Set Autopilot for 7000 ft --> <parameter name="sim-time-sec" comparison="ge" value="2500"/> <set name="ap/altitude_setpoint" value="7000.0"/> </when> </run> </runscript> I was also using the very latest code from JSBSim CVS. I'm not sure there's anything inherently wrong with the script you are using, but the engine may be acting wrong. Look at the power generated by the engine while it is flying. In the case I tried, I suspect the engine is overpowered, somehow. Jon |