From b48d7bb4ed8603c8a58436176de8b647af42b8a2 Mon Sep 17 00:00:00 2001 From: Timur Iskhodzhanov Date: Thu, 27 Aug 2020 22:47:22 -0700 Subject: [PATCH] Start adding info on FT86 CAN messages --- README.md | 16 +++++++++++++++- can_db/ft86.md | 13 +++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 can_db/ft86.md diff --git a/README.md b/README.md index 8c0c408..d037ae4 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,19 @@ INT | Currently unused, may use 9 in the future Optionally, put everything into a nice enclosure. +## Tweaking to work with your car + +This particular example is optimized to work with FT86 cars (Subaru BRZ, +Toyota 86, Scion FR-S). You can search for "BRZ" in the source code to see where +the customizations were made, and tweak to work better with your car. + +If you do have an FT86 car, you might want to read [the info](can_db/ft86.md) on +messages that these cars are known to send over their CAN network. + +It might be nice to make these customizations programmable via a mobile app and +store the preferences in the flash storage of the nRF52840, but currently this +has not been implemented to keep the code minimalistic and easier to read. + ## Testing You don't need to always be in the car to test changes. @@ -88,4 +101,5 @@ Instead, you can build another device (possibly using a cheaper board, such as Arduino Uno), and use the [FakeSubaruBRZ example](https://github.com/timurrrr/arduino-CAN/tree/master/examples/FakeSubaruBRZ) from my fork of the `arduino-CAN` library, and connect the two boards into a -small CAN network. +small CAN network. Note that you don't need to use a jumper to connect the +120 Ohm resistor on the second board in a CAN network (right?). diff --git a/can_db/ft86.md b/can_db/ft86.md new file mode 100644 index 0000000..62257dd --- /dev/null +++ b/can_db/ft86.md @@ -0,0 +1,13 @@ +# FT86 cars (Subaru BRZ, Toyota 86, Scion FR-S) + +## PID 0xD0 + +Update frequency: 50 times per second. + +Channel | RaceChrono equation +------- | ------------------- +Steering angle | bytesToIntLe(raw, 0, 2) * 0.1 +Z rate of rotation | bytesToIntLe(raw, 2, 2) * -0.318309886 +??? | bytes 4, 5 +Lateral acceleration | bytesToIntLe(raw, 6, 1) * 0.2 +Longitudinal acceleration | bytesToIntLe(raw, 7, 1) * -0.1