Yoshi’s Drift Box: Day 7

It seems like every time I make a post on this project, I do completely different things than I set out to do in the post. I wound up cleaning up some code (but not much). I realized that the gauge animation code ate up a significant amount of time between PID polls so I managed to get a 4 PID from 600ms down to about 150. After that, I did some GUI improvements. The Subaru ECU still proves to be temperamental but things consistently work.

Originally, I wanted the log parser in a web application format but I don’t have time to learn everything I want to. So I started up a windows application. The application is still very fragile but it does load up logs and let you see data points as well as mix and match logged elements. It gives things like time stamps as well as parsing the GPS information.

I copied over the KML google earth code that I wrote and then wound up rewriting almost completely. I managed to get it to take in the GPS data but colorize the line based on any other logged data. The image below shows the line plot with speed information overlayed. Red is where the vehicle was stopped and green was my top speed for that log.

From here, I’d really like to output this data to something that can be imported by a video editor and overlayed on some in car footage. I also might go back to trying to get external input logging reliably. Or I might clean up code some more. I’m not entirely sure.

Posted in Drifting, Technology | 1 Comment

E30 Brake System Overview

While troubleshooting my general brake issues, I found numerous gaps in my own knowledge. So here is my current understanding of the general E30 brake system (within reason). To start, late model E30s (not sure about before) have a 17mm rear and 22mm front sized Girling master cylinder. I’m surprised by the 17mm rear. To my knowledge, the ABS unit provides nothing other than ABS functionality. I think late model E36s and all E46s use the ABS unit to proportion as well as perform ABS functions.

E30s have 1 proportioning valve behind the driver’s shock tower on the rear line. I don’t know what its specifications are or why it’s there. Here’s the part number to delete it. (M10x1.0) though I havent tested this. But it’s there. My googling shows it as a common issue with the SpecE30 crowd. The ABS unit itself receives both inputs from the master and splits only the front lines out (see diagram below).

The rear line follows along the fuel lines to the back of the car where it wraps above the subframe and is T-ed out above the diff/subframe combo (T part number 34341111435).

The front passenger’s line run against the firewall under the heater core flap. The driver’s side simply exits on the shock tower and in front of the proportioning valve for the rear. The above diagram properly notes which port of the master cylinder goes front or rear (V front, H rear). I did not fully note down the ABS unit ports. Lower case “h” is for the rear but I don’t recall what “I” or “J” goes to (it’s left or right).

Posted in E30 | Leave a comment

Manual brakes – LS E30 problems

The LS swapped E30 inherently has to ditch the vacuum assisted brakes. Directly bolting the factory master cylinder to the firewall causes a large increase in pedal effort that isn’t acceptable. For this reason, the brakes cannot be left alone. Here are several options that I’ve researched and extremely generalized numbers to go with them.

Hydroboost Assist
Hydroboost is an assist method commonly used in diesels and trucks/vans. Diesels don’t make vacuums so the regular vacuum booster wouldn’t work. Hydroboost systems generate their assist based off of a fluid pump. Sikky makes a hydroboost kit based off of an E350 booster (IIRC) that is driven from the power steering pump.

Pros – No other modifications are necessary to your brakes. Plug in the kit and have factory feeling brakes back.

Cons – Some people don’t like the pedal feel and consider it “squishy”. If you drift and left foot brake, it completely changes how the pedal feels. There is added complexity to the engine bay but it’s not too bad. My only issue was that my track use overheated the unit and caused the brakes to stick.

Cost – The full kit from Sikky is ~$1200 with booster. But that’s it, plug in and go!

Wilwood Pedal box
He’s one I’m not super sure about. This should be another solution where you install it and go about your life. It replaced the clutch and brake pedal box with a proprietary pedal set. Garagistic makes a pedal box adapter so placing the pedal set in the car is simpler.

Pros – wilwood quality and adjustment. Allegedly still should keep the factory feel and function.

Cons – This looks like (again I haven’t done this) it would require a good amount of fabrication and work to fit into the car.

Price – The pedal adapter is currently $125, the pedal set is $200, and another ~$300 for 3 master cylinders. Plus miscellaneous fabrication and fittings. So I figure ~$800 all done.

Manual brakes and BBK
RX7 front brakes are a common cheap upgrade to the front of E30s. But they aren’t a complete solution. Massive makes an adapter bracket to physically remove the booster. But those two mods alone won’t give back the factory braking effort. I tried using a VW beetle (17mm) master cylinder. The car does stop better but now the pedal is squishy and still no where near factory levels of braking.

Pros – Cheaper of the solutions (but not by much). Fewer parts to worry about and requires little to no fabrication (just the pedal pivot relocation).

Cons – Doesn’t give great braking feel/force. But it works ok.

Price – ~$300-600 depending on what parts you pick up

Manual Brakes With Wilwood Calipers
This is the same as above but using wilwood brand calipers. The calipers are about $120 each for the front and $100 each for the rear so that and the welding needed to attach the calipers puts this around the $1,000 mark.

Pros – Better (possibly) factory feeling brakes. That cool wilwood logo.

Cons – Requires a GOOD welder as I haven’t found anyone making bolt on brackets for these. As I haven’t tried this, it’s possible braking still won’t be up to par with the factory.

Price – ~$1,000 depending on how much you can do yourself.

Manual Brake With 5 Lug swap
The biggest issue with the wilwood calipers is that the small factory rotors become the limiting factor. Larger diameter rotors give better braking (overly generalized). Swapping to full M3 E36 calipers (or E46 330 or any other swap option) will give better braking with the manual braking setup.

Pros – If you were already doing a 5 lug swap, this isn’t an issue. Retains factory parts. Very well documented swap.

Cons – Still might not give you factory braking (don’t quote me on that). Requires you to get 5 lug rims/tires/etc. And there’s 80 ways to go with the swap that might not give better braking performance. I think the E36 318 rear brakes aren’t as good as the Z3 rear brakes.

Price – $1200+

Brake Booster Relocation
Here’s a link to the basic setup. Essentially, you pull all the parts from an E32/E34 and fab it to fit an E30.

Pros – Mostly OEM parts. Retains the booster so it’s all factory.

Cons – Probably one of the most involved setups but not by much. You need to be able to weld and do brake fittings. This deletes the ABS unit and shoves all the bits in there. More parts in the engine bay and theoretically more parts for failure.

Price – ??? No one sells a kit and you’ll have to pay whatever the junkyard prices are. I honestly think this could be the cheapest of the “good” options.

Posted in E30, Technology | Leave a comment

Yoshi’s Drift Box: Day 6

A lot has happened in 2 weeks. I found out that the I2C bus is easily susceptible to noise like in an automotive environment so the UART connection made a bit more sense. Even though it can only take in 1 input, I’m only going to connect 1 arduino. Which works out great because now I don’t have to split out the I2C connector.

Here’s what the current setup looks like. You push the button, the arduino uno reads it, sends it to the arduino mega, and the mega displays it on screen. With that, I’ve officially reached the end of the “proof of concept” stage. Now I know and have setup every major milestone in the system. The rest is code and finalizing IO.

Before that, I worked a bit on the gui. I went for that old NES look. The touch screen now displays 3 different setting screens. So far they don’t do much of anything, but you can swap between them. I’ve also been toying with some DTC reading/scanning/clearing code but that’s really far on the list of priorities.

The down side I realized is that the more PIDs you poll from the OBD2 port, the slower everything goes. Just reading the RPMs was a 60ms lead time. Reading in the final list of what I want (rpm/iat/clt/throttle %) bumps that time up to 600ms (over half a second). This is likely due to the kwp2000 “fast” protocol not being able to give me the data fast enough. But I think the LS2 uses the CAN protocol so this might be a non issue. I should test on the E30 soon.

From here, there’s still too much to list that needs to be done. For instance, I’d like to be able to read in a config file from the SD card. The main goal is to start cleaning things up. My code is pretty disjointed and messy. I’d mainly like to polish the GUI. Maybe look more into reading PIDs faster.

For my own archive, here’s the current list of external IO for the uno to eventually log:
Accelerometer for the uno (another MEMS to keep things consistent?)
Clutch switch
Brake switch
Ebrake switch
Steering wheel input? (I have no idea how I would do this)

Posted in Drifting, Technology | 1 Comment

Yoshi’s Drift Box: Day 5

OK I lied. The urge to work on the expansion of inputs won over and I’ve done a bunch of research into that. The I2C connector the OBD2 plug uses is an expandable bus while the UART plug is only able to take in a single input. As a result, I made the decision to use another arduino (uno) on the I2C bus using the existing plug on the LCD TFT screen. This gives me another set of digital and analog inputs that can be farther away from the main unit (without tons of wires all over). This will also make a great way to mount a second accelerometer to calculate slip angles later.

Anyway, some sexy mods I did was to figure out how to make a basic dial gauge. I’m going to use it for RPMs since the tachometer doesn’t work on the LS E30. It’s also very noteworthy that the lag time between the car’s tach in the IG video and the arduino is minimal. This beats out most bluetooth solutions I’ve used in the past. This makes me very happy.

Uh. Turn it sideways

A post shared by The Thrusting Penis of Justice (@protomor) on

I’m still ordering parts here and there for the new arduino setup. But in the man time, I should be able to start to build out the UI. I’d like to get it broken into a few different useful screens. One will likely be checking and clearing DTCs and one will likely be just a main gauge readout. I figure I’ll have a third for reading out tons of other stuff but I haven’t fully filled out that thought process yet.

Posted in Drifting, Technology | 1 Comment

Drift Box

Drift boxes are units for on track data acquisition. Many aftermarket units are well into the thousand dollar range. I’d like to create a cheap unit for data logging and drift telemetry.

Drift Box Day 0: Project overview

Drift Box Day 1: Basic setup

Drift Box Day 2: Images, touch screen, and accelerometer logging

Drift Box Day 3: GPS data parsing and KML export

Drift Box Day 4: OBD2 logging successful

Drift Box Day 5: I2C success and graphics

Drift Box Day 6: More external input and GUI updates

Drift Box Day 7: Data log viewer

Drift Box Day 8: Logger V1, new Freematics kit

Drift Box Day 9: Close to beta testing

Drift Box Day 10: Fruits of labor

Drift Box Day 11: Dashware and functionality additions

Posted in Uncategorized | Leave a comment

Yoshi’s Drift Box: Day 4

I finally managed to get the OBD2 protocol working. It was mildly embarrassing but at least it works now. The screen shot below looks like a jumbled mess but that’s ok. To help figure out sizes and place things appropriately on screen, I’ve added a grid background. At this point, every major component outside of the external input, has reached “proof of concept” stage. Now it’s time to start polishing.

I think my next step is to clean up the UI and get it to display things I want. I’ll do an attempt at the G meter animation but it’s not the most important thing right now. If it does get done, it’ll be to test the refresh rate and speed of the animation.

Otherwise, I’d really like to get a sexy background up so it doesn’t look like the mess that it currently is.

Posted in Drifting, Technology | 1 Comment

Yoshi’s Drift Box: Day 3

Well at least I’ve made some form of progress. I originally wanted to make the log files queue all data then export gut the gps polling and other parts of the system don’t update in unison so it was simpler to leave the logs the way they came from Freematics.

I did whip up this quick windows application to parse the log files into separate bits. Ideally, I want to create a web application that will do all of this regardless of your operating system. For now, I just needed something to take the log files spat out and turn them into the KML format to load into google maps/earth.

The KML file format is a bit foreign to me but I did manage to get it to load. Eventually, I’d like to make the line color change according to accel/decel so you can more accurately view your data.

The data is even good enough to see what lane I’m in. Which is good considering the GPS unit I have is the cheap/slow/inaccurate model. I think the altitude is also a bit off or google maps doesn’t have their altitude right on the map.

On top of this, I have managed to get buttons to work on the touch screen. I’m not entirely sure what I’m going to use them for, but I have them. In the mean time, I’ve become obsessed with figuring out why the unit won’t connect to my daily driver 2–7 Subaru. It’s technically some form of CAN bus. But regardless, the unit should connect. Older Subarus are “ISO 9141-2” and mine falls into a weird split where google isn’t helpful. Either the car is “KWP2000 FAST” or “CAN 11bit 500K”. None of these settings seem to work.

Without it, I can’t test full data logging without driving around the race car. Winter is not the best time to drive it around.

I’m not entirely sure what my next steps are. I might bang my head against this OBD Protocol issue until I figure it out. If I do, I’ll either work on the UI of the device itself or start working on parsing data logs to find useful information. I did have this idea for a G force readout animation. The arduino might not be able to render that much though.

Posted in Drifting, Technology | 1 Comment

Yoshi’s Drift Box: Day 2

It’s only been a year and two months since my last update. I did get a lot of interest in this project so I figure I’d update.

Before I put this away last time, I managed to get all major features working except accepting external IO. There still is some left over pins and ports so creating an analog to digital conversion that links into the arduino’s bus shouldn’t be too hard. But I do expect it to be the most involved part of this.

I forget what the special secret was from the last post so here’s the outline of what I want to get done:

  1. Log all data to external SD card
  2. Load background image from SD card for “theming”
  3. Display useful data on screen
  4. Math for drift data/scoring
  5. Accept external I/O sensors like steering angle
  6. External software/website for parsing log files
  7. Touch screen has toggle buttons for various cool things

Interestingly, most of the concepts have already been proven. I wound up hacking up a lot of the canned touch screen and SD card code but I got the background images to load using this UTFT RGB565 converter. The “raw” file format used by the UTFT lcd screen is proprietary so this converter is a necessary evil. It’s a bit of an annoying step but it works.


The green text on the middle left of the image is the current coordinates of the press. It isn’t a button per se but it will allow me to accept touch input then do something as a result.

Finally, here is an excel print out of 3 minutes of log time for the accelerometer chip. It’s integrated into the OBD2 port under the dash so that could prove problematic. For some reason, there seems to be some offsets. Z axis appears to be forward/backward movement and Y axis seems to be side to side movement.

Unfortunately, my daily driver subaru won’t connect to the I2C OBD2 adapter and read PIDs but it will do everything else. So in the mean time, I hope to get the logging format hammered out and some more polish work on the code as a whole.

For my next update, I’ll likely focus on the GPS unit and see how I can export that to google maps.

Posted in Drifting, Technology | 1 Comment

Driver Theory: Jefferson Expansion Post Mortem

Well that did not go according to plan. Jefferson wound up getting run in a reverse configuration. The course started at the #11 corner station and ran clockwise until corner station/corner #1.

CaptureI only managed to get 2 honest runs in before I gave up for the day (1 normal drive through first). I almost crashed both runs and decided to cool down elsewhere. Pushing when frustrated has led to previous crashes so I tried to recognize my limits (excuses).

In reverse, the track actually flows quite well. There are only 2 major sticking points. The first is corner 8. Stretching the first corner (10) into 9 puts you into a slight straight away before corner 8. You can’t see how tight the corner becomes so over shooting is easy. This corner ended at least 2 driver’s days an is where I went off on my first run.

The second sticking point is the corner set of 5/4/3. They are gentle corners with long straight-aways. The first half of the course, I was constantly on the rev limiter in third, so stretching the second half in the same gear probably isn’t possible. I straightened of flew off the course entirely in this section.

With more practice, I’m confident the majority of the course is doable. It’s simply the 5/4/3 section that needs an upshift that I’ve never done before. 3rd gear allows for up to a 60mph average speed. So 4th will likely easily hit 80. The bar has raised and I can’t wait to hit it.

Posted in Drifting, Theory | Leave a comment