Board index FlightGear Development

Generating Phugoid and Dutch Modes using FLIGHT GEAR

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby chaitanya » Sun Jan 16, 2011 11:55 am

can someone suggest me method to generate phugoid and dutch roll modes using flight gear alone . I want to edit the source file in order to generate those modes . i Have a set of equations to solve and generate the visual effects using flight gear . As Flight gear source is written in C++ i want to know how to start with generating those modes. Can someone help me with the problem . I am sure that i have to write those codes in C++ but i donno how to generate scripts connecting those codes to flight gear.
Any suggestions are accepted ..............thankyou
with regards
nanigaadu
chaitanya
 
Posts: 15
Joined: Sun Jan 16, 2011 11:45 am

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby MAKG » Sun Jan 16, 2011 5:08 pm

Matlab (or perhaps its free cousin Scilab) would seem to be a better tool for modelling equations you have in hand. The "generic" FG protocol allows control from an external entity.

Your FDM doesn't bear much resemblance to the ones in FG, as yours have a restricted range. Clipping it from the source code isn't going to find a "generatePhugoid()" method. Phugoids are what happens when all inputs are kept constant at an out-of-trim airspeed. If you just want to experience it (doesn't sound likely), turn on the "wings level" autopilot (to suppress roll) and let go of the stick.

Dutch roll is a consequence of swept wings coupling roll and yaw. So, use an aircraft with swept wings (e.g., an airliner).
MAKG
 
Posts: 1152
Joined: Sun Oct 19, 2008 7:11 pm
Location: California Central Coast

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby curt » Mon Jan 17, 2011 12:38 am

I may not be understanding your question, but the aircraft already in FlightGear are pretty realistic and effects like dutch roll and phugoid are already modeled.

Regards,

Curt.
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby chaitanya » Mon Jan 17, 2011 6:07 am

@ curt : i have modelled those high angle of attack modes using matlab by solving the generic flight dynamic model equations by generating scripts in simulink and connected those scripts to flight gear . now i want to generate scripts within the flightgear software ( basically in C++) to run those modes .
if they are already modelled within the software can i know how to genenrate those modes without using joystick ( i meant flight gear alone )


@ MAKG : as i have solved those fdm equations in matlab and run those modes(using simulink and flightgear) can i generate those modes using C++ and direct those FDM to flightgear
chaitanya
 
Posts: 15
Joined: Sun Jan 16, 2011 11:45 am

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby chaitanya » Mon Jan 17, 2011 6:09 am

i havent used joystick to generate those modes i simply run it using matlab and flight gear . now i want to run it with flight gear alone (with a FDM model)
chaitanya
 
Posts: 15
Joined: Sun Jan 16, 2011 11:45 am

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby curt » Mon Jan 17, 2011 4:55 pm

Do you want to use FlightGear to model the flight of the aircraft and the visualize the result? Or do you want to use matlab to model the flight physics and just use FlightGear to visualize the results? You can do it which ever way you prefer, but FlightGear is very capable of modeling detailed and complex flight physics itself. Do you want to script the flights so you can trigger a phugoid or dutch roll and plot the results?

Curt.
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby chaitanya » Tue Jan 18, 2011 5:14 am

yes, I want to script the flights and trigger phugoid or dutch roll and plot the results.
But i have done the same using matlab and flightgear, now i want to do the same with flight gear alone , so i want to know where to startup with the process .
chaitanya
 
Posts: 15
Joined: Sun Jan 16, 2011 11:45 am

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby curt » Tue Jan 18, 2011 6:15 am

If it was me doing it, I'd take a close look at nasal. If you have the appropriate autopilot modes to hold your wings level, hold altitude, hold speed, etc. then you can use nasal to configure the autopilot, monitor the flight until the system has stabilized, record the elevator position. Then give a some elevator input and return it to the trimmed out position and let the airplane fly (probably with the wing leveler still on...)

I've done something similar externally in perl through the --telnet interface, but it's probably much easier to use nasal.

Regards,

Curt.
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby MAKG » Tue Jan 18, 2011 7:12 pm

It would help if we knew if this was for personal understanding or a formal study. Precision is the difference.

If you just want to experience a phugoid, the c172p has a pronounced and obvious phugoid mode. At altitude, trim the aircraft fully so it flies straight and level with no pressure on the stick. Then change the throttle or elevator trim a little with no input to the stick and it will fly a phugoid. Watch the airspeed, "8 ball," and altimeter. The motion is weakly coupled to yaw, so it will eventually get into a "spiral of death," but that's easily suppressed with the autopilot in "wings level" (WL) mode. Hit HDG twice, for instance.

Dutch roll is natural for airliners. Fly it to altitude, trim it, and DO NOT turn on the yaw damper or autopilot. Adjust roll or yaw quickly, and the aircraft will execute a dutch roll. The 777 and 787 seem to have fairly complete FDMs.
MAKG
 
Posts: 1152
Joined: Sun Oct 19, 2008 7:11 pm
Location: California Central Coast

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby chaitanya » Thu Jan 27, 2011 6:13 am

i m doing it as a formal study .
but though i want to experience the phugoid not by using joystick( by controlling the motion of the aircraft). the phugoid mode undergoes a set of non linear behaviour of the system, i have a set of physics equations for that mode, can i implement/run those equations using flightgear.
chaitanya
 
Posts: 15
Joined: Sun Jan 16, 2011 11:45 am

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby curt » Fri Jan 28, 2011 2:40 pm

FlightGear already implements the physics of a phugoid. If you want to implement the physics equations yourself, then I'm not sure what the best plan would be. Maybe write an standalone program and send the output for FlightGear to render? (would require learning about socket communications.) Maybe write your own physics engine inside FlightGear (using JSBSim or YASim as an example of how to interface the code?)
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby chaitanya » Fri Jan 28, 2011 5:10 pm

if flight gear implements the physics of phugoid by itself , can you please guide me through a step by step procedure on how to generate phugoid mode.
i would like to give it a try .
chaitanya
 
Posts: 15
Joined: Sun Jan 16, 2011 11:45 am

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby curt » Fri Jan 28, 2011 5:49 pm

Take off and trim the plane for close to straight and level flight (throttle, elevator trim, etc.) Then pull back on the yoke for a second or two and pitch up maybe 10 degrees. Then release the yoke back to it's natural center point. Keep the wings level so that a turn or spiral doesn't develop. You should be able to observe the phugoid ... you'll see a phugoid shape if you plot airspeed, or if you plot pitch angle, or if you plot raw altitude, etc.

If you are flying in formation with another aircraft when you trigger a phugoid, it will appear that the other aircraft is flying a circle around your wing tip (or visa versa from the other aircraft's perspective.)

Curt.
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby chaitanya » Fri Jan 28, 2011 7:44 pm

thank you ,yeah i can visualize the phugoid with this procedure

now how can i write my own physics engine within flight gear( using JSBSim or YASim as an example of how to interface the code )what requirements do i need to write my own physics to edit flight gear
chaitanya
 
Posts: 15
Joined: Sun Jan 16, 2011 11:45 am

Re: Generating Phugoid and Dutch Modes using FLIGHT GEAR

Postby curt » Sat Jan 29, 2011 2:28 am

I think this is the point where you should start diving into the code and figuring out the structure and taking a look at JSBSim and YASim sections for examples. I'm not going to say it's self explanatory, I'm not saying it's easy, and I'm not saying you are on your own with no help, but my time is limited and it's been a while since I've dug into that section of the code myself. If you are serious about this I think you can make a lot of headway if you jump in and start exploring on your own and then come back and ask some more specific questions.
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Next

Return to Development

Who is online

Users browsing this forum: No registered users and 11 guests