October 19, 200421 yr I would like to detect the rate at which a variable is changing and react to the rate, as opposed to the number in the variable.For instance, if I adjust the throttle too quickly, I would like to make another user defined variable dependant upon the rate it is increased, but if the throttle is adjusted slowly, there would be no impact on the second variable.Any thoughts?Steve
October 19, 200421 yr Author Hi Steve,That's not very complicated.- Read the throttle, and save it's value in a temp variable.- In the next schedule, read the throttle again and compare with the previously saved value. Since the interval time betwen two samples is known (and fixed in in FS) you have a measure for the speed of change.(IN XML: the UPDATE FREQUENCY determines the schedue rate).If you want to make it more accurate:use either a fixed average (calculate the average over a fixed time (eg. 10 or 20 samples), or use a moving average (the average over the last x samples at any point in time).Disadvantage of using an average, is of course a "lag" in response time.Or even more complex (which eliminates this "lag"): make a predictive algoritm (so assume future values based on history); and constantly verify/adapt that.Cheers, Rob Barendregt.
October 20, 200421 yr Author Steve, (A:GENERAL ENG1 THROTTLE LEVER POSITION,percent) (G:Var1) - (>G:Var2) (* Var2 contains the difference between current read throttle position and previous one *) .... .... (A:GENERAL ENG1 THROTTLE LEVER POSITION,percent) (>G:Var1) Example:if the value of G:Var2 is 2, it means that in this interval the throttle is changing at a rate of 6*2= 12 % per sec.If this doesn't make it clear, I suggest you better describe exactly what you want to accomplish.. That will make it easier to give a good example ..Cheers, Rob
Create an account or sign in to comment