Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Detecting a trend

Featured Replies

Hi,I want to build a gauge that can detect a speed trend - i.e. be able to detect when the speed is increasing/decreasing.Any ideas? How can i take two measurements of speed at different times and then compare?Many thanks,Paul ScarrattPS Panelshttp://www.pspanels.co.uk

You store the speed in a variable at one time and compare it later with the new speed, take difference, store back in the variable. In C or XML? In both cases you should avoid calculating in each frame, that makes a speed trend too jerky. Try to use time steps up to a second or so. You could wait until the current time is bigger then a certain reference time plus a step, make differences in time and speed, display it and reset the stored time to the current value, so the waiting process can be restarted. Arne Bartels

Hi,This may help.. this was from a 737-400 project that never came to be.(P:Local Time, seconds) 0.2 % 10 * int 0 == if{ (A:Airspeed indicated, knot) (>G:Var1) }(P:Local Time, seconds) 0.2 % 10 * int 1 == if{ (A:Airspeed indicated, knot) s1 (G:Var1) - 0.1 / 10 * l1 + (>G:Var3) }(G:Var3) (A:Airspeed indicated, knot) >(A:Airspeed indicated, knot) 45 < if{ 0 } els{ (G:Var3) (A:Airspeed indicated, knot) - }(G:Var3) (A:Airspeed indicated, knot) <(A:Airspeed indicated, knot) 45 < if{ 0 } els{ (G:Var3) (A:Airspeed indicated, knot) - }Regards,Roman(KGRB)

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Thanks all,Much appreciated!PaulPS Panelshttp://www.pspanels.co.uk

>You store the speed in a variable at one time and compare it>later with the new speed, take difference, store back in the>variable. In C or XML? In both cases you should avoid>calculating in each frame, that makes a speed trend too jerky.....>Arne Bartels I think the trick is to put the speed, etc. in another variable. Then, use the stored variable in furture calculations. Rather reading speed, etc. again and assuming it is still the same. In XML, I copy A: variables to local L: variables on one 'tick' or strobe, then use the L: variables. One the next tick the L:variables are refreshed again. All in sequence. No display and calculations between the parameter copies. I display V_dot, dTAS/dt to 0.01 ft/sec resolution, and it's stable. Similar for attitude rates, I can see 0.001 deg/sec. I also filter the results, but that won't help much if one is reading a variable for the same calculation when it changes part way through. Here is a screen shot. Lots of rates calculated and displayed. p, q, and r are roll, pitch, and sideslip rates in deg/sec.http://forums.avsim.net/user_files/83489.gifRAF

Is XML offering a PixelPerSec displacement lag feature? I would tend to think it is then wrong to use it in the trend vector, because the same gauge, displayed at different sizes, won't move the trend at the same speed?

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.