Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

no events from CalculatedCrankCadence method

Rank

Total Posts: 23

Joined 2013-02-06

PM

I'm not receiving any cadence events from the onNewCalculatedCrankCadence method in AntPlusBikePowerPcc using a Stages power meter and Ant plug-in version 2.2.0

myCode:
powerPcc.subscribeCalculatedCrankCadenceEvent(new ICalculatedCrankCadenceReceiver() {
   
// This data can only be sent by crank torque power sensors
   
@Override
   
public void onNewCalculatedCrankCadence(final long estTimestamp,
     final 
EnumSet<EventFlageventFlags,
     final 
DataSource dataSource,
     final 
BigDecimal calculatedCrankCadence{
    Log
.d(APP_NAME"Power Calculated Cadence: " calculatedCrankCadence.intValue());
{snip} 


I do receive cadence events via the InstantaneousCadenceEvent interface, but only from the POWER_ONLY_DATA dataSource. The Stages power meter also transmits the Standard Crank Torque Main Data page 0x12 according to their support engineer.

I receive cadence events via InstantaneousCadenceEvent on both Data Page 0x10 and 0x11 with the PowerTap G3 wheel torque power meter.

Is it possible that CalculatedCrankCadence is looking for data page 0x12 and not finding it? Surprising that the java doc says this is the recommended method if it relies on optional data pages.      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

I'm having some difficulty replicating this bug, could you detail which phone you're using and the circumstances in which you see this issue?

Do you still receive calculatedPower from CRANK_TORQUE_DATA?

Does this also occur using an ANT USB stick and SimulANT+ to simulate a crank torque power meter?

If you have time, could you also use SimulANT+ and simulate a Bike Power Display to capture ANT packets as a DeviceX.txt file for a couple minutes? This would be extremely helpful as well.

Thanks      
Rank

Total Posts: 23

Joined 2013-02-06

PM

Finally investigated this problem: to get CRANK_TORQUE_DATA messages one must use .subscribeRawCrankTorqueDataEvent(), even without any code in the onNewRawCrankTorqueData() { } receiver! It is not sufficient to just .subscribeCalculatedCrankCadenceEvent() and .subscribeCalculatedPowerEvent()...

Now I receive CalculatedCrankCadence, CalculatedPower and InstantaneousCadence events from CRANK_TORQUE_DATA dataSource. I don't think this requirement is documented in those methods. Presumably to get WHEEL_TORQUE_DATA events one should subscribe to RawWheelTorqueDataEvent().

Another issue:
With the Stages crank power meter (with SW rev 21) when cadence is zero, the InstantaneousCadence from CRANK_TORQUE_DATA retains its last value and doesn't drop to 0, even though InstantaneousCadence from POWER_ONLY_DATA does return 0. Then no calculatedCrankCadence or calculatedPower events are received. This makes it difficult to report a 0 power or cadence value when user stops pedaling.      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi,

Thanks for investigating this issue, the calculated data events are designed to be used without being coupled to the raw data receivers. This issue only affects crank torque data and will be fixed in the next release of the plugin service.

Regarding your other issue, the instantaneous cadence event should only be used when the calculated cadence event is not available. The instantaneous cadence event does have an issue where it is sending both the power only and crank torque data page versions, and is updating even when the event count has not changed. This will also be fixed in a future version of the plugin service.

Concerning the lack of events when the user stops pedaling, this is related to how the sensor and bike power device profile work. For a time synchronous power meter, the events occur at a regular time interval, so the sensor sends new data at a regular frequency.
For an event synchronous power meter however, each data update occurs per each revolution event (or other physical indicator like 1/2 rev, etc). This means as the user slows down, the time between events slows down, which means at very low power close to 0, events may take long periods of time to come from the sensor.
The plugin does not send 0 when this happens in order to preserve the small amount of accumulated power in case the user was coasting and starts pedalling again later, in which case the next event the sensor sends will average power over the time coasting.

There is a recommendation for event based power meters to automatically send a 0 value when they've stopped after a certain period of time but it does not appear that your power meter does that.

My suggestion then depends on if your app is displaying power data or recording power data. If your only displaying power data then generally the standard practice I've seen is to show coasting or 0 or stopped to the user after you haven't received a new calculated data event for 3 seconds using a Timer or Handler. This generally correlates to around 5W or less.
If your recording power data then you don't want to arbitrarily place any 0's in the data, as instead the plugin will be sending averages during a user's coasting period.

For more details you may refer to the Bike Power Device Profile.

Cheers      
Rank

Total Posts: 23

Joined 2013-02-06

PM

Thanks. Just to confirm: I am receiving WHEEL_TORQUE_DATA events without subscribing to RawWheelTorqueDataEvent().

Any time schedule for the next Ant plugin release?      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Thanks for the confirmation. The next ANT+ Plugin release should be within the next few months at the latest.

If you'd like to beta test any upcoming changes that may also be arranged through ShaneG.      
Rank

Total Posts: 23

Joined 2013-02-06

PM

Captured several minutes of Stages power meter messages via PC ANT stick and ANT+ Display Simulator (Bike Power Display). Not pedaling at first, constant ~100 Watts for a few minutes, then coasting for a minute or so...

My app does see CRANK_TORQUE_DATA power values and I monitor raw power messages to detect coasting condition.      

File Attachments

Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Thanks for the device log, it appears that Stages has a small implementation issue where they continue updating page 16 when it should be updated once, as it appears the power meter is supposed to be event synchronous.

We will be implementing coast detection directly in the plugin. When the plugin detects an unchanging event count for 3 seconds it will automatically send a zero value on the receiver with a dataSource of "COAST_OR_STOP_DETECTED" which will also allow for data accuracy if the values are being stored as it can be filtered out for archive.