October 6, 200421 yr 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
October 6, 200421 yr 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" Jan "Beatus ille qui procul negotiis..."
October 6, 200421 yr 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
October 7, 200421 yr Commercial Member >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 AviationMy Playland - I69
October 7, 200421 yr 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
October 8, 200421 yr >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
October 8, 200421 yr 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
October 8, 200421 yr 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
Create an account or sign in to comment