Jump to content
Sign in to follow this  
Guest Ron Freimuth

Developing Autopilot - need help!

Recommended Posts

Guest Frank Benfeld

Dear FS programming experts,after developing a Moving Map with an ability to enter a flightplan, I would like to create a LNAV function to make the aircraft follow the pre-entered route.I have no clue about the mathematics or the basic structure such an autopilot should have. I only know that the default FS autopilot might be not sufficient because I cannot regulate the rate of turn and so I cannot calculate how to make the aircraft capture the course line.I hope there is somebody out there who might offer me some information about an autopilot's structure, mathematics or may be a small source-code snipped. I think it will be necessary to control the elevator/rudder/ailerson via an event, but that's all I am sure about.Thank you very much for your help.Kind RegardsF. Benfeld

Share this post


Link to post
Share on other sites
Guest Ron Freimuth

>Dear FS programming experts,>>after developing a Moving Map with an ability to enter a>flightplan, I would like to create a LNAV function to make the>aircraft follow the pre-entered route.>>I have no clue about the mathematics or the basic structure>such an autopilot should have. I only know that the default FS>autopilot might be not sufficient because I cannot regulate>the rate of turn and so I cannot calculate how to make the>aircraft capture the course line. I've noted the FS9 GPS shows hold ovals, but they are only appropriate for one hold TAS. In fact, one flies the turns at a '2 minute' rate. One minute straight, one minute turning at the standard rate, 180 degees, etc. >I hope there is somebody out there who might offer me some>information about an autopilot's structure, mathematics or may>be a small source-code snipped. I think it will be necessary>to control the elevator/rudder/ailerson via an event, but>that's all I am sure about.>F. Benfeld There is an XML "A:Variable" for Turn Rate. It normally drives the Turn Rate Indicator. To turn at a given turn rate, I'd make an XML code block that that compared the A: Var turn rate with a commanded turn rate (180 deg per second if in a holding pattern) and feed the difference into the ailerons to turn the aircraft. Or, one might be able to make the HDG command change at the right rate, though the former is better. I have never done that. In fact, I just got some SPD hold XML code working. It uses a calculated 'vdot', (rate of change of TAS), and the A: 'True airspeed' variable. It's hard to control the elevators, rudder, and/or ailerons with K: events since the JS output also goes to them. I guess it's not so bad if one doesn't though the JS, or, perhaps disables it with another K: event. Normally, an FS AC turns at the rate that depends on the max bank angle (set in aircraft.cfg) and the current TAS. Quite limited. If you know the TAS then it's easy to calculate the turn rate or turn radius at the max_bank set in aircraft.cfg. Ron

Share this post


Link to post
Share on other sites
Guest Frank Benfeld

Hi Ron,thank you for your information.I am programming in C++ so I have a litte more opportunities.If I have the delta change rate (Var turn rate) and the groundspeed. How can I calculate the radius of the turn ?----If you know the TAS then it's easy to calculate the turn rate or turn radius at the max_bank set in aircraft.cfg.----Where can I find this formula?Thank you for your help!Kind RegardsFrank

Share this post


Link to post
Share on other sites
Guest Ron Freimuth

>Hi Ron,>>I am programming in C++ so I have a litte more opportunities.>>If I have the delta change rate (Var turn rate) and the>groundspeed. How can I calculate the radius of the turn ?>>---->If you know the TAS then it's easy to calculate the turn rate>or turn radius at the max_bank set in aircraft.cfg.>---->Where can I find this formula?>>FrankFrom: Aviation Formulary V1.42 By Ed Williamshttp://williams.best.vwh.net/avform.htm Turns and pivotal altitudeIn a steady turn, in no wind, with bank angle, b at an airspeed v tan(:(= v^2/(R g) v= w Rwhere g is the acceleration due to gravity, R is the radius of turn and w is the rate of turn.Pivotal altitude h_p is given by h = v^2/gWith R in feet, v in knots, b in degrees and w in degrees/sec inconsistent units!), numerical constants are introduced: R =v^2/(11.23*tan(0.01745*:()(Example) At 100 knots, with a 45 degree bank, the radius of turn is100^2/(11.23*tan(0.01745*45))= 891 feet.The rate of turn w is given by: w = 96.7*v/R(Example) = 96.7*100/891= 10.9 degs/secThe bank angle b_s for a standard rate turn is given by: b_s = 57.3*atan(v/362.1)(Example) for 100 knots, b_s = 57.3*atan(100/362.1) = 15.4 degrees A useful rule-of-thumb, accurate to ~1 degree for speeds up to 250knots, is b_s= v/7 (v in knots).The pivotal altitude is given by: h_p = v^2/11.23(Example) At 100 knots groundspeed the pivotal altitude is 100^2/11.23 = 890 feet.---------

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...