Gear Indicator?

edited February 2014 in RaceChrono for Android
Any way we can do a simple calculated gear display? When logging both RPM and Speed, a simple ratio of the two would provide the gear..... The user could enter the number of gears and the ratio for each. The user would have to go log some rpm and speed values for each gear and compute the ratio, then the code would test if the ratio was close to one of the gear ratios....

This would be a really cool feature!


  • edited February 2014
    This is something that has been in my mind and I will absolutely be doing it!
  • edited February 2014
    Cool. I am actually thinking of picking up a teensy 3.1 board to read my gear position sensor, and translate it into a single voltage on one wire....Right now it is 6 wires....:(

    I might use the teensy to do some other things too....
  • Did this ever get incorporated?
  • It didn't. But it is still a good idea and on my backlog. Unfortunately there's only one me, and all the features need to be prioritised. Now that we have video overlays and all, I think this is something I should do in higher priority :)
  • +1 for a calculated gear indicator overlay
  • +1 but no need to go for a drive etc. Would just need a settings page to configure gear ratios and final drive yeah? I supposed the next thing people ask for after that is profiles so you can save multiple cars, the features never end haha
  • edited May 2015
    In addition to gear ratios and final drive, you would also need to know the tire diameter. But this just results in a RPM/Speed ratio that can be found mathematically by multiplying those variables together, or empirically as described below.

    Another approach would be a screen that lets you Calibrate 1st, 2nd, 3rd, etc. gears. Because the RPM/Speed ratio is a constant at all times in a particular gear, the user could drive in 1st gear, hit the 'Calibrate 1st Gear' button, then stay in 1st gear for a few seconds until a 'beep' is heard. Then shift to 2nd gear, press 'Cal. 2nd Gear' etc. Rinse and repeat for all other gears.
  • edited November 2015
    Just a bump on this. And to go further on ratios etc. This would not be complicated as working ratios and tyre sizes. As above, and possibly even simpler. A selection of how many gears, then a short test run from 1st to top and it would be easy for the software to work out which speeds relate to which revs and it should work with no further programing.
  • Hi aol,
    Thanks for the amazing work.
    Now that v5 is released is this feature back on your radar?
  • I could look at it again. The readers are getting faster allowing more accurate RPM/speed value.
  • Well not on my Daytona but that's OK, even the integrated one on the dashboard is laggy and buggy ^^
    I get about 2hz on rpm and speed
  • Yep, that getting faster bit applies only to vehicles with CAN-BUS ...
  • hello @aol , did you ever get somewhere with the rpm/speed gear indicator? thanks
  • Still on my TO-DO list, sorry. I've just dusted it and moved it higher on the list :) While it's not done yet, it's now much easier to add than it used to be, as the app has been almost completely overhauled under the hood in last 2-3 years.
  • good to hear thanks, happy to beta test if you need at some point
  • Tried that myself.
    There are (at least) two problems:
    - You once need the ratio (maybe by a "learning meachanism")
    - Without Clutch information, you´ll always have wrong values

    For my motorbike it looks like the following (simplified):
    uint8_t GetCurrentGear() {
    uint8_t ratio = rpm / speed;

    if (ratio >= 130 && ratio <= 180)
    return 1;
    if (ratio >= 88 && ratio <= 120)
    return 2;
    if (ratio >= 70 && ratio <= 80)
    return 3;
    if (ratio >= 60 && ratio <= 69)
    return 4;
    if (ratio >= 55 && ratio <= 59)
    return 5;
    if (ratio >= 48 && ratio <= 54)
    return 6;
    return 0;

    It works good enough, after two testrides and a tiny bit of shifting the ratio-ranges.
    But during a shift or pulling the clutch when rolling out, the gear sometimes get crazy.
    Instead of returning 0, I think it would be better to return the last known value.
  • In the Torque plugin Racingmeter it works by entering the number of gears and the speed at a certain RPM for each gear (to have the overall gearing, including wheel size etc).
    On top of that, there is an accuracy parameter.

    Not sure whether it uses OBD/CAN speed or GPS speed (with/without correction factor).
  • I suppose it would need some form of smoothing of the reading to avoid going crazy during shifts, maybe work with 1-2 sec averages. I can provide session files if you need to test it
  • My idea is to do this without the need to configure the gear ratios. Just through data analysis. The configuration is the part I hate about this on the other apps, and is the reason why it's not in RaceChrono. No idea if this is feasible yet, but it should be...
  • edited April 2021
    I guess that would be good for very accurate readings, but it would still be good to have something like an expert mode to configure ratio ranges and accuracy margins for slower/older HW
  • Sure, that´s possible. There are several aftermarked gear indicators available, which have a "learning mode".
    To prevent them from storing wrong ratios during a gear change, they´d have a period of time, this ratio must be present.
    Additional to that, there will be a tolerance.
    This mode will be started once and then you have to shift through all gears for storing.

    I´ve also started my coding like that. A sortable array with a fixed tolerance and a method to check a bit of logic validity.
    The idea behind that was to measure the gears on every startup, without any stored/fixed ratios. If a gear was skipped, it will sort the array right, during the next cycle.

    But it began with clutching in on startup, which made bad values.
    Or double-clutch on a downshift. I guess the reverse on a car will also let the values went crazy.
    Neutral gear, rolling onto the trafficlights.
    My slow bike ECU, with just ~7 values per second.
    And measured ratios, too close to each other. On my bike 5. gear between 55 - 59.
    If you store 57 as a ratio, and a tolerance of 2 for that gear (it will differ off course from transmission to transmission). Next time, storing 56 with the same tolerance will make you jump between 4. and 5. gear.

    For those reasons, I decided to take my datalog, a video and approximated the ratios.
    - Just to tell my journey and prevent you from doing it the same way ;)
  • Hi guys, my 2 cents (just brainstorming)

    @TriB I think on car, or at least mine, would be easier due to the clutch switch accessible via CAN-bus. My car also has a switch checking if the car is in gear or neutral, I think these switches are needed on all manual transmission cars with cruise control or ready to mount cruise control.

    The thing is that usually the speed and the engine rpm are broadcasted on very fast channels (in my case 100 Hz, and they are also broadcasted on the same ID), while the clutch switch is sent on slower channel and with different time stamp.

    I think the gear indicator should be a math channel all managed by RaceChrono (sorry @aol more work for you :D) and not by the device, without clutch input (that may be not available/may be too slow), in this way you may also add a gear indicator on past sessions!

    @mmrizio I would use ECU speed, since it is mechanically linked to rpm via transmission, while GPS may be subject to variation... I plotted RPM vs Speed both ECU and GPS and using the ECU you get nice straight line, especially on low speed, while with GPS it's not that neat and also you may lose connection.

    Some idea:

    - Do not calculate for speed < 10 km/h (who cares!!) or rpm below a certain threshold (i.e. 1000 rpm?)
    - I think you can take 2 subsequent points in time, speed and rpm, and calculate the slope and X intercept of the line. If you are in gear the line is going to intercept X axis at 0 (with tolerance), while if you upshift you'll have a nearly vertical drop during clutch time, and a spike in downshift when rev-matching. Whatever action you are doing when you press the clutch the subsequent RPM-vs-speed points are describing a line that is not going to intercept X at 0... Maybe this is enough to discard clutch time values, without involving averages. If subsequent values are the same you fall back on previous slope and intercept calculation.
    - I think just checking the RPM-vs-speed slope, with some tolerance, you can identify the different ratios, than is just a matter on where start to count :smile: this may be a manual input, for each session you can indicate the minimum or maximum gear you have used (i.e. I never use my sixth gear, in some track I hardly use the fifth... I think it's easy to remember this things at the end of a session)
  • edited April 2021
    Thank you guys for the ideas! I think the minimum gear used is great. If someone misses one between, they're just being stupid :) I don't think maximum is needed.
  • not impossible to skip gears when downshifting on a bike, take magny-cours 6th to 1st braking at the end of the not-so-straight into the super-tight hairpin, you can probably skip 5th and maybe 4th with a slipper clutch to save a bit of time and wrist pain, but all gears will be used on the way up for sure. Can't wait to see what you come up with!
  • edited April 2021
    I'm not talking about some times skipping a gear, but rather never using one in between. :)
  • edited April 2021

    I calculated the ratios and use dashware to do the math and display it in the dash area of the overlay. See example here.

  • Looks great @TAD158 !

    On a track with my Gsx-R600 I can just rely on the gear from my ECU data. Independent which change on the transmission I did. It even knows the gear on the dash, in the exact moment I put in 1st.
    My Kawasaki went crazy, since I changed the rear sprocket. That´s why I must calculate it on my own.

    @aol you were right! I was testing a lot on the road, and it´s common to just shift 2 gears at once, after accelerating quite hard ;)
    But on a track (where racechrono belongs) it´s rubbish :)
  • @aol Yeah I'm pretty sure the histogram for (rpm/speed) will have very distinct peaks for gears, with some tails for situations where the clutch is engaged (which should hopefully be easy to filter out). +1 that even with all the automatic goodies there should be a way to manually tweak the thresholds. Maybe for your own debugging purposes there should be an "expert" mode that plots the histogram?
  • 2022 bump for this @aol :wink: :kiss:
  • @loggyboy We have already a prototype algorithm for this. But it still takes time to fully test it and integrate to the product. We got lot of other things going on too, so this has to wait little bit longer :)
Sign In or Register to comment.