Sublimis / UrbanBiker

Urban Biker issue tracker and Knowledge Base
https://urban-bike-computer.com/
18 stars 4 forks source link

Power readings never negative in gpx and Strava #193

Closed DoofyOnABike closed 6 months ago

DoofyOnABike commented 1 year ago

I'm currently having a problem with my power readings. Firstly, I don't have a power meter, so all the power readings in Urban Biker are calculated using my cadence/speed and heart rate sensors and my RuuviTag (I assume). The values I get in Urban Biker seem reasonably plausible. That is, going uphill the values increase and going downhill the values are negative. Now my problem: I have started exporting my rides to Strava, which seems to work fine, except that the power values are not exported correctly, i.e. they never become negative. The lowest value the power values reach is zero. So the average power calculated by Strava is much too high. I then tried exporting the gpx file of my ride and using a Python script to display the power values, but the PowerInWatts column in the gpx file never goes negative either. Is there a way to fix this?

Sublimis commented 1 year ago

Hi, so if I understand correctly, your main goal is to adjust the Strava calculated average power? Your problem is almost certainly not sub-zero values in the GPX file. When calculating the average power, only positive values are taken into account anyway (otherwise the average would always be around zero, based on the energy balance).

PowerInWatts GPX extension field is of type "unsignedShort" in the standard, as you can see here: https://www8.garmin.com/xmlschemas/PowerExtensionv1.xsd (view page source). This means it only takes values in the range 0-65535. If we were to enter negative values there, we would violate the standard, and various software would probably have problems with this (eg. Golden Cheetah).

IIRC, I did a test with Strava a few years ago by uploading negative power values, but it didn't accept those either, it just set those values to zero.

Note that Strava gives you two "average power" values. One is the Weighted Avg Power, and you really shouldn't compare it to the average value given by Urban Biker. The second is the Power Avg in the table below (when viewing the ride overview on Strava), and this is the correct one.