follow ft86club on our blog, twitter or facebook.
FT86CLUB
Ft86Club
Delicious Tuning
Register Garage Community Calendar Today's Posts Search

Go Back   Toyota GR86, 86, FR-S and Subaru BRZ Forum & Owners Community - FT86CLUB > Technical Topics > DIY (Do-It-Yourself) Guides

DIY (Do-It-Yourself) Guides For all DIYs.


User Tag List

Reply
 
Thread Tools Search this Thread
Old 08-28-2020, 03:02 AM   #1
timurrrr
Senior Member
 
timurrrr's Avatar
 
Join Date: May 2019
Drives: 2022 GR86
Location: Between Sonoma and Laguna Seca
Posts: 1,707
Thanks: 2,129
Thanked 1,297 Times in 718 Posts
Mentioned: 30 Post(s)
Tagged: 1 Thread(s)
DIY CAN bus reader for RaceChrono

Hey folks,
Recently I've been working on a DIY data logging device for my BRZ.

I'm happy to report that I've just uploaded all the code, as well as a decent amount of documentation, to GitHub!
The whole build cost me ~$50, compared to hundreds of dollars I'd pay for a comparable off-the-shelf device.

Check this out:
https://github.com/timurrrr/RaceChronoDiyBleDevice Overview of the project
https://github.com/timurrrr/RaceChro...can_db/ft86.md Everything I've learned about the CAN bus for FT86 platform

If you know anything useful for track enthusiasts about the FT86 CAN protocol that's not reflected on the second page, I'd be happy to add it!

Here's an example of data captured by that device at T6 at Laguna Seca during a recent 86DC event:


And here it is used for virtual gauges in RaceChrono:

As you can see, it has a much higher update rate (25 Hz) than is typical for OBD-II Bluetooth adapters.
Most importantly for me, it allows me to log the brake pressure!

Anyone with basic soldering skills should be able to create a similar device for themselves.
If you don't know how to solder, etc., I'm sure you can find a friend who will be happy to help, and you'll both learn something along the way.

I need to warn you that you assume any and all risk from connecting a DIY device to the CAN bus of your car.
If you mess up something badly, it can cause costly repairs and/or injuries.
Don't mess up badly
timurrrr is offline   Reply With Quote
The Following 7 Users Say Thank You to timurrrr For This Useful Post:
dsc_pat (04-30-2021), fminicooper (10-23-2020), Jianlun (08-26-2022), ML (09-04-2020), RedReplicant (12-14-2022), Stonehorsw (09-05-2022), whataboutbob (02-19-2021)
Old 08-29-2020, 10:30 PM   #2
lsh411
Junior Member
 
Join Date: Aug 2020
Drives: 2015
Location: south korea
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Fantastic!

Its absoutely better than any other expensive data loggers on the market. I'll try to follow your instruction.

lsh411 is offline   Reply With Quote
Old 09-04-2020, 02:15 PM   #3
TwinFTW
Member
 
Join Date: Nov 2016
Drives: 17 BRZ w/PP & 08 STI
Location: CA
Posts: 29
Thanks: 7
Thanked 7 Times in 6 Posts
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Looks like this could be a fun quarantine side project to tinker on. I haven't used racechrono before, so just want to confirm a few things.

In addition to your github build sheet, I would also need:

- some type of android device
- racechrono pro app.


Is the data stored in racechrono? can it be exported?

Will an old android device become bottleneck and/or what features should I look for in the device?
TwinFTW is offline   Reply With Quote
Old 09-04-2020, 04:53 PM   #4
timurrrr
Senior Member
 
timurrrr's Avatar
 
Join Date: May 2019
Drives: 2022 GR86
Location: Between Sonoma and Laguna Seca
Posts: 1,707
Thanks: 2,129
Thanked 1,297 Times in 718 Posts
Mentioned: 30 Post(s)
Tagged: 1 Thread(s)
Quote:
Originally Posted by TwinFTW View Post
Is the data stored in racechrono? can it be exported?

Will an old android device become bottleneck and/or what features should I look for in the device?
Yes, the data is stored in the RaceChrono app on the phone. There are a bunch of export formats available in RaceChrono, including CSV and RaceRender/DashWare.

Any reasonably old Android phone with Bluetooth Low Energy support should suffice. You may want a larger screen and USB-C fast charging if you want to clearly see the phone screen while driving.

If you have an Android Auto head unit and want to project the app on the head unit you'll need the phone to be rooted, and not all phones are easy to root. Some say Motorola E5 is a good cheap rootable phone for this purpose. Or you can buy a used/refurbished Google Pixel.
timurrrr is offline   Reply With Quote
Old 09-15-2020, 04:11 AM   #5
timurrrr
Senior Member
 
timurrrr's Avatar
 
Join Date: May 2019
Drives: 2022 GR86
Location: Between Sonoma and Laguna Seca
Posts: 1,707
Thanks: 2,129
Thanked 1,297 Times in 718 Posts
Mentioned: 30 Post(s)
Tagged: 1 Thread(s)
Squiggly lines alert!

I did some minor refinements and updates to both the hardware and the software (everything updated on GitHub), and went to a local AutoX.

There was an interesting wide-tight-wide left corner that I wanted to review.
One of the features was the bumpiness of the surface around that corner.
I'm blown away how much resolution there is in the data captured with this cheap DIY device!

Speed vs inputs


Speed: cyan (50 Hz update rate)
Accelerator: green (25 Hz)
Steering: purple (25 Hz)
Brake: orange (50 Hz)

Individual wheel speeds


Front left: cyan blue (25 Hz)
Front right: purple (25 Hz)
Rear left: green (25 Hz)
Rear right: orange (25 Hz)

You can see in the first phase of the corner the unladen left wheels briefly locked up when I went over bumps.
Then after the apex you can see that the inner rear wheel started turning at the same rate as the outside wheels (but not the inner front wheel!), occasionally slipping when going over bumps.

I'm curious what happened at the ~2s mark with the brake pressure.
I don't remember releasing the brake pedal that much.
I wonder if it was the ABS intervening after I went over bumps.
Need more tests to say for sure!

Last edited by timurrrr; 10-22-2020 at 11:44 PM.
timurrrr is offline   Reply With Quote
The Following User Says Thank You to timurrrr For This Useful Post:
TMF (05-26-2021)
Old 10-22-2020, 04:23 PM   #6
redlined600
Senior Member
 
redlined600's Avatar
 
Join Date: Nov 2014
Drives: Fr-s
Location: MN
Posts: 733
Thanks: 125
Thanked 492 Times in 266 Posts
Mentioned: 5 Post(s)
Tagged: 0 Thread(s)
Nice work!
I really like the RaceChrono app and this definitely takes it to the next level.
__________________
redlined600 is offline   Reply With Quote
The Following User Says Thank You to redlined600 For This Useful Post:
timurrrr (10-22-2020)
Old 10-23-2020, 12:15 AM   #7
timurrrr
Senior Member
 
timurrrr's Avatar
 
Join Date: May 2019
Drives: 2022 GR86
Location: Between Sonoma and Laguna Seca
Posts: 1,707
Thanks: 2,129
Thanked 1,297 Times in 718 Posts
Mentioned: 30 Post(s)
Tagged: 1 Thread(s)
Here's a couple more examples of what kind of data you can get with this device:

1) Individual wheel speeds

Here's a launch in the beginning of a run, followed by a couple of corners at a recent autoX:


Front left: cyan blue (25 Hz)
Front right: purple (25 Hz)
Rear left: green (25 Hz)
Rear right: orange (25 Hz)

You can see in the beginning the rear wheels spinning at roughly constant rate, whereas the front wheels speed up with the "real" speed of the car. If you look closely, you can see the slope of the graph for the front wheels increases slightly as the car's own speed approaches the speed at which the rear wheels are spinning (or, in other words, as the rear wheels spin less relative to the speed of the car they generate slightly more traction).

At t = 2025 you can see the rear left wheel starting to slip in a left corner until the LSD engages.
At t = 2026 ... 2030 you can see how a slalom looks like.
At t = 2033 you can see the fronts locking up as I brake on a bumpy patch of the track.

2) Combined acceleration vs pedals


Accelerator: green (25 Hz)
Brake: orange (50 Hz)
Combined acceleration, from the CAN bus: purple (25 Hz)
Combined acceleration, from GPS: cyan (10 Hz)

I was looking at how well (or not well) I trail brake on a ~55 mph straight into a ~25 mph hairpin.

As you can see, the accelerometer data on the CAN bus is pretty noisy.
This is typical for digital accelerometers, and usually some filtering is needed.
Also you can see the GPS data is slightly offset/delayed.
Both of these issues are fixable, see this discussion on the RaceChrono forum.

Even without filtering IMO the data from the CAN bus is more useful than the 10 Hz data from the GPS.
For example, right before braking I know I was going in a straight line at the rev limiter, so should be ~0 G's.
Indeed, I see a brief drop to 0 in the data from the CAN bus. For comparison, the minimal value in the GPS data here is 0.5 G's!
The CAN-based "combined acceleration" graph jumps up quickly as I step on the brake pedal;
whereas the graph based on the GPS data takes ~0.5 sec to get from the minimal value to the first local maximum.
timurrrr is offline   Reply With Quote
Old 02-19-2021, 03:09 AM   #8
timurrrr
Senior Member
 
timurrrr's Avatar
 
Join Date: May 2019
Drives: 2022 GR86
Location: Between Sonoma and Laguna Seca
Posts: 1,707
Thanks: 2,129
Thanked 1,297 Times in 718 Posts
Mentioned: 30 Post(s)
Tagged: 1 Thread(s)
Great news! Starting v7.1, RaceChrono allows adjusting the timing data from CAN and OBD devices relative to the GPS data, and even can do that automatically.

As an example, here's T6 at Laguna Seca:



Here's the data log from that lap, after aligning GPS and CAN data:



Purple line: GPS speed
Cyan line: Speed as reported on the CAN bus (from rear wheels)
Green line: Accelerator
Orange line: Brake pedal

Now that GPS and CAN data is aligned in time, you can see that the tire "slip" between 3s and 5.5s.
It's very clear that the GPS data is wrong when going under a bridge.

Last edited by timurrrr; 11-16-2022 at 03:26 AM.
timurrrr is offline   Reply With Quote
Old 02-19-2021, 03:17 AM   #9
timurrrr
Senior Member
 
timurrrr's Avatar
 
Join Date: May 2019
Drives: 2022 GR86
Location: Between Sonoma and Laguna Seca
Posts: 1,707
Thanks: 2,129
Thanked 1,297 Times in 718 Posts
Mentioned: 30 Post(s)
Tagged: 1 Thread(s)
Here's another great example of what kind of data can be acquired from the CAN bus.


This is me losing the car a little bit after crossing a wet patch in an otherwise dry corner:



Data:



Green line: Accelerator
Cyan line: Steering wheel angle
Purple line: Combined acceleration (from the CAN bus, unfiltered)
Orange line: Yaw speed a.k.a. rate of vertical rotation (degrees per second)

As you can see from the data, around 1229.5s I hit the wet patch and the car briefly lost ~50% of its grip. I then pressed the throttle too much and, despite counter-steering, the car started to enter a spin. I then counter-steered way too much, and lifted the throttle — which of course made the car snap to the outside. Luckily, I was able to quickly correct my mistake and tuck the car back in the correct direction, avoiding the walls.

Now I need to change my pants and go find a skidpad

Last edited by timurrrr; 11-16-2022 at 03:28 AM.
timurrrr is offline   Reply With Quote
Old 08-25-2022, 03:20 PM   #10
bfitzy
Junior Member
 
bfitzy's Avatar
 
Join Date: Oct 2021
Drives: 2013 Subaru BRZ Limited 6M
Location: Ottawa
Posts: 3
Thanks: 0
Thanked 4 Times in 2 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Attempts to get Arduino Program Compiled is failing

Hey timurrrr,

I just want to say that this project you've created is awesome and I really want to try to make this device for my BRZ. Before I buy the parts, I wanted to make sure I could get your program to compile on my Arduino UNO as a test, but ran into a snag with a library inclusion.


I've done a bit of Arduino stuff in the past but not a whole lot so this may be a noob question and solution.



So, I downloaded the two libraries you created which are needed for the RaceChronoDiyBleDevice software to run. When I try to test compile RaceChronoDiyBleDevice.ino, Arduino IDE complains that there is no library for algorithm that is defined within the RaceChronoPidMap header file.

Arduino: 1.8.19 (Linux), Board: "Arduino Uno"
In file included from /home/bfitzy/Arduino/libraries/RaceChrono/src/RaceChrono.h:4:0,
from /home/bfitzy/Arduino/RaceChronoDiyBleDevice/RaceChronoDiyBleDevice.ino:4:
/home/bfitzy/Arduino/libraries/RaceChrono/src/RaceChronoPidMap.h:4:10: fatal error: algorithm: No such file or directory
#include <algorithm>
^~~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Arduino Uno.

Any ideas what I'm missing here? Orignally I thought maybe I needed to update g++ but seems like I'm running the newest compiler. I'm running Debian based PopOS btw.



Thanks in advance!
Brad
bfitzy is offline   Reply With Quote
Old 09-02-2022, 01:08 AM   #11
timurrrr
Senior Member
 
timurrrr's Avatar
 
Join Date: May 2019
Drives: 2022 GR86
Location: Between Sonoma and Laguna Seca
Posts: 1,707
Thanks: 2,129
Thanked 1,297 Times in 718 Posts
Mentioned: 30 Post(s)
Tagged: 1 Thread(s)
Quote:
Originally Posted by bfitzy View Post
Before I buy the parts, I wanted to make sure I could get your program to compile on my Arduino UNO as a test, but ran into a snag with a library inclusion.
[...]
fatal error: algorithm: No such file or directory
#include <algorithm>
^~~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Arduino Uno.

Any ideas what I'm missing here? Orignally I thought maybe I needed to update g++ but seems like I'm running the newest compiler.
You won't be able to compile this project for an UNO, as that is a very basic board that doesn't have all the necessary hardware (e.g. BLE).
Apparently, they didn't even bother providing the standard C++ <algorithm> header that has a lot of helpful utils

I suggest you get an nRF-based board to play with, they aren't that expensive.
__________________
Follow the build thread for my GR86!
timurrrr is offline   Reply With Quote
Old 09-02-2022, 01:13 AM   #12
timurrrr
Senior Member
 
timurrrr's Avatar
 
Join Date: May 2019
Drives: 2022 GR86
Location: Between Sonoma and Laguna Seca
Posts: 1,707
Thanks: 2,129
Thanked 1,297 Times in 718 Posts
Mentioned: 30 Post(s)
Tagged: 1 Thread(s)
Forgot to post that this project has been updated to work on 2022+ GR86/BRZ.
The primary focus now is 2022+ cars, but it should still work fine on gen1 cars.
You just need to tweak one of the files to specify which car you have.
If you forget to do that, the code will fail to compile, and the error will nudge you in the right direction.

Demo from a track day in my 2022 GR86:

__________________
Follow the build thread for my GR86!
timurrrr is offline   Reply With Quote
The Following 3 Users Say Thank You to timurrrr For This Useful Post:
jflogerzi (09-03-2022), MrSkubi (09-02-2022), whataboutbob (09-02-2022)
Old 09-12-2022, 01:17 AM   #13
Ronac
Junior Member
 
Join Date: Jun 2022
Drives: Gr86
Location: Vancouver
Posts: 6
Thanks: 0
Thanked 5 Times in 2 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
I have a OBDlink MX+ that I use with Racechrono and I basically can log everything I want except brake % or brake pressure. I'm a bit lazy so I'd rather not build this reader just to get that one variable. Would you happen to know if I can access that via OBD?
@timurrrr I see in another thread that you found it for the first gens. Any idea if we have it for the second gen cars?
Ronac is offline   Reply With Quote
Old 09-12-2022, 01:56 AM   #14
timurrrr
Senior Member
 
timurrrr's Avatar
 
Join Date: May 2019
Drives: 2022 GR86
Location: Between Sonoma and Laguna Seca
Posts: 1,707
Thanks: 2,129
Thanked 1,297 Times in 718 Posts
Mentioned: 30 Post(s)
Tagged: 1 Thread(s)
Quote:
Originally Posted by Ronac View Post
I have a OBDlink MX+ that I use with Racechrono and I basically can log everything I want except brake % or brake pressure. I'm a bit lazy so I'd rather not build this reader just to get that one variable. Would you happen to know if I can access that via OBD?
@timurrrr I see in another thread that you found it for the first gens. Any idea if we have it for the second gen cars?
I suggest you don't use the OBD-II protocol, as it's very slow.
Use the CAN protocol instead.

RaceChrono supports reading CAN data via OBD-II port on gen1 cars,
you just need to add it as a CAN reader instead of an OBD reader in RaceChrono settings.
Here is the data mapping:
https://github.com/timurrrr/RaceChro...mended-can-ids

gen2 cars have no CAN data on the OBD-II port, or at least not without some currently unknown tricks.
Since I already had a DIY device, I just use it instead of trying to figure out half-measures such as OBD-II PID for the brake pedal.
__________________
Follow the build thread for my GR86!
timurrrr is offline   Reply With Quote
 
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Abs Code reader ilovetheabel Suspension | Chassis | Brakes -- Sponsored by 949 Racing 5 09-23-2018 03:36 PM
Gauges Vs. OBDII Reader + App HachiRo Scion FR-S / Toyota 86 GT86 General Forum 21 12-04-2017 09:12 PM
Code reader recommendations? FLYFISHR Mechanical Maintenance (Oil, Fluids, Break-In, Servicing) 4 08-01-2014 10:01 AM
OBD II reader says my throttle open %80.78 theom Electronics | Audio | NAV | Infotainment 9 10-04-2013 07:23 PM
Obd ii reader Jhon19lopez Electronics | Audio | NAV | Infotainment 1 06-03-2013 11:12 AM


All times are GMT -4. The time now is 10:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
User Alert System provided by Advanced User Tagging v3.3.0 (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.

Garage vBulletin Plugins by Drive Thru Online, Inc.