FS2004 Autopilot for Helicopter

Hello friends

After a long... long absence, I am back to bother you with more questions and hopefully, finish and refine my current projects (not sure if "current" counts after almost eight months of doing nothing with them :duck:).

I want to write an XML autopilot for my helicopters. The ones availables for FS9 are written in C and I can't study them; they work fine until I determined the code has a flooding issue -with Bjorn and Roman's help-.

This is a general question: the autopilot's XML code design for a helicopter should follow the same rules as the standard Cessna's 182 autopilot?
If it is so, I will try to implement the code to work in a VC (with 3d parts and buttons working in tandem with 2D autopilot).

In advance, thank you all.
Sergio.
 
Last edited:

Roy Holmes

Resource contributor
I would think that before you start code design for a helicopter autopilot you should list what you want it to do. That clearly depends on what you want the helicopter to do. Sort those out and make a requirements list.
Then work on how to meet those requirements.
For an obvious example you might want it to hover automatically. That would be a complete departure from anything the Cessna does.
And a hover autopilot is not that hard to achieve.
Requirements always come before design.
Roy
 
Hello

Roy, thanks for the head up. My real intention here is to get a hint on what I should read to test the ideas you've mentioned and a few others wich resembles Antti Pankkonen's helicopter autopilot; this is another case where I will use XML for FS9 to achieve this goal. Unfortunately for me, all standard FS9's autopilot gauges are written in C language as well; therefore, I cannot even get the faintest idea on how to proceed.

Any hint for a good reading in this regard?
For now, I will keep looking here in the forum to get some ideas.
Thanks again,
Sergio.
 
Last edited:

tgibson

Resource contributor
Hi,

The 747 AP gauge(s) are written in XML, but they won't do you any good because they just turn standard FS events on and off, with no real logic.
 
Hi Tom

I suspected that, because "Flight Instrumentation Data" about the A:Vars and K:Events in the SDK's is pretty grim. So this is one instrument that will require "some" engineering knowledge which I don't have; Automatic Control Systems Theory and Laplace Transformations are not precisely my favorite cup of tea... :eek:

Thank you.
Sergio.
 
Last edited:

Roy Holmes

Resource contributor
Sergio,
I have one I made that will hold a baro alt you set and you can vary airspeed by the cyclic. It also has a hover mode where you can set airspeed in increments which means you can be in the winch mans position and dangle the winch cable so as to pick up SimObjects.
If that interests you, PM me
Roy
 
Sergio,
If you want to see how the C++ helo AP works you could use FSUIPC logging (send to cmd window for ease) with the following checked and while the AP on. "non axis events" & "axis events"
This will, at least, give you what commands are used to manipulate the attitude of the helo.
I can bet that the flooding issue you are having may not be able to be fully solved.. There may be a command in there that does not have a read var to keep from the flood.
For instance, the terrain following in our F-111 project has slight flooding, only in a certain TF mode. There was just no way to check the returned values.
If Roy's gauge is XML then you will have a good example to make your own..

Good luck.
 
Hi Roman

Thank you for the head up; however I'm affraid I am not enough versed coding in C++. Furthermore, I am not sure if I understood what you said about FSUIPC logging (I never used it before). I will launch the simulator and try to do what you've teached me.

I can bet that the flooding issue you are having may not be able to be fully solved
My money is on you again, I'm afraid it won't be possible to fix that gauge since I don't have the source code.

On the other hand, Roy was very kind and will send to me his own XML autopilot code to do my research.

By the way, If you're working with Karol in the same F-111 project, dear Lord, those gauges are very impresive!

Thank you; as always, your input is very much appreciated.
Kindest regards,
Sergio.
 
Last edited:
Hi!

Just want to thank Roy; he shared with me his own FSX helicopter gauge. :wizard: :wizard: :wizard:

Time to learn about it!
Cheers,
Sergio.
 

Ronald

Resource contributor
Hello Sergio
I'v found some papers, which can be helpful to understand how a helicopter autopilot does its trick
https://scholarcommons.usf.edu/cgi/viewcontent.cgi?article=1113&context=etd <- very extensive document
https://www.sciencedirect.com/science/article/pii/S1474667016440735
>>
https://www.helitrak.com/autopilot - commercial Helicopter Autopilot System
https://genesys-aerosystems.com/sites/default/files/files/HeliSAS_Technical_Overview-Genesys.pdf - commercial Helicopter Autopilot System - HeliSAS presentation
https://www.faa.gov/regulations_policies/handbooks_manuals/aviation/advanced_avionics_handbook/media/aah_ch04.pdf FAA document on Automated Flight Control
>>
https://spinoff.nasa.gov/Spinoff2008/t_2.html - NASA document on auto-pilots
https://deankmiller.com/aircraft-autopilot-system-description/ - Autopilot functional block diagrams
https://helicoptermaintenancemagazine.com/article/understanding-helicopter-automatic-flight-control-systems-afcs - Autopilot block diagram and internal mechanics
https://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=0B3E6B62D1A5BF304B18B227D4F1F9DD?doi=10.1.1.31.8317&rep=rep1&type=pdf Another white design paper
>>
https://www.helisimmer.com/news/helicopter-autopilot-p3d-released - website of someone how already has created one
https://www.sae.org/publications/technical-papers/content/2012-01-2098/ - payware document

I hope that there is something useful to be found inside these resources for you.
 
Hello Ronald

Thank you very much, I have some of them already. The more, the merrier!

Kindest regards,
Sergio.
 
Hello lads

The code for the autopilot kindly provided by Roy is for FSX; I made my best to translate it to a version meant to be used in FS9.

The FSX version code is writen in this order:
  1. Gauge event logic.
  2. Macros.
  3. Mouse Area.
  4. Update section.
I took a look at the original FS9 Garmin 500 where all Macros were defined in first place; on the other hand, Bjoern teached me in one fully operational gauge to set up the update section in the first place. I have a one question though...

Should be necessary to rearrange the order for the FS9 version? Lets say, this order:
  1. Update section.
  2. Macros.
  3. Gauge event logic.
  4. Mouse Area.
If some kind soul has the time to take a look, I attached the FS9 code written in the same order used in the FSX version. As a side note, I am not sure if I missed some K:Events in their respective FS9's equivalents. Since I don't have any images for this gauge yet, all mouse areas needs to be tested as well... o_O

In advance, thank you.
Sergio.
 

Attachments

Last edited:
Hello

Roy:
All files have been received and ready to be studied. Thank you very much!

Kindest regards,
Sergio.
 
Top