Tuesday, March 27, 2018

The Pi Logger

Since it's too cold to windsurf, and cheap OTG phones are not available in most of the world, I've been looking into using a Raspberry Pi for logging GPS data. For those who don't know Raspberry: they are tiny little Linux computers that cost between $5 and $30, depending which model you want. Here's an image showing two of them:
The clear case contains a Raspberry 3 (~ $30); the white case a Raspberry Zero W ($10). The black thing at the bottom is a USB battery; the blue & black thing at the left is a GT-31 GPS. Here's a view from the side:

There's a USB GPS dongle plugged into the Raspberry 3 - the same dongle I had used with Android phones before. I tested the Pi 3 - dongle setup on a bur ride into Boston today, and it worked! Here's are some speed tracks from the dongle and a GW-60 watch:
The blue lines are from the GW-60 (the "gold standard GPS), the red lines are from the dongle + pi. The watch had problems when the bus went under bridges, and dropped a bunch of points (the lines to the bottom). Zoomed in, the data from the dongle look less noisy than the watch data:
This is reflected in lower error estimates for the dongle data (the numbers on the right side):
No big surprises here, the dongle had done better than the watch in previous driving tests (when using an Android phone). The next thing will be to get some tests with the smaller Raspberry Pi Zero W in a few days (I'm waiting for a cable I need).

So far, the setup is just a logger: plug the battery cable into the Pi, wait a couple of minutes for it to boot, plug the dongle in, and record. When done, take the dongle out, and the Pi will shutdown a little later. Back home, grab the data over WiFi, and through them into your favorite GPS software, or upload to ka72.com. To get this to run, it needs a custom Java program, a couple of libraries for the USB/serial communication, a couple of scripts, and an entry in the /etc/rc.local to start things up automatically - not too bad.

The hardware cost for Pi Zero W + GPS dongle + battery + case cables is around $50 US. Adding a small display would add another $40 or so, almost doubling the cost, so that's not very high on my list of priorities.

Things I'll probably try first are:

  • Use a smaller battery pack
  • Pack things neatly for use when windsurfing
  • Configure the Pi Zero as a USB drive for easier downloading onto a computer
  • Use Bluetooth to announce speed
  • Use Bluetooth and an Android phone to display speeds 
  • Automatically transfer files after a session to a phone or PC (over Bluetooth or WiFi)
The entire setup should consist of a few things that are easy and cheap to buy, and a few cables, with no or very little assembly required. Geeks can swap the USB dongle against a ublox 8 chip with a larger antenna, and hook it up using either a serial-to-USB cable, or using the GPIO pins on the Pi (which would also require software changes). 

Monday, March 19, 2018

Texas Wrap

After three days of driving, we're back from Texas, and were once again greeted by snow on the ground. I'm not sure what the bigger shock was, though - the temperature differences or the "sticker shock" in the supermarket, where exactly the same food costs 1/3 to 1/2 more. Maybe I can understand that for fresh fruit from Mexico - but for frozen food? Well, at least the selection of vegetarian pizza is better here. Texas is not the best place for vegetarians!

The weather this year was weird, with a lot of cloudy and rainy days. I still got to sail 31 days, about the same as last year, but that included 4 light wind days, and 4 days on South Padre Island. My biggest sail (the 7.8) also was the most used sail, and only 6 of the 31 days were on sails smaller than 7.0 (2 x 5.6, 4 x 6.3).  It's not quite as bad as it might seem, though - since I only sailed slalom gear, I was on the 7.0 race sail in 23 mph wind averages, where I would use a 5.0 on freestyle gear. The two days on the 5.6 had wind averages of 27 and 32 mph.

We got only one "real" speed session this year, and not a single day with northwesterly wind that would have been perfect at the South Bird Island Slicks. On the upside, we sailed a couple of spots for the first time that are great for long distance speed: the North Flats at South Padre Island, and Grassy Point in Corpus Christi. At low water levels, both spots are great for nautical mile and one hour runs, so it's no surprise that 4 of my top 5 sessions for both of these disciplines are from this year. Good practice for the OBX long distance race next month! And maybe all that "big sail" practice will be useful at the US Nationals a week later, where I'll be sailing a 9.0 in the Kona One category. It's cool to see that more than 50 windsurfers are already registered for the US Nationals, including racers from the US, Canada, Denmark, Great Britain, Belgium, FranceBrazil, Poland, Italy, and Germany. The list includes multiple national champions, so the racing should be hot! See you there or in Avon in a few weeks!

Monday, March 12, 2018

The Difference Between Good and Bad

No, this is not a philosophy post. It's about GPS reception. Surprised?

When I looked at GPS test results from yesterday and today, one thing puzzled me. Look at the data and take a guess:
Why was the phone GPS so inaccurate on 3/11, with large errors in every GPSTC discipline, but quite accurate on 3/12? I'll give you some clues, so you can see how early you can guess the answer.

Clue #1: A cold front pulled in yesterday afternoon. Temperatures dropped from the 80s into high 60s yesterday evening, and to 50s today.

Clue #2: That made me wear a 4 mm wetsuit today, while I was sailing in a lycra top yesterday.

The ardent reader of my blog may have a suspicion on what was going on by now (ha!).

Clue #3: The arm band I use for my phone tends to slip on the lycra, but much less so on the wetsuit. Yesterday, I stopped several times just to re-orient the phone so that it was pointing to the sky; it often was on the side of my arm.

Clue #4: Compare the track points from one run where the phone reported about 1 knot less speed than the GW-60 shown here:
to a run where both devices gave almost the same speed:
Clue #5: Check the "Sats" column for the phone data (the numbers on the right side) for the picture above.

So: yesterday, the armband with the phone slipped often, so that the phone was on the side of my arm, instead of pointing up. The runs that deviate most from the GW-60 data had reception from fewer GPS satellites, and changes in the number of satellites during the run. It seems that having the phone facing sideways on the arm during speed runs screws things up. That's not really very surprising - perhaps the more surprising thing is that the USB dongle gave accurate results yesterday (it was in the same bag, lying on the screen of the phone).

Can we verify that turning the phone sideways and blocking one side screws up GPS reception? Sure! I used GPSLogit, which has a graph that shows satellite reception. Here's a screen shot showing the reception with the phone facing up:
The phone used GPS 13 satellites, and had a decent horizontal accuracy of 4.6 meters. Just turning the phone onto its side did not change much, but then putting a hand close to the top of the phone on the back side did:
Now, the phone had good signal (green bars and dots) from only 7 satellites, and the estimated positional accuracy was 19.7 meters - four times worse!

If you want to reproduce this, but don't have GPSLogit, there are plenty of free GPS test apps on the Google Play Store available that could be used instead. The phone's GPS antenna is typically located near one of the top corners of the phone. You'll have to wait a few seconds to see changes in the satellite reception (probably because that information is not updated as often as position and speed info).

So, if you want to get accurate speeds from your phone with GPSLogit or Windsport Tracker, make sure the phone is facing to the sky! Of course, that's the same for the GW-60.

Sunday, March 11, 2018

Dongles Beats Phone

Here's a graph that compares the accuracy of the GPS from an Android phone to the USB GPS dongle that I have been testing:
The bars show the (absolute) difference between the results of the GPS units to the results from the "Gold Standard" GW-60 GPS in the six GPS Team Challenge disciplines over 10 different windsurfing sessions. The unit is knots. Shorter bars are better.

The results show that the phone GPS (red bars) can give quite accurate results, but sometimes does not. In 5 of the 10 sessions, at least one number (usually for 2 second average speed) was off by 0.3 knots or more. In three sessions, the observed difference was larger than 0.5 knots, which is definitely unacceptable for competition (but still good enough for just recording your sessions, and getting an idea how fast you were).

In contrast, the USB dongle had a maximum error below 0.4 knots in all 10 sessions, with a maximum deviation of 0.2 knots in 9 out of 10 sessions. The one session with a higher error was the one I reported about previously, where the arm band with the phone and dongle had slipped for large parts of the session. In all other session, the accuracy was very good. For comparison, the observed differences when wearing two GW-60 watches (one on each hand) are often in the 0.1-0.2 knot range.

Compared to the phone GPS, the USB dongle has another advantage (in addition to the higher accuracy): the u-blox GPS chip in it can provide accuracy estimates, which allows the automatic detection and elimination of artifacts, for example those that can happen during crashes or when swimming.

Anyone interested more detail can look at the data in this PDF file. You may notice that not all sessions have entries for all 6 GPS disciplines. There are various reasons for this: some sessions are shorter than 1 hour, so GPSResults did not give 1 h results; other sessions are different length in the different files (for various reasons, including a little bug that stopped the dongle logging in earlier versions), so distance differences where meaningless; and so on.

If you're really interested and want to look at the raw GPS data yourself, you can download them from here. It's a 32 MB ZIP archive with about 35 files. Note that you may need to define the time range in GPSResults for some of the sessions where the different units recorded different length sessions if you want to get meaningful results. Also, a few of the GW-60 session contain data from multiple sessions, so make sure to select just the session you want to compare.

Friday, March 2, 2018

Another Naughty Spot

I recently wrote about how great Grassy Point in Corpus Christi is for nautical mile runs (naughties). Today, I finally got to try out a different naughty spot that I had wanted to sail for years: the shipping channel to the right of the JFK Memorial Causeway between Corpus Christi and North Padre Island. Check out the water depth map:
The channel is between the causeway and the big green spoil area in the lower right quadrant of the map. We cross the causeway every time we go shopping, and many times when the water level was low, parts of the spoil area have been above water; the boundary region next to the channel often was just inches deep. A perfect speed channel?

Today, the wind direction was just right: NE, a 90 degree angle to the channel (note that the map above is not in the usual "north on top" orientation). At around 19 knots, it was weak enough to let me use the Falcon 112 - when exploring, a little extra volume is always welcome! After a 5 minute drive from our condo, I was on the shore, ready to rig. Here are today's tracks:

The water level today was quite high. I got off at one spot that's shown in green on the depth map, and the water was above my hips. That meant the channel had some chop - perhaps a foot high, but quite orderly, allowing me to pick lanes. The channel is about 50-80 m wide, so it allows some mini "downwind" runs at about 15 degrees angle to the channel direction. One of those got me a top speed of 28.1 knots over 2 seconds. The best nautical mile run was 25.45 knots, pretty decent for square runs in 19 knot wind. My jibes today were quite poor, partly because I went for very tight turns which the Falcon 112 does not like much, so the hour came out at 20.06 knots. But with a bit more wind and a lower water level, this would be a great spot for 1 hour runs; with a slightly less square wind direction, it will be a great spot for naughties.

Thursday, March 1, 2018

Too Much?

We really had planned to not windsurf today. But when the meters show 25 mph wind, and it's sunny and warm, what do you expect from a couple of wind addicts? That they stay home, just because today would be the 12th day of sailing in the last 15 days, and the fourth day in a row? Really?

Of course we went. And had a blast. I started the session by sailing 2.5 km ( 1 1/2 miles) upwind on a 50 degree weed fin. Nina joined me a bit later to work on her Flakas - for once not overpowered, and on a "big" sail (4.7). That's in contrast to yesterday, when she rigged down from 3.7 to 3.4, and was still overpowered. Here are today's GPS tracks:
That was a thoroughly enjoyable session. Easy fun on flat, knee- to hip-deep water. 

Yesterday was a different story. The forecast had predicted what we got today - 22 mph, but from the south instead of the north. On sunny days, the wind always seems to come in a lot stronger than predicted, and yesterday was no exception. We rigged in 26 mph wind, but then got almost blown off the water when it increased to 32 mph gusting to 40. At least that's what the meters said. But at other spots, Nina would have been perfectly happy on a 3.4.  Of course, she looked good:
But she was so powered on the 3.4 that she aborted many Flaka attempts - even going far downwind was not enough to dump the power in the sail. After hearing her state that she was overpowered, I felt a bit better about my problems to control my 5.6 m race sail. I was on my small board (a 72 l speed board), and I had expected to get some nice nautical mile runs in - but even before the wind really picked up, I never felt in control for more than a few hundred meters, usually in the flattest sections and in lulls. My inner chicken simply did not want to risk any big stacks at 30 knots a mile or two from the launch. In my defense, the water level was a bit higher, which increased the chop and made it slightly more chaotic. 

So the IC sent me to look for some flat water, and I explored an area that I had not ventured to before: Pita Island. Just behind the island, I found a couple of hundred meters of perfectly flat water:
The speed strip is quite short, but you can enter it with a flying start, and you can probably sail onwards after it. The water still is quite flat, but there is a sandbar under water that may make it a bit too shallow. I only did a couple of runs there, and then returned back to the launch, since this spot is more than a kilometer away, and I was not sure if Nina could see me there. Sometimes, people get worried unnecessarily when they see me walk around to check the water depth... but I admit that I was a bit tired by then. Even with just two runs, this ended up being my 4th-fastest session ever, with a 2 second speed of 32.5 knots. I'm sure I'll re-visit this spot in the future!

The day before that had been similar, but different. The wind also came in almost 10 miles higher than predicted, but only to the mid-20s with gusts in the low 30s. With a less wind and a lower water level, the chop was small and nice, perfect for trying to improve my personal best (PB) for 1 hour average speed. During the second half of the hour, the wind had increased, and holding on to the 6.3 on the  Falcon 99 was quite entertaining, but well worth it - I improved my PB by 1.5 knots, to 24.14 knots. Here are the tracks:
Runs were between 3.5 and 4.5 km long. The darker green region on the right was very smooth, the region on a left required a bit more attention. Afterwards, we went to the Lazy Beach Brewing Company to celebrate, which has become one of our favorite watering holes. Nina's expression shows what she thinks about the place: