|
Post by Tony on Feb 4, 2019 18:06:24 GMT -8
I'm using the Weather rack anemometer and retrieving readings using REST commands. How are wind speed and wind gust defined? Over what time interval are they measured? Thanks.
|
|
|
Post by SDL on Feb 6, 2019 17:51:44 GMT -8
|
|
|
Post by Tony on Feb 12, 2019 5:04:35 GMT -8
I'm finding it difficult to decipher your code to answer my questions. Can you please answer my questions in plain English?
Thanks.
|
|
|
Post by SDL on Feb 13, 2019 14:12:21 GMT -8
Tony,
I don't know about it plain English, but I will give it a try.
Windspeed is defined by the time between debounced "ticks" coming from the anemometer. So, it is time between the interrupts (debounced) from the Windspeed. Faster the anemometer turns, the shorter the time interval. The debouncing limits the wind speed number to somewhere around 120MPH.
Wind Gust is defined by the shortest time between anemometer "ticks" during your sampling time. Remember that both of these wind measurements are defined by the speed of the interrupts coming from the anemometer into your computer. So, the most important part of the code is that interrupt service routine, shown below:
def serviceInterruptAnem(self,channel):
#print "Anem Interrupt Service Routine"
currentTime= (micros()-SDL_Pi_WeatherRack._lastWindTime);
SDL_Pi_WeatherRack._lastWindTime=micros(); if(currentTime>4000): # debounce SDL_Pi_WeatherRack._currentWindCount = SDL_Pi_WeatherRack._currentWindCount+1
if(currentTime<SDL_Pi_WeatherRack._shortestWindTime): SDL_Pi_WeatherRack._shortestWindTime=currentTime;
else: print "currentTime=%i"%currentTime print "DEBOUNCE-count=%i" % SDL_Pi_WeatherRack._currentWindCount
|
|