|
From: Philippose R. <sa...@ro...> - 2006-02-21 18:24:10
|
Hello Guys, Thanks a lot Wysong, Tim and Jon for the stimulating discussion, the ideas and the suggestions regarding the Matlab Interface! First...Wysong...well...my intention right from the beginning..was to try and come up with a "Co-simulation" interface between JSBSim and Simulink, because my base intention (really long term :-)!) is to work on a UAV based on a model helicopter. For this, I wanted to run the control systems design on Simulink and use JSBSim for the Flight dynamics part of it. Tim, interesting to have a GaTech Aero dude in the group :-) I must confess...this whole fascination with UAVs and helicopters goes back atleast 7 years when I first saw the UAV Competition website (in which GaTech seems to always lead :-) With the Yamaha helicopter (GTar?)) Its only now that I have gotten the opportunity, the resources...and JSBSim to actually do something tangible. (Well...got rejected for a PhD from GaTech last year :-)!) So coming back....I dont know if any of you have used a software called "Simpack"...its used mainly for Railway simulation (My Master thesis was about Robust ABS brake control systems for trains using QFT for frequency domain and LQR for time domain)...Simpack has a Co-Simulation interface which runs over sockets...its basically an S-Function which takes as input the different inputs you want to send to your model...and gives as output the output variable from the model. This is what I am aiming at reaching. As for using an "openloop" assumption that the two will be automatically synchronised by using Blocking mode will lead to trouble...the reasons I see for this are: 1. You cannot perfectly synchronise the start of the simulink simulation and the JSBSim Simulation...JSBSim needs some time before it starts putting out values. And since you need to drive the JSBSim simulation via Simulink...Simulink will start-up faster. 2. 120Hz is 0.0083333333.....seconds...you will end up with a drift due to differences in sample steps unless you can specify the time step upto exactly the sae number of decimal points as in JSBSim. 3. You cant really run a normal simulink model in real-time...unless you use Realtime workshop to generate code and compile it....etc...etc....basically...if you choose a fixed time step simulation mode and press "play"...Simulink does not simulate in real-time. On the other hand...JSBSim I assume simulates in real time when the "--realtime" switch is provided. So you will end up with a confused simulation system :-)! Becuase of all this, and because JSBSim is more felxible than Simulink, I thought we could probably drive the JSBSim clock from Simulink by sending the current simulation time along with the data sent out from Simulink...and then JSBSim simulates the current time step...and gives back the results. As for a union...thats something I hadnt thought of :-) So...shall try to look into that option too...thanks Wysong :-)! Only problem...in the windows socket "recv" command...the incoming data comes in as a character array pointer...and in the "send" command...the outgoing data is also a "char *"...doesnt that mean that you are restricted to send on character arrays? As in...for the network layer...there is only one datatype...the "char". And Jon...I had mentioned that I wanted to ask you something specific about the sockets....shall put that into a second mail..I think this is already too long :-)! Driving went quite well today :-)! Just...the Germans seem to be a little more agressive than me :-) Places where I would feel most comfortable at around 65km/h..I had to hold the steering wheel tight and go to over 85 :-)!! Enjoy the rest of the day :-)! And...keep the ideas flowing :-)! Regards, Philippose __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |