From: Michael.McCarthy <Mic...@ul...> - 2010-06-21 08:41:31
|
Hi Brian Many thanks for the detailed response. That is indeed a powerful facility. I did not realise the entire JSBSim program was available in the S-Function. As you say that opens up using all the different JSBSim aircraft within matlab, which is very exciting. I will be working on getting familiar with all this over the coming weeks, so no doubt will have some follow up questions and feedback. Thanks for this great initiative. Regards Michael ________________________________ From: b mills [mailto:bri...@in...] Sent: Sun 20/06/2010 06:10 To: jsb...@li... Subject: Re: [Jsbsim-matlab] S-function Hello Michael! Your question is not dumb at all, and in fact it is very reasonable that JSBSim and Simulink could be a bit overwhelming to a new user...or a seasoned user as well. Let me first say that I'm excited that my project may find its way into a college classroom, as that was one of the intended uses ;). That said, I know that my current documentation for the project leaves much to be desired. I'm working on something of a white paper/user doc currently, but it will be a few more weeks before anything is ready for release. OK, let me attempt to put all this together so that it makes sense and you can get started.... JSBSim is the default non-linear flight dynamic model used in the FlightGear flight simulator project. The JSBSim S Function takes the JSBSim code and compiles it into a matlab compatible executable file that is called a MEX file. An S Function is a user-defined Simulink function that can be written in M, ADA, C etc, and can be in the form of a MEX file. What is nice about a MEX S Function is that it can be a rather complex external program (like JSBSim), but is treated as a simple Simulink block. Now, all the power of JSBSim flight modeling software is available in any Simulink model. With the JSBSim Sfunction, any JSBSim compatible aircraft FDM/engine file that is located in the JSBSimData/aircraft or .../engine folder can be run in any Simulink simulation. This is quite powerful as there are many decent FDMs already available to start out with. The S Function can then be used for many different teaching scenarios such as: * * how to trim an aircraft using the built-in trim utility * linearizing non-linear models and analyzing the decoupled state-space matrices * flight model validation and construction * control system and autopilot system design with the JSBSim S Function acting as the plant * using an events driven tool like StateFlow to script a flight The flight scripting that you mention is something that I would be interested in working with you on as it is a capability that I have not really explored as of yet, but would like to implement better in the future. To get started using the S Function, simply type "jsbsimgui_start" at the Matlab command line- this will launch the JSBSim GUI application. The JSBSim GUI is just a convenient way to initialize all of the Sfunction parameters such as the Simulink model (use the default choice), the delta time, the JSBSim multiplier (allows you run simulations much faster), the trim utility, and all of the aircraft control inputs and states. Please read the README text file and use the Help button on the GUI for further explanation. Also please keep in mind that this is still a developing project with much further development work needed so there may be some bugs :). Also, I will attach my incomplete paper that I am working on (it is a rough draft so please bear with me...) which will explain things in more detail, like the trim script and the different MEX files used. So to sum it up, the JSBSim S Function would be a great tool to teach your students as it brings a well-established non-linear flight dynamic modeling engine directly into Simulink as a single block. Any control system can be built around it and all the states, propulsion parameters, control parameters, state derivatives etc are made available as outputs from the S Function block. Any JSBSim compatible flight model file available can be run and analyzed in a way not previously available. Best of luck and please keep in touch with me as I am interested in getting feedback from users on how the project is being used. Also keep an eye out for updates as some may be coming soon. Best Regards, Brian Mills ----- Original Message ----- From: "Michael.McCarthy" <Mic...@ul...> Date: Thursday, June 17, 2010 19:14 Subject: [Jsbsim-matlab] S-function To: jsb...@li... > Hi Brian > > This is going to sound like a really dumb question, but I was > just wondering if you could post something that explains in a > nutshell what the S-function does and how it can be used. I have > downloaded it and played with it a little but am still not too sure. > > To put my question in context, I am new to JSBSim, and pretty > new to Simulink too. I've obtained the matlab aerospace toolbox > and blockset, and am trying to make sense of it all. My main > motivation is obtaining tools that will help me in teaching > Stability and Control of Aircraft in an exciting way. The > aerospace blockset looks too complex for that. > > Currently my thinking is to use Datcom, Matlab, JSBSim and > (possibly) Flightgear. Our students generally aren't able to fly > aircraft in Flightgear so I am thinking more in terms of > scripted flights, for which we can then apply different control > system approaches. > > If you could advise on how your S-function could assist with > that it would be great. > > Many thanks > Michael > > > |