Saturday, October 15, 2005

Reading data from the simulator

Today I've been able to read the aircraft's current position, which means the commanded course in the HUD is starting to work. This is stuff that should be placed in the flight computer, but since I haven't made that program yet these functions will have to be placed in the HUD program temporarily. However this means that for the moment there will not be anything else than hardcoded waypoints. I'll see if I have the time tonight to make the program change waypoint according to the right conditions.

Wednesday, October 12, 2005

Project overview

It might be a good idea to give you an overview of this project to understand what I am doing.

SUL37 is a project to build a simulator based on a real SAAB AJ37 cockpit. We are 6 people from completely different parts of Sweden involved in this project. For simulation we use Microsoft Flight simulator 2004 which is projected on a big screen in front of the cockpit. Our goal is realism and we aim to be as true to the original as possible. Everything in the cockpit is original except for the displays for HUD and radar. Most of the gauges are modified to house stepper motors that we can control from our software, and there is only a few reserve gauges that aren't working so far. To top this there is a pneumatic G-simulation system fitted in the ejection seat.

My contribution to this project is the software for the flight systems. that includes the HUD presentation system, the radar display system and the flight computer for navigational calculations and other tasks. The programming is made in C++ and the graphical presentation is made with OpenGL. The different sub systems will be distributed to several programs on several computers. This way we can use old "junk" computers that don't cost us anything, but the different systems will then have to communicate in some way. To start with we will probably use FSUIPC since this is what we use to fetch data from the simulator, but we might want to make some interface of our own down the line.

The original hardware for the HUD (head up display), or SI as it is called in system 37, is kept as it is except we've replaced the small round CRT with an old b/w TV. Since the TV is slightly larger than the original CRT, and since we need to have a closer focus for the HUD presentation (the simulated world is projected just a few meter in front of the pilot instead of infinity as the real world) we've also placed our own optics between the TV and the HUD. The result is almost perfect.

The radar display, or CI as it is called in system 37, is also replaced by a b/w TV with a green filter and a Fresnel lens in front of it. The radar display presents some navigational aid, a horizon line and a radar image in PPI och B-scope. I have plans for a realistic radar simulation with shadows and proper illumination. But since this is very complicated it is not something I prioritize.

Finally the central flight computer, or CK as it is called in system 37, is the heart of the whole system. The flight computer has many different tasks, but one of the main things is navigational calculations. it controls what is presented in the HUD and radar display, but also many of the gauges. The pilot controls the computer from a panel on the right side.

I will write more about the different systems as I make the programs for them.

Monday, October 10, 2005

SI starting to take shape

After a few hours in the AJSH37 simulator at the F7 airbase in Såtenäs, and now recently a few hours in a similar simulator at SAAB in Linköping, and after having gone through all not classified documentation we have been able to get our hands on and then some, I think I've got a somewhat good understanding of how the HUD works. The program I made last summer is now restructured and as a result it was easy and quick to add some new HUD modes. What we have now is the startmode (I'm still not entirely sure how to make calculations for rotation velocity though), a somewhat complete nav mode, low nav mode and optical landing mode.

Today I've also made some real progress of making the HUD-program communicating with the simulator.... With one exception. There don't seem to be any variable in FlightSim for climb angle. But I think it should be possible to calculate that from vertical speed and ground speed. This seems to give me correct values, but unfortunately these variables are not updated more than a few times every second which renders them almost unusable. So I have to find some other way. If anyone has any suggestions, I'd be happy to try it.

Finally I started to add functionality for commanded altitude, which seems to work just fine. I also adjusted radar altitude so it is presented correctly. Next step is to finish the commanded altitude, but that would require waypoints I guess, and that is a completely different part of this project.

After some thinking, drawing and calculting I think I've figured out a way to get the climb angle

climbAngle = pitchAngle - (sin(rollAngle) * beta + cos(rollAngle) * alfa)

At least it seems right to me, but if I'm thinking all wrong please tell me. Here is a video of the result