![]() |
Feasibility of figuring out current gear, clutch pos over CAN/OBD2?
(EDIT: RESOLVED)
Hi there! First off, a disclaimer - this is not exactly about tuning, but there's enough overlap that I think this is the best forum to ask about it in. Okay - so as a little hobbyist project, I want to build a cheap, stupid device that will show me "if you downshift from CURRENT_GEAR to CURRENT_GEAR-1, what should your target RPM be?" Basically, a little helper for rev-matching. Current plan is: - ELM327 OBD2 reader communicating over BT to... - an ESP32 (or some such hobbyist chip) displaying on a cheap display The logic would be pretty simple on the ESP32. A quick and dirty pseudocode representation: Code:
def main():I've messed around with OBD2 readers on my phone, and it can definitely read RPM (and the latency is surprisingly not bad), but I haven't seen if there are PIDs for: - what's my current gear? (manual transmission if it counts) - what's the clutch pedal position? |
Techstream has a number of information that is shown, however I'm not sure whether those are communicated via OBD2 PIDs or via some other means. I've did some tinkering in the past by sniffing the communication between the ECU and Techstream to identify the PID and replaying the transmits and responses in hex values to understand how they are derived.
I'm sure it's possible on our cars (it was a long time ago, I've lost all the software) but if those values you're looking for are available in Techstream, chances that you would be able to pull it from your OBD2 reader. |
As there is no sensor (except maybe reverse, as rear camera & backup lights switch on immediately when putting in reverse gear) for gear position and even for car dash gear indication itself position gets calculated only after gear switch and letting out clutch pedal (and it gets calculated wrong for guys with different FD, if they don't also adjust calculation ratios in ecu tune), with lag, from engine rpm readings & wheel speed sensors, and even for clutch IIRC there was just sensor if clutch pedal is on or off (for keyless start sake i guess), i don't think you'll be able to get needed readings from twins stock sensors.
Maybe some custom aftermarket sensors can be added to clutch and gearbox, but have no info on those. |
As above the ECU calcualtes the gear from rpm and speed data. There is no gear sensor.
Note you can get auto blip rev matching on these cars with ecutek tunes, ie it blips throttle for you on downshift, and full throttle upshift, all in software |
You have speed, RPM, and clutch position in OBD. That should be all you need to figure out the current gear.
Oh and this :bonk:: Quote:
|
Thanks guys!
I recognize the Ecutek can auto-blip for me, but I'm doing this more for the fun of building it :) |
Quote:
|
You won't be able to request the calculated gear over OBD2, but you can access it under the regular CAN bus:
ID: 0x140 Offset: 6 bytes Length: 4 bits Mask: 0x0F (i.e. you only care about the 4 least significant bits on that byte) These 4 bits match the gear display, and reads 7 (0b0111) when nothing is displayed, between shifts, neutral, etc.. Obviously you could compare vehicle speed vs. engine speed, which would be faster I think. You can also get those off the CAN bus, which is quicker and less intrusive than over OBD2. Vehicle speed: ID: 0x0D1 Offset: 0 bytes Length: 2 bytes (little endian) Multiplier: 0.05747 for kph, 0.3571019137 for mph Engine speed: ID: 0x140 Offset: 2 bytes Length: 2 bytes (little endian) Mask: 0x3FFF EDIT: You can see how well comparing vehicle speed vs. engine speed works here: https://streamable.com/sqk9h8 It's much faster than using the gear data on the CAN bus because you don't necessarily have to wait for clutch out like the ECU does in the car. |
(I finished a super hacky quick-and-dirty version here!)
|
Sweet!
|
Somewhat related, I've noticed the gear indicator on the gauge cluster sometimes isn't there and occasionally is even wrong - it may say 4 when I'm in 5th. Is this normal? Its not like I actually need this, but I found it odd.
|
Quote:
|
Quote:
What is FD? I feel like I know that abbreviation, but its escaping me at the moment... |
Quote:
|
| All times are GMT -4. The time now is 10:37 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
User Alert System provided by
Advanced User Tagging v3.3.0 (Lite) -
vBulletin Mods & Addons Copyright © 2026 DragonByte Technologies Ltd.