Add a couple of tables with recommended PIDs to the top of the FT86 page

This commit is contained in:
Timur Iskhodzhanov 2021-06-13 18:49:22 -07:00
parent 6d400b9b3d
commit bdbbc59ec8
1 changed files with 149 additions and 114 deletions

View File

@ -3,123 +3,38 @@
Here is information on some of the PIDs that you're most likely to use with
RaceChrono and equations to get the right scale, etc.
## PID 0x18
## Recommended PIDs:
Update frequency: 100 times per second.
Here are PIDs and RaceChrono equations for data channels that should be enough
for most people:
`0x18` is a strange PID. Judging by the low PID number (which in CAN networks
implies higher priority) and the high update frequency, one would expect it to
have some important data, like data for ABS or ESC systems. But based on what is
currently known, it only has one the steering angle as a useful data channel.
The steering angle graphs are usually relatively smooth, and this data is also
available over `0xD0`, along with some much more important data, such as
accelerometers.
Channel name | PID | Equation | Notes
------------ | --- | -------- | -----
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` |
Coolant temperature | 864 | `D - 40` |
Engine oil temperature | 864 | `C - 40` |
Channel name | Equation | Notes
------------ | -------- | -----
Steering angle | `bytesToIntLe(raw, 0, 2) * -0.1` | Also available in `0xD0`
??? | `C` or `bytesToIntLe(raw, 2, 1)` | The value is 112 most of the time for me
??? | `D` or `bytesToIntLe(raw, 3, 1)` | 014 sawtooth
??? | `E` or `bytesToIntLe(raw, 4, 1)` | The value is 0 most of the time for me
??? | `F` or `bytesToIntLe(raw, 5, 1)` | The value is 0 most of the time for me
??? | `G` or `bytesToIntLe(raw, 6, 1)` | The value is 0 most of the time for me
??? | `H` or `bytesToIntLe(raw, 7, 1)` | Strange data channel. It changes in a strange way when the car turns. It also has a 0-14 sawtooth over some otherwise smooth curve.
Here are a few data channels that might be useful for more detailed analysis,
but due to limited Bluetooth bandwidth, adding them might affect the update rate
of the more essential channels:
## PID 0xD0
Update frequency: 50 times per second.
Channel name | Equation | Notes
------------ | -------- | -----
Steering angle | `bytesToIntLe(raw, 0, 2) * 0.1` | Also available in 0x18
Z rate of rotation | `bytesToIntLe(raw, 2, 2) * -0.286478897` | The multiplier for º/sec appears to be ((90 / pi) * 100)
??? | `E` | Some flags?
??? | `F` | Some flags?
Lateral acceleration | `bytesToIntLe(raw, 6, 1) * 0.2` | Not 100% sure about the multiplier, but looks about right
Longitudinal acceleration | `bytesToIntLe(raw, 7, 1) * -0.1` | Not 100% sure about the multiplier, but looks about right
Combined acceleration | `sqrt(pow2(bytesToIntLe(raw, 6, 1) * 0.2) + pow2(bytesToIntLe(raw, 7, 1) * 0.1))` |
## PID 0xD1
Update frequency: 50 times per second.
Length: 4 bytes
Channel name | Equation | Notes
------------ | -------- | -----
Speed | `bytesToIntLe(raw, 0, 2) * 0.015694` | May want to check the multiplier against an external GPS device
Brake position | `min(C / 0.7, 100)` | The third byte is the pressure in the brake system, in Bars. 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.
??? | D | Always 0?
## PID 0xD4
Update frequency: 50 times per second.
Channel name | Equation | Notes
------------ | -------- | -----
Wheel speed FL | `bytesToIntLe(raw, 0, 2) * 0.015694` | Use same multiplier as for speed in 0xD1
Wheel speed FR | `bytesToIntLe(raw, 2, 2) * 0.015694` | Use same multiplier as for speed in 0xD1
Wheel speed RL | `bytesToIntLe(raw, 4, 2) * 0.015694` | Use same multiplier as for speed in 0xD1
Wheel speed RR | `bytesToIntLe(raw, 6, 2) * 0.015694` | Use same multiplier as for speed in 0xD1
## PID 0x140
Update frequency: 100 times per second.
Channel name | Equation | Notes
------------ | -------- | -----
Accelerator position | `A / 2.55`
Clutch position | `(B & 0x80) / 1.28` | On/off only
??? | B & 0x70 | Unused?
??? | B & 0x0f | 015 counter?
Engine RPM | `C + (D & 0x3f) * 256`
??? | `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
Accelerator position | `F / 2.55` | Not clear what's the difference from the other two
Throttle position | `G / 2.55` | Not tested
??? | H | Some flags
## PID 0x141
Update frequency: 100 times per second.
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`
??? | `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.
??? | `G & 0xF0` | I saw values of 128, 160, 192 here.
??? | `H` | Equals to 16 when I lift off the accelerator, then turns to 8, then 0.
## PID 0x360
Update frequency: 20 times per second.
Channel name | Equation | Notes
------------ | -------- | -----
Engine oil temperature | `C - 40`
Coolant temperature | `D - 40`
Cruise control ON | `(F & 16) / 16` | Means the mode is "On", but not necessarily "Set". Not tested much.
Cruise control set | `(F & 32) / 32` | Not tested much.
Cruise control speed | `H` | In the same unit as the current speed display units? Not tested much.
## PID 0x361
Update frequency: 20 times per second.
Channel name | Equation | Notes
------------ | -------- | -----
Gear | A & 0x7 | Not tested
## Would be nice to find PIDs for ...
TODO: would be great to find how to read the ambient temperature, and maybe the
intake temperature.
TODO: find how to log the fuel remaining.
Channel name | PID | Equation | Notes
------------ | --- | -------- | -----
Brake pressure | 209 | `C * 100` | Not sure about the units / multiplier yet.
Clutch position | 320 | `B & 0x80 / 1.28` | Only 0% and "not 0%", unfortunately.
Throttle position | 320 | `G / 2.55` | This is the throttle *valve*, not pedal.
Lateral acceleration | 208 | `bytesToIntLe(raw, 6, 1) * 0.2` | Data is noisy.
Longitudinal acceleration | 208 | `bytesToIntLe(raw, 7, 1) * -0.1` | Data is noisy.
Combined acceleration | 208 | `sqrt(pow2(bytesToIntLe(raw, 6, 1) * 0.2) + pow2(bytesToIntLe(raw, 7, 1) * 0.1))` |
Z rate of rotation | 208 | `bytesToIntLe(raw, 2, 2) * -0.286478897` | Or is this "Yaw rate"?
Wheel speed FL | 212 | `bytesToIntLe(raw, 0, 2) * 0.015694` | Use same multiplier as for "Speed".
Wheel speed FR | 212 | `bytesToIntLe(raw, 2, 2) * 0.015694` | Use same multiplier as for "Speed".
Wheel speed RL | 212 | `bytesToIntLe(raw, 4, 2) * 0.015694` | Use same multiplier as for "Speed".
Wheel speed RR | 212 | `bytesToIntLe(raw, 6, 2) * 0.015694` | Use same multiplier as for "Speed".
## Connections
@ -150,7 +65,127 @@ JST SM connector to the cable.
![Assembled device in the glovebox](../images/ft86_glovebox.jpg)
## Typical histogram of PIDs
## Stuff for nerds like me
### PID 0x18 (24)
Update frequency: 100 times per second.
`0x18` is a strange PID. Judging by the low PID number (which in CAN networks
implies higher priority) and the high update frequency, one would expect it to
have some important data, like data for ABS or ESC systems. But based on what is
currently known, it only has one the steering angle as a useful data channel.
The steering angle graphs are usually relatively smooth, and this data is also
available over `0xD0`, along with some much more important data, such as
accelerometers.
Channel name | Equation | Notes
------------ | -------- | -----
Steering angle | `bytesToIntLe(raw, 0, 2) * -0.1` | Also available in `0xD0`
??? | `C` or `bytesToIntLe(raw, 2, 1)` | The value is 112 most of the time for me
??? | `D` or `bytesToIntLe(raw, 3, 1)` | 014 sawtooth
??? | `E` or `bytesToIntLe(raw, 4, 1)` | The value is 0 most of the time for me
??? | `F` or `bytesToIntLe(raw, 5, 1)` | The value is 0 most of the time for me
??? | `G` or `bytesToIntLe(raw, 6, 1)` | The value is 0 most of the time for me
??? | `H` or `bytesToIntLe(raw, 7, 1)` | Strange data channel. It changes in a strange way when the car turns. It also has a 0-14 sawtooth over some otherwise smooth curve.
### PID 0xD0 (208)
Update frequency: 50 times per second.
Channel name | Equation | Notes
------------ | -------- | -----
Steering angle | `bytesToIntLe(raw, 0, 2) * 0.1` | Also available in 0x18
Z rate of rotation | `bytesToIntLe(raw, 2, 2) * -0.286478897` | The multiplier for º/sec appears to be ((90 / pi) * 100). Or is this "yaw rate"?..
??? | `E` | Some flags?
??? | `F` | Some flags?
Lateral acceleration | `bytesToIntLe(raw, 6, 1) * 0.2` | Not 100% sure about the multiplier, but looks about right
Longitudinal acceleration | `bytesToIntLe(raw, 7, 1) * -0.1` | Not 100% sure about the multiplier, but looks about right
Combined acceleration | `sqrt(pow2(bytesToIntLe(raw, 6, 1) * 0.2) + pow2(bytesToIntLe(raw, 7, 1) * 0.1))` |
### PID 0xD1 (209)
Update frequency: 50 times per second.
Length: 4 bytes
Channel name | Equation | Notes
------------ | -------- | -----
Speed | `bytesToIntLe(raw, 0, 2) * 0.015694` | May want to check the multiplier against an external GPS aevice
Brake position | `min(C / 0.7, 100)` | The third byte is the pressure in the brake system, in Bars. 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.
??? | D | Always 0?
### PID 0xD4 (212)
Update frequency: 50 times per second.
Channel name | Equation | Notes
------------ | -------- | -----
Wheel speed FL | `bytesToIntLe(raw, 0, 2) * 0.015694` | Use same multiplier as for speed in 0xD1
Wheel speed FR | `bytesToIntLe(raw, 2, 2) * 0.015694` | Use same multiplier as for speed in 0xD1
Wheel speed RL | `bytesToIntLe(raw, 4, 2) * 0.015694` | Use same multiplier as for speed in 0xD1
Wheel speed RR | `bytesToIntLe(raw, 6, 2) * 0.015694` | Use same multiplier as for speed in 0xD1
### PID 0x140 (320)
Update frequency: 100 times per second.
Channel name | Equation | Notes
------------ | -------- | -----
Accelerator position | `A / 2.55`
Clutch position | `(B & 0x80) / 1.28` | On/off only
??? | B & 0x70 | Unused?
??? | B & 0x0f | 015 counter?
Engine RPM | `C + (D & 0x3f) * 256`
??? | `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
Accelerator position | `F / 2.55` | Not clear what's the difference from the other two
Throttle position | `G / 2.55` | Not tested
??? | H | Some flags
### PID 0x141 (321)
Update frequency: 100 times per second.
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`
??? | `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.
??? | `G & 0xF0` | I saw values of 128, 160, 192 here.
??? | `H` | Equals to 16 when I lift off the accelerator, then turns to 8, then 0.
### PID 0x360 (864)
Update frequency: 20 times per second.
Channel name | Equation | Notes
------------ | -------- | -----
Engine oil temperature | `C - 40`
Coolant temperature | `D - 40`
Cruise control ON | `(F & 16) / 16` | Means the mode is "On", but not necessarily "Set". Not tested much.
Cruise control set | `(F & 32) / 32` | Not tested much.
Cruise control speed | `H` | In the same unit as the current speed display units? Not tested much.
### PID 0x361 (865)
Update frequency: 20 times per second.
Channel name | Equation | Notes
------------ | -------- | -----
Gear | A & 0x7 | Not tested
### Would be nice to find PIDs for ...
TODO: would be great to find how to read the ambient temperature, and maybe the
intake temperature.
TODO: find how to log the fuel remaining.
### Typical histogram of PIDs
Here's what the distribution of PIDs looks like in the CAN bus while idling in a
parking lot: