logo

Braking System with Matlab - PDF

   

Added on  2021-04-17

10 Pages4095 Words141 Views
BRAKING SYSTEM WITH MATLABIntroductionThe goal of this exercise has been to create a matlab program to represent a reasonably accurate model of a racing car travelling around an arbitrary circuit. This allows experimentation to take place with a variety of factors that are likely to affect the performance.A number of assumptions have been made thus far that are likely to affect the outcome, to a greater or lesser degree:i)The coefficient of friction of the tyre remains constant at all times- in practice, this tails off as the load placed on the tyre increases, and hence brings into play the design of the suspensionin terms of the effects of weight transfer, and the possible benefits of adding downforce.ii)The sample points on the circuit are close enough together to calculate the car’s performance statically at each point. Acceleration between sample points is taken to be constant.iii)The driver is capable of getting the maximum performance from the tyres during braking and cornering (or is ableto achieve a fixed percentage of the maximum possible forces).iv) The circuit is completely flat – no hills or dips are present.– in practice the presence of hills will affect the ability of the car to brake and accelerate, aswell as the grip available from the tyres for cornering.Side Slip, Deceleration * Angular Velocity Matlab Codeclose allclearm = 300; %mass of the vehicleg = 9.81; %gravitation forcer = 0.32;I = 1;v0 = 38.88889; %mps of 140kmph velocityw0 = 100;desiredSlip = 0.2; %normal forceFN = m*g;%temporary MbMb = 1500;v(1) = v0;w(1) = w0;%controllerKp = 1000;P0 = -50;%counter for vectorsvecPos = 1;%step sizeh = 0.01;for t = 1:h:10%calculate slip ratio
Braking System with Matlab - PDF_1
%slip ratio = the spin velocity divided by its actual world velocity.%A slip ratio of -1 means full braking lock;%a ratio of 0 means the tire is spinning at the exact same rate as the road is disappearing below it.%A slip ratio of 1 means it's spinning. slipRatio(vecPos) = (v(vecPos) - w(vecPos)*r) / v(vecPos);%adjust slip if it exceeds its limitsif(slipRatio(vecPos) > 1) slipRatio(vecPos) = 1;elseif(slipRatio(vecPos) < 0) slipRatio(vecPos) = 0;end%calculate the error slipError(vecPos) = abs(slipRatio(vecPos)-desiredSlip);%adjust Mbif(slipRatio(vecPos) > desiredSlip) Mb = Mb - Kp*slipError(vecPos) + P0;elseif(slipRatio(vecPos) < desiredSlip) Mb = Mb + Kp*slipError(vecPos) + P0;end%calculate friction using Pacejka's Magic Formula u = sin(1.9*atan(10*slipRatio(vecPos) - 0.97*(10*slipRatio(vecPos) - atan(10*slipRatio(vecPos)))));%u = 1.28*(1-exp(-23.99*slipRatio(vecPos)) - 0.52*slipRatio(vecPos));%update wheel angular velocity dw = (r*u*FN - Mb) / I; w(vecPos+1) = w(vecPos) + h*dw;%update car velocty dv = -u*FN/m; v(vecPos+1) = v(vecPos ) + dv*h;%if car velocity is zero or lower, stop simulationif(v(vecPos+1) < 0) v(vecPos+1) = 0;breakend%count array vecPos = vecPos + 1; endplot(v)title('Deceleration')xlabel('t') % x-axis labelylabel('v') % y-axis label
Braking System with Matlab - PDF_2
figureplot(w)title('Angular Velocity')xlabel('t') % x-axis labelylabel('w') % y-axis labelfigureplot(slipRatio)title('Side Slip')xlabel('t') % x-axis labelylabel('Slip Ratio') % y-axis label%ends hereBraking Operationsclear, clc;%% Conversion Factorsft2Meters = 0.3048; %1ft = 0.3048mMiles2Meters = 1609.344;mph2ms = 1609.344/3600;%% vehicle ConstantsvehicleMass = 300; %kgpusher_accel_rate_g = 2.4; %g - from linearly interpolated graph. pusher_accelrate = pusher_accel_rate_g * 9.81; %m/s^2track_distance = 5000*ft2Meters; %m (Assume 5000ft track)pusher_distance = 1600*ft2Meters; %m (Assume 1600ft pusher accel phase)setbraking_distance = 400*ft2Meters; %m%setbraking_distance = ft2Meters * input('Set braking distance (feet) = '); %mcoast_distance = track_distance - pusher_distance - setbraking_distance; %m%--VelocityVmax1 = 140 * mph2ms; %m/s - Max velocity after pusher releases (constant accel)Vkmax = 140 * mph2ms; %m/s - Max velocity before hitting kantrowitz limit, full carbon shell%% Time Calcs%--On pusher (estimation!!)timepusherend1 = Vmax1 / pusher_accelrate;%--Coastingcoastingtime1 = coast_distance / Vmax1; %m%--Brakingbrakingtime1 = setbraking_distance / Vmax1; %sec%--Total Operation TimeTotalTime1 = timepusherend1 + coastingtime1 + brakingtime1; %sec%% Graph%Correcting Time Intervalscoastingtime1_int = coastingtime1 + timepusherend1; %secbrakingtime1_int = brakingtime1 + coastingtime1_int; %sec
Braking System with Matlab - PDF_3

End of preview

Want to access all the pages? Upload your documents or become a member.