Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT+ Bike cadence

Rank

Total Posts: 23

Joined 2013-02-06

PM

Using the new plug-in library for cadence

cadPcc.subscribeCalculatedCadenceEvent(new ICalculatedCadenceReceiver() {
@Override
public void onNewCalculatedCadence(final long estTimestamp,
final EnumSet<EventFlag> eventFlags,
final BigDecimal calculatedCadence) {
// my processing...
}
});

got a negative value reported for calculatedCadence. Does this function account for roll-over in cadence count?

I must say the new plug-in interface is a BIG improvement over ANTRadio. Thanks for all the great work!      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

I noticed this hasn't been responded to yet, sorry. The plugins do handle roll-overs so I am unsure what might have caused this. I am unable to reproduce it by just running a cadence sensor and watching it. Are you able to provide more details on when you are seeing this? Are you still seeing it?      

Signature

Dynastream Developer

Rank

Total Posts: 23

Joined 2013-02-06

PM

I have only seen this once; just by chance, since I only record at 1/sec and cadence arrives 4/sec.
Here is the relevant section of the .tcx file that records speed, cadence, location, etc:
<Trackpoint>
  <
Time>2013-09-15T16:32:41Z</Time>
  <
Position> </Position>
  <
AltitudeMeters>285.0000000</AltitudeMeters>
  <
DistanceMeters>18547.8877109</DistanceMeters>
  <
Cadence>61</Cadence>
  <
Speed>2.2500000</Speed>
 </
Trackpoint>
 <
Trackpoint>
  <
Time>2013-09-15T16:32:42Z</Time>
  <
Position> </Position>
  <
AltitudeMeters>285.0000000</AltitudeMeters>
  <
DistanceMeters>18549.8936339</DistanceMeters>
  <
Cadence>-4055350</Cadence>
  <
Speed>2.2500000</Speed>
 </
Trackpoint>
 <
Trackpoint>
  <
Time>2013-09-15T16:32:43Z</Time>
  <
Position> </Position>
  <
AltitudeMeters>285.0000000</AltitudeMeters>
  <
DistanceMeters>18551.9295769</DistanceMeters>
  <
Cadence>60</Cadence>
  <
Speed>2.2500000</Speed>
 </
Trackpoint

and here is the code snippet that receives the calculated cadence value from the ant plugin:
public void onNewCalculatedCadence(final long estTimestamp,
  final 
EnumSet<EventFlageventFlags,
  final 
BigDecimal calculatedCadence{
  myBikeStat
.setPedalCadence(calculatedCadence.intValue());

  
{snip}

No other processing is done on cadence.
The code that assembles the cadence value into the .tcx file is
logout.writeBytes(CADENCE_START_TAG
    
Integer.toString(myBikeStat.getPedalCadence())
    + 
CADENCE_END_TAG); 

The javadoc says the cumulativeRevolutions (in onNewRawCadenceData) has Rollover: Every ~9 quintillion revolutions, but the ANT+ Device Profile for Bike Speed and Cadence says the rollover in hardware is 65536; unless the plug-in handles this? Have only seen this once; the cadence sensor had about 190 hours cumulative operating time.      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Well, I don't feel too bad in admitting that we haven't let the bike cadence run for 8 days in our previous testing smile I will find something around here to run that log with some logging turned on to see if I can reproduce.

We do use an internal accumulator that is backed by a java long. It seems you would need a lot longer than that to hit the rollover, but even if it was a rollover the negative value would remain negative and just keep incrementing from there. In this instance you reported you said you saw a single isolated negative, but was it followed by more negative values or just the one instance?      

Signature

Dynastream Developer

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Ok, managed to reproduce it. This will most likely be fixed in the next release of the plugins. Thanks for your report.      

Signature

Dynastream Developer

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Fixed now in a public release http://www.thisisant.com/forum/viewthread/4092/      

Signature

Dynastream Developer

Rank

Total Posts: 7

Joined 2021-09-29

PM

Good morning,
In the case of the bike cadence display, is it necessary to view the battery status? I saw that page 4 is optional, but also for the display? in this case the SD_0015 Invalid Data script passes only yes?

Thank you
Greetings      
RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

Per the profile doc "The minimum requirements for an ANT+ bike speed display are to receive and decode bytes 4-7 of each data page; and display speed to the user. The minimum requirements for an ANT+ bike cadence display are to receive and decode bytes 4-7 of each data page; and display cadence to the user."

SD_0015 states "If none of the fields are supported, press "Yes"" so you should be pressing yes if the display never shows "Battery Status".      

Signature

Ian Haigh