Monday, February 22, 2016

An Engineer's OCD


Let's face it, I'm a bit of a metrics geek. About as soon as I learned how to read, I memorized stats on all the planets. How far from the sun, orbit duration's, size, etc. Numbers and how things interact with each other have always fascinated me.

All of my off-road bicycles have wheel sensors on them. GPS receivers do a surprisingly lousy job measuring distance in tight and twisty terrain. A wheel sensor communicates wirelessly with the GPS unit and provides ground truth. The metrics geek in me would accept nothing less.

When I built up my quasi-fat bike last fall, I transferred the Garmin wheel sensor from the bike I decommissioned. It refused to work properly. I replaced the battery. No improvement. I tried a different magnet. No luck. The sensor synced up well via the Ant+ link, but it would always record way more distance than I rode. Much of the time my speed would show up on the Garmin at twice what I was actually travelling. I figured it was an old Garmin GSC-10 sensor that had a spotty reliability record to begin with, so it must have gone bad. I ordered a new Wahoo sensor.

I mounted the new sensor, synced it up, figured that would be it. Except exactly, the same, thing, still, happened! SOB! This became an obsessive issue now. There is no way a stupid magnet/reed switch sensor is going to thwart me. This is 100+ year old technology, and I could design a wireless link from scratch. What was different about this new bike that all manner of sensor and magnet combinations wouldn't work that worked flawlessly on other bikes?

Let's look at how these speed (or cadence) sensors work. If you use one, listen in a quiet room as you spin the wheel. You'll hear a faint poink, poink, poink as the wheel rotates. It is the mechanical reed switch in the sensor opening up each time the magnet moves away.

A reed switch is nothing more than two piece of springy metal overlapping each other with a small gap between them. Put a magnet near one end, the magnetic flux wants to flow through the metal and cause the two "reed" ends to attract each other and close the gap. It is a magnetically actuated switch. Electronics in the sensor module detect each closure (which is each wheel revolution) and sends this to the Garmin GPS via an encoded radio message.

It turns out you need a north or south pole to pass by one of the ends of the reed switch. You can't put a magnetic pole in the middle, as this doesn't cause flux to flow through the reeds to make a magnetic circuit that closes the switch. A spoke magnet presents a north or south pole to the reed switch. Thus the magnet must pass exactly over the end of the reed switch to trigger it. Sensors have a mark where this spot is.

But a reed switch really has two ends, and either end can be triggered by the spoke magnet.  If you passed a magnet's north pole along the length of a reed switch, it would turn on once passing over the first end, turn off in the middle, then turn on again passing over the second end of the reed switch. Manufactures don't tell you about this. They mark only one end.

When I sat down to carefully listen to the sensor, I didn't here a poink, poink, poink. I heard a poink-poink, poink-poink, poink-poink. Ah-ha! It is double actuating each time the magnet came by. But why?

It turns out the carbon rigid fork has some fundamental geometry differences from the suspension forks on my other mountain bikes. The suspension forks have a lot of offset built into the drop-out. This allows the fork leg mounted sensor to be positioned such that the magnet passes by perpendicularly. But on my new Carver, the offset is built into the angle of the fork legs. This pushes the sensor much further forward relative to the wheel axle, so the magnet now sweeps more top to bottom than across the trigger point. The magnet was just passing through the unintended trigger area of the sensor!

A little fudging ensured the magnet only passed through the intended trigger area. A test ride confirmed I now measured ground truth! It's embarrassing how many times I fussed with this before figuring it out.

I slid the magnet closer to the axle to ensure it would not trigger the upper sensitive area
while being just far enough into the lower sensitive area without missing triggers.

I wish challenges I deal with at work had fixes this certain. Sometimes you think you've got to the root cause, only to find the problem comes back to bite you in the ass.

5 comments:

Jason said...

I'm obsessive about stats as well. In fact, I don't fully trust wireless computers as I've heard stories about interference affecting them. So all three computers on my bikes are wired!

Of course, your problem didn't seem to be related to it being wireless but rather with the input from the magnet itself.

You don't feel that having the magnet system is warranted for road riding?

Hill Junkie said...

I used to use only wired computers too before switching over to GPS. In fact I ran both for along time until I trusted GPSs. I have big pile of wired computers, including some brand new I never used. Can't even give them away today.

For most part, roads are much more linear and open, thus you get good signal and less rounding around corners. I find GPS on road measures within a percent of what a wired computer shows, so there was no need to encumber my bike with expensive sensors and wheel magnets.

There is one place I ride where distance can fall off by 20-30%, the FOMBA trails near Manchester. Most other areas are not nearly as bad, maybe be off by 2-3mi in 50mi. Over the course of a year though, all those lost miles add up. That bugs me some. When I travel and do huge rides in new areas, I also rely on accurate distance measurement to help in navigation. When you're up on a new 12,000ft ridgeline and a storm pops up, is the nearest escape route ahead or behind you? Minutes matter. Being off by a few miles can skew where you think you really are.

Isaac said...

https://en.wikipedia.org/wiki/Lies,_damned_lies,_and_statistics

Paul said...

Holy cow, that sensor is mounted low.....

Hill Junkie said...

Yeah, the shape of the fork doesn't lend itself well for this sensor to hold it's position higher up. Even down low, I needed a little duct tape assist to ensure it doesn't rotate away from the wheel.