From: Bill G. <bil...@gm...> - 2019-08-05 20:35:01
|
Martin, I do all of my testing with scripts in JSBSim, but the concepts and parameters should be the same. From a Flaps-Up test: <!-- Specify the initial conditions --> <property value="7629.0"> ic/h-sl-ft </property> <property value="118.0"> ic/vc-kts </property> <property value="0.375"> fcs/flap-cmd-norm </property> <property value="15.0"> fcs/flap-pos-deg </property> <property value="0.0"> gear/gear-cmd-norm </property> <property value="0.0"> gear/gear-pos-norm </property> <!-- Set the engines running and trim the aircraft. --> <event name="Trim"> <condition> simulation/sim-time-sec ge 0.0 </condition> <set name="propulsion/set-running" value="-1"/> <set name="simulation/do_simple_trim" value="1"/> </event> <!-- After 4 seconds, move the flap control in 0.25 seconds. --> <event> <condition> simulation/sim-time-sec ge 4.0 </condition> <set name="fcs/flap-cmd-norm" value="0.0" action="FG_RAMP" tc="0.25"/> </event> Hope this helps, Bill From: Martin Hoffmann [mailto:mar...@gm...] Sent: Monday, August 05, 2019 4:29 PM To: jsb...@li... Subject: [Jsbsim-devel] Flaps command not changing flaps position Hi all, I am trying to get JSBSim running as the flight model for a project using the Unity Game Engine. To get there, I built a DLL wrapper around JSBSim that makes it available to Unity as a third party component. Marshalling C# data to and from JSBSim works without any problems, and I have a running sim loop in Unity. I'm using the C172p model for a first test. So far, I set the engine controls in Unity, marshal them to JSB and receive engine data back in Unity. Engine behavior looks as expected with RPM increasing at the beginning and stabilizing after a few seconds into the sim loop. Next step would be setting the flaps according to the user's input, and this is where I got stuck. I am setting the flaps command, but the flaps don't react - flap position is always zero. This is the sequence I am using (following roughly the FlightGear implementation): * Load aircraft model * Set initial conditions: * ... * FCS->SetDfCmd(10.0d); // set flaps to 10 percent * ... * fdmex->RunIC(); * fdmex->DoTrim(JSBSim::tGround); * Start the sim loop with with a frequency of 120 iterations per second * fdmex->Setdt(120.0d); * FCS->SetDfCmd(10.0d); * fdmex->Run(); * aircraftStatus.FlapsPos = FCS->GetDfPos(); No matter what DfCmd is set to, the result of GetDfPos() is always zero. I tested this with multilple single prop models. and the behavior is always the same. As already mentioned, other FDM parameters react as expected. Side note: The above test is running outside Unity, so Unity does not have an influence on the behavior. Any suggestions are highly appreciated! Cheers, Martin <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free. <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> www.avg.com |