Appendix B. Sample Algorithm.
_____________________________Algorithm A1______________________________
1 void loop()
2 {
3 time_now = millis();
4 newEncPos = encPos;
5 newtym = millis();
6 rpm = (newEncPos-oldEncPos) * 1000 /(newtym-oldtym);
7 if(rpm >= 0 || rpm <= 0)
8 {
9 Serial.print (rpm);
10 Serial.print(",");
11 }
12 oldEncPos = newEncPos;
13 oldtym = newtym;
_________________________________________________________________________
_____________________________Algorithm A2______________________________
1 Wire.beginTransmission(hmcAddr);
2 sensors_event_t event;
3 mag.getEvent(&event);
4 event.magnetic.x;
5 event.magnetic.y;
6 event.magnetic.z;
7 Wire.endTransmission();
8 float heading = atan2(event.magnetic.y, event.magnetic.x);
9 float declinationAngle = 0.22;
10 heading += declinationAngle;
11 if(heading < 0)
12 heading += 2*PI;
13 if(heading > 2*PI)
14 heading -= 2*PI;
15 float headingDegrees = heading * 180/M_PI;
16 Serial.print(headingDegrees);
17 Serial.print(",");
_________________________________________________________________________
_____________________________Algorithm A3______________________________
1 Wire.beginTransmission(bmpAddr);
2 Serial.print(bmp.readTemperature());
3 Serial.print(",");
4 Serial.print(bmp.readPressure());
5 Serial.print(",");
6 Serial.print(bmp.readAltitude());
7 Serial.println(",");
8 Wire.endTransmission();
9 while(millis() < time_now + period){}
10 }
_________________________________________________________________________
Table A1.
Designed Cup-Vane Wireless Sensor Node vs. Reference Anemometer Wind Speed Data.
Table A1.
Designed Cup-Vane Wireless Sensor Node vs. Reference Anemometer Wind Speed Data.
Wind Source (%) | Designed Cup-Vane | Reference Anemometer |
---|
Run Round 1 | Run Round 2 | Run Round 1 | Run Round 2 |
---|
13 | 1.2614 | 1.2214 | 1.8286 | 1.7714 |
16 | 1.9586 | 1.8571 | 2.2286 | 2.1857 |
19 | 2.6286 | 2.5043 | 2.6286 | 2.5857 |
22 | 3.3043 | 3.1857 | 3.0429 | 3.0571 |
25 | 3.7471 | 3.7100 | 3.5000 | 3.5429 |
28 | 4.3657 | 4.3543 | 3.8143 | 3.8286 |
31 | 4.9400 | 4.9700 | 4.1429 | 4.2286 |
34 | 5.3629 | 5.3471 | 4.5000 | 4.5429 |
37 | 5.8343 | 5.9900 | 4.8286 | 4.9143 |
40 | 6.4414 | 6.4500 | 5.1857 | 5.1714 |
43 | 6.9343 | 6.9729 | 5.5286 | 5.4857 |
46 | 7.2943 | 7.3857 | 5.8000 | 5.7571 |
49 | 7.8414 | 7.8100 | 6.1143 | 6.1286 |
52 | 8.2843 | 8.2457 | 6.3000 | 6.4143 |
55 | 8.7071 | 8.8086 | 6.7429 | 6.6714 |
58 | 9.2671 | 9.0943 | 7.0429 | 7.1000 |
61 | 9.6529 | 9.5757 | 7.3857 | 7.2857 |
64 | 9.9800 | 10.0557 | 7.5571 | 7.6429 |
67 | 10.4729 | 10.3414 | 7.7714 | 8.0714 |
70 | 10.8286 | 10.8000 | 8.1000 | 8.2571 |
73 | 11.2814 | 11.2186 | 8.2571 | 8.4429 |
76 | 11.8257 | 11.9000 | 8.5286 | 8.4857 |
79 | 12.2671 | 12.3114 | 8.9571 | 9.0000 |
82 | 12.9614 | 12.9757 | 9.3429 | 9.3571 |
85 | 13.5271 | 13.3443 | 9.4571 | 9.7429 |
88 | 14.0671 | 14.0086 | 10.1143 | 10.1000 |
91 | 14.7386 | 14.6000 | 10.3714 | 10.4429 |
94 | 15.2914 | 14.8943 | 10.7143 | 10.9000 |
97 | 15.6171 | 15.6043 | 11.3000 | 11.1143 |
100 | 16.2471 | 16.0671 | 11.4714 | 11.5714 |
Table A2.
Cup-Vane Wireless Sensor Node Wind Speed Uncertainty Data.
Table A2.
Cup-Vane Wireless Sensor Node Wind Speed Uncertainty Data.
Reference Anemometer (m/s) | Designed Cup-Vane (m/s) | Residual (m/s) |
---|
1.8286 | 1.807656 | −0.020944 |
2.2286 | 2.219478 | −0.009122 |
2.6286 | 2.638751 | 0.010151 |
3.0429 | 3.080180 | 0.037280 |
3.5000 | 3.419835 | −0.080165 |
3.8143 | 3.837229 | 0.022929 |
4.1429 | 4.236096 | 0.093196 |
4.5000 | 4.480391 | −0.019609 |
4.8286 | 4.896878 | 0.068278 |
5.1857 | 5.194878 | 0.009178 |
5.5286 | 5.533626 | 0.005026 |
5.8000 | 5.801048 | 0.001048 |
6.1143 | 6.075921 | −0.038379 |
6.3000 | 6.358179 | 0.058179 |
6.7429 | 6.722840 | −0.020060 |
7.0429 | 6.907924 | −0.134976 |
7.3857 | 7.219787 | −0.165913 |
7.5571 | 7.530744 | −0.026356 |
7.7714 | 7.715827 | −0.055573 |
8.1000 | 8.012920 | −0.087080 |
8.2571 | 8.284100 | 0.027000 |
8.5286 | 8.725529 | 0.196929 |
8.9571 | 8.992044 | 0.034944 |
9.3429 | 9.422395 | 0.079495 |
9.4571 | 9.661184 | 0.204084 |
10.1143 | 10.091534 | −0.022766 |
10.3714 | 10.474659 | 0.103259 |
10.7143 | 10.665314 | −0.048986 |
11.3000 | 11.125270 | −0.174730 |
11.4714 | 11.425084 | −0.046316 |
Table A3.
Cup-Vane Wireless Sensor Node Hysteresis Data.
Table A3.
Cup-Vane Wireless Sensor Node Hysteresis Data.
Rising Wind Speed (m/s) | Falling Wind Speed (m/s) |
---|
0.000000 | 12.394286 |
0.285000 | 11.130000 |
1.406667 | 9.571250 |
2.500000 | 8.598571 |
3.640000 | 7.458333 |
4.420000 | 6.360000 |
5.262500 | 5.300000 |
6.430000 | 4.570000 |
7.601667 | 3.640000 |
8.654286 | 2.523333 |
9.705000 | 1.386667 |
11.277143 | 0.185000 |
12.394286 | 0.000000 |
Table A4.
Cup-Vane Wireless Sensor Node Direction Data (HMC5883L) before Calibration.
Table A4.
Cup-Vane Wireless Sensor Node Direction Data (HMC5883L) before Calibration.
X | Y | X Scaled | Y Scaled | Bearing |
---|
673 | −457 | 619.16 | −420.44 | 325.821573 |
778 | −28 | 715.76 | −25.76 | 357.938831 |
642 | 364 | 590.64 | 334.88 | 29.552291 |
342 | 598 | 314.64 | 550.16 | 60.234486 |
342 | 598 | 314.64 | 550.16 | 60.234486 |
−361 | 486 | −332.12 | 447.12 | 126.604904 |
−570 | 194 | −524.40 | 178.48 | 161.203948 |
−622 | −54 | −572.24 | −49.68 | 184.961791 |
−532 | −438 | −489.44 | −402.96 | 219.464909 |
−532 | −438 | −489.44 | −402.96 | 219.464909 |
−283 | −700 | −260.36 | −644.00 | 247.987220 |
17 | −800 | 15.64 | −736.00 | 271.217352 |
351 | −745 | 322.92 | −685.40 | 295.227044 |
351 | −745 | 322.92 | −685.40 | 295.227044 |
351 | −745 | 322.92 | −685.40 | 295.227044 |
778 | −107 | 715.76 | −98.44 | 352.169117 |
700 | 270 | 644.00 | 248.40 | 21.092340 |
317 | 610 | 291.64 | 561.20 | 62.540357 |
317 | 610 | 291.64 | 561.20 | 62.540357 |
−224 | 573 | −206.08 | 527.16 | 111.351769 |
−506 | 325 | −465.52 | 299.00 | 147.287671 |
−603 | 84 | −554.76 | 77.28 | 172.069534 |
−576 | −341 | −529.92 | −313.72 | 210.626122 |
−576 | −341 | −529.92 | −313.72 | 210.626122 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
754 | 125 | 693.68 | 115.00 | 9.413025 |
754 | 125 | 693.68 | 115.00 | 9.413025 |
525 | 491 | 483.00 | 451.72 | 43.083337 |
−106 | 613 | −97.52 | 563.96 | 99.810575 |
−495 | 343 | −455.40 | 315.56 | 145.280778 |
−622 | −49 | −572.24 | −45.08 | 184.504352 |
−622 | −49 | −572.24 | −45.08 | 184.504352 |
−580 | −335 | −533.60 | −308.20 | 210.010138 |
−379 | −630 | −348.68 | −579.60 | 238.969418 |
33 | −801 | 30.36 | −736.92 | 272.359166 |
33 | −801 | 30.36 | −736.92 | 272.359166 |
33 | −801 | 30.36 | −736.92 | 272.359166 |
730 | −341 | 671.60 | −313.72 | 334.961627 |
752 | 133 | 691.84 | 122.36 | 10.029711 |
621 | 388 | 571.32 | 356.96 | 31.997089 |
621 | 388 | 571.32 | 356.96 | 31.997089 |
45 | 644 | 41.40 | 592.48 | 86.002910 |
−490 | 350 | −450.80 | 322.00 | 144.462322 |
−613 | 40 | −563.96 | 36.80 | 176.266580 |
−597 | −276 | −549.24 | −253.92 | 204.811646 |
−597 | −276 | −549.24 | −253.92 | 204.811646 |
−470 | −529 | −432.40 | −486.68 | 228.379909 |
−211 | −740 | −194.12 | −680.80 | 254.085287 |
162 | −795 | 149.04 | −731.40 | 281.517676 |
Table A5.
Cup-Vane Wireless Sensor Node Direction Data (HMC5883L) after Calibration.
Table A5.
Cup-Vane Wireless Sensor Node Direction Data (HMC5883L) after Calibration.
X | Y | X Scaled | Y Scaled | Bearing |
---|
−348 | 642 | −320.16 | 590.64 | 118.460176 |
−658 | 266 | −605.36 | 244.72 | 157.988717 |
−701 | −104 | −644.92 | −95.68 | 188.438817 |
−701 | −104 | −644.92 | −95.68 | 188.438817 |
−625 | −351 | −575.00 | −322.92 | 209.318567 |
−465 | −562 | −427.80 | −517.04 | 230.395572 |
−239 | −696 | −219.88 | −640.32 | 251.048000 |
41 | −736 | 37.72 | −677.12 | 273.188453 |
41 | −736 | 37.72 | −677.12 | 273.188453 |
373 | −626 | 343.16 | −575.92 | 300.788458 |
626 | −342 | 575.92 | −314.64 | 331.351078 |
703 | 117 | 646.76 | 107.64 | 9.449105 |
703 | 117 | 646.76 | 107.64 | 9.449105 |
703 | 117 | 646.76 | 107.64 | 9.449105 |
−124 | 727 | −114.08 | 668.84 | 99.679447 |
−506 | 516 | −465.52 | 474.72 | 134.439394 |
−630 | 324 | −579.60 | 298.08 | 152.783888 |
−630 | 324 | −579.60 | 298.08 | 152.783888 |
−630 | 324 | −579.60 | 298.08 | 152.783888 |
−687 | −179 | −632.04 | −164.68 | 194.603897 |
−614 | −372 | −564.88 | −342.24 | 211.210130 |
−362 | −640 | −333.04 | −588.80 | 240.506414 |
−362 | −640 | −333.04 | −588.80 | 240.506414 |
18 | −738 | 16.56 | −678.96 | 271.397181 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
−707 | 11 | −650.44 | 10.12 | 179.108624 |
−707 | 11 | −650.44 | 10.12 | 179.108624 |
−707 | 11 | −650.44 | 10.12 | 179.108624 |
−485 | −543 | −446.20 | −499.56 | 228.229218 |
−233 | −697 | −214.36 | −641.24 | 251.515743 |
30 | −735 | 27.60 | −676.20 | 272.337306 |
30 | −735 | 27.60 | −676.20 | 272.337306 |
360 | −631 | 331.20 | −580.52 | 299.705752 |
675 | −219 | 621.00 | −201.48 | 342.024633 |
687 | 186 | 632.04 | 171.12 | 15.149212 |
687 | 186 | 632.04 | 171.12 | 15.149212 |
687 | 186 | 632.04 | 171.12 | 15.149212 |
105 | 732 | 96.60 | 673.44 | 81.837026 |
−391 | 614 | −359.72 | 564.88 | 122.489303 |
−644 | 305 | −592.48 | 280.60 | 154.657649 |
−644 | 305 | −592.48 | 280.60 | 154.657649 |
−704 | −77 | −647.68 | −70.84 | 186.241914 |
−609 | −379 | −560.28 | −348.68 | 211.895313 |
−392 | −619 | −360.64 | −569.48 | 237.654759 |
−75 | −733 | −69.00 | −674.36 | 264.157871 |
−75 | −733 | −69.00 | −674.36 | 264.157871 |
293 | −671 | 269.56 | −617.32 | 293.589051 |
589 | −409 | 541.88 | −376.28 | 325.223992 |
708 | 33 | 651.36 | 30.36 | 2.668635 |
Table A6.
Cup-Vane Wireless Sensor Node Collected Data Sample.
Table A6.
Cup-Vane Wireless Sensor Node Collected Data Sample.
Time (s) | Speed (m/s) | Direction (deg) | Temp. (C) | Pressure (Pa) | Altitude (m) | Humidity (%) |
---|
500 | 1.00 | 341.28 | 27.2 | 82,266 | 1723.46 | 37 |
505 | 1.13 | 340.55 | 27.2 | 82,263 | 1723.75 | 35 |
510 | 1.07 | 340.06 | 27.2 | 82,268 | 1723.46 | 53 |
515 | 1.88 | 340.37 | 27.2 | 82,268 | 1723.46 | 51 |
520 | 2.03 | 340.51 | 27.3 | 82,262 | 1723.66 | 50 |
525 | 1.86 | 341.39 | 27.3 | 82,257 | 1723.36 | 41 |
530 | 1.72 | 339.31 | 27.3 | 82,257 | 1724.15 | 40 |
535 | 1.57 | 337.09 | 27.3 | 82,254 | 1725.43 | 39 |
540 | 2.84 | 11.78 | 27.3 | 82,249 | 1724.15 | 38 |
545 | 3.80 | 35.14 | 27.3 | 82,255 | 1724.74 | 36 |
550 | 3.90 | 46.30 | 27.3 | 82,254 | 1724.94 | 52 |
555 | 2.88 | 112.41 | 27.3 | 82,253 | 1724.35 | 51 |
560 | 2.19 | 341.32 | 27.4 | 82,257 | 1724.74 | 38 |
565 | 2.60 | 342.86 | 27.4 | 82,260 | 1724.15 | 36 |
570 | 0.72 | 345.31 | 27.5 | 82,265 | 1723.36 | 46 |
575 | 1.88 | 214.41 | 27.5 | 82,262 | 1723.95 | 41 |
580 | 2.77 | 345.04 | 27.5 | 82,264 | 1723.36 | 40 |
585 | 1.97 | 345.33 | 27.5 | 82,263 | 1723.85 | 39 |
590 | 2.32 | 343.20 | 27.5 | 82,265 | 1724.25 | 38 |
595 | 1.62 | 344.91 | 27.5 | 82,264 | 1723.66 | 36 |
600 | 1.45 | 345.00 | 27.5 | 82,267 | 1723.16 | 52 |
605 | 2.50 | 345.11 | 27.5 | 82,273 | 1722.87 | 52 |
610 | 1.66 | 344.21 | 27.5 | 82,271 | 1722.97 | 51 |
615 | 1.55 | 344.48 | 27.5 | 82,274 | 1723.06 | 50 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
885 | 2.86 | 345.93 | 27.8 | 82,262 | 1723.26 | 41 |
890 | 1.67 | 344.42 | 27.8 | 82,266 | 1723.75 | 40 |
895 | 1.70 | 340.85 | 27.9 | 82,263 | 1724.35 | 52 |
900 | 1.20 | 341.13 | 27.9 | 82,272 | 1723.75 | 46 |
905 | 1.65 | 343.07 | 27.9 | 82,266 | 1723.06 | 39 |
910 | 1.79 | 343.30 | 27.9 | 82,266 | 1723.16 | 38 |
915 | 1.75 | 343.25 | 27.9 | 82,268 | 1723.26 | 36 |
920 | 0.77 | 345.03 | 27.9 | 82,267 | 1722.87 | 35 |
925 | 0.54 | 337.47 | 27.9 | 82,263 | 1723.56 | 52 |
930 | 0.71 | 344.89 | 28.0 | 82,261 | 1723.36 | 52 |
935 | 0.44 | 344.81 | 28.0 | 82,268 | 1723.75 | 51 |
940 | 0.33 | 345.69 | 28.0 | 82,265 | 1723.36 | 50 |
945 | 0.69 | 343.34 | 28.0 | 82,266 | 1723.26 | 49 |
950 | 1.28 | 344.57 | 28.0 | 82,274 | 1722.97 | 44 |
955 | 1.28 | 344.52 | 28.0 | 82,266 | 1723.06 | 36 |
960 | 0.84 | 344.16 | 28.0 | 82,270 | 1722.47 | 53 |
965 | 1.24 | 342.39 | 28.1 | 82,265 | 1723.06 | 52 |
970 | 1.48 | 344.67 | 28.1 | 82,269 | 1723.16 | 52 |
975 | 1.40 | 343.55 | 28.1 | 82,272 | 1723.66 | 51 |
980 | 1.16 | 337.07 | 28.1 | 82,269 | 1723.66 | 50 |
985 | 0.97 | 344.89 | 28.1 | 82,267 | 1723.75 | 49 |
990 | 0.77 | 344.63 | 28.1 | 82,260 | 1723.06 | 47 |
995 | 0.80 | 341.14 | 28.1 | 82,265 | 1723.56 | 44 |
Table A7.
Polyfit Calibration Data.
Table A7.
Polyfit Calibration Data.
X-Axis Polynomial Fitting Data | Y-Axis Polynomial Fitting Data |
---|
1.2214 | 1.807656 |
1.8571 | 2.219478 |
2.5043 | 2.638751 |
3.1857 | 3.080180 |
3.7100 | 3.419835 |
4.3543 | 3.837229 |
4.9700 | 4.236096 |
5.3471 | 4.480391 |
5.9900 | 4.896878 |
6.4500 | 5.194878 |
6.9729 | 5.533626 |
7.3857 | 5.801048 |
7.8100 | 6.075921 |
8.2457 | 6.358179 |
8.8086 | 6.722840 |
9.0943 | 6.907924 |
9.5757 | 7.219787 |
10.0557 | 7.530744 |
10.3414 | 7.715827 |
10.8000 | 8.012920 |
11.2186 | 8.284100 |
11.9000 | 8.725529 |
12.3114 | 8.992044 |
12.9757 | 9.422395 |
13.3443 | 9.661184 |
14.0086 | 10.091534 |
14.6000 | 10.474659 |
14.8943 | 10.665314 |
15.6043 | 11.125270 |
16.0671 | 11.425084 |