Sign in to follow this  
Guest

XML Ammeter

Recommended Posts

I am trying to model an ammeter that shows charge and discharge like the one in the Cessna using XML. This is the type with zero in the center of the gauge. The need moves left on discharge and right on charge. BTW FS apparently models a voltage regulator because when I turn the nav lights on the ammeter flicks to discharge briefly then returns to zero.I am unsure given the parameters we have, how to achieve this. Most report load in amps, which is when the system is discharging or zero. The quetion is how to move the needle when the system is charging.The Baron ammeter does not measure charge. It only measure load on the generator or alternator and epresses it as a percentage. The needle only has to move in one direction. This is the only example I have to go on.Is this possible or is the C-programmed Cessna gauge doing something XML cannot do?Steve

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Sadly some C variables aren't available in XML and vice versa. I haven't checked the electrical variables yet. In C gauges I use BATTERY_LOAD for amperemeters that show charge and discharge, possibly there is an equivalent in XML, I haven't checked.Arne Bartels

Share this post


Link to post
Share on other sites

In my Cessna 421B xml voltammeter, I use these:(A:ELECTRICAL BATTERY BUS VOLTAGE,volts) 4.166667 * for battery voltage, multitplied to use the other visual scale correctly.(A:ELECTRICAL BATTERY LOAD,amps) for the load on the battery, i.e. when alternarots are offline, and(A:Electrical genalt1 bus amps,amps) to show the load on alternator1.Additionally, you can hook up RPM effects to get a shaky needle, or even add your own parts of the electrical system (special equipment etc) that isn't by default supported.

Share this post


Link to post
Share on other sites

Here is the code I am using.

<Value Minimum="0" Maximum="28">(A:GENERAL ENG1 MASTER ALTERNATOR,bool) if{ (A:Electrical genalt1 bus amps,amps) } els{ (A:Electrical genalt1 bus amps,amps) }(A:Electrical genalt1 bus amps,amps)</Value>... and non-linearity looks like this with zero center.<Nonlinearity>			<Item Value="-30" X="38" Y="47"/>			<Item Value="0" X="75" Y="41"/>		<Item Value="30" X="111" Y="47"/></Nonlinearity>

Usual disclaimers apply to the XML entities (man that sounds like some kind of alien race!).It seems to work.Steve

Share this post


Link to post
Share on other sites

>In my Cessna 421B xml voltammeter, I use these:>(A:ELECTRICAL BATTERY BUS VOLTAGE,volts) 4.166667 * for>battery voltage, multitplied to use the other visual scale>correctly.>>(A:ELECTRICAL BATTERY LOAD,amps) for the load on the battery,>i.e. when alternarots are offline, and>>(A:Electrical genalt1 bus amps,amps) to show the load on>alternator1.>>Additionally, you can hook up RPM effects to get a shaky>needle, or even add your own parts of the electrical system>(special equipment etc) that isn't by default supported.Hi Karl,I have read most of the topics related to the MSFS Electrical system, which seemingly is rather buggy :-(. I have really worked hard to solve the ATR42 DC Ampere gauge, which is integrated in the Overhead panel. So far no luck whatsoever. Here's a screenshot of the DCAmp gauge with the stuck needle:http://www.jspanels.com/images/atr423_dcamp.jpgThe XML code for this element (the comments are values stated in the Aircraft.cfg file): (A:GENERAL ENG1 MASTER ALTERNATOR,bool) if{ (A:Electrical genalt1 bus amps,amps) } els{ (A:Electrical genalt1 bus amps,amps) (A:Electrical genalt1 bus amps,amps) } 4*The statement is copied from another post on this tread. Does anyone have a solution to this issue?Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com

Share this post


Link to post
Share on other sites

Jan,May be some help, this is what i use:It shows discharging and charging of the battery: (A:Electrical Battery Load,amps)Jan

Share this post


Link to post
Share on other sites

Jan :-)Thanks again for your help! Unfortunately the variable "(A:Electrical Battery Load,amps)" did not show any noticeable needle movement when testing miscellaneous switches.Howevever, when testing this code with the "(A:ELECTRICAL BATTERY BUS VOLTAGE,volts)" variable, the needle came on the move :-). I guess I just might use this variable as a "fake" solution and adjust the scale as appropriate for the correct deflection (aprx. 40 amps) when switching on the battery.Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com

Share this post


Link to post
Share on other sites

The discharge, when power is used while the alternator is off, can be quite big. The charge however tend to be small, especially if the battery isn't all that drained. so expect to see smaller movement to the right than to the left.To get a better overview, and also nail some of the many bugs in the electrical system, make a textgauge where you display the various parameters. Certain things might become more obvious then.

Share this post


Link to post
Share on other sites

Jan,The gauge only moves after shutting off the alternators (failure)!It shows a power drain, negative value, from the battery equal to the load: lights etc. (A:Electrical Main bus amps,amps), so start to shutoff nonessential electrical equipment!The Voltage, (A:ELECTRICAL BATTERY VOLTAGE,volts), another gauge, drops slowly then; in my case i can operate electrical another 10 minutes before voltage dropping below 17V (starters!).After reconnecting the alternators Voltage returns to normal in a while and the Ammeter is also showing a positive value of a few Amps (3-5A) during a short period, a few minutes.So there is a gauge showing - and + values. Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this