Replace "PID" with "CAN ID" in docs
This commit is contained in:
parent
6543f430a2
commit
b605639f16
|
@ -116,7 +116,7 @@ messages that these cars are known to send over their CAN network.
|
|||
|
||||
Some information about the CAN data has been documented for Mazda MX-5/Miata
|
||||
([NC generation](can_db/mazda_mx5_nc.md) and
|
||||
[ND generation](can_db/mazda_mx5_nd.md)). If you know CAN PIDs and equations for
|
||||
[ND generation](can_db/mazda_mx5_nd.md)). If you know CAN IDs and equations for
|
||||
other track cars, feel free to send a pull request!
|
||||
|
||||
It might be nice to make these customizations programmable via a mobile app and
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
# FT86 cars (Subaru BRZ, Toyota 86, Scion FR-S)
|
||||
|
||||
Here is information on some of the PIDs that you're most likely to use with
|
||||
Here is information on some of the CAN IDs that you're most likely to use with
|
||||
RaceChrono and equations to get the right scale, etc.
|
||||
|
||||
## Recommended PIDs:
|
||||
## Recommended CAN IDs:
|
||||
|
||||
Here are PIDs and RaceChrono equations for data channels that should be enough
|
||||
Here are CAN IDs and RaceChrono equations for data channels that should be enough
|
||||
for most people:
|
||||
|
||||
Channel name | PID | Equation | Notes
|
||||
Channel name | CAN ID | 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.
|
||||
|
@ -22,18 +22,18 @@ Below is a table with a few more data channels that might be useful for more
|
|||
detailed analysis. When adding more channels, be aware that it might negatively
|
||||
affect the update rate of the more essential channels, due to limited Bluetooth
|
||||
bandwidth. However, the communication protocol in RaceChrono is smart enough to
|
||||
optimize Bluetooth usage if multiple channels share the same PID. As a general
|
||||
rule, if a new channel has the same PID as an existing channel (such as
|
||||
"Throttle position" using the same PID 320 as "Accelerator position"), then
|
||||
adding it should not affect the update rates. Adding a channel based on
|
||||
a new PID (such as "Wheel speed FL") will likely affect the update rates of all
|
||||
other channels.
|
||||
optimize Bluetooth usage if multiple channels share the same CAN ID. As a
|
||||
general rule, if a new channel has the same CAN ID as an existing channel (such
|
||||
as "Throttle position" using the same CAN ID 320 as "Accelerator position"),
|
||||
then adding it should not affect the update rates. Adding a channel based on
|
||||
a new CAN ID (such as "Wheel speed FL") will likely affect the update rates of
|
||||
all other channels.
|
||||
|
||||
Channel name | PID | Equation | Notes
|
||||
Channel name | CAN ID | 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.
|
||||
Gear | 321 | `(G & 0xf) * (1 - (min(G & 0xf, 7)) / 7)` | Car calculates it based on speed, RPM and clutch position. It's pretty slow. I really doubt it's worth wasting one PID for this channel. It's not that hard to see which gear you're in based on speed and RPM in data.
|
||||
Gear | 321 | `(G & 0xf) * (1 - (min(G & 0xf, 7)) / 7)` | Car calculates it based on speed, RPM and clutch position. It's pretty slow. I really doubt it's worth wasting one CAN ID for this channel. It's not that hard to see which gear you're in based on speed and RPM in data.
|
||||
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.
|
||||
|
@ -75,11 +75,11 @@ JST SM connector to the cable.
|
|||
|
||||
## Stuff for nerds like me
|
||||
|
||||
### PID 0x18 (24)
|
||||
### CAN ID 0x18 (24)
|
||||
|
||||
Update frequency: 100 times per second.
|
||||
|
||||
`0x18` is a strange PID. Judging by the low PID number (which in CAN networks
|
||||
`0x18` is a strange CAN ID. Judging by the low CAN ID 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.
|
||||
|
@ -97,7 +97,7 @@ Steering angle | `bytesToIntLe(raw, 0, 2) * -0.1` | Also available in `0xD0`
|
|||
??? | `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)
|
||||
### CAN ID 0xD0 (208)
|
||||
|
||||
Update frequency: 50 times per second.
|
||||
|
||||
|
@ -111,7 +111,7 @@ Lateral acceleration | `bytesToIntLe(raw, 6, 1) * 0.2` | Not 100% sure about the
|
|||
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)
|
||||
### CAN ID 0xD1 (209)
|
||||
|
||||
Update frequency: 50 times per second.
|
||||
Length: 4 bytes
|
||||
|
@ -122,7 +122,7 @@ Speed | `bytesToIntLe(raw, 0, 2) * 0.015694` | May want to check the multiplier
|
|||
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)
|
||||
### CAN ID 0xD4 (212)
|
||||
|
||||
Update frequency: 50 times per second.
|
||||
|
||||
|
@ -133,7 +133,7 @@ Wheel speed FR | `bytesToIntLe(raw, 2, 2) * 0.015694` | Use same multiplier as f
|
|||
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)
|
||||
### CAN ID 0x140 (320)
|
||||
|
||||
Update frequency: 100 times per second.
|
||||
|
||||
|
@ -151,14 +151,14 @@ Accelerator position | `F / 2.55` | Not clear what's the difference from the oth
|
|||
Throttle position | `G / 2.55` | Not tested
|
||||
??? | H | Some flags
|
||||
|
||||
### PID 0x141 (321)
|
||||
### CAN ID 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 load? | `bytesToIntLe(raw, 2, 2)` | Follows the data from OBD-II PIDs 0x4 and 0x43 pretty well.
|
||||
Engine RPM | `bitsToUIntLe(raw, 32, 14)`
|
||||
??? | `F & 0x80` | 1 when accelerator pedal is released, 0 otherwise
|
||||
??? | `F & 0x40` | Always 0?
|
||||
|
@ -166,7 +166,7 @@ Gear | `(G & 0xf) * (1 - (min(G & 0xf, 7)) / 7)` | It's basically just `G & 0xf`
|
|||
??? | `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)
|
||||
### CAN ID 0x360 (864)
|
||||
|
||||
Update frequency: 20 times per second.
|
||||
|
||||
|
@ -178,7 +178,7 @@ Cruise control ON | `(F & 16) / 16` | Means the mode is "On", but not necessaril
|
|||
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)
|
||||
### CAN ID 0x361 (865)
|
||||
|
||||
Update frequency: 20 times per second.
|
||||
|
||||
|
@ -186,19 +186,19 @@ Channel name | Equation | Notes
|
|||
------------ | -------- | -----
|
||||
Gear | A & 0x7 | Not tested
|
||||
|
||||
### Would be nice to find PIDs for ...
|
||||
### Would be nice to find CAN IDs 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
|
||||
### Typical histogram of CAN IDs
|
||||
|
||||
Here's what the distribution of PIDs looks like in the CAN bus while idling in a
|
||||
Here's what the distribution of CAN IDs looks like in the CAN bus while idling in a
|
||||
parking lot:
|
||||
|
||||
PID | Decimal PID | Number of packets received over a 10 second period
|
||||
CAN ID (hex) | CAN ID (decimal) | Number of packets received over a 10 second period
|
||||
---- | --- | ---
|
||||
0x18 | 24 | 1000
|
||||
0xD0 | 208 | 500
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
# Mazda MX5 2005-2015 (third generation, including NC/NCFL/NCFLFL or MK3/MK3.5/MK3.75)
|
||||
|
||||
Here is information on some of the PIDs that you're most likely to use with
|
||||
Here is information on some of the CAN IDs that you're most likely to use with
|
||||
RaceChrono and equations to get the right scale, etc.
|
||||
|
||||
Please note there is still much work in progress, any contributions are welcome.
|
||||
|
||||
## PID 0x081
|
||||
## CAN ID 0x081
|
||||
|
||||
Update frequency: 100 times per second.
|
||||
|
||||
`0x081` contain data related to steering angle. This PID is available only in
|
||||
`0x081` contain data related to steering angle. This CAN ID is available only in
|
||||
cars with DSC module, so all cars from 2007 onwards.
|
||||
Only 4 bytes long.
|
||||
|
||||
|
@ -24,11 +24,11 @@ Channel name | Equation | Notes
|
|||
------------ | -------- | -----
|
||||
Steering angle | `bytesToInt(raw, 2, 2)` | positive values are from centered position (0) to right, negative otherwise
|
||||
|
||||
## PID 0x085
|
||||
## CAN ID 0x085
|
||||
|
||||
Update frequency: 100 times per second.
|
||||
|
||||
`0x085` contain data related to braking. This PID is available only in
|
||||
`0x085` contain data related to braking. This CAN ID is available only in
|
||||
cars with DSC module, so all cars from 2007 onwards.
|
||||
|
||||
Byte | Meaning
|
||||
|
@ -47,11 +47,11 @@ Brake pressure | `(3.4518689053*bytesToInt(raw, 0, 2)-327.27)/1000.00` | multipl
|
|||
Brake percentage | `min(0.2*(bytesToInt(raw, 0, 2)-102),100)` | this is an alternative to get brake percentage. When not pressed the value is 102, after braking and releasing it goes briefly down to 99 so you may see slightly negative percentage.
|
||||
Digital | `bitsToUint(raw,17,1)/2` | 0-1 value
|
||||
|
||||
## PID 0x090
|
||||
## CAN ID 0x090
|
||||
|
||||
Update frequency: 100 times per second.
|
||||
|
||||
`0x090` WIP. Probably related to accelerations. This PID is available only in
|
||||
`0x090` WIP. Probably related to accelerations. This CAN ID is available only in
|
||||
cars with DSC module, so all cars from 2007 onwards.
|
||||
|
||||
Byte | Meaning
|
||||
|
@ -69,7 +69,7 @@ Channel name | Equation | Notes
|
|||
------------ | -------- | -----
|
||||
... | ... | ...
|
||||
|
||||
## PID 0x200
|
||||
## CAN ID 0x200
|
||||
|
||||
Update frequency: 100 times per second.
|
||||
|
||||
|
@ -89,13 +89,13 @@ Byte | Meaning
|
|||
|
||||
Channel name | Equation | Notes
|
||||
------------ | -------- | -----
|
||||
Throttle Position | `bytestouint(raw,7,1)*100/255.00` | Scale may need adjustment, doesn't take into account the offset for idle. Same value available in PID 0x215 byte 6
|
||||
Throttle Position | `bytestouint(raw,7,1)*100/255.00` | Scale may need adjustment, doesn't take into account the offset for idle. Same value available in CAN ID 0x215 byte 6
|
||||
|
||||
## PID 0x201
|
||||
## CAN ID 0x201
|
||||
|
||||
Update frequency: 100 times per second.
|
||||
|
||||
`0x201` This PID is related to engine speed, vehicle speed
|
||||
`0x201` This CAN ID is related to engine speed, vehicle speed
|
||||
and accelerator position.
|
||||
|
||||
Byte | Meaning
|
||||
|
@ -113,7 +113,7 @@ Engine RPM | `bytestouint(raw,0,2)/4.00` |
|
|||
Speed | `((bytestoint(raw,4,2)/100.00)-100)/3.6` | Raw speed data is given in km/h with a 100 km/h offset. The "3.6" at the end of the equation is needed to switch to m/s that is the unit used internally for calculation by RaceChrono. In the calculation RaceChrono will then multiply automatically for the correct value to transform the m/s to your choice of units (i.e. km/h or mph).
|
||||
Accelerator Position | `bytestoint(raw,6,1)*2.00` | This is a percentage, increments of 0.5%
|
||||
|
||||
## PID 0x215
|
||||
## CAN ID 0x215
|
||||
|
||||
Update frequency: 100 times per second.
|
||||
|
||||
|
@ -133,9 +133,9 @@ Byte | Meaning
|
|||
|
||||
Channel name | Equation | Notes
|
||||
------------ | -------- | -----
|
||||
Throttle Position | `bytestouint(raw,6,1)*100/255.00` | Scale may need adjustment, doesn't take into account the offset for idle. Same value available in PID 0x200 byte 7
|
||||
Throttle Position | `bytestouint(raw,6,1)*100/255.00` | Scale may need adjustment, doesn't take into account the offset for idle. Same value available in CAN ID 0x200 byte 7
|
||||
|
||||
## PID 0x231
|
||||
## CAN ID 0x231
|
||||
|
||||
Update frequency: 40 times per second.
|
||||
|
||||
|
@ -159,7 +159,7 @@ Channel name | Equation | Notes
|
|||
Digital | `(bitstouint(raw,15,1)-4)/2` | 0 - 1 value
|
||||
|
||||
|
||||
## PID 0x240
|
||||
## CAN ID 0x240
|
||||
|
||||
Update frequency: 10 times per second.
|
||||
|
||||
|
@ -187,7 +187,7 @@ Throttle position | `100*bytestouint(raw,1,1)/255` | Scale may need adjustment.
|
|||
Ignition advance
|
||||
Intake temperature | `bytestouint(raw,4,1)-40` | RaceChrono does calculation in °C then converts to your unit of choice
|
||||
|
||||
## PID 0x4b0
|
||||
## CAN ID 0x4b0
|
||||
|
||||
Update frequency: 100 times per second.
|
||||
|
||||
|
@ -208,12 +208,12 @@ Vehicle Speed Rear Left | `((bytestoint(raw,4,2)/100.00)-100)/3.6` |
|
|||
Vehicle Speed Rear Right | `((bytestoint(raw,6,2)/100.00)-100)/3.6` |
|
||||
|
||||
|
||||
## Typical histogram of PIDs
|
||||
## Typical histogram of CAN IDs
|
||||
|
||||
Here's what the distribution of PIDs looks like in the CAN bus while idling in a
|
||||
parking lot:
|
||||
Here's what the distribution of CAN IDs looks like in the CAN bus while idling
|
||||
in a parking lot:
|
||||
|
||||
PID | Decimal PID | Number of packets received over a 10 second period
|
||||
CAN ID (hex) | CAN ID (decimal) | Number of packets received over a 10 second period
|
||||
---- | --- | ---
|
||||
081 | 129 | 1000
|
||||
085 | 133 | 1000
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
# Mazda MX-5 Miata (ND generation)
|
||||
|
||||
Here is information on some of the PIDs that you're most likely to use with
|
||||
Here is information on some of the CAN IDs that you're most likely to use with
|
||||
RaceChrono and equations to get the right scale, etc.
|
||||
|
||||
These PIDs were tested on 2019 Mazda MX-5 Miata RF, but should apply to other
|
||||
These CAN IDs were tested on 2019 Mazda MX-5 Miata RF, but should apply to other
|
||||
model years of the ND generation as well. If you find any mistakes, or model
|
||||
year specific PIDs, please send a pull request!
|
||||
year specific CAN IDs, please send a pull request!
|
||||
|
||||
## Recommended PIDs:
|
||||
## Recommended CAN IDs:
|
||||
|
||||
Here are PIDs and RaceChrono equations for data channels that should be enough
|
||||
for most people:
|
||||
Here are CAN IDs and RaceChrono equations for data channels that should be
|
||||
enough for most people:
|
||||
|
||||
Channel name | PID | Equation | Notes
|
||||
Channel name | CAN ID | Equation | Notes
|
||||
------------ | --- | -------- | -----
|
||||
Accelerator position (%) | 514 | `E/2.5` |
|
||||
Brake position (%) | 120 | `max(0, 100 + bytesToInt(raw, 4, 1)) / 2.55` | Might need more work, possibly a different scale
|
||||
|
@ -20,7 +20,7 @@ Steering angle | 134 | `(16000 - bytesToUInt(raw, 0, 2)) * 0.1` | Positive value
|
|||
Speed | 514 | `bytesToInt(raw, 2, 2) / 360.0` |
|
||||
Engine RPM | 514 | `bytesToUInt(raw, 0, 2) / 4` | If someone records >8192 rpms to confirm, let me know :)
|
||||
|
||||
### Would be nice to find PIDs for ...
|
||||
### Would be nice to find CAN IDs for ...
|
||||
|
||||
Essentials: fuel level, coolant temperature, clutch pedal, current gear.
|
||||
|
||||
|
|
Loading…
Reference in New Issue