From 0d4d29ea77955312153c72bab1511c9f373f37d2 Mon Sep 17 00:00:00 2001 From: Timur Iskhodzhanov Date: Sun, 13 Jun 2021 23:42:57 -0700 Subject: [PATCH] Use bitsToUIntLe for RPM data channel --- can_db/ft86.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/can_db/ft86.md b/can_db/ft86.md index 912d7fc..f8eaf2b 100644 --- a/can_db/ft86.md +++ b/can_db/ft86.md @@ -14,7 +14,7 @@ Accelerator position (%) | 320 | `A/2.55` | Brake position (%) | 209 | `min(C / 0.7, 100)` | The 0.7 divider seems to be a good value to get 100% at pressure slightly higher than those you're likely to use on the track for cars with no aero. You can use 0.8 or 0.9 if you see 100% too often. Steering angle | 208 | `bytesToIntLe(raw, 0, 2) * 0.1` | Positive value = turning right. You can add a `-` if you prefer it the other way around. Speed | 209 | `bytesToIntLe(raw, 0, 2) * 0.015694` | May want to check the multiplier against an external GPS aevice -Engine RPM | 320 | `C + (D & 0x3f) * 256` | +Engine RPM | 320 | `bitsToUIntLe(raw, 16, 14)` | Coolant temperature | 864 | `D - 40` | Engine oil temperature | 864 | `C - 40` | @@ -143,7 +143,7 @@ Accelerator position | `A / 2.55` Clutch position | `(B & 0x80) / 1.28` | On/off only ??? | B & 0x70 | Unused? ??? | B & 0x0f | 0–15 counter? -Engine RPM | `C + (D & 0x3f) * 256` +Engine RPM | `bitsToUIntLe(raw, 16, 14)` ??? | `D & 0x80` | Always 0? ??? | `D & 0x40` | 1 when accelerator pedal is released, 0 otherwise Accelerator position | `E / 2.55` | Not clear what's the difference from the other two @@ -159,7 +159,7 @@ Channel name | Equation | Notes ------------ | -------- | ----- Accelerator pedal position? | `bytesToIntLe(raw, 0, 2)` | Follows `A` from `0x140` closely with ~9860 for 0% and ~11625 for 42%. Needs more testing. Engine load? | `bytesToIntLe(raw, 2, 2)` | Follows the data from OBD PIDs 0x4 and 0x43 pretty well. -Engine RPM | `E + (F & 0x3f) * 256` +Engine RPM | `bitsToUIntLe(raw, 32, 14)` ??? | `F & 0x80` | 1 when accelerator pedal is released, 0 otherwise ??? | `F & 0x40` | Always 0? Gear | `(G & 0xf) * (1 - (min(G & 0xf, 7)) / 7)` | It's basically just `G & 0xf` but neutral is reported as `7`, hence the complex math to turn it into a 0. The reverse gear is reported as `1`. The value can be wrong when the clutch pedal is depressed.