Gear Selection

by mechgt

Downloads: 2,603 (5) • Reviews: 3

Version:

1.0.4

Updated:

Jan 31, 2012

Plug-in concept: Gear Indicater

Plug-in concept: Gear Indicater

Postby DavidCHall » Sun Oct 28, 2007 6:00 am

Gear Indicater

An idea for a plug-in.... (Of course I have no idea if this is possible or how it may be coded!!!!)

It would be nice to be able to plot (graphically) the gear in use for a given activity.

In theory given cadence data, and wheel based speed activity data sourced from a Garmin computer one only needs the tyre size, front and rear teeth counts as fixed parameters to estimate the gear in use.
User avatar
DavidCHall
Donated!
Donated!
 
Posts: 977
Joined: Mon Sep 24, 2007 8:29 am
Location: Cape Town, South Africa

Postby 7270martin » Sun Oct 28, 2007 4:35 pm

I also like this idea!!

Before I bought a garmin computer, I felt attached to Shimano's bike computer called Flight deck, which displays the gear in use.

Especially when analyzing trainings on the same track (with a comparable condition state), such an analysis would help to better understand and interpret cadence and speed/evelation gained.

Unfortunately, I am not a programmer. Therefore, I am not in a position to realize such a feature. However, I am quite sure that many cyclists would appreciate such a feature.


Martin
7270martin
Donated!
Donated!
 
Posts: 244
Joined: Fri Sep 21, 2007 12:06 pm

Gear indicator plugin

Postby old_man_biking » Sun Oct 28, 2007 7:10 pm

Hi David,

yes this should be possible.
You have to indicate your chainwheel and sprocket sizes (# of teeth),
the tire diameter.
This could either be entered in the equipment notes in a given format.
Or the developper could create a settings page very much like the grid view that I have designe for my GPS2PowerTracks plugin.
I'd definitely prefer the second variant.

The output needs some filtering in order to correct phases when you don't pedal. This will lead to glitches in the cadence output of Garmin edge.

Sounds nice. Would be a fine little piece of work for someone who tries to get into ST plugin development.

A first step could be even easier:
Don't show gears but just the number of inches that you cover with a single revolution of your crank (don't know the English terminus, the German word for this is "Entfaltung").

Best regards,
old_man_biking
User avatar
old_man_biking
Donated!
Donated!
 
Posts: 5889
Joined: Mon May 28, 2007 8:07 am
Location: Munich, Germany

Gear Indicator

Postby DavidCHall » Fri Nov 02, 2007 4:07 pm

A long way short of a solution, but I've put some thought into the subject.

Excel:

http://www.dch.co.za/GPSPowerTrack/BicycleGearsV3.xls

[Edit: (Thanks for constructive suggestions via PM)

http://www.dch.co.za/GPSPowerTrack/BicycleGearsV4.xls

Added print ranges and settings.
Added comments (re what Range and other things mean).
Added speed at cadence for lowest gear as well.

End edit]


This MS Excel 2003 is a handy graphical gear calculator: The formulaes are protected, but the password is blank. There is an included table of wheel diameters vs tyre size.

Graph Format Suggestion:

http://www.dch.co.za/GPSPowerTrack/Gears.JPG

Calculations:

Formulae A:

{Wheel Circumferance (Meters)} = {Wheel Diameter (Meters)} * Pi

"Wheel Circumferance" is typically given by the tyre manufacturer for each size tyre.

Formulae B:

{Distance moved per pedal crank revolution (Meters)} = {Wheel Circumferance (Meters)} * {Teeth on chainwheel} / {Teeth on rear cassette}

This value should be calculated for each gear and plotted as the right hand y-axis.

Formulae C:

{Distance moved per pedal crank revolution (Meters)} = {Speed (km/h)} / {Cadence (rev per min)} / 60 *1000

This value should be plotted as a function or the activity time (duration) or activity distance on the left hand y-axis.
Last edited by DavidCHall on Sat Nov 03, 2007 3:39 am, edited 1 time in total.
User avatar
DavidCHall
Donated!
Donated!
 
Posts: 977
Joined: Mon Sep 24, 2007 8:29 am
Location: Cape Town, South Africa

Postby old_man_biking » Sat Nov 03, 2007 12:47 am

Hi David,

you already did half the job.
Need some help concerning C# and .NET development?
It's never too late to become a software developper :wink:

Best regards
User avatar
old_man_biking
Donated!
Donated!
 
Posts: 5889
Joined: Mon May 28, 2007 8:07 am
Location: Munich, Germany

Gear Indicator

Postby DavidCHall » Sat Nov 03, 2007 11:19 am

Need some help concerning C# and .NET development?


The last time I got into any serious development was when Pascal 7.0 was the latest and greatest working environment going. "A little rusty and out of date" doesn't begin to describe my current situation :!: Not to be duanted by reality I've downloaded the MS Visual Studio Express C# environment and have started tinkering at "hello world" level. Next up I've got hold of the "starter" plug-in (CSV export??) and will see if I can destroy my computer by bludering in where experts would wisely fear to venture.

In short: YES!! Any advice, help, direction greatly appreciated.
User avatar
DavidCHall
Donated!
Donated!
 
Posts: 977
Joined: Mon Sep 24, 2007 8:29 am
Location: Cape Town, South Africa

Wow!

Postby old_man_biking » Sat Nov 03, 2007 2:08 pm

Hey,
I was just joking and you are getting down to business without hesitation.
Good guy!

Maybe Gerhard could supply some example code for you.
Remember the line charts for weather information in my plugin? I could create a generic control out of it that can be used by others to build arbitrary activity detail pages with line charts.
You can of course build upont the Plugin API, but this control would already implement most of the basic plumbing necessary.
The benefit of using it: less work and homogeneous look and feel
The price: less flexibility.

Concerning your Turbo Pascal experience.
In fact the "Common Language Runtime" concept of .NET is a revival of good old Turbo Pascals intermediate code concept. So some sentimental feelings might come up.
N.B. these plugins are my first steps into C# and .NET as well. So you can learn the basics without too much effort.

Best regards to ZA,
old_man_biking
User avatar
old_man_biking
Donated!
Donated!
 
Posts: 5889
Joined: Mon May 28, 2007 8:07 am
Location: Munich, Germany

Gear Indicator

Postby DavidCHall » Sat Nov 03, 2007 3:05 pm

Remember the line charts for weather information in my plugin? I could create a generic control out of it that can be used by others to build arbitrary activity detail pages with line charts.


Certainly if I am to progress I will need to implement a graph: And certainly the work already done for GPSPT is impressive!! At some point I may need to extend to be able to plot as a histogram, but that might be phase n, at some point in the future.

Equally I will need a settings page: Very similar to what you have done to enter tyre size (Unless you already publish tyre diameter / circumference somehow? I assume GPSPT must take tyre size into account somewhere in the power formulae? Or not?) Of course I will need to still enter gear teeth numbers elsewhere irrespective.

Any sample code or access to existing work / controls would be greatly appreciated.
User avatar
DavidCHall
Donated!
Donated!
 
Posts: 977
Joined: Mon Sep 24, 2007 8:29 am
Location: Cape Town, South Africa

Postby gerhard » Sat Nov 03, 2007 3:36 pm

Send a message to admin and he will register you as a developer when he is back. You will then get access to the dev forum, that is closed for others. (It is not that much activity there actually, but it is good to separate user and dev questions. I believe the access should be open.)

In the meanwhile I can supply some examples. Will send PM.
old_man_biking should be able to provide much better examples if he decides to clean up and share the code.

The ST API is well designed to handle manipulation of the data in ST. You have access to all information and can do almost everything, however, some tasks is more difficult than others, more like a stand alone application.
Some nice additions have already been identified and admin has said he plans to do some of them later.
User avatar
gerhard
Contributor!
Contributor!
 
Posts: 2115
Joined: Mon Nov 27, 2006 7:07 pm
Location: Sweden

Re: Gear Indicator

Postby texmurphy » Sat Nov 03, 2007 3:42 pm

DavidCHall wrote:The last time I got into any serious development was when Pascal 7.0 was the latest and greatest working environment going. "A little rusty and out of date" doesn't begin to describe my current situation

Hmm, I have fond memories of C aka PDP-11 Macro Assember from my software development days.
User avatar
texmurphy
Donated!
Donated!
 
Posts: 1860
Joined: Wed Jul 05, 2006 7:38 pm
Location: Maryland, USA

Re: Gear Indicator

Postby old_man_biking » Sat Nov 03, 2007 4:03 pm

DavidCHall wrote:Equally I will need a settings page: Very similar to what you have done to enter tyre size (Unless you already publish tyre diameter / circumference somehow? I assume GPSPT must take tyre size into account somewhere in the power formulae? Or not?) Of course I will need to still enter gear teeth numbers elsewhere irrespective.
Any sample code or access to existing work / controls would be greatly appreciated.


Hi David,

no, I really don't use tire size as a parameter for power calculation, at least not explicitly.
Go to the settings page and hover the mouse over an entry in the "Tires" gridview. The tooltip tells you which parameters I use: only rolling drag coefficient and area (= width*height).
When you get into graphs later on I could try to tune my Chart Control to a generic control that could be reused by you.

Best regards,
old_man_biking
User avatar
old_man_biking
Donated!
Donated!
 
Posts: 5889
Joined: Mon May 28, 2007 8:07 am
Location: Munich, Germany

Postby clackerz » Tue Dec 18, 2007 6:09 pm

I'd like to give this a bump!
I'm interested from a point that if the gear is known, the cadence is known, the tire size is known, thus the number of wheel rotations can be calculated based on this info, giving you a distance covered.
I use a trainer on bad weather days/recovery etc, and it would be great to know this info.
My bike computer is front wheel, so I can't get this info normally!
User avatar
clackerz
Contributor!
Contributor!
 
Posts: 1292
Joined: Sun Jun 24, 2007 10:26 pm
Location: Melbourne, Australia

Postby racerfern » Tue Dec 18, 2007 7:04 pm

Turbo Pascal? Oh my goodness. Is there any hope for me? My last languages were Fortran WAT IV or V (can't remember) and Clipper dBase.

Keep it up all you current and future hackers. The world belongs to you. Look at where ST2 has gone in a few short months.

Congratulations all.
Fernando
racerfern
Donated!
Donated!
 
Posts: 889
Joined: Tue Jun 06, 2006 6:49 pm
Location: Newport Beach, CA

Postby 7270martin » Wed Sep 09, 2009 7:54 am

Sorry for raising such an old topic again. But I'm still very interested in it. I would appreciate very much a plugin which enables post analysis for gears.

Reasons: please see the following links:

http://www.ibikeforum.com/viewtopic.php?f=5&t=900
(especially comments by oldfartrunner)

http://code.google.com/p/st-filteredsta ... tail?id=21
(with a chart example at the bottom: Mappe2(1).xls -> this file was recorded by a indoor cycling machine with gears, therefore, the gear values didn't need to be calculated manually for the chart)

Edit:
The shimano flightdeck provides such data, see images at http://images.google.ch/images?hl=de...-8&sa=N&tab=wi

I already have two bike computers on my bike (of course an Edge 705 and an Ibike Areo because of its wind measurement function) and I don't want to have a third computer and a cockpit like an airplane...

In addition, as ST is my primary analysis software, it would be best if the analysis could be done within ST.

Am I the only one who is interested in that?
Last edited by 7270martin on Wed Sep 09, 2009 8:56 am, edited 3 times in total.
7270martin
Donated!
Donated!
 
Posts: 244
Joined: Fri Sep 21, 2007 12:06 pm

Postby DavidCHall » Wed Sep 09, 2009 8:18 am

7270martin wrote:I'm still very interested in it. I would appreciate very much a plugin which enables post analysis for gears.

The shimano flightdeck provides such data


A few thoughts:

DotRacing from OMB allows you to plot "Distance per Crank Revolution": Effectively an indication of gear for your activity.

After a careful look at the graph one soon notices that it doesn't tell you very much:

# The indication is less than precise, perhaps due to the latency, averaging, and sampling of the two input values: Speed, and cadence.
# Even once you know which gear you might have been using, the usefullness of this data is still debatable.

A more interesting chart compares Speed and Cadence as either a scatter diagram, or histogram: Adding colour to the points as a function of activity duration, distance, elevation, or some other factor gives some indication of which gears may be favoured, and why: Which is actually useful in some way.

I've created a few of these charts as Excel graphs: If interested respond to this post to encourage me to find my last spreadsheet and publish a few illustrations.


The Shimano ST levers have contacts that allow a computer to read the actual gear state: Which is a much better way to do things than deducing this from cadence / speed. As far as I know only Shimano Flightdeck reads this data, and there are no devices that read and record the data.

It might be nice if Garmin would open the ANT+ interface to other logging devices: Which could allow somebody to build a device that would read gear position, and log to an Edge 705. Of course this might also be used to log ambiant temperature, humidity, wind speed and direction, and perhaps other data.
User avatar
DavidCHall
Donated!
Donated!
 
Posts: 977
Joined: Mon Sep 24, 2007 8:29 am
Location: Cape Town, South Africa

Postby 7270martin » Wed Sep 09, 2009 8:50 am

Hi David

Thanky you for your interesting response.

In garmin's forum, I suggested that garmin should implement such a function as the edge probably does better calculations as post-analysis with smart-recording files. See my post on 9/7/2009, https://forums.garmin.com/showthread.php?t=137&page=3
But I guess, a quick implementation is rather improbable.

I like the idea of having scatter charts in ST with regression analysis and the color functions as described by you. Especially in combination with an elevation profile (like power analysis by OMB), this would give interesting results.

But in addition: Why not smooth out the Distance per Crank Revolution values and summarize them in classes (average revolution calculated based on the number of teeth etc., as entered in the settings pages, +- a certain standard deviation). I still find histograms of gears quite interesing, especially in combination with ascent/descent in %.

Do you know whether Shimano's Flightdeck computer also record its data. Can the data be exported to a computer program? If yes, which one?
7270martin
Donated!
Donated!
 
Posts: 244
Joined: Fri Sep 21, 2007 12:06 pm

Postby texmurphy » Wed Sep 09, 2009 9:14 am

7270martin wrote:I like the idea of having scatter charts in ST with regression analysis and the color functions as described by you. Especially in combination with an elevation profile (like power analysis by OMB), this would give interesting results.


I have exported fitlog of activities, then rearranged the tracks to put cadence in heartrate, (and other such fun using an xml editor) followed by re-import. Then I applied omb's power analysis plugin. Result was not that useful.

Another approach is to use the Cadence From Speed Plugin combined with the Filtered Statistics Plugin. Requires knowing your gearing and rearranging your speed zones to correspond.

Problems with deriving bicycle gear selection
    Close gear ratios make for much overlap;
    GPS error makes most speed data very noisy, especially under tree cover or when riding areo;
    Device sampling rates (e.g. "Smart"/"1 second") and device smoothing of both Cadence and Speed cause more error;
    Coasting or light pedeling in a pace line will be mis-reported.
User avatar
texmurphy
Donated!
Donated!
 
Posts: 1860
Joined: Wed Jul 05, 2006 7:38 pm
Location: Maryland, USA

Postby 7270martin » Wed Sep 09, 2009 9:52 am

It's not that easy to interpret a power/cadence scatter chart, see http://anonymous.coward.free.fr/wattage ... plots.html

Reason: Besides cadence, torque/gear ratio is an important factor for power.
This is why I wrote an enhancement suggestion on the quadrant analysis, see
http://www.zonefivesoftware.com/SportTr ... php?t=6346

I would find it interesting to compare ascent in % with gear ratio in a scatter chart and compare the result to the same ride of previous trainings.
Would be very cool if a scatter chart analyzer plugin could be realized, where the user can choose which values to compare and based on what the points should be colorized (time, or other data such as slope in % etc.).

But I agree with you regarding the mentioned problems regarding the calculation of gears. But with smoothing over some time (e.g. 10-30 sec) or distance, it should be possible to calculate the gear ratio and finally the gear used. Of couse this is only an approximation. But an approximation is better than nothing.

To get correct results, one needs probably a shinamo flightdeck. But for my purposes, it needs to record and export the gear usage. I'm still not sure if this is possible.
7270martin
Donated!
Donated!
 
Posts: 244
Joined: Fri Sep 21, 2007 12:06 pm

Postby mechgt » Wed Sep 09, 2009 9:58 pm

Here's a graph I created covering 15 minutes of data at 1 second recording. I'm not exactly convinced of how accurate/useful all this is but here goes.

Image
1 Second Recording (above)
Elevation = Gold line
Raw Gear ratio (expressed in meters traveled/crank revolution) = yellow dots
Guess of gear choice (using vlookup of actual gearing options) = red dots

Left Y axis is m/rev (gear ratio), lower X axis is seconds, secondary Y axis is elevation

Smart Recording (below)
Image
Enhance SportTracks with Training Load, Fit Plan and more plugins at mechgt.com. Garmin FR310XT & iBike iPro
User avatar
mechgt
Donated!
Donated!
 
Posts: 1366
Joined: Wed Sep 26, 2007 2:13 pm
Location: Atlanta, GA, USA

Postby mechgt » Wed Sep 09, 2009 10:01 pm

From the charts above, with 1 second recording (top chart), you can somewhat see me switching to easier gears as I climb up hills, and faster gears while descending (that's pretty neat).

However the smart record data (bottom chart) looks almost useless to me...
Enhance SportTracks with Training Load, Fit Plan and more plugins at mechgt.com. Garmin FR310XT & iBike iPro
User avatar
mechgt
Donated!
Donated!
 
Posts: 1366
Joined: Wed Sep 26, 2007 2:13 pm
Location: Atlanta, GA, USA

Postby 7270martin » Thu Sep 10, 2009 3:45 am

@mechgt
Thanks for the interesting graphs. I also did some calculations in excel (also with vlookup) and noted similar results: Such a calculation is better with 1 sec. recording than with smart recording. Maybe it needs a moving average of a few seconds in order to get better results.

I wonder how the distribution of the gear ratios differs between smart recording and 1 sec recording (for exactly the same track)?

Nevertheless, the result with 1 sec. is pretty nice, isn't it? Based on this data, you could create some tables and graphs saying e.g
a) which was the average gear ratio for a certain range of ascent in % and vice versa
b) average speed per gear ratio
c) average cadence per gear -> need to shift better?
d) How much time spend per gear
e) how much distance or elevation gained per gear
f) scatter chart to compare slope and gear ratio, coded with colors based on elapsed time to know where it happened -> non-correlating valutes are due to higher rolling resistance or wind etc.

Especially for mountain biking, this would be interesting data, when comparing tracks with prior trainings on the same track. You could see the influence of different weather situations and therefore, different rolling restistance (e.g. mud vs dry).

I would appreciate such an analysis within ST very much!
7270martin
Donated!
Donated!
 
Posts: 244
Joined: Fri Sep 21, 2007 12:06 pm

Postby mechgt » Thu Sep 10, 2009 6:44 am

Problem is that I question the validity of the data. Especially if you want zone distribution details (time in each gear, etc) Seems like it shows general trends alright IF you have 1 second recording (which everyone is advocating against now, and newer Garmin models are going away from), but I don't know that the details can be that accurate.

My calculation/charts uses GPS for the distance measurement which inserts uncertainty at this level of detail right off the bat. I wonder if we had the speed track created from garmin if this would be any different; I had to create the Distance track from the GPS route, rather than it being imported directly from my watch.
Enhance SportTracks with Training Load, Fit Plan and more plugins at mechgt.com. Garmin FR310XT & iBike iPro
User avatar
mechgt
Donated!
Donated!
 
Posts: 1366
Joined: Wed Sep 26, 2007 2:13 pm
Location: Atlanta, GA, USA

Postby 7270martin » Thu Sep 10, 2009 7:22 am

I'm aware of the fact that distance measured by GPS might be imprecise in certain conditions. However, many people said that the distance calculated by the garmin units is very accurate as long as you don't have too many narrow curves (as on a 400m track-and-field run) or a lot of trees or skyscrapers etc.

Therefore, the algorithm used by Garmin seems generally quite good. Especially when using a GSC-10 speed and cadence-sensor, the results should get even more precise. A calculation based on gps-distance might not be perfectly corerct but it delivers a good approach to determine the gear ratio. That is alright for me.

Of course, for such a calculation, the best thing is to measure it the traditional way (by magnet) or even mechanically (Shinamo).

But don't forget: There are also many users that use Sporttracks in combination with Polar, SRM, Powertap, Ibike which measure the distance not based on GPS.
7270martin
Donated!
Donated!
 
Posts: 244
Joined: Fri Sep 21, 2007 12:06 pm

Postby mechgt » Thu Sep 10, 2009 7:43 am

7270martin wrote:...Especially when using a GSC-10 speed and cadence-sensor, the results should get even more precise.


This is what I'm using, however somewhere between my Garmin and ST the distance track (data track picked up by speed sensor) is discarded. I'm assuming that ST decided there was no use for this because it had GPS and thus doesn't import it. I'm planning to do this same route again tonight, and I should be able to modify my LinuxGarminImport plugin to import the data directly from the speed sensor also and record it as the distance track. I'll be sure to put it on 1 second recording. We'll see what that turns out.

For anyone interested, here's my spreadsheets if you want to see if you can analyze the data any better:
OpenOffice (recommended)
Excel (This one is converted from OpenOffice, so I didn't test it and the charts may be messed up)
Enhance SportTracks with Training Load, Fit Plan and more plugins at mechgt.com. Garmin FR310XT & iBike iPro
User avatar
mechgt
Donated!
Donated!
 
Posts: 1366
Joined: Wed Sep 26, 2007 2:13 pm
Location: Atlanta, GA, USA

Postby PissedOffCil » Thu Sep 10, 2009 10:30 am

This plugin would clearly be useful but again there are so many problems that I feel it would be very unreliable. These problems have been noted by texmurphy and seem to be highlighted by mechgt's graphs. There is also the problem of having the exact same ratio on 2 different gears (like 44-22 and 32-16) In theory it doesn't really change anything as you get the same 2:1 ratio but in practice it changes everything because it might require a front shift for the next hill instead of a rear shift. I would also add that this plugin would clearly be interesting for MTBing but the sources of error are even greater because of slippery roots/rocks/dirt that can cause false wheel revolutions and the shifts are so frequent.

Anyways it might be worth giving it a try but I'm not starting this in the near future as I doubt the results and I've got 2 other plugins that will be coded first.
User avatar
PissedOffCil
Donated!
Donated!
 
Posts: 1824
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Next

Return to Gear Selection

Who is online

Users browsing this forum: No registered users and 0 guests