1
0
Fork 0

A320 Electrical system: push an entirely new battery logic and connections

This commit is contained in:
legoboyvdlp R 2021-03-19 16:46:37 +00:00
parent 3f9852d0f0
commit 75b874d2a9
5 changed files with 1031 additions and 865 deletions

View file

@ -113,8 +113,8 @@ var relayExt = func {
settimer(func {setprop("/sim/sounde/relay-ext",0);},0.35);
}
setlistener("/systems/electrical/sources/bat-1/contact", relayBatt1, nil, 0);
setlistener("/systems/electrical/sources/bat-2/contact", relayBatt2, nil, 0);
setlistener("/systems/electrical/sources/bat-1/bcl-supply", relayBatt1, nil, 0);
setlistener("/systems/electrical/sources/bat-2/bcl-supply", relayBatt2, nil, 0);
setlistener("/systems/electrical/relay/apu-glc/contact-pos", relayApu, nil, 0);
setlistener("/systems/electrical/relay/ext-epc/contact-pos", relayExt, nil, 0);

View file

@ -29,6 +29,7 @@ var APU = {
bleedTime: 0,
cooldownEndTime: 0,
fastStart: 0,
inhibitEMERELEC: 0,
_count: 0,
warnings: {
lowOilLevel: 0,
@ -62,6 +63,7 @@ var APU = {
me.signals.fault.setValue(0);
me.signals.autoshutdown = 0;
me.signals.emer = 0;
me.inhibitEMERELEC = 0;
checkApuStartTimer.stop();
apuStartTimer.stop();
apuStartTimer2.stop();
@ -119,7 +121,7 @@ var APU = {
if (me.fastStart) {
me.inletFlap.setpos(1);
}
if (pts.APU.rpm.getValue() < 7 and me.fuelValvePos.getValue() and me.inletFlapPos.getValue() == 1 and me.signals.oilTestComplete and !me.warnings.lowOilLevel) {
if (pts.APU.rpm.getValue() < 7 and me.fuelValvePos.getValue() and me.inletFlapPos.getValue() == 1 and me.signals.oilTestComplete and !me.warnings.lowOilLevel and !me.inhibitEMERELEC) {
me.setState(4);
me.listenStopSignal = 1;
checkApuStartTimer.stop();
@ -270,6 +272,7 @@ var APU = {
if (me.state == 5 and APUNodes.Oil.pressure.getValue() < 35 or APUNodes.Oil.temperature.getValue() > 135) {
me.autoStop();
}
if (systems.ELEC.Bus.dcBat.getValue() < 25) {
if (!me._powerLost) {
me._powerLost = 1;
@ -287,6 +290,12 @@ var APU = {
} else {
me._powerLost = 0;
}
if (systems.ELEC.EmerElec.getValue() == 1 and (systems.ELEC.EmerElec45.getValue() != 1 and systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110)) {
me.inhibitEMERELEC = 1;
} else {
me.inhibitEMERELEC = 0;
}
}
},
};

View file

@ -14,6 +14,7 @@ var dc2 = 0;
# Main class
var ELEC = {
EmerElec: props.globals.getNode("/systems/electrical/some-electric-thingie/emer-elec-config"),
EmerElec45: props.globals.getNode("/systems/electrical/some-electric-thingie/emer-elec-config-45"),
Bus: {
acEss: props.globals.getNode("/systems/electrical/bus/ac-ess"),
acEssShed: props.globals.getNode("/systems/electrical/bus/ac-ess-shed"),
@ -79,11 +80,11 @@ var ELEC = {
acTie1: props.globals.getNode("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos"),
acTie2: props.globals.getNode("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos"),
apuGlc: props.globals.getNode("/systems/electrical/relay/apu-glc/contact-pos"),
dcEssFeedBat: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-bat/contact-pos"),
essTrContactor: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/contact-pos"),
dcEssFeedBat: props.globals.getNode("/systems/electrical/relay/dc-bat-tie-dc-ess/contact-pos"),
essTrContactor: props.globals.getNode("/systems/electrical/relay/ess-tr-contactor/contact-pos"),
extEpc: props.globals.getNode("/systems/electrical/relay/ext-epc/contact-pos"),
dcTie1: props.globals.getNode("/systems/electrical/relay/dc-bus-tie-dc-1/contact-pos"),
dcTie2: props.globals.getNode("/systems/electrical/relay/dc-bus-tie-dc-2/contact-pos"),
dcTie1: props.globals.getNode("/systems/electrical/relay/dc-bat-tie-dc-1/contact-pos"),
dcTie2: props.globals.getNode("/systems/electrical/relay/dc-bat-tie-dc-2/contact-pos"),
glc1: props.globals.getNode("/systems/electrical/relay/gen-1-glc/contact-pos"),
glc2: props.globals.getNode("/systems/electrical/relay/gen-2-glc/contact-pos"),
tr1Contactor: props.globals.getNode("/systems/electrical/relay/tr-contactor-1/contact-pos"),
@ -103,7 +104,7 @@ var ELEC = {
Bat1: {
volt: props.globals.getNode("/systems/electrical/sources/bat-1/volt"),
amps: props.globals.getNode("/systems/electrical/sources/bat-1/amps"),
contact: props.globals.getNode("/systems/electrical/sources/bat-1/contact"),
contact: props.globals.getNode("/systems/electrical/sources/bat-1/bcl-supply"),
percent: props.globals.getNode("/systems/electrical/sources/bat-1/percent"),
direction: props.globals.getNode("/systems/electrical/sources/bat-1/direction"),
time: props.globals.getNode("/systems/electrical/sources/bat-1/time"),
@ -111,7 +112,7 @@ var ELEC = {
Bat2: {
volt: props.globals.getNode("/systems/electrical/sources/bat-2/volt"),
amps: props.globals.getNode("/systems/electrical/sources/bat-2/amps"),
contact: props.globals.getNode("/systems/electrical/sources/bat-2/contact"),
contact: props.globals.getNode("/systems/electrical/sources/bat-2/bcl-supply"),
percent: props.globals.getNode("/systems/electrical/sources/bat-2/percent"),
direction: props.globals.getNode("/systems/electrical/sources/bat-2/direction"),
time: props.globals.getNode("/systems/electrical/sources/bat-2/time"),
@ -135,10 +136,10 @@ var ELEC = {
outputAmp: props.globals.getNode("/systems/electrical/relay/tr-contactor-2/output-amp"),
},
trEss: {
outputVolt: props.globals.getNode("/systems/electrical/sources/tr-ess/output-volt"),
outputAmp: props.globals.getNode("/systems/electrical/sources/tr-ess/output-amp"),
outputVoltRelay: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/output"),
outputAmpRelay: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/output-amp"),
outputVolt: props.globals.getNode("/systems/electrical/sources/ess-tr/output-volt"),
outputAmp: props.globals.getNode("/systems/electrical/sources/ess-tr/output-amp"),
outputVoltRelay: props.globals.getNode("/systems/electrical/relay/ess-tr-contactor/output"),
outputAmpRelay: props.globals.getNode("/systems/electrical/relay/ess-tr-contactor/output-amp"),
},
IDG1: {
gcrRelay: props.globals.getNode("/systems/electrical/sources/idg-1/gcr-relay"),

File diff suppressed because it is too large Load diff

View file

@ -363,7 +363,7 @@
<test logic="AND" value="1">
<test logic="OR">
/systems/electrical/bus/dc-2 ge 25
/systems/electrical/relay/dc-ess-feed-bat/contact-pos eq 1
/systems/electrical/relay/dc-bat-tie-dc-ess/contact-pos eq 1
</test>
<test logic="OR">
<test logic="AND">