This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF Toolbox app on IOS - CSCS Service - Speed calculation seems to be totally wrong?

I have a question regarding the nRF Toolbox App v5.0.2 on iOS 14.1 and the Cycling Speed and Cadence demo app. It appears to be that the km/h calculation based on the CSCS measurement is not correct. I would like to have a confirmation for this or an explanation what I am misinterpreting.

My approach:

I am sending values to the nRF Toolbox App - CSCS module every second. Basically I want to mimick the values of a good cyclist. So I am heading at 90 rpm crank revolutions and about 35-40 km/h. Using the standardized wheel type 700c this gives me a circumfence of 2.139m.

On every sending of the characteristic I increment the crank revolution by 1 and the crank wheel time by 0.666 (-> 1 revoluton = 0.66 seconds --> 1.5 evalution == 1sec). This is shown as a perfect 92 rpm cadence in the app (why it's 92 and not 90 I don't know, but "close enough" ;-) ).

In order to achieve the approximate km/h value of 35-40 in the nRF app I need to send a measurement of 12 revolutions per second which is totally wrong -> 12 revolutions * 2.136m * 3600 s = 92.275 km/h and not around 35-40km/h. But the app gives me 43 km/h as the achieved speed (so maybe 11 revolutions might do as well).

Using the Zwift app in comparison results in approx. 56 mph for the exact same measurements which is roughly the 90 km/h you end up when doing the maths above. See screenshot below.

Doing it the other way around gives: 4 revolutions per second * 2.136m * 3600 s == ca. 36 km/h, but when I set the increment to 4 revolutions with a wheel time of 1024 in the code I end up with 14.3 km/h in the app.

Changes to the wheel size do not seem to get honored until the app is fully terminated (disconnect does not seem to be enough and during a connection changes to the slider are not considered at all).

To make a clear point. I am not talking about the implementation in the code or the sending device at all. I verified the problem with the nRF52 DK as well - it's the app which seem to behave erratic with the speed calculation independent of the sending device. 

Screenshots show the same measurements once in nRF Toolbox app and in the Zwift App

Parents
  • LightBlue-20201108-1730.csv

    The attached file can be used as a data source in order to illustrate my observations

  • I think I can answer my own question, or in other words, show the error in the app!

    According to the CSCS profile, CSCP_SPEC_V10.pdf, p14, it says:

    "Calculation of speed at the Collector can be derived from the wheel circumference and data in two successive measurements. The Collector calculation can be performed as shown below: Speed = (Difference in two successive Cumulative Wheel Revolution values * Wheel Circumference) / (Difference in two successive Last Wheel Event Time values)"

    Lets take the observed value of 12 revs/s in this formula:

    12 * 2.312m / (1024/1024) = 27,744m/s * 3600s = 99878m = 99,8 km/h --> which is pretty exaclty the value Zwift (and the Tacx app print).

    Given 4 revs we get: 4 * 2.312m / (1024/1024) = 9,248m/s * 3600m = 33292m = 33,29 km/h -> which is my presumed and probable true result.

    What does the nRF Toolbox app print when I deliver 4 revs/s?

    4 * x / (1024/1024) * 3600 = 14400m = 14.4 km/h --> x = 1! The nRF Toolbox app seems to ignore the wheel circumfence of 2.312m in the calculation of the speed!

    This is consistent with my observation that changing the slider with the wheel size does not seem to have any drastic effect on the calculation and this is the bug in the app in my opinion...

Reply
  • I think I can answer my own question, or in other words, show the error in the app!

    According to the CSCS profile, CSCP_SPEC_V10.pdf, p14, it says:

    "Calculation of speed at the Collector can be derived from the wheel circumference and data in two successive measurements. The Collector calculation can be performed as shown below: Speed = (Difference in two successive Cumulative Wheel Revolution values * Wheel Circumference) / (Difference in two successive Last Wheel Event Time values)"

    Lets take the observed value of 12 revs/s in this formula:

    12 * 2.312m / (1024/1024) = 27,744m/s * 3600s = 99878m = 99,8 km/h --> which is pretty exaclty the value Zwift (and the Tacx app print).

    Given 4 revs we get: 4 * 2.312m / (1024/1024) = 9,248m/s * 3600m = 33292m = 33,29 km/h -> which is my presumed and probable true result.

    What does the nRF Toolbox app print when I deliver 4 revs/s?

    4 * x / (1024/1024) * 3600 = 14400m = 14.4 km/h --> x = 1! The nRF Toolbox app seems to ignore the wheel circumfence of 2.312m in the calculation of the speed!

    This is consistent with my observation that changing the slider with the wheel size does not seem to have any drastic effect on the calculation and this is the bug in the app in my opinion...

Children
No Data
Related