Board index FlightGear Development Canvas

F-16CJ HUD types

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Re: F-16CJ HUD types

Postby Johan G » Wed Apr 30, 2014 5:22 pm

hvengel wrote in Wed Apr 30, 2014 4:15 pm:Interesting - these reticles look EXACTLY like the K-14A reticle.

That was my thought as well when I had a look at the K-14A while you was starting on it.

hvengel wrote in Wed Apr 30, 2014 4:15 pm:Could these sights still be using manual ranging in the early 1980's?

No, I don not think they even could be manually ranged. I read at Greg Goebel's AirVectors that the earliest versions of the Thomson-CSF Cyrano IV multimode monopulse radar had only a single target capability and was a sole air-to-air radar. I would guess limited to searching, target ranging and illumination.

hvengel wrote in Wed Apr 30, 2014 4:15 pm:If these sights are using radar ranging then why do they have the manual ranging diamonds? Are these just a left over appendage from an earlier era? Or are these GGS-III/K-14A derivatives that have been retro fitted with radar ranging. If that is the case then the gun sights would have been mechanical (IE. driven by a gyroscope) and other than the ranging system would have been very much like a K-14A/.GGS-III with similar lag and damping issues.

I would guess that the diamonds was left as an emergency backup and the sight would return to a default range if the radar fails. I would not at all be surprised if the sight was indeed mechanical. The HUD in its whole is sometimes referred to as the "reflector sight and head up display unit". Also, the first flight was in the mid-1960's. :wink:
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: F-16CJ HUD types

Postby Hooray » Fri May 02, 2014 8:11 pm

@HDS:
While the code is using some fancy maths, it's pretty straightforward otherwise, i.e. also accessible to newcomers with strong math skills, because it's not really using any fancy programming constructs (e.g. OOP or design patterns ) or exotic Nasal constructs. Looking at the code, I am wondering if it's dealing properly with reset/re-init, the fdm-initialized handler seems like it could register multiple instances of the same callback for each reset (just checked very briefly)? Not sure about the settimer() call if there's anything preventing multiple instances of the same callback there ?

From an interfacing standpoint, the whole thing depends on the property tree obviously, i.e. there's no such a thing as an OO interface s - e.g. supporting multiple instances would seem to require some work. But the code is very much written in a procedural style, so if your maths is good enough, you should have a fairly good starting point here (under 350 LOC).

The radar code is more involved, but is using OO - which makes interfacing a bit more straightforward probably (if you are familiar with the concepts)
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: F-16CJ HUD types

Postby HelldiverSquadron » Fri May 02, 2014 8:24 pm

OOP? The K14 in FG uses this? Oooohhh....
User avatar
HelldiverSquadron
 
Posts: 392
Joined: Sat Feb 16, 2013 7:35 pm
Callsign: Friend
Version: 3.0
OS: Windows 7 Ultimate

Re: F-16CJ HUD types

Postby hvengel » Fri May 02, 2014 10:16 pm

The lead computer code is very plain Jane procedural code and is an almost direct translation of the original 1974 FORTRAN code although I did try to make the names of various things more meaningful than the 3 and 4 character names used in the original code. At the time the original code was written OO and design patterns and the like did not exist. In addition, the original FORTRAN code was doing some things math wise that likely would not be done now days by using very close approximations to reduce computer cycle times (that is substituting low computational cost very close approximations for computationally expensive but exact operations) and this was retained in the translation.

It was intended to be a single instance per aircraft. This lead computer is a fixed gun lead computer meaning that it does not have the hooks needed for a turret gun (IE. variable elevation and azimuth) as it assumes that the guns and sight point in a fixed direction. There are configuration parameters that tell the lead computer where the gun is located relative to the sight line, how much the gun's bore is elevated relative to alpha (IE. the guns have a single known position and direction of fire that is more or less parallel to the flight path) and at what range the bullets path intersects the sight line. I don't know of any aircraft that uses fixed guns that has more than one gun sight. So I don't think supporting multiple instances makes sense for the type of gun sight this computer supports.

For turret guns there will either have to be a different solution or this one will need to be extended to allow for gun azimuth and elevation corrections as the gun is moved by the gunner. This will be non-trivial. In addition all of the math/physics in the paper that the original code came from is for fixed guns and does not include the additional factors needed for a turret gun. By the time this paper was written turret guns were very rare in actual service and were considered obsolete. It will be necessary to find additional reference materials to implement a turret gun sight and this might prove difficult. A turret gun lead computer should be setup to support multiple instances since most aircraft with turret guns will have more than one. For example a B-17 had three turret guns and some of these on later models had lead computing sights that were USN-MK18 derivatives which were specifically for turret guns.

Of the approx 350 lines of code a significant part of that is initialization code and stuff that interfaces with FlightGear to get or calculate data it needs (true air speed, normal acceleration, q-body, p-body, r-body, air temperature, air density,,,). The actual computational part that gets executed with each iteration of the computer is only perhaps 140 lines and some of this is related to interfacing to prevent bad property tree data from causing the computer to become unstable or to recover the computer if something extreme, like a spin, causes the computer to become unstable. There is also code in the main loop that clamps the elevation and azimuth to the physical limits of the gun sight which are setup as part of the lead computer configuration.
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

Re: F-16CJ HUD types

Postby HelldiverSquadron » Fri May 02, 2014 10:29 pm

The USN MK18 was for turrets specifically, I believe. I think they came out with a better sight later on in the next two years after 1945
User avatar
HelldiverSquadron
 
Posts: 392
Joined: Sat Feb 16, 2013 7:35 pm
Callsign: Friend
Version: 3.0
OS: Windows 7 Ultimate

Re: F-16CJ HUD types

Postby hvengel » Fri May 02, 2014 10:35 pm

Yes the Mk18 was specifically for turret guns. The Mk21 was a MK18 with the turret gun stuff removed so that it could be used with fixed guns. The MK23 was the Navy version of the K-14A. The turret guns on USAAF aircraft used Army versions of the MK18 which had, I think, a K-15 designation.
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

Re: F-16CJ HUD types

Postby HelldiverSquadron » Fri May 02, 2014 10:54 pm

Ah....the navy. *click* :P
User avatar
HelldiverSquadron
 
Posts: 392
Joined: Sat Feb 16, 2013 7:35 pm
Callsign: Friend
Version: 3.0
OS: Windows 7 Ultimate

Previous

Return to Canvas

Who is online

Users browsing this forum: No registered users and 4 guests