Why does a cadence sensor lag at starts and in accelerations?

For a long time I treated the cadence sensor as the reference. In accelerations the Cadence Coach algorithm argued with it, and I was sure the app was to blame. Then I looked closer: the one to argue with was the sensor.

It does not send revolutions per minute. It sends “this many revolutions made, the last one was at such a time”, and whoever receives that has to work it out. On steady riding this works great. But at starts and in accelerations, in my rides, this combination matched the revolution marks I made from the phone's gyroscope only 15% and 44% of the time. Cadence Coach does not shine there either, but it hits more often: 42% and 79%.

I first noticed it by ear. After a start, before I had got up to speed, the coach said I was in the zone. Then I opened the chart of that same moment and saw the disagreement. That is how I started looking into the sensor in accelerations.

An honest caveat: the app reads the same gyroscope that I made the marks from, so for the app the check is not fully independent. And all of this is about one sensor of mine and six of my rides.

· Alexey Egorenko

AI translation from Russian. The original is the Russian version; if something reads oddly, trust it.

In short

  • What cadence is. How many crank revolutions you make per minute (rpm). The faster you pedal, the higher the number.
  • What the app does. Cadence Coach on Android calculates cadence from the phone and says “faster” or “slower” by voice. More on the page “How Cadence Coach works”.
  • Where to put the phone. On your leg: in a shorts or trouser pocket. In a bag, on the handlebar, in a chest pocket or in a jersey pocket the app will not see your pedalling; there you need a Bluetooth cadence sensor, and the app can work with one too.
  • How accurate it is. On steady riding the average disagreement with the labelling is 0.7 rpm (over all seconds; for the sensor it is 1.1), and 99% of the time it is within 3 rpm. At starts it matches 42% of the time (the sensor with averaging 15%): this is still a weak spot. Below 40 rpm the app is silent more often. The first article has better figures (0.32 rpm, 99.7% within 2 rpm), but there it is a different algorithm (Algorithm 1, not 3), a different reference (the sensor, not the labelling) and a different set of rides.
  • What it costs. Free: 2 rides with the voice coach and 2 with workout programs. After that a one-time purchase, with no subscription and no ads: the coach €9.99, the programs €9.99, or €15 for both, excluding taxes.

The sensor lags at starts and in accelerations

Here is one real start from my six rides: the pace grows from 44 to 85 rpm. The bold line is the “labelling”: marks saying “here was a revolution”, which I built from the phone's gyroscope. The blue one is the “sensor with averaging”: the number the receiver calculates from the sensor's messages (how that works I explain below). See it? For a few seconds the sensor plods along below the labelling, while the phone with Algorithm 3 stays closer.

One value per second; a gap in the line means there is no number. Blue circles are the raw sensor events: the cadence from each pair of neighbouring events at the moment the packet arrived (at second 11 two events arrived almost together, that is the very “burst”). The blue line is what you get from them once a second: the last event that had arrived. The phone has a gap at seconds 6–7: Algorithm 3 compares two neighbouring revolutions and shows a number only if they are similar enough, and when the pace grows quickly they differ slightly. The grey band is the match corridor of ±3 rpm (the tolerance is explained above) around the labelling; the first 10 seconds of the start are highlighted. This is not the most successful example: of 63 starts lasting the full 10 seconds I took the one where the match shares are close to the averages over the whole time of starts (the sensor with averaging 10% against the average 15%, Algorithm 3 40% against the average 42%). I did not take starts where the labelling itself jumps by more than 30 rpm per second. In total, Algorithm 3 matched the labelling more often than the sensor with averaging in 50 starts out of 63, equally in 7, less often in 6.

If you train by a sensor. On steady stretches you can trust its number. At starts and in accelerations you cannot: it lags behind the pace in the labelling and disagrees with it almost half the time. Read it there as “roughly”.

The phone is wrong less often

The app versions are named the same across all three articles: is described in the first article (where it is called C1), (Algorithm 1 plus gap filling) in the second, is new. It is the only one that runs in the app now.

Each cell has three shares of time: matches the labelling (within 3 rpm) / disagrees / no number. Because of rounding, the sum may differ from 100% by one.

Riding modeShare of recordingSensor with averagingAlgorithm 2Algorithm 3
Steady riding62%95 / 4 / 198 / 1 / 199 / <1 / <1
Acceleration10%44 / 49 / 753 / 33 / 1479 / 7 / 14
Braking7%58 / 36 / 666 / 23 / 1176 / 9 / 14
Start12%15 / 49 / 3720 / 23 / 5842 / 12 / 46
Stop9%59 / 23 / 1865 / 13 / 2276 / 6 / 19

The modes together make up 99.7% of the recording; the remaining seconds are not assigned to any of them.

“Sensor with averaging” is the cadence averaged over the time between the sensor’s last two events; after the last event the number is held for 3 seconds, then there is no number. Cadence Coach does the same when a sensor is connected.

  • Steady riding. Boring: all three almost agree, and the sensor remains a good reference.
  • Accelerations and starts. Here the sensor stumbles: it disagrees with the labelling in almost half of the seconds (49% both in accelerations and at starts), and at starts in a third of the time (37%) there is also no number. That is why checking against it understated the accuracy of the app: some of the app's “errors” turned out to be the sensor's errors.
  • Algorithm 3 matches more often than Algorithm 2 in all modes. At starts it disagrees with the labelling almost half as often (12% against 23%) and is silent less often (46% against 58%).
  • The start remains a weak spot: for almost half of this time Algorithm 3 shows no number.
  • Below 40 rpm none of the variants I checked copes with it: the sensor with averaging (the maker states a range from 30 rpm) matches 11% of the time, Algorithm 3 7%. It disagrees less often (9% against 35%), but is silent more often. By ear and by feel it is the same for me: at slow cadence the sensor works better.

When the pedals are not turning. A separate count, not part of the 2 hours 12 minutes: about 30 minutes when there are no revolutions in the labelling and the phone is almost still. The sensor with averaging still showed a number 8% of this time, Algorithm 2 0.6%, Algorithm 3 0.1%. So that the coach does not praise you for riding while you are standing still, silence is exactly what is needed here.

Why the sensor lags

A cadence sensor does not know how many revolutions per minute there are. It keeps a counter. According to the Bluetooth specification for speed and cadence sensors, it transmits the accumulated number of revolutions and the time of the last revolution with a resolution of 1/1024 of a second, usually about once a second (the interval is set by the sensor itself). The cadence is calculated by the receiver: a phone, a watch or a bike computer. For comparison, the phone's gyroscope delivers data about 230 times a second (200 is requested), with a constant step of 4.35 milliseconds by the sensor's clock. I did not measure the accuracy of the clock itself separately.

This gives the first limitation. To notice that you have sped up, a receiver that counts by revolutions has to wait for the next revolutions. At 90 rpm one revolution lasts 0.67 seconds, at 60 already a second. And when you stop turning, the receiver decides for itself how long to keep showing the old number.

So the figures below refer not to the sensor alone but to the sensor together with how the receiver averages its messages (“sensor with averaging”). The cadence is taken as the average over the time between the last two sensor events. The formula is this: the difference in revolutions divided by the difference in time, as the Bluetooth specification and the explanations I found describe it. How long to hold the old number when there are no new revolutions is not set by the specification, and I have not found it described anywhere how particular devices and apps, such as Garmin, handle this. Cadence Coach holds the number from the sensor for 3 seconds after the last event, and I used the same period in the calculation. Another device may treat the same messages differently.

What I saw on my unit of the sensor (the sensor itself is described in the block for engineers below):

  • The delay drifts. I measured it over 30-second windows: the median is +0.5 seconds, and in 16% of windows it is more than a second. A single fixed shift does not correct it: several revolutions fall into the delay, and it is unclear which ones.
  • Events arrive in bursts. My sensor transmits data every half second (the specification says “about once a second”; the sensor sets the interval) and sometimes sends stale events all at once. From the arrival time you cannot tell exactly when the revolution happened.
  • Data cleaning hides the problem. In the analysis you can keep only events with a stable delay, but in accelerations there are almost none. I would get a nice chart about steady riding without a single acceleration, that is, about the very riding where there is no problem.

How I checked it

At first the sensor was my reference. In accelerations and at starts Cadence Coach disagreed with it, and I decided the app was wrong. Then I noticed that the sensor behaves strangely there too. So I called in a third judge: a labelling of revolutions (marks saying “here was a revolution”) built from the phone's gyroscope, and compared both sources with it.

An important caveat. The labelling and the app look at the same gyroscope signal, so for the app this check is not independent: it partly checks itself. The crank sensor is independent of this signal, but it lags. I do not claim that the app is more accurate than the sensor in every sense. I say that at starts and in accelerations the sensor with averaging is a poor reference. One more caveat: on my rides the phone sits tight against the thigh and makes almost no stray movements, so I consider the gyroscope labelling reliable. I have not yet done an independent check (see “What remains unsolved”).

The check used six of my rides with a sensor: 2 hours 12 minutes of pedalling. The labelling is built by an automatic detector from the peaks of the main axis of thigh motion; I reviewed the result on charts and corrected it where needed. This is not a manual labelling of every revolution. I tuned the parameters of the algorithm on other data (four of my rides and testers' recordings, about 36 minutes), but I had seen all these rides before, so the check is not external.

I count a reading as a match when it is within 3 rpm of the labelling. I set this tolerance for myself as the initial accuracy target for cadence detection by my algorithm, and I recalculated at 1, 2, 5 and 10 rpm: the order does not change at any of them (the table is in the block for engineers).

What this means for voice cues

The coach adds its own waiting time to the estimation delay. It is set in the settings, in the “Prompt pace” section: “Calm”, “Normal” and “Quick”. For finer tuning of the values there is the “Advanced” section. This waiting applies only to the “Faster” and “Slower” cues. The cue that you have reached the target zone (“In zone”) is almost instant (no waiting on “Normal” and “Quick”, 5 seconds on “Calm”), so that you do not miss the moment to hold your revolutions.

The first “Faster” or “Slower” cue after your pace leaves the range arrives after the waiting time plus the estimation delay. Example: you set off at a green light and pedal below your range. On “Normal” the “Faster” cue comes after 5–6 seconds with Algorithm 3 (with the previous Algorithm 2, after about 7). On my rides I manage to spin up to the target zone in that time, even in the city.

Prompt paceAlgorithm 2Algorithm 3
“Quick” (3 s)about 5 s3–4 s
“Normal” (5 s)about 7 s5–6 s
“Calm” (8 s)about 10 s8–9 s

If cues seem late, choose “Quick”. If there are too many, choose “Calm” instead.

What it sounds like in the city

To have as many different recordings as possible, I run the app not only in workouts but also on ordinary errand rides. In the city, because of traffic, I do not always manage to ride at the target cadence: lots of coasting and standing at traffic lights. So the app is often silent or says I am in the zone: I pedal in short stretches roughly in the target zone and rarely stay above or below it for longer than 5 seconds (that is the cue threshold I have set).

Sometimes a cue sounded at the wrong moment, for example in a crowd of cyclists. Then I acted differently: sometimes I put up with it, sometimes I simply shifted down.

The cues themselves do not bother me: they sound rarely, especially if the target is easy. For me that is 80–90 rpm.

The phone is always in my trouser pocket, and it has never been in the way. I have tried the cues both through the speaker and in headphones. For the speaker you have to set the volume to maximum, in headphones the usual volume is enough.

What surprised me in development and testing: the accuracy of the algorithm at cadence 80+. I thought a bumpy road would distort the signal badly, and the phone would be flopping around in cargo pockets. But even those movements do not trouble the algorithm. This is my observation from rides, not a separate measurement.

Where a beginner should start

My advice for the first week is this.

  1. Just ride with the app, with the coach and the metronome turned off. Collect statistics of your rides and understand what your cadence is right now.
  2. Look for a cadence that feels pleasant.
  3. Then turn on the coach and ride with cues at the cadence that is most comfortable for you.
  4. And only after that go deeper into workouts.

My cadence probably has not changed, but holding it by feel has become easier: the body gradually gets used to it and starts falling into the right rhythm by itself.

Details for engineers

My sensor

The protocol is the same for all Bluetooth sensors, so what is said above about the receiver’s calculation applies to any of them. The sensors themselves differ. Mine is a Van Rysel (Decathlon): it needs no magnet, connects over ANT+ and Bluetooth, and the maker states a cadence range of 30–180 rpm and sleep after 60 seconds without data. The shop page does not say how it detects rotation and gives no accuracy or delay figures. After sleeping it presumably has to be woken by turning the pedal, which may add delay at a start after a stop; I did not check that separately, but it is noticeable when analysing the raw data. I did not compare it with other sensors and did not find a test that compared sensors at starts, so I cannot say whether it is better or worse than its competitors.

Match tolerance

Where ±3 rpm comes from: the tolerance was set in advance and does not follow from the accuracy of the data; how accurate the labelling itself is, I have not independently checked. The stricter the tolerance, the bigger the gap between Algorithm 3 and the sensor with averaging. But I do not yet have a third source of truth to understand independently which of them is more accurate.

Share of time when the reading is within the tolerance of the labelling:

ToleranceSteady ridingStarts
Algorithm 3Sensor with averagingAlgorithm 3Sensor with averaging
±1 rpm79%57%22%5%
±2 rpm96%86%35%10%
±3 rpm99%95%42%15%
±5 rpm99%98%47%22%
±10 rpm99%99%53%35%

The ±3 rpm row is the same as in the main table.

Names in the code. Algorithm 1 is C1: it counts every revolution and discards a weak signal by an amplitude threshold (0.8 rad/s). Algorithm 2 is the one described in the second article: Algorithm 1 plus a second part that switches on only where Algorithm 1 is silent; because of the amplitude threshold it is silent at slow cadence. Algorithm 3 is the newest one: it compares the shape of two neighbouring revolutions as a whole and shows a number only if they are similar enough; its amplitude threshold is much lower (0.15 rad/s).

Two ways to check

Algorithm 2 shows a number averaged as the median of the events over the last 3 seconds; otherwise it would jump on every revolution. Algorithm 3 averages nothing after the calculation: it gets each number from the shape of two neighbouring revolutions, and the app shows it rounded and keeps it for 0.3 seconds. So the number can be compared with two things: with the instantaneous cadence in the labelling and with the cadence averaged the way Algorithm 2 does it. The first answers “how close is the number to the movement at that moment”, the second “how close is it to the averaged number as Algorithm 2 showed it”. Matches / disagrees, share of the whole pedalling time:

Instantaneous cadenceAveraged cadence
Algorithm 279% / 10%88% / 2%
Algorithm 386% / 4%84% / 6%

For Algorithm 2, when compared with the averaged cadence there are five times fewer disagreements: part of its “errors” was a difference in the way of averaging. For Algorithm 3 the picture is the opposite: it takes two neighbouring revolutions and does not average the number, so it follows the instantaneous cadence faster and looks slightly worse by the averaged method.

This can also be seen in the delay. I shifted the labelling in time and looked at which shift makes the reading match it best. The share of time within 3 rpm of the labelling shifted by 0, 1 and 2 seconds (only seconds where both values exist are counted):

Labelling shift0 s1 s2 sBest shift
Algorithm 2, all seconds88.7%93.6%95.7%about 2 s
Algorithm 3, all seconds95.8%94.7%88.7%0–1 s
Algorithm 2, accelerations and braking66.7%82.5%86.9%about 2 s
Algorithm 3, accelerations and braking90.6%88.4%69.1%0–1 s

Algorithm 2 lags behind the instantaneous cadence in the labelling by about 2 seconds, Algorithm 3 by no more than a second (the labels come in one-second steps, so I cannot say more precisely). The averaged labelling itself lags behind the instantaneous one by 1–2 seconds, roughly like Algorithm 2, and therefore it suits Algorithm 2 better.

So “better” depends on the checking method. I choose the instantaneous cadence as the main one: for voice cues it matters more to react quickly to a change of pace. But I show both methods: when compared with the averaged cadence, Algorithm 2 matches more often by 4 percentage points.

What remains unsolved

  • An independent check. The sensor lags, and the gyroscope gives the same signal as the app. A third source is needed: video, a power meter with a pedal sensor, or another sensor with an accurate clock. This is the weakest point of the article, and if you can help with such a recording, write to me.
  • Below 40 rpm. Almost no gain: it matches 7% of the time, and about 85% of the time there is no number. I need slow-cadence rides from other people.
  • Starts. It matches 42% of the time.
  • Weak phones. Algorithm 3 is computationally more complex than the previous one. The load on the processor and battery of a weak phone has not been measured: there is only a measurement on a computer (JVM), and no control ride on the Samsung SM-A715F.

What these numbers do not show

  • One main rider, one phone, the phone in a trouser pocket.
  • One crank sensor and one rule for calculating from its messages. Other sensors and bike computers may behave differently.
  • Testers' recordings add other phones and riding styles (on them Algorithm 2 matches the labelling 82% of the time, Algorithm 3 83%), but they have no sensor and no confirmation that it is really pedalling.
  • The app and the Python version, which the numbers in the tables come from, give the same results.
  • “Disagrees” means a disagreement with the labelling (instantaneous or averaged, as stated) and includes the smoothing delay.
  • Seconds depend on each other, they are not thousands of independent trials, so I do not give confidence intervals.
  • These are my own measurements, not a certified accuracy.

Try it and help

I especially need rides with frequent changes of pace and with cadence below 80 rpm: on slow riding the app detects it worse. Join the test

Cadence Coach is in open testing on Google Play. You need an Android phone and a Google account. Optionally you can send a ride archive: a file with a recording of the phone's sensors. What it contains and how to delete it is described in the research participation notice. Questions and feedback: [email protected].