Jump to content
Sign in to follow this  
Guest Skymed

Triggering an event via Gauge needle position

Recommended Posts

Guest Skymed

Instead of using predetermined variables to trigger an event, I need to use the actual postion of a gauge needle to trigger a warning light.Problem Im having is that I need a warning light to come on when a gauge variable reaches a specific setting ie.TOT of >950. Easy to do, except that, due to the that the needle uses, the warning light appears a second or two before the needle gets to the point where the warning should be on.So, can I use the actual position of the needle to trigger the warning light, or is there a better way of doing this that anyone can think of?Steve

Share this post


Link to post
Share on other sites

Steve,Just an idea:If you need the "delayetc", you can build a timer in the warninglight and experiment with the amount of seconds.Otherwise scrap the delay?Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest bartels

Is the light really triggered by the needle? I ask since a certain delay in needle movement is natural, and the light might be triggered immediately. One way around is introducing the damping of the needle by yourself, and not by "DegreesPerSecond". A sort of damping is the "exponential averaging". yn1=yn*D+(1.0-D)xn1 yn is the displayed value of the previous frame, yn1 is the displayed value now, xn1 is the value from FS now, D is a "damping constant" (0

Share this post


Link to post
Share on other sites

>Is the light really triggered by the needle? I ask since a>certain delay in needle movement is natural, and the light>might be triggered immediately. >One way around is introducing the damping of the needle by>yourself, and not by "DegreesPerSecond". A sort of damping is>the "exponential averaging". >yn1=yn*D+(1.0-D)xn1 >yn is the displayed value of the previous frame, yn1 is the>displayed value now, xn1 is the value from FS now, D is a>"damping constant" (0higher the damping (Never wrote that in XML though). You only>need one constant and the value from the previous frame, so to>L: or G:vars for the y.. parts (one for remebering yn, one for>driving the light on/off decision [yn1]).>Arne BartelsGeez Arne... trying to fry our feeble brain cells? ;)


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites
Guest bartels

Na..Na.. not frying. Maybe a bit of encouraging warmth...Here an example, trying out is simpler then explaining:D is declared as macro, I want to type it just once not twice.It is the Baron airspeed indicator, slightly modified 0.9125...(Needle:)(G:Var1) @D * (A:Airspeed select indicated or true,knots) 1.0 @D - * + d (>G:Var1)....(Lamp: or with , choose to taste)(G:Var1) 200 > ....Arne Bartels

Share this post


Link to post
Share on other sites
Guest Skymed

>Na..Na.. not frying. Maybe a bit of encouraging warmth...>>Here an example, trying out is simpler then explaining:>>D is declared as macro, I want to type it just once not>twice.>It is the Baron airspeed indicator, slightly modified>> 0.9125>...(Needle:)>(G:Var1) @D * (A:Airspeed>select indicated or true,knots) 1.0 @D - * + d>(>G:Var1)>....(Lamp: or with , choose to taste)>(G:Var1) 200 > >....>>Arne BartelsOk I am trying to get my head around this one.What is the 0.9125 in the Macro definition? 0.9125Steve

Share this post


Link to post
Share on other sites
Guest bartels

The factor D of my first equation (yn1=D*yn+(1-D)*xn1). It is a constant to describe the strength of damping, it as to be between 0 and 1, more to 1. I could give you the mathematical definition if you insist (some logarithmic stuff). The highr D the higher the damping and vice versa, you'll soon reach a value typically between 0.85 and 0.95, depending on how long the old values should be "remembered".Arne Bartels

Share this post


Link to post
Share on other sites
Guest Skymed

COOL!!Works like a charm.0.9125(G:Var1) @D * (L:CorrectedTOT1,enum) 1.0 @D - * + d (>G:Var1) (G:Var1) 927 >= (L:annwarn,bool) || (A:Electrical master battery,bool) && Thanks ArneSteve

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...