There is another thread where people initially were trying to set up non-standard data channels for ND2 Miata, but it quickly turned into a broader discussion about CAN logging, etc.
https://racechrono.com/forum/discussion/1854/can-bus-data-logging-was-custom-obd-ii-channnels-for-miata-nd2/I figured it would be valuable to start a new thread with all the important information presented in a more beginner-friendly way.
Recommended setup:
OBDLink MX+ in the "Experimental CAN" mode.
It provides refresh rates of ~40 updates per second, which is significantly higher than what you can get using the regular OBD-II mode.
https://github.com/timurrrr/RaceChronoDiyBleDevice/blob/master/can_db/mazda_mx5_nd.mdlists how to set up the most common/important channels.
Comments
Accelerator position (%)
PID: 0x22032b
Equation: B/2.0
(Surprisingly, the standard OBD PIDs for accelerator communicate values in some weird ranges. This PID gives data in a 0–200 range, but at least that looks deliberate)
Brake position (%)
OBD-II header: 0x760 (not sure if necessary, what's the default value?)
PID: 0x222b0d
Equation: max(0, bytesToInt(raw, 1, 2)) / 2.3
(You can try other multipliers if you find the number to be too high or too low for you. You can also wrap it with "min(100, ...)" to limit to 100%.)
Tire pressures, if your Miata has TPMS sensors (I believe earlier model year NDs had indirect TPMS only):
OBD-II header: 0x720
PIDs: 0x222a05 (FL), 0x222a07 (FR), 0x222a06 (RL), 0x222a08 (RR)
Equation: B * 1.373
You'll probably want to use the PIDs for tire pressures to be set up as "Slow channels". Their values don't change that often, and making them "Fast channels" would consume too much of the limited OBD-II bandwidth, negatively affecting the update rates for the more time-sensitive channels such as pedals.
There the CAN mapping for the steering angle is documented on my github.
(although it might be a little off/buggy, I've seen some interesting data artifacts from NDs on that channel)
Question: do I risk to create any permanent damage (or risk some malfunction while driving) when using "OBDLink MX+" + CAN + RaceChrono?
https://forum.miata.net/vb/showthread.php?t=616995
There is information about gears in the spreadsheet shared here.
CAN ID: 357
Byte7
CurrentGear
Neutral/1st: 19 (dec)
2nd: 11 (dec)
3rd: 7 (dec)
4th: 6 (dec)
5th: 5 (dec)
I researched this info using my car.
I found that combining Byte7 and Byte8 results in a gear ratio.
Formula: bytesToUInt(raw, 6, 2)
1st: 5087
2nd: 2991
3rd: 2035
4th: 1594
5th: 1286
6th: 1000