Jump to content

Gina

Beyond the Event Horizon
  • Posts

    45,326
  • Joined

  • Last visited

  • Days Won

    120

Everything posted by Gina

  1. Update... Gust gauges now show zero so it seems the 73mph was an instantaneous value which propagated through the gust ringArray until it was replaced by the correct zero value. I'll do some more testing... Fan on low and anemometer rotating at about 1 rev per second. Gust showing 3mph.
  2. Mean speed have now decreased to zero which is right but the gust continues to show 73mph!! Back to the drawing board then and no deployment!!
  3. It was going well with reducing the fan speed until I turned the fan off and the anemometer stopped then I got this!
  4. Mean speed has now increased to 10mph. Got one more test before deploying the wind sensors - reduced the fan speed. Now watching for the speed readings to decrease over the next 10m or so. I don't expect the gust speed to change until more than 10m have elapsed but the mean speed should gradually decrease over the 10m period.
  5. Since the Mean Speed is summed over a long period I could read it to greater precision than integer but I guess wind speed in whole miles per hour is quite sufficient and "if it ain't broke, don't fix it". The gust speed is only accurate to units of 1.5mph as the calibration factor is mph in 4.5s and I'm reading in 3s periods and correcting afterwards. The test rig has been running correctly for a while now so I guess I can put everything back together and put the rig back on the observatory. Having found a definite cause of problems and fixed it I feel reasonably confident that it should be ready for deployment - again. The anemometer rotation rate has just increased a bit - guess the mains voltage has increased and with it the fan speed. I'll just watch it a bit longer and see if the mean speed increases too as it should (slowly).
  6. Running test rig on the table with desk fan. Seems reasonable. Mean speed slightly below the Gust speed but speeds are just to the nearest mph, so Gust of 10mph and Mean of 9mph is reasonable.
  7. Tried a different ESP32 and it's alright.
  8. Back to the wind client... Have a problem.
  9. I've been using the UL method of making unsigned long constants in all my clients so these will all need correcting, though they seem to be working fine.
  10. Working fine I think, though won't know for sure until I get the wind sensors connected and the wind blowing on it. Looks like the UL constant(s) has been causing the problems all along and that the Arduino Reference is wrong!
  11. I thought adding U or L or UL allocated the extra space but to avoid any possible trouble I've declared as follows // periods or intervals in milliseconds const int P3s = 3000; // integer unsigned long P3m = 180000; // variable used as constant unsigned long last3s = 0; unsigned long last3m = 0;
  12. The hardware timer works. I don't quite understand "While the Arduino manual is right you cannot declare an int and stuff it with an unsigned long." I've thought about this, it seems to work fine but I guess I could assign an unsigned long variable and preset it with the value I want and use it as a constant. After all, a non-varying variable is a constant in effect. Would that be better? Yes, the compiler should have picked up that error. Guess nothing is perfect and the error checking is pretty good. Though sometimes the error message can be rather vague or unhelpful.
  13. I'm not. I'm only running one hardware timer - the ESP32 has 4. All other timings are by counting or using millis and now.
  14. OK took that from elsewhere - changed it to void loop() { // if (!client.connected()) {reconnect();} client.loop(); if (interrupts == 0 ){ // ISR has triggered - proceed and perform the jobs if (timerCount >= 21) {speed21sum(); timerCount=0;}; // time the various periods long now = millis(); if(now - last3s > P3s) {getDirection(); last3s = now;} if(now - last3m > P3m) {ConsensusAveraging(); last3m = now;} interrupts = 0; // Reset the flag } }
  15. Got that from the Arduino Reference for Constants.
  16. The problem was trying to increment a float. Now fixed.
  17. Next will be to remove Serial Monitor debugging and upload the sketch to the wind sensors ESP32 and try the table based test rig. That will be tomorrow.
  18. Fixed. 1m3s interval as it should be - 21 intervals of 3s.
  19. Found that error easily - forgot to reset the timerCount. New code. if (timerCount >= 21) {speed21sum(); timerCount=0;};
  20. Changed windSpeed to unsigned long int and it's working. Except that the process that should occur every minute is running at 3s! The speeds are zero because the sensors arn't connected.
  21. All lines back except windSpeed += PulseCount; // Accumulate mean speed Not sure why but windSpeed is a float whilst PulseCount is an integer. I'll try changing that.
  22. I'll uncomment each line in turn until the problem comes back.
  23. Put the timerCount++ line back and now it runs the speed21sum routine.
  24. Hmmm... Decided to try commenting out all my code from the timer ISR. Now it connects and just sits there doing nothing more.
  25. Something is causing it to reboot!!!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.