18 November, 2021. Brake Setup and the Arduino.
18 November, 2021. Brake Setup and the Arduino.

18 November, 2021. Brake Setup and the Arduino.

The next step from the last post was re-bleeding the hydraulics, and then to see if the changes had worked.

Firstly the clutch now feels ‘right’ so that’s done and then it was onto the brakes.

Setting a target.

From the brake calculation spreadsheet I have I came up with a target curve for brake pressures that looks like this:

Target brake pressure curve.

The point at which the slope of the curve changes is where the proportioning valve kicks in. The spreadsheet has several assumptions in it such as the coefficient of friction of the brake pads, the same for the tyres, where the center of gravity is in the car etc. so this is a starting point only with real world testing required.

The graph shows for the front pressure on the vertical and the rear pressure on the horizontal, so for any measured rear pressure we know what the front should be. This is how I can use this to activate the brake system warning light, if the pressures done stay on the curve then somethings wrong and Arduino will then turn on the warning light. Onward…

Measuring the real situation

The pressure sensors were hooked up to an Arduino UNO using 0-5V analogue inputs. The Arduino has a resolution of 1024 steps over the 5V range, but the sensors run from 0.5V at 0 PSIG to 4.5V at full range so in reality we can only use 4V range of the 5V, so that’s 820 steps. Which means for a 1,000 PSIG sensor you can get a 1.22 PSI resolution and for a 2,000 PSI one 2.44 PSI per step which is way more than good enough.

Arduino hooked up.

Here’s the basic code used to read the values:

void setup() {
// put your setup code here, to run once:
int FrTar;
String S1=”, “;
String SFr=”Fr, “;
String SRe=”Re, “;
String SHiLo;

void loop() {
// put your main code here, to run repeatedly:
int FrVal = analogRead(A1);
int ReVal = analogRead(A0);
int VVal = analogRead(A2);

float FrPSI= ((FrVal0.00488759)-0.5)*250;
float RePSI= ((ReVal0.00488759)-0.5)*500;
float VRail= VVal*0.00488759;
// Chop off negative values
if (FrPSI < 0) { FrPSI = 0; }
if (RePSI < 0) { RePSI = 0; }

// Calc target front value
if (RePSI < 500) { FrTar = RePSI * 0.5214; } //check math
else { FrTar = ( RePSI * 1.2126 ) – 346; } //check math

// Calc Hi or Lo
//if (FrTar > FrPSI) { SHiLo = “Front Low, “;}
//else { SHiLo = “Front High, “;}

// send to monitor
Serial.println(ReVal + S1 + FrVal);

I used a few variations of this along the way, but its simply read the voltage on a pin A0, A1, A2 then do a bit of math to turn it in to PSI then calculate a target value and see if the actual value value was higher or lower than the target.

Something is not right

The result is then sent to the serial monitor, I used RealTerm to capture that output to a text file. Which could then be plotted in excel. After the first nights testing I was struggling with whole thing, changing the brake balance bar was making no difference to anything and I seemed unable to get the kinds of pressures in the system I was expecting.

The Honewell Sensors I’m using have a supply current of up to 8 mA so 16 mA so according to the documentation the Arduino should have been easily able to power the sensor from just the USB connection to the laptop. I found a 12V power supply to plug it into though and magically everything got better all of a sudden.

Here’s the first run with the sensors working correctly:

You can see that’s 1,200 psi on the rear and about 1,100 at the front, the blue line is the measured and the orange is the target, the slope of the blue line is due to the balance bar proportion and there’s no kink in the line so the proportioning valve did not engage.

There then followed about a bunch of stuffing about whilst I worked on the best way to get it on to the target curve.

In the end I picked a point at 500 psi for the rear (with the proportioning valve adjusted not to work). Which meant the font should be at 260 psi at that point, setting the program to only send values when the rear was between 490 and 510 psi I could easily grab the numbers whilst sitting in the car and then adjust the balance bar to suit.

Once that was done I repeated it at 800 psi rear and 625 front, but this time leaving the balance bar alone and adjusting the proportioning valve instead.

After that I recorded the pressure from 10 repeats of pressing the pedal and letting it go. Plotting that all out I got the graph below:

You can see there a bit of a front bias in there, but this will do to start. Note on the bottom where there are fewer scattered dots, this is when the pedal is being released. you can see initially as the pressure on the front falls, but not the rear, until it gets back to what would be the un-proportioned curve. This I believe is the spring loaded mechanism in the proportion valve releasing before the pressure in the rear circuit can fall. I don’t think that this is a problem I think this is just how it works.

Before bolting in the pedal assembly, I’l followed the Wilwood instructions on setting up the balance bar, as described in this video:

What bothered me was the amount of side to side free play in the, balance bar assembly I didn’t feel that the balance could be consistent as a result. In the end it dawned on me that it didn’t matter, and that the only measurements that do are from the center pivot of the bar to the clevis pivot points, these only move when you adjust the bar even if the whole assembly can slide inside the pedal tube. So the advice is follow the manufactures instructions and don’t make the gap too small or the whole thing will bind and the balance will be lost.

Arduino plan

The future for the Arduino is I plan to use it to control:

  • Brake system warning lamp.
  • Seat belt warning lamp
  • Stop lamps
  • Indicator / hazard flasher

There’s maybe some other stuff it can be used for, but we’ll see.