State of Art (history)
computer aided
suspension design
Below is a short computer program written back in 1985 on one of the pioneering home computers the Sinclair Spectrum. I wrote it to try and optimise the suspension geometry on the Countess kitcar that I built and then again when designing my own car. I also wrote a complimentary program to calculate spring rates.
Written in Basic, the program asks the user to input the location of the suspension pivot points (both inner and outer) relative to the car centre line. Next it asks for the height above ground of the same pivot points to be entered. Finally it asks the distance of the tyre centre line from the car centre line (half the track width) to be entered. From the above coordinates the program calculates the position of the instantaneous centre and roll centre.
Once that has been done, the user is asked to enter a roll angle. The program then rotates the inner pivot points around the roll centre and calculates where the outer pivot points will move to. Finally it calculates, assuming that the tyre was originally upright, what angle the tyre camber will be with respect to the ground.
If you want to try out both of the programs click on links below and save the
files (You may need to right click and select save target as). They are
tzx files and will run on Spectrum emulators which can be downloaded from
the internet (see the links page). Even on today's super fast computers, the one
I tried ran the programs just as slowly as the original Spectrum.
Camber change prog'
| 0 | REM | |
| 6 | POKE 23756,0 (this line made the ink and paper the same colour if anyone tried to LIST the program) | |
| 10 | LET roll = 2000 | |
| 20 | LET clear = 3000 | |
| 100 | PLOT 0,50 : DRAW 245,0 : PLOT 20,30 : DRAW 0,135 | |
| 110 | CIRCLE 100,70,2 : CIRCLE 190,115,2 | |
| 120 | PLOT 101,69 : DRAW 96,0 :DRAW 56,15 : DRAW 0,2 : DRAW -56,-15 | |
| 130 | PRINT AT 6,16;"A"; AT 6,24;"B"; AT 12,12;"C"; AT 12,25;"D" | |
| 135 | PRINT AT 2,4; "Enter in correct order"; AT 3,10;"ABCD" | |
| 140 | PRINT AT 16,4; "Enter measurements (cm) of the distance from the care centre line to the suspension pivot points." | |
| 150 | INPUT x1,x2,x3,x4 | |
| 152 | PRINT AT 20,0; x1,x2,x3,x4 | |
| 153 | PRINT AT 16,4;"Are the values correct? Y/N " | |
| 154 | PAUSE 0 | |
| 155 | IF INKEYS <> "y" AND INKEYS <> "Y" THEN GOTO 140 | |
| 156 | GOSUB clear | |
| 160 | PRINT AT 16,4;"Enter measurements (cm) of the distance above ground of the suspension pivot points." | |
| 170 | INPUT y1,y2,y3,y4 | |
| 172 | PRINT AT 20,0; y1,y2,y3,y4 | |
| 173 | PRINT AT 16,4;"Are the values correct? Y/N " | |
| 174 | PAUSE 0 | |
| 175 | IF INKEYS <> "y" AND INKEYS <> "Y" THEN GOTO 160 | |
| 176 | GOSUB clear | |
| 180 | PRINT AT 15,26;"X" | |
| 182 | PRINT AT 16,4;"Enter the measurment (cm) of the distance from the car centre line to the tyre centre line." | |
| 184 | INPUT track | |
| 198 | LET lenU = SQR(ABS(y2-y1)^2 + ABS(x2-x1)^2) | |
| 199 | LET lenL = SQR (ABS(y4-y3)^2 + ABS(x4-x3)^2) | |
| 200 | LET grad1 = (y2-y1)/(x2-x1) | |
| 201 | LET grad2 = (y4-y3)/(x4-x3) | |
| 202 | LET const1 = y2-grad1*x2 | |
| 203 | LET const2 = y4-grad2*x4 | |
| 204 | LET a = (const2 - const1)/(grad1 - grad2) | |
| 205 | LET b = grad1*a + const1 | |
| 208 | LET grad3 = -b/(track - a) | |
| 209 | LET grad4 = (x4-x2)/(y4-y2) | |
| 210 | LET const3 = -1*((-b/(track - a))*track) | |
| 211 | CLS : PRINT "inst' centre "; INT (a+0.5);","; INT (b + 0.5) | |
| 212 | ||
| 213 | PRINT "roll centre" ; INT(const3 + 0.5) | |
| 1000 | PLOT 0,50 : DRAW 250,0 : PLOT 20,30 : DRAW 0,120 | |
| 1010 | CIRCLE x1*2 + 20, y1*2 + 50, 2 | |
| 1011 | CIRCLE x2*2 + 20, y2*2 + 50, 2 | |
| 1012 | CIRCLE x3*2 + 20, y3*2 + 50, 2 | |
| 1013 | CIRCLE x4*2 + 20, y4*2 + 50, 2 | |
| 1014 | PLOT track*2 + 20, 45 : DRAW 0,60 | |
| 1017 | LET c2 = 50 - (grad3*(track*2 + 20)) | |
| 1018 | LET c = y2*2 + 50 -(grad1*(x2*2 + 20)) | |
| 1019 | LET c1 = y4*2 + 50 -(grad2*(x4*2 + 20)) | |
| 1020 | FOR n = 0 TO 255 | |
| 1025 | LET z = grad1 * n + c : LET z1 = grad2 * n + c1 : LET z2 = grad3 * n + c2 : | |
| 1026 | INK 4 | |
| 1030 | IF z1 >0 AND z1<175 THEN PLOT n,z1 | |
| 1032 | IF z >0 AND z1<175 THEN PLOT n,z | |
| 1035 | INK 2 | |
| 1036 | IF z2 >0 AND z1<175 THEN PLOT n,z2 | |
| 1040 | NEXT n | |
| 1045 | INK 0 | |
| 1100 | LET Q = x1 : LET W = y1 | |
| 1120 | GOSUB roll | |
| 1125 | LET f = v : LET g = h | |
| 1150 | LET Q = x3 : LET W = y3 | |
| 1160 | GOSUB roll | |
| 1165 | LET f1 = v : LET g1 = h | |
| 1199 | GOSUB 3100 | |
| 2000 | LET l = SQR((Q)^2 + (w - rc)^2) | |
| 2012 | LET sinang = (w - rc)/l | |
| 2020 | LET angle = ASN sinang | |
| 2030 | LET newang = angle -(rc*PI/180) | |
| 2040 | LET sin = SIN newang | |
| 2045 | LET cos = COS newang | |
| 2050 | LET v = sin*l + rc | |
| 2060 | LET h = cos*l | |
| 2070 | CIRCLE h*2 + 20,v*2 + 20,2 | |
| 2080 | RETURN | |
| 3000 | PRINT AT 20,0;" " | |
| 3001 | RETURN | |
| 3100 | LET sinQ = (y2 - f)/lenU | |
| 3110 | LET Q = ASN sinQ : LET cosQ = COS Q | |
| 3120 | LET lenx% = cosQ*lenU | |
| 2130 | LET x5 = g + lenx5 | |
| 3140 | CIRCLE 2*x5 + 20,2*y2 + 50,2 | |
| 3200 | LET sinQ1 = (y4 - f1)/lenL | |
| 3210 | LET Q1 = ASN sinQ1: LET cosQ1 = COS Q1 | |
| 3220 | LET lenx6 + cosQ1*lenL | |
| 3230 | LET x6 = gl*lenx6 | |
| 3240 | CIRCLE 2*x6 + 20,2*y4 + 50,2 | |
| 3300 | LET grad5 = (x6 - x5)/(y4 - y2) | |
| 3310 | LET anga = (ATN grad4)*180/PI | |
| 3320 | LET angb = (ATN grad5)*180/PI | |
| 3330 | LET diff = ABS anga - ABS angb | |
| 3340 | PRINT AT 20,0;"Camber Change ";diff;" degrees." |