From: Martin H. <mar...@gm...> - 2019-08-05 21:32:12
|
Bill, Thanks for your suggestion. I tried to replicate your parameters, but the result is still the same - the model does not react on flaps input. I set the flaps to a non-zero state at the beginning using FCS->SetDfPos(JSBSim::ofDeg, 30.0). Using this command, the flaps are set accordingly, but they still don't react on the flaps command FCS->SetDfCmd(10.0d) in the main loop. Martin Am Mo., 5. Aug. 2019 um 22:35 Uhr schrieb Bill Galbraith < bil...@gm...>: > 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 > > > > > > > > [image: Image removed by sender.] > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > > Virus-free. www.avg.com > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > > > _______________________________________________ > Jsbsim-devel mailing list > Jsb...@li... > https://lists.sourceforge.net/lists/listinfo/jsbsim-devel > _______________________________________________ > The JSBSim Flight Dynamics Model project > http://www.JSBSim.org > _______________________________________________ > > -- Dr. Martin Hoffmann Rietburgstraße 2 67141 Neuhofen Tel.: 06236/699022 Mobil: 0163/5698053 E-Mail: mar...@gm... |