[Flightgear-devel] Re: (electrical) Flightgear-devel Digest, Vol 30, Issue 19

2005-10-08 Thread Steve Knoblock

I noticed recently that electrical outputs still show a voltage (frozen) 
when a switch is shut off.Is there a reason for this ... or is it a work 
in progress?
The reason I ask is that I want to animate lights by the voltage rather 
than switch position ... (dimming lights as the battery voltage drops , 
etc...).I just want to know if  this is the way it is going to operate , 
and I can change my animations (I'm currently working on the 
overhead light switch panel in the B1900D).Thanks in advance, I know how 
busy everyone is .Cheers

I am still learning the electrical system model. I like to see all the
electrical devices and switches work as in real life. If the master
avionics switch is off or the battery is dead, the autopilot should
not be displaying anything or operating.

For the autopilot, I set a power-good property (like mainboards have)
and use NASAL to check for sufficient output on the autopilot bus. For
example:

ap_pwr = getprop(/systems/electrical/outputs/autopilot[0]);
  if( ap_pwr = 0.3) {
print(Digitrak: Power Good);
setprop(Internal, power-good, on);
  } else {
print(Digitrak (Warning): Insufficient power.);
setprop(Internal, power-good, off);
  }

This seems to work well. The Digitrak requires 0.3 amp.

On the other hand, I am still confused about some aspects of the
electrical system.

/systems/electrical/volts
/systems/electrical/amps

both seem to be read only properties. I suppose this makes sense, if
these are just monitoring the flow (but at what point?) and the system
is modeled as suppliers and outputs of electricity. Any adjustments
would be made at the supply side.

I can change

/systems/electrical/serviceable

but it appears to do nothing.

However,

/systems/electrical/suppliers/alternator
/systems/electrical/suppliers/battery
/systems/electrical/suppliers/external

are also read only. It appears all the outputs are ready only

/systems/electrical/outputs/*

I am left looking for where the actual source of electrical power is
specified. Looking at the electrical.xml the properties are defined
here.

I can change the initial value of the battery in amps from here (shows
up /systems/electrical/suppliers/battery), but lowering it to 5 amps
did not seem to affect the a/c.

Okay, if I set both battery and alternator to 0.1 amps in the config,
my autopilot fails power good. It appears the turn coordinator also
fails. Flaps still work (this is the Cessna). Radios work. ADF works.
Clock works. Fuel, Temp, Flow gauges all work, the AMPs show zero.
This suggests many instruments do not check the electrical properties.
The a/c engine turns over and works fine without a battery or
alternator (magneto?).

I am unsure how the output properties are affected by switches or if
they can be.

Steve



___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: (electrical) Flightgear-devel Digest, Vol 30, Issue 19

2005-10-08 Thread Curtis L. Olson

Syd and Steve,

Check out the newer nasal based electrical system for the C172.  I just 
had too much trouble getting the old xml based system to really work the 
way I was hoping it might.  The nasal based approach seemed to work out 
so much better for me.  The logic ends up being pretty much the same, 
but I found it to be a lot easier to model some of the more subtle 
electrical system behavior with nasal ... probably because it's easier 
to cheat and fudge things when needed. :-)


But there's no reason you can't make every switch and circuit breaker 
and light work just like the real aircraft ...


Curt.


Steve Knoblock wrote:

I noticed recently that electrical outputs still show a voltage (frozen) 
when a switch is shut off.Is there a reason for this ... or is it a work 
in progress?
The reason I ask is that I want to animate lights by the voltage rather 
than switch position ... (dimming lights as the battery voltage drops , 
etc...).I just want to know if  this is the way it is going to operate , 
and I can change my animations (I'm currently working on the 
overhead light switch panel in the B1900D).Thanks in advance, I know how 
busy everyone is .Cheers
   



I am still learning the electrical system model. I like to see all the
electrical devices and switches work as in real life. If the master
avionics switch is off or the battery is dead, the autopilot should
not be displaying anything or operating.

For the autopilot, I set a power-good property (like mainboards have)
and use NASAL to check for sufficient output on the autopilot bus. For
example:

ap_pwr = getprop(/systems/electrical/outputs/autopilot[0]);
 if( ap_pwr = 0.3) {
   print(Digitrak: Power Good);
   setprop(Internal, power-good, on);
 } else {
   print(Digitrak (Warning): Insufficient power.);
   setprop(Internal, power-good, off);
 }

This seems to work well. The Digitrak requires 0.3 amp.

On the other hand, I am still confused about some aspects of the
electrical system.

/systems/electrical/volts
/systems/electrical/amps

both seem to be read only properties. I suppose this makes sense, if
these are just monitoring the flow (but at what point?) and the system
is modeled as suppliers and outputs of electricity. Any adjustments
would be made at the supply side.

I can change

/systems/electrical/serviceable

but it appears to do nothing.

However,

/systems/electrical/suppliers/alternator
/systems/electrical/suppliers/battery
/systems/electrical/suppliers/external

are also read only. It appears all the outputs are ready only

/systems/electrical/outputs/*

I am left looking for where the actual source of electrical power is
specified. Looking at the electrical.xml the properties are defined
here.

I can change the initial value of the battery in amps from here (shows
up /systems/electrical/suppliers/battery), but lowering it to 5 amps
did not seem to affect the a/c.

Okay, if I set both battery and alternator to 0.1 amps in the config,
my autopilot fails power good. It appears the turn coordinator also
fails. Flaps still work (this is the Cessna). Radios work. ADF works.
Clock works. Fuel, Temp, Flow gauges all work, the AMPs show zero.
This suggests many instruments do not check the electrical properties.
The a/c engine turns over and works fine without a battery or
alternator (magneto?).

I am unsure how the output properties are affected by switches or if
they can be.

Steve



___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d
 




--
Curtis Olsonhttp://www.flightgear.org/~curt
HumanFIRST Program  http://www.humanfirst.umn.edu/
FlightGear Project  http://www.flightgear.org
Unique text:2f585eeea02e2c79d7b1d8c4963bae2d


___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d