• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS Baffled by electrical system

I have been getting started with the electrical system on my L1011 project. I have to say that the way Asobo has set this up makes it so easy to create a complex system; I just can't get it to work.

I have set up my generators and buses, but I'm having problems with the circuits. I've started out by connecting a fuel pump. After rooting through the default templates, I gather that the only way to turn off a fuel pump is by disabling it's circuit. I've set up my own template to do this as shown below. The button animates correctly, but as far as I can tell, the circuit variable value turns to zero only for a split second before going back to one. (Elsewhere, I put the A value into an L:Var so I can see the value in the L:Var window we have available in development mode.) I can't see anything in my code that would flip the circuit back on and I am using the same code as Asobo.

I just can't figure out what's turning the circuit back on.

Code:
<Template Name ="L1011_FUEL_PUMP_BTNS">
    <UseTemplate Name="ASOBO_GT_Anim_Code">
        <ANIM_NAME>TANK_PUMP_ANIM_#KEY#</ANIM_NAME>
        <ANIM_CODE>(L:L1011_TANK_PUMP_#KEY#,number) 2 *</ANIM_CODE>
        <ANIM_LAG>20</ANIM_LAG>
        <ANIM_LENGTH>2</ANIM_LENGTH>
    </UseTemplate>  
    <UseTemplate Name="ASOBO_GT_MouseRect">
        <TOOLTIPID>#KEY#</TOOLTIPID>
        <CURSOR>Hand</CURSOR>
        <MOUSEFLAGS_DEFAULT_IM>LeftSingle+LeftRelease</MOUSEFLAGS_DEFAULT_IM>
        <CALLBACKCODE_DEFAULT_IM>                  
            (M:Event) 'LeftSingle' scmi 0 == if{ 1 (>L:L1011_TANK_PUMP_#KEY#,number)
            (A:CIRCUIT SWITCH ON:#KEY#, Bool) if{
                            #KEY# (&gt;K:ELECTRICAL_CIRCUIT_TOGGLE)
                        }          
            }
            (M:Event) 'LeftRelease' scmi 0 == if{ 0 (>L:L1011_TANK_PUMP_#KEY#,number) }
        </CALLBACKCODE_DEFAULT_IM>  
    </UseTemplate>
</Template>


<Component ID="L1011_FUEL_PUMP_1" Node="Cube.233">
    <UseTemplate Name="L1011_FUEL_PUMP_BTNS">
        <KEY>1</KEY>
    </UseTemplate>
</Component>
 
I've had success with the following:

Code:
1 (&gt;A:CIRCUIT SWITCH ON:13,bool)

Set to zero for off. Shocking, but it works :).

I also extracted this from FlightSimulator.exe:

Code:
CIRCUIT_INVALID
CIRCUIT_XML
CIRCUIT_GENERAL_PANEL
CIRCUIT_FLAP_MOTOR
CIRCUIT_GEAR_MOTOR
CIRCUIT_AUTOPILOT
CIRCUIT_AVIONICS
CIRCUIT_PITOT_HEAT
CIRCUIT_PROP_SYNC
CIRCUIT_AUTO_FEATHER
CIRCUIT_AUTO_BRAKES
CIRCUIT_STANDBY_VACUUM
CIRCUIT_MARKER_BEACON
CIRCUIT_GEAR_WARNING
CIRCUIT_HYDRAULIC_PUMP
CIRCUIT_FUEL_PUMP
CIRCUIT_FUEL_TRANSFER_PUMP
CIRCUIT_PROP_DEICE
CIRCUIT_STARTER
CIRCUIT_LIGHT_NAV
CIRCUIT_LIGHT_BEACON
CIRCUIT_LIGHT_LANDING
CIRCUIT_LIGHT_TAXI
CIRCUIT_LIGHT_STROBE
CIRCUIT_LIGHT_PANEL
CIRCUIT_LIGHT_RECOGNITION
CIRCUIT_LIGHT_WING
CIRCUIT_LIGHT_LOGO
CIRCUIT_LIGHT_CABIN
CIRCUIT_LIGHT_PEDESTAL
CIRCUIT_LIGHT_GLARESHIELD
CIRCUIT_DIRECTIONAL_GYRO
CIRCUIT_DIRECTIONAL_GYRO_SLAVING
CIRCUIT_NAV
CIRCUIT_COM
CIRCUIT_PFD
CIRCUIT_MFD
CIRCUIT_ADC_AHRS
CIRCUIT_FIS
CIRCUIT_ADF_DME
CIRCUIT_XPNDR
CIRCUIT_TURN_COORDINATOR
CIRCUIT_AUDIO
CIRCUIT_AVNFAN
CIRCUIT_GPS
CIRCUIT_INST
CIRCUIT_INST_LIGHTS
CIRCUIT_ALTFLD
CIRCUIT_WARN
CIRCUIT_LTS_PWR
CIRCUIT_ATTITUDE_INDICATOR
CIRCUIT_STALL_WARNING
CIRCUIT_APU_STARTER
CIRCUIT_FUEL_VALVE

INVALID_ACTION
SetCir  SetBat  SetAlt  SetExt
SetCir2Bus_Con  SetBat2Bus_Con  SetAlt2Bus_Con  SetExt2Bus_Con  SetBus2Bus_Con  SetCir2Bus_Brk  SetBat2Bus_Brk  SetAlt2Bus_Brk  SetExt2Bus_Brk  SetBus2Bus_Brk  SetCirPwr      
Autostart       Autoshutdown

Furthermore:

Code:
(A:CIRCUIT SWITCH ON:#KEY#, Bool) if{
                            #KEY# (&gt;K:ELECTRICAL_CIRCUIT_TOGGLE)

This will only call the key event if the circuit is ON. Hence it can only switch it off. I suggest to get rid of this IF condition and simply write your L-VAR into the A-VAR.
 
Thanks for the reply. Have you really seen this work: 1 (&gt;A:CIRCUIT SWITCH ON:13,bool) ? Writing to an A:Var? I tried it after reading your post and it didn't work for me.

I had the condition in my code temporarily because something unknown was setting the value to one (ON) and I wanted to be sure it wasn't me doing it. I wanted the toggle to work only in the off direction until I figured out what was going wrong.

I have discovered that I can set circuits on and off as expected, but for some reason not fuel pump circuits. If I turn one off, it immediately turns back on.
 
I can even see my N1 needle dip slightly when the circuit goes off for a split second. But then it climbs back to idle right away.

I note that the fuel pump switches don't seem to have any effect in the default 747 so maybe this a bug in the sim itself.
 
I'm simply going to move on. The irony is that I don't even intend to use the default fuel pumps as turning off boost pumps shouldn't shut down the engines on my aircraft, which is the default behaviour. I simply picked the boost pumps to get started understanding how to set up the electrical system. The other circuit types I've since tried work as expected.
 
Strange, I am using boost pumps. If they kill the engine is because you are not allowing gravity flow. I have added it all across the system. also be warned of #Volume parameter on lines. There is a default, and for me was way too large. Enough fuel in the lines to account for the entire tankage...!!
My current fuel system has tip tanks gravity feeding main tanks, that gravity feed into a single, very tiny collector tank. From there, two lines go to the engines, but first they go through a boost pump and an engine driven pump. Valves are there too, so I automatically correct the imbalance (caused by FS always preferring the left tanks) and close the feed to the collector tank if gs go negative. engine shut-off valves also work as expected.... I intend to share more about my tretcherous journey of discovery in a few when I clear my mind on a few more things!
 
While on the topic of the electrical system, does anyone know what the three numbers are following "power" in the circuit data lines? The second appears to be watts, but I don't know what the others represent.
 
While on the topic of the electrical system, does anyone know what the three numbers are following "power" in the circuit data lines? The second appears to be watts, but I don't know what the others represent.
Going to have to guess that the numbers represent cutoff power and voltage.

So the CAP10

circuit.7 = Type:CIRCUIT_PITOT_HEAT #Connections:bus.1# Power:20, 30, 10.0# Name:pitot_Heat ; pitot_heat 40W

Power:20, 30, 10.0 is 20 watts min power, 30watts nominal and 10.0 volts cutoff, so the pitot heat fails at 10 volts or 20 watts avalable.

It's just a guess. Can't be amps.
 
Back to a point that MarioPilot raised, it seems we are able to write directly to A variables, at least in some cases.

After getting somewhat frustrated in not being able to turn off bus connections in the way that Asobo apparently does it, I tried the following, which worked:

0 (>A:BUS CONNECTION ON:1, Bool)
 
Last edited:

DragonflightDesign

Resource contributor
Too much reliance on using default events. Don't do it - forget they exist until the IDGs are online and all of the generator bus ties/field trip switches are connected in the right order. The IDG voltmeter should go active when combustion is confirmed and the IDG switch is On. Write your own code to control the IDG voltmeter and ammeter needles. If you're going to model the electrical system properly, you need to do things like generator matching. If you haven't got that far, the L-1011 has no auto-matching of the generator output. The FE has to monitor them and parallel them up (and the APU if it's online) when the 380vac is within specified limits. Failure to do so will burn the systems out because you'll launch a huge back emf into the IDGs. You need to model that too. Once your electrical system variables are all lined up, then - and only then - switch on the default generators.
 
At this point I just want to understand how the default system works, find the code to manipulate it and so on. Then I can build a default system to the extent it's possible to simulate the read deal, and then integrate that into whatever custom coded additions or overlays I need to add on.
 
At this point I just want to understand how the default system works, find the code to manipulate it and so on. Then I can build a default system to the extent it's possible to simulate the read deal, and then integrate that into whatever custom coded additions or overlays I need to add on.
Do what others are doing. Select a plane that Asobo has made that has the Systems that are similar to yours, and use that as your template.

Many start out with the Cessna 150, such as Oz. Its a good go-to template system. Then modify it to suit your needs.
 
Top