Board index FlightGear Development Aircraft

Adding TACAN to an aircraft model

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Adding TACAN to an aircraft model

Postby ScottBouch » Sun May 15, 2022 7:56 pm

Hi all,

I am working on developing the FGUK EE Lightning, and have recently been trying to make TACAN work.

I have been looking at the official Flightgear hangar Buccaneer as an example with working TACAN, and have tried adding lines in set.xml etc taken from the Buccaneer, but I am just stabbing in the dark with no clear direction.

What I really need is some clear guidance as to what an aircraft model needs in order to invoke / turn on TACAN in Flightgear.

I am building a hardware simulator alongside the software development, and have a real TACAN control unit from a Lightning. I have the channel selection working through to the 'Radio' dialogue box in Flightgear, all properties in the tree are looking good, the final hurdle is now getting Flightgear to start TACAN.

this is what I have tried so far: http://forum.fguk.me/discussion/comment/352#Comment_352

And this is my hardware project : https://www.scottbouch.com/mcfs/lightni ... -9273a.htm

Many thanks in advance, Scott
User avatar
ScottBouch
 
Posts: 183
Joined: Wed Jun 22, 2016 4:14 pm
Location: Midlands, UK
OS: Linux Mint

Re: Adding TACAN to an aircraft model

Postby TheEagle » Sun May 15, 2022 8:34 pm

Well, normally all an aircraft should need to have a working TACAN are these lines in it's instrumentation.xml file:
Code: Select all
<tacan>
    <name>tacan</name>
    <number>0</number>
</tacan>


After that, check that /instrumentation/tacan/serviceable is set to true and the powered property too. The switch property seems to toggle between transmit and receive mode. There is a wiki page for the TACAN in FG: https://wiki.flightgear.org/Tactical_Air_Navigation
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Adding TACAN to an aircraft model

Postby ScottBouch » Tue May 17, 2022 3:22 pm

Hi Eagle, thanks!

Do you know which properties FGFS Tacan looks at to confirm power supplies are healthy?
serviceable' is ok, so hoping it may be power.

Thanks for the "switch" tip about the T/R and R modes, these will relate to Air/Ground and Air/Air (range only) modes.
User avatar
ScottBouch
 
Posts: 183
Joined: Wed Jun 22, 2016 4:14 pm
Location: Midlands, UK
OS: Linux Mint

Re: Adding TACAN to an aircraft model

Postby TheEagle » Tue May 17, 2022 3:29 pm

Yep, the /instrumentation/tacan should also have a powered property if I'm not mistaken, which should be written to by the electrical system (you have to set that up manually - it's set to true by default). Also, you might have to set /systems/electrical/outputs/tacan to something like 28.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Adding TACAN to an aircraft model

Postby ScottBouch » Wed May 18, 2022 6:14 pm

Hi Eagle,

Thank you for pointing me in the right direction. It's now fixed!


I read the code in FGFS file: fgmeta/flightgear/src/Instrumentation/tacan.cxx

Found the line: _electrical_node = fgGetNode("/systems/electrical/outputs/tacan", true);

Checked this property, and hey presto, a value of "none".

Setting this to a 1 makes TACAN work!

I'll visit my electrical NASAL script to set this true when adequate voltage is available on the right wires.

Thanks again, Scott.
User avatar
ScottBouch
 
Posts: 183
Joined: Wed Jun 22, 2016 4:14 pm
Location: Midlands, UK
OS: Linux Mint

Re: Adding TACAN to an aircraft model

Postby TheEagle » Wed May 18, 2022 6:40 pm

ScottBouch wrote in Wed May 18, 2022 6:14 pm:Checked this property, and hey presto, a value of "none".

Yeah, the electrics handling of FG can be a pain in the back sometimes … when I introduced my custom electrical system on the P210N, I couldn't figure out for DAYS whyever my ADF needle was always pointing 90° right … until I took a look at /systems/electrical/outputs/adf ! :mrgreen: :lol: :x
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Adding TACAN to an aircraft model

Postby ScottBouch » Wed May 18, 2022 7:00 pm

Haha, well to add complexity, it currently has two electrical systems active at the same time; the default FGFS generic system, plus I have written the entire DC system (AC still to do) of the Lightning T5. This is to the detail of every wire ID, and fuse number. In the future I will implement random fuse failures, which will take out the exact circuits as that particular fuse would in the real aircraft. The generator systems including relays and switching logic is also implemented, so the DC voltage levels jump around a bit as they would in the real aircraft when GPU and aircraft power supplies come online/offline. It sounds complex (and is), but it was the best way to build in the realism I wanted to see instead of settling for something that wasn't quite right.

The instrumentation and systems that were already written for this model refer to the generic FGFS electrical system, but I am slowly moving things over to the actual representation of the aircraft electrical system. As TACAN wasn't fully implemented previously, I will begin it's life on the full electrical system!

Cheers, Scott
User avatar
ScottBouch
 
Posts: 183
Joined: Wed Jun 22, 2016 4:14 pm
Location: Midlands, UK
OS: Linux Mint

Re: Adding TACAN to an aircraft model

Postby TheEagle » Wed May 18, 2022 9:07 pm

@Scott: Cool, that another aircraft in FG gets rid of the generic electrical system ! :) I've also done that, not down to every wire, but the circuit breakers are all working, as the power sources … well, it comes at 3000+ lines of property rules …
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Adding TACAN to an aircraft model

Postby ScottBouch » Wed May 18, 2022 10:11 pm

I've just had a quick look at your electrical system on your git hub page! it looks painful!

I wrote mine in Nasal (again, thousands of lines), are there any advantages of using xml property rules vs Nasal scripting?

PS, does your logic execute at screen refresh rate? Or is there a program execution timer somewhere?

Cheers, Scott
User avatar
ScottBouch
 
Posts: 183
Joined: Wed Jun 22, 2016 4:14 pm
Location: Midlands, UK
OS: Linux Mint

Re: Adding TACAN to an aircraft model

Postby TheEagle » Wed May 18, 2022 10:24 pm

My electrical system executes at frame rate - no timer. One could also make it run at 120 Hz by loading it as an autopilot - but I think that's an overkill for an electrical system.

ScottBouch wrote in Wed May 18, 2022 10:11 pm:are there any advantages of using xml property rules vs Nasal scripting?

Well, the only benefit AFAIK is that property-rules use much less computational capacity.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Adding TACAN to an aircraft model

Postby ScottBouch » Wed May 18, 2022 11:39 pm

Thanks for that.. I was running my Nasal scripts at 25ms, but as I am building a hardware simulator, the delay was really noticeable when flicking a switch should light a lamp immediately. I have sped them up to 5ms, but may try frame rate and see if the PC can cope.

Regarding the detail of using circuit ID's from the wiring diagrams... initially I tried avoiding them and using descriptive words for the circuits, but it was just more work, I realised that English Electric had already done a good job of designing the aircraft, and have already named everything, so I used their codes to save re-inventing the wheel.

I note in your system you have Currents as well as Voltages. Have you estimated how much current each piece of equipment draws? Can you draw too much and simulate blowing a fuse?

I only have invluded Voltages so far, mainly because I don't know how much current the equipment draws.. and also its a dynamic thing, anthing containing a rotary inverter will pull 4 or 5 x the normal operating current on start up. plus a radio will draw more when transmitting, etc...

cheers, Scott
User avatar
ScottBouch
 
Posts: 183
Joined: Wed Jun 22, 2016 4:14 pm
Location: Midlands, UK
OS: Linux Mint

Re: Adding TACAN to an aircraft model

Postby TheEagle » Wed May 18, 2022 11:48 pm

Well, I don't have blowing fuses yet, but that's definitely something I want to implement … later. (Well, actually it's not blowing fuses. but rather popping circuit breakers ! ;) )
As for the currents, most of them were noted in the Electrical Load Analysis in the Service manual - sadly not all, so I had to guesstimate the rest. Having the Service Manual of the aircraft you are making, is always worth a lot ! ;)
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Adding TACAN to an aircraft model

Postby ScottBouch » Thu May 19, 2022 12:07 am

Thats brilliant!

Unfortunately the manuals for the Lightning don't include a similar electrical load schedule. There is some mention in the emergency procedures about load shedding if there is a generator failure to make the battery last longer, there may be clues there. Aside from that, I have are fuse ratings, but really they are sized according to the downstream wire gauge to prevent a fire, so not really indicative of the actual loads.

I have equipment manuals for some of the pieces of equipment, some include loads, but not all.

I do however have some real pieces of equipment from Lightnings, so can fire them up on the bench and take measurements, but thats only a few items... but I guess some accuracy is better than none!
User avatar
ScottBouch
 
Posts: 183
Joined: Wed Jun 22, 2016 4:14 pm
Location: Midlands, UK
OS: Linux Mint


Return to Aircraft

Who is online

Users browsing this forum: No registered users and 8 guests