within ; package TSFS02_Lab3_ESP package Experiments model JTurn "J-Turn test" extends VeSyMA.Experiments.Templates.VehicleTest( redeclare replaceable Suspensions.Drivers.TestDriver.SingleStep driver( handbrake=false, steeringOveride=true, brakeOveride=true, acceleratorOveride=true, clutchOveride=true, overideTime=2, redeclare model steeringSource = Claytex.Blocks.Tables.TimeTable ( startTime=0, table(data=[0,0; 2,0; 2.24,0.352; 6.24,0.352; 8.24, 0; 10,0])), final initialGear=vehicle.initialGear, stopLogic=false, gearLogic=false, pullAwayStop=false, antiStall=false), redeclare replaceable CarModel.SmallFamilyCar vehicle( v_start=20, initialGear=4, stabilityControl(deactivationFeedESC(k=ESP_ON.value))), redeclare replaceable VeSyMA.Roads.StaticRoads.FlatRoad road( animation=world.enableAnimation, mue=1, v=20, width=180), redeclare replaceable VehicleInterfaces.Atmospheres.ConstantAtmosphere atmosphere); CarModel.ValueBlock ESP_ON(value=0) annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); annotation ( experiment(StopTime=10, __Dymola_Algorithm="Radau"), __Dymola_experimentSetupOutput, Documentation(revisions="

   


Copyright © 2015-2020, Claytex Services Limited

", info="

This is an experiment designed to replicate the National Highway Traffic Saftey Administration J-turn vehicle perfromance test. The test sees a steering input applied at a linearly increasing rate to a maximum value which is held for 4s before being linearly decreased to 0 over another 2s.

Image: Forkenbrock, G. J., Riley Garrott, E., Heitz, M. and O'Harra, B. C. (2003). "An Experimental Examination of J-Turn and Fishhook Manoeuvres. That May Induce On-Road, Untripped, Light Vehicle Rollover", in: 2003 SAE World Congress, 3-6 March 2003, Detroit, Michigan, SAE International, Warrendale, PA., p.6

Calibration of Experiment for Other Vehicles

Any vehicle can undergo the J-Turn test. However the steering input rate mandated by the test is unique to each vehicle. The procedure for calibrating the steering input requires calculation of the maximum steering input value and the time intervals of maximum steering input. The calculated maximum steering input and the time intervals of maximum steering will be combined in a lookup table to determine the steering rate.

The function steeringInputJTurn has been written to automate the process of calibrating the J-Turn steering input, outputting a .mat file containg the required steering demand (consistent with the NHTSA test standard) which can then be uploaded into the J_TurnTest. This function also has a more comprehensive discussion regarding the calculation of the calibrated steering input.

Test limitations

Please note that as the test requires the rate of steering variation to be linear, therefore the result of the test are only valid for vehicles equipped with a linear position actuated steering handwheel, not any non-linear or torque based variants.

"), __Dymola_Commands( file="modelica://Suspensions/Scripts/Analysis/Body Variables.mos" "Body Variables", file="modelica://Suspensions/Scripts/Analysis/Wheel Forces.mos" "Wheel Forces", file="modelica://Suspensions/Scripts/Analysis/Manual Driver Controls.mos" "Driver Inputs", file="modelica://Suspensions/Scripts/Analysis/Spring and Damper Forces.mos" "Spring and Damper Forces", file="modelica://Suspensions/Scripts/Analysis/Spring Deformation and Damper Velocity.mos" "Spring Deformation and Damper Velocity", file="modelica://Suspensions/Scripts/SideViewCar.mos" "Car Side Rotations Transparent Body", file="modelica://Suspensions/Scripts/PlanTransparentBody.mos" "Car Plan Rotations Transparent Body", file="modelica://Suspensions/Scripts/Front Rotations Transparent Body.mos" "Car Front Rotations Transparent Body")); end JTurn; model Slalom "Slalom test" extends VeSyMA.Experiments.Templates.VehicleTest( redeclare replaceable Suspensions.Drivers.ClosedLoop.ClosedLoop driver( final initialGear=vehicle.initialGear, handbrake=false, stopLogic=false, gearLogic=false, pullAwayStop=false, antiStall=false), redeclare replaceable CarModel.SmallFamilyCar vehicle( s_start=30, initialGear=3, final v_start=road.vProfile[1, 2], stabilityControl(deactivationFeedESC(k=ESP_ON.value))), redeclare replaceable Suspensions.Roads.Static.IndependentDrivingLine road( readConesFromFile=true, mue=1, vOverride=true, fileName=Modelica.Utilities.Files.loadResource( "modelica://Suspensions/Resources/Data/Slalom.mat"), vProfile=[0.0,14.5; 1000.0,14.5], roadWidth=10, roadLength=255, flatRoad=true, constMue=true), redeclare replaceable VehicleInterfaces.Atmospheres.ConstantAtmosphere atmosphere); CarModel.ValueBlock ESP_ON(value=0) annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); annotation ( experiment( StopTime=13, Interval=0.01, __Dymola_Algorithm="Radau"), __Dymola_experimentSetupOutput, Documentation(revisions="

   


Copyright © 2015-2020, Claytex Services Limited

", info="

This experiment is an example of a vehicle performing a slalom test that uses the file created by the buildSlalomCourse function within the Roads package.

"), __Dymola_Commands( file="modelica://Suspensions/Scripts/Analysis/Body Variables.mos" "Body Variables", file="modelica://Suspensions/Scripts/Analysis/Wheel Forces.mos" "Wheel Forces", file="modelica://Suspensions/Scripts/Analysis/Manual Driver Controls.mos" "Driver Inputs", file="modelica://Suspensions/Scripts/Analysis/Spring and Damper Forces.mos" "Spring and Damper Forces", file="modelica://Suspensions/Scripts/Analysis/Spring Deformation and Damper Velocity.mos" "Spring Deformation and Damper Velocity", file="modelica://Suspensions/Scripts/SideViewCar.mos" "Car Side Rotations Transparent Body", file="modelica://Suspensions/Scripts/PlanTransparentBody.mos" "Car Plan Rotations Transparent Body", file="modelica://Suspensions/Scripts/Front Rotations Transparent Body.mos" "Car Front Rotations Transparent Body")); end Slalom; model DoubleLaneChange "ISO double lane change test" extends VeSyMA.Experiments.Templates.VehicleTest( redeclare replaceable Suspensions.Drivers.TestDriver.SingleStep driver( activationCondition=2, brakeOveride=true, acceleratorOveride=true, overideDistance=50, final initialGear=vehicle.initialGear, handbrake=false, stopLogic=false), redeclare replaceable CarModel.SmallFamilyCar vehicle( s_start=40, initialGear=3, v_start=16.5, stabilityControl(deactivationFeedESC(k=ESP_ON.value))), redeclare replaceable Suspensions.Roads.Static.IndependentDrivingLine road( animation=world.enableAnimation, mue=1, fileName=Modelica.Utilities.Files.loadResource( "modelica://Suspensions/Resources/Data/Double Lane Change.mat"), redeclare VeSyMA.Roads.Visualisers.Textures.FourLaneRoadWithYellowLines roadType, roadWidth=25, roadLength=180, flatRoad=true, constMue=true), redeclare replaceable VehicleInterfaces.Atmospheres.ConstantAtmosphere atmosphere); CarModel.ValueBlock ESP_ON(value=0) annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); annotation ( experiment( StopTime=6, Interval=0.01, __Dymola_Algorithm="Radau"), __Dymola_experimentSetupOutput, Documentation(revisions="

   


Copyright © 2015-2020, Claytex Services Limited

", info="

This is an experiment designed to simulate the ISO 3888 Part 2 Double LaneChange manoeuvre.


Image: Forkenbrock, G. J., Riley Garrott, E., Heitz, M. and O'Harra, B. C. (2003). "An Experimental Examination of Double Lane Change Manoeuvres. That May Induce On-Road, Untripped, Light Vehicle Rollover", in: 2003 SAE World Congress, 3-6 March 2003, Detroit, Michigan, SAE International, Warrendale, PA., p.6

Course Generation

As defined in the test standard, the specific course to be followed is dependant upon physical vehicle parameters. To accomodate this, there is a function within the Roads package in the Suspensions library to generate the course.

To use this function:

"), __Dymola_Commands( file="modelica://Suspensions/Scripts/Analysis/Body Variables.mos" "Body Variables", file="modelica://Suspensions/Scripts/Analysis/Wheel Forces.mos" "Wheel Forces", file="modelica://Suspensions/Scripts/Analysis/Automatic Driver Controls.mos" "Driver Inputs", file="modelica://Suspensions/Scripts/Analysis/Spring and Damper Forces.mos" "Spring and Damper Forces", file="modelica://Suspensions/Scripts/Analysis/Spring Deformation and Damper Velocity.mos" "Spring Deformation and Damper Velocity", file="modelica://Suspensions/Scripts/SideViewCar.mos" "Car Side Rotations Transparent Body", file="modelica://Suspensions/Scripts/PlanTransparentBody.mos" "Car Plan Rotations Transparent Body", file="modelica://Suspensions/Scripts/Front Rotations Transparent Body.mos" "Car Front Rotations Transparent Body")); end DoubleLaneChange; end Experiments; package Controllers model MyESP extends Claytex.Icons.Component; Modelica.Blocks.Interfaces.RealOutput wheel_1 annotation (Placement(transformation(extent={{90,50},{110,70}}))); Modelica.Blocks.Interfaces.RealOutput wheel_2 annotation (Placement(transformation(extent={{90,10},{110,30}}))); Modelica.Blocks.Interfaces.RealOutput wheel_3 annotation (Placement(transformation(extent={{90,-30},{110,-10}}))); Modelica.Blocks.Interfaces.RealOutput wheel_4 annotation (Placement(transformation(extent={{90,-70},{110,-50}}))); Modelica.Blocks.Interfaces.RealInput controllerActivationSignal annotation (Placement(transformation(extent={{-120,60},{-80,100}}))); // Sensors Modelica.Blocks.Interfaces.RealInput a_y annotation (Placement(transformation(extent={{-120,20},{-80,60}}))); Modelica.Blocks.Interfaces.RealInput v_x annotation (Placement(transformation(extent={{-120,-20},{-80,20}}))); Modelica.Blocks.Interfaces.RealInput Omega_z annotation (Placement(transformation(extent={{-120,-60},{-80,-20}}))); Modelica.Blocks.Interfaces.RealInput delta_sw annotation (Placement( transformation(extent={{-120,-100},{-80,-60}}))); // Normalized brake pressures Real ub1; Real ub2; Real ub3; Real ub4; // ------------------------------------------------------------------------- // ----------------- Do not modify anything above this line ---------------- // Parameters parameter Real g = Modelica.Constants.g_n "Gravity constant"; parameter Real pi = Modelica.Constants.pi "Pi"; parameter Real m = 1242; parameter Real h = 0.45; parameter Real L = 2.65; parameter Real l_1 = 1.23; parameter Real t_w = 1.6; parameter Real R_w = 0.3264; parameter Real C_af = 11e4; parameter Real C_ar = 16e4; parameter Real k_sw = -1/16; // Clockwise positive steering angle parameter Real A_cp = 7.9e-3; parameter Real p_bmax = 1.5e6; parameter Real R_disc = 0.25; parameter Real mu_bp = 1; // Variables Real vy(start=0,fixed=true); Real dvy; equation dvy = a_y - v_x*Omega_z; der(vy) = dvy; ub1 = 0; ub2 = 0; ub3 = 0; ub4 = 0; // ----------------- Do not modify anything under this line ---------------- // ------------------------------------------------------------------------- // Output signal from model if controllerActivationSignal > 0 then wheel_1 = max(0, min(1, ub1)); wheel_2 = max(0, min(1, ub2)); wheel_3 = max(0, min(1, ub3)); wheel_4 = max(0, min(1, ub4)); else wheel_1 = 0; wheel_2 = 0; wheel_3 = 0; wheel_4 = 0; end if; annotation (); end MyESP; end Controllers; package CarModel model BrakeLineCircuit "Brake Line configuration with bias for a single circuit system" parameter Integer splitConfig=1 "Configuration" annotation (choices( choice=1 "Front-Rear", choice=2 "Diagonal Front-Rear", choice=3 "Triangular Front-Rear")); parameter Real maxRear=0.9 "Maximum normalised rear force"; parameter Real staticBrakeBias=0.5; Modelica.Blocks.Interfaces.RealOutput wheel_1(unit="Pa") annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={-100,-60}))); Modelica.Blocks.Interfaces.RealOutput wheel_2(unit="Pa") annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={-100,60}))); Modelica.Blocks.Interfaces.RealOutput wheel_3(unit="Pa") annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={100,-60}))); Modelica.Blocks.Interfaces.RealOutput wheel_4(unit="Pa") annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={100,60}))); Modelica.Blocks.Interfaces.RealOutput brakeBias annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={0,-60}))); Modelica.Blocks.Interfaces.RealInput linePressure annotation (Placement( transformation( extent={{-20,-20},{20,20}}, rotation=270, origin={0,100}))); Modelica.Blocks.Interfaces.RealInput dynamicBrakeBias annotation (Placement( transformation( extent={{-20,-20},{20,20}}, rotation=270, origin={-60,100}))); Modelica.Blocks.Interfaces.RealInput deactivationFeedEBD annotation (Placement( transformation( extent={{-20,-20},{20,20}}, rotation=270, origin={60,100}))); equation if deactivationFeedEBD > 0 then brakeBias = dynamicBrakeBias; else brakeBias = staticBrakeBias; end if; if splitConfig == 1 then wheel_1 = (linePressure*brakeBias)/2; wheel_2 = (linePressure*brakeBias)/2; wheel_3 = (linePressure*(1 - brakeBias))/2; wheel_4 = (linePressure*(1 - brakeBias))/2; elseif splitConfig == 2 then wheel_1 = (linePressure*brakeBias)/2; wheel_2 = (linePressure*(1 - brakeBias))/2; wheel_3 = min((linePressure*brakeBias)/2, maxRear); wheel_4 = min((linePressure*(1 - brakeBias))/2, maxRear); else wheel_1 = ((linePressure*brakeBias)/2)*0.5 + ((linePressure*(1 - brakeBias)))*0.5; wheel_2 = ((linePressure*brakeBias)/2)*0.5 + ((linePressure*(1 - brakeBias)))*0.5; wheel_3 = min(((linePressure*brakeBias)/2), maxRear); wheel_4 = min(((linePressure*(1 - brakeBias))), maxRear); end if; annotation ( Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}})), Icon(graphics={Rectangle( extent={{-100,100},{100,-100}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid),Line( points={{-20,100},{-20,60},{-90,60}}, color={0,0,255}, smooth=Smooth.None, visible=splitConfig == 2),Line( points={{20,100},{20,60},{90,60}}, color={255,0,0}, smooth=Smooth.None, visible=splitConfig == 2),Line( points={{-20,60},{20,-60},{90,-60}}, color={0,0,255}, smooth=Smooth.None, visible=splitConfig == 2),Line( points={{20,60},{-20,-60},{-90,-60}}, color={255,0,0}, smooth=Smooth.None, visible=splitConfig == 2),Rectangle( extent={{51,-51},{69,-69}}, lineColor={0,0,255}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, visible=splitConfig == 2),Rectangle( extent={{51,69},{69,51}}, lineColor={255,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, visible=splitConfig == 2),Line( points={{-20,100},{-20,64},{-90,64}}, color={0,0,255}, smooth=Smooth.None, visible=splitConfig == 3),Line( points={{-20,64},{-20,-58},{-90,-58}}, color={0,0,255}, smooth=Smooth.None, visible=splitConfig == 3),Line( points={{-20,-58},{90,-58}}, color={0,0,255}, smooth=Smooth.None, visible=splitConfig == 3),Line( points={{20,100},{20,58},{-90,58}}, color={255,0,0}, smooth=Smooth.None, visible=splitConfig == 3),Line( points={{20,100},{20,-64},{-90,-64}}, color={255,0,0}, smooth=Smooth.None, visible=splitConfig == 3),Line( points={{20,58},{90,58}}, color={255,0,0}, smooth=Smooth.None, visible=splitConfig == 3),Rectangle( extent={{51,69},{69,51}}, lineColor={255,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, visible=splitConfig == 3),Rectangle( extent={{51,-51},{69,-69}}, lineColor={0,0,255}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, visible=splitConfig == 3),Line( points={{-16,100},{-16,0},{-72,0},{-72,60},{-88,60}}, color={0,0,255}, smooth=Smooth.None, visible=splitConfig == 1),Line( points={{-72,0},{-72,-60},{-88,-60}}, color={0,0,255}, smooth=Smooth.None, visible=splitConfig == 1),Line( points={{14,100},{14,0},{70,0},{70,60},{86,60}}, color={0,0,255}, smooth=Smooth.None, visible=splitConfig == 1),Line( points={{70,0},{70,-60},{86,-60}}, color={0,0,255}, smooth=Smooth.None, visible=splitConfig == 1)}), Documentation(revisions="

   


Copyright © 2015-2020, Claytex Services Limited

", info="

Brake line configuration model for transferring line pressure to the individual brakes. The model receives a similar value of brake line pressure, distributing the pressure to the four wheels according to the brakeBias and maxRear parameters and the configuration selected with the splitConfig parameter. The brakeBias parameter is used to split the input pressure into front and rear components, with maxRear being used to limit the amount of pressure the rear brakes can experience (analogous to a blow off value).

The parameter splitConfig controls the distribution configuration of the braking signals to each of the wheels.

This component is for use in single circuit systems.

")); end BrakeLineCircuit; model HydraulicCircuit "Braking system" extends VeSyMA.Brakes.Templates.FourWheelBrakes( final includeManualHandbrake=true, redeclare replaceable Suspensions.Brakes.Summary.ESPEnabledBrakes summary( wheelSpeed1=wheelSpeed_1.w, wheelSpeed2=wheelSpeed_2.w, wheelSpeed3=wheelSpeed_3.w, wheelSpeed4=wheelSpeed_4.w, handbrakeForce3=wheel3Handbrake.fInput, handbrakeForce4=wheel4Handbrake.fInput, brakeTorque1=brake_1.brake.flange_a.tau, brakeTorque2=brake_2.brake.flange_a.tau, brakeTorque3=brake_3.brake.flange_a.tau, brakeTorque4=brake_4.brake.flange_a.tau, brakePedalPosition=vacuumBooster.positionSensor.s, brakeForce1=brake_1.fInput, brakeForce2=brake_2.fInput, brakeForce3=brake_3.fInput, brakeForce4=brake_4.fInput, plungerForce=vacuumBooster.plungerForce, masterCylinderPressure=singleMasterCylinder.brakeLinePressure, espPressure1=eSPPumpcopy.add_1.u2, espPressure2=eSPPumpcopy.add_2.u2, espPressure3=eSPPumpcopy.add_3.u2, espPressure4=eSPPumpcopy.add_4.u2, brakePistonPressure1=caliperPistonWheel_1.linePressure, brakePistonPressure2=caliperPistonWheel_2.linePressure, brakePistonPressure3=caliperPistonWheel_3.linePressure, brakePistonPressure4=caliperPistonWheel_4.linePressure), redeclare VeSyMA.Brakes.Components.Brake brake_1(redeclare replaceable Claytex.Mechanics.Rotational.Parts.ElasticBrake brake(tau_max=10000)), redeclare VeSyMA.Brakes.Components.Brake brake_2(redeclare Claytex.Mechanics.Rotational.Parts.ElasticBrake brake(tau_max=10000)), redeclare VeSyMA.Brakes.Components.Brake brake_3(redeclare replaceable Claytex.Mechanics.Rotational.Parts.ElasticBrake brake(tau_max=10000)), redeclare VeSyMA.Brakes.Components.Brake brake_4(redeclare replaceable Claytex.Mechanics.Rotational.Parts.ElasticBrake brake(tau_max=10000))); replaceable VeSyMA.Brakes.Components.VacuumBoosterPosition vacuumBooster constrainedby VeSyMA.Brakes.Interfaces.VacuumBooster annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={0,60}))); VeSyMA.Brakes.Components.SingleCircuitMasterCylinder singleMasterCylinder(D=0.025) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={0,20}))); VeSyMA.Brakes.Components.CaliperPiston caliperPistonWheel_2 annotation ( Placement(transformation( extent={{-10,10},{10,-10}}, rotation=90, origin={-40,10}))); VeSyMA.Brakes.Components.CaliperPiston caliperPistonWheel_1 annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={-40,-30}))); VeSyMA.Brakes.Components.CaliperPiston caliperPistonWheel_4 annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={40,10}))); VeSyMA.Brakes.Components.CaliperPiston caliperPistonWheel_3 annotation ( Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, origin={40,-30}))); ESPABSPump eSPPumpcopy( firstOrder1(initType=Claytex.Types.Init.InitialState), firstOrder2(initType=Claytex.Types.Init.InitialState), firstOrder(initType=Claytex.Types.Init.InitialState), firstOrder3(initType=Claytex.Types.Init.InitialState)) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={0,-10}))); VeSyMA.Brakes.Components.Brake wheel4Handbrake( redeclare replaceable Claytex.Mechanics.Rotational.Parts.ElasticBrake brake(tau_max=handbrakeForce.k), leftWheel=false, animation=animation, specularCoefficient=specularCoefficient, caliper( r_shape={wheel4Handbrake.disc.length*0.55,-wheel4Handbrake.disc.outerDiameter *0.55,0}, lengthDirection(displayUnit="1") = {0,1,0}, widthDirection(displayUnit="1") = {0,-1,0}, height=abs(wheel4Handbrake.disc.outerDiameter*0.45))) "Handbrake model for wheel 4" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=90, origin={90,40})), choicesAllMatching=true); VeSyMA.Brakes.Components.Brake wheel3Handbrake( redeclare replaceable Claytex.Mechanics.Rotational.Parts.ElasticBrake brake(tau_max=handbrakeForce.k), leftWheel=true, animation=animation, specularCoefficient=specularCoefficient, caliper( r_shape={wheel3Handbrake.disc.length*0.55,-wheel3Handbrake.disc.outerDiameter *0.55,0}, lengthDirection(displayUnit="1") = {0,1,0}, widthDirection(displayUnit="1") = {0,-1,0}, height=abs(wheel3Handbrake.disc.outerDiameter*0.45))) "Handbrake model for wheel 3" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={90,-40})), choicesAllMatching=true); Modelica.Mechanics.Translational.Sensors.PositionSensor positionSensor1 annotation (Placement(transformation( origin={88,0}, extent={{5,-5},{-5,5}}, rotation=0))); Modelica.Blocks.Math.Gain handbrakeForce(k=15000) "Gain to convert position to handbrake force" annotation (Placement( transformation( extent={{-7,7},{7,-7}}, rotation=180, origin={70,0}))); equation connect(controlBus, eSPPumpcopy.controlBus) annotation (Line( points={{-100,60},{-100,60},{-100,-100},{0,-100},{0,-20}}, color={255,204,51}, thickness=0.5)); connect(brakePedal, vacuumBooster.pedalInput) annotation (Line(points={{0,100},{0,70}}, color={0,127,0})); connect(eSPPumpcopy.espPressureWheel_4, caliperPistonWheel_4.linePressure) annotation (Line(points={{23.2,-5},{40,-5},{40,0}}, color={0,0,127})); connect(eSPPumpcopy.espPressureWheel_3, caliperPistonWheel_3.linePressure) annotation (Line(points={{23,-15},{40,-15},{40,-20}}, color={0,0,127})); connect(eSPPumpcopy.espPressureWheel_2, caliperPistonWheel_2.linePressure) annotation (Line(points={{-19.4,-5.2},{-40,-5.2},{-40,0}}, color={0,0,127})); connect(eSPPumpcopy.espPressureWheel_1, caliperPistonWheel_1.linePressure) annotation (Line(points={{-22.8,-14.2},{-40,-14.2},{-40,-20}}, color={0,0,127})); connect(singleMasterCylinder.brakeLinePressure, eSPPumpcopy.linePressure) annotation (Line(points={{0,10},{0,0}}, color={0,0,127})); connect(vacuumBooster.plungerForce, singleMasterCylinder.plungerForce) annotation (Line(points={{0,50},{0,30}}, color={0,0,127})); connect(brake_2.fInput, caliperPistonWheel_2.padForce) annotation (Line( points={{-50,60},{-40,60},{-40,20}}, color={0,0,127})); connect(caliperPistonWheel_3.padForce, brake_3.fInput) annotation (Line( points={{40,-40},{40,-60},{50,-60}}, color={0,0,127})); connect(caliperPistonWheel_4.padForce, brake_4.fInput) annotation (Line(points={{40,20},{40,60},{50,60}}, color={0,0,127})); connect(caliperPistonWheel_1.padForce, brake_1.fInput) annotation (Line( points={{-40,-40},{-40,-60},{-50,-60}}, color={0,0,127})); connect(wheel3Handbrake.wheelHub, wheelHub_3) annotation (Line( points={{90,-50},{90,-74},{60,-74},{60,-100}}, color={135,135,135}, thickness=0.5)); connect(wheel4Handbrake.wheelHub, wheelHub_4) annotation (Line( points={{90,50},{90,74},{60,74},{60,100}}, color={135,135,135}, thickness=0.5)); connect(handbrakeForce.u, positionSensor1.s) annotation (Line(points={{78.4, -1.77636e-15},{80,-1.77636e-15},{80,0},{82.5,0}}, color={0,0,127})); connect(handbrakeForce.y, wheel4Handbrake.fInput) annotation (Line( points={{62.3,0},{60,0},{60,40},{80,40}}, color={0,0,127})); connect(handbrakeForce.y, wheel3Handbrake.fInput) annotation (Line( points={{62.3,0},{60,0},{60,-40},{80,-40}}, color={0,0,127})); connect(handbrakeCable, positionSensor1.flange) annotation (Line(points={{100,0},{93,0}}, color={0,127,0})); annotation (Documentation(revisions="

   


Copyright © 2015-2020, Claytex Services Limited

", info="

This is a Pseudo-Hydraulic braking model, simulating the action of a hydraulic braking system within a vehcile equipped with an Electronic Stability Programme (ESP). The model works in the same way as the VeSyMA.Brakes.IndependentBrakes.SingleCircuit model, but with the added architecture of an ESP system.


The ESPPump recieves signals from the espController through the brakesControlBus and generates a brake line pressure which is fed into each of the invidiual wheel CaliperPiston models depending upon the action dictated by the espController logic.

The handbrake requires the manual input and uses a separate brake model to the conventional brakes. This allows the handbrake to be entirely separate to the ESP system and not interfere with their working. The handbrake cable position is converted to a force in the handbrakeForce block, where k is the ratio of position travel to force.

"), Icon(graphics={Rectangle( extent={{-2,18},{2,10}}, lineColor={0,0,0}, fillPattern=FillPattern.VerticalCylinder, fillColor={215,215,215}),Rectangle( extent={{-18,-10},{18,10}}, lineColor={0,0,0}, fillPattern=FillPattern.VerticalCylinder, fillColor={0,0,0}),Polygon( points={{-2,26},{2,26},{0,18},{-2,26}}, lineColor={0,127,0}, lineThickness=0.5, fillColor={0,127,0}, fillPattern=FillPattern.Solid),Line( points={{0,24},{0,94}}, color={0,127,0}, thickness=0.5),Line(points={{-4,-18},{-4,-68},{-38,-68}}, color={0,0,0}),Line(points={{-12,-18},{-12,-22},{-34,-22},{-34,48}, {-38,48}}, color={0,0,0}),Rectangle( extent={{-14,-10},{-10,-18}}, lineColor={0,0,0}, fillPattern=FillPattern.VerticalCylinder, fillColor={135,135,135}),Rectangle( extent={{-6,-10},{-2,-18}}, lineColor={0,0,0}, fillPattern=FillPattern.VerticalCylinder, fillColor={135,135,135}),Rectangle( extent={{2,-10},{6,-18}}, lineColor={0,0,0}, fillPattern=FillPattern.VerticalCylinder, fillColor={135,135,135}),Rectangle( extent={{10,-10},{14,-18}}, lineColor={0,0,0}, fillPattern=FillPattern.VerticalCylinder, fillColor={135,135,135}),Line( points={{-90,60},{-84,60},{-84,0},{-18,0}}, color={255,204,51}, thickness=0.5),Line(points={{4,-18},{4,-68},{38,-68}}, color={0,0,0}),Line(points={{12,-18},{12,-22},{34,-22},{34,48},{ 38,48}}, color={0,0,0}),Text( extent={{-84,2},{-38,-26}}, lineColor={255,204,51}, fillPattern=FillPattern.VerticalCylinder, fillColor={135,135,135}, textString="ESP"),Polygon( points={{80,60},{80,58},{82,48},{80,38},{80,36},{70,36},{70, 42},{72,48},{70,54},{70,60},{80,60}}, lineColor={255,0,0}, smooth=Smooth.Bezier, fillColor={255,0,0}, fillPattern=FillPattern.Solid),Polygon( points={{80,-56},{80,-58},{82,-68},{80,-78},{80,-80},{70,-80}, {70,-74},{72,-68},{70,-62},{70,-56},{80,-56}}, lineColor={255,0,0}, smooth=Smooth.Bezier, fillColor={255,0,0}, fillPattern=FillPattern.Solid),Line(points={{80,48},{80,-68}}, color={0,140,72}),Line(points={{100,0},{80,0}}, color={0,140,72})})); end HydraulicCircuit; model ESPABSPump "Hydraulic pump which actuates the brakes under command of the ESP controller" extends Claytex.Icons.Component; parameter Modelica.SIunits.Pressure maxESPPresure=1500000 "The maximum pressure the ESP pump can generate"; parameter Modelica.SIunits.Time tConstant=0.002 "Time Constant for actuators"; parameter Integer splitConfig=1 "Configuration" annotation (choices( choice=1 "Front-Rear", choice=2 "Diagonal Front-Rear", choice=3 "Triangular Front-Rear")); parameter Real brakeBias=0.5 "Normalised brake force from front"; parameter Real maxRear=0.9 "Maximum normalised rear force"; parameter Modelica.SIunits.Time filterT_1=0.01 "Filter time constant to replicate inherent smoothing of actual sensor feeds"; parameter Modelica.SIunits.Time filterT_2=0.01 "Filter time constant to replicate inherent smoothing of actual sensor feeds"; parameter Modelica.SIunits.Time filterT_3=0.01 "Filter time constant to replicate inherent smoothing of actual sensor feeds"; parameter Modelica.SIunits.Time filterT_4=0.01 "Filter time constant to replicate inherent smoothing of actual sensor feeds"; Modelica.Blocks.Interfaces.RealOutput espPressureWheel_1 annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={-228,-42}))); Modelica.Blocks.Interfaces.RealOutput espPressureWheel_2 annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={-194,48}))); Modelica.Blocks.Interfaces.RealOutput espPressureWheel_3 annotation (Placement(transformation(extent={{220,-60},{240,-40}}))); Modelica.Blocks.Interfaces.RealOutput espPressureWheel_4 annotation (Placement(transformation(extent={{222,40},{242,60}}))); VehicleInterfaces.Interfaces.ControlBus controlBus annotation ( Placement(transformation( extent={{-20,-20},{20,20}}, rotation=180, origin={0,-100}))); Modelica.Blocks.Math.Add add_2 annotation (Placement(transformation(extent={{-26,40},{-46,60}}))); Modelica.Blocks.Math.Add add_1 annotation (Placement(transformation(extent={{-28,-60},{-48,-40}}))); Modelica.Blocks.Math.Add add_3 annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={38,-50}))); Modelica.Blocks.Math.Add add_4 annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={38,50}))); Modelica.Blocks.Interfaces.RealInput linePressure annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={0,100}))); TSFS02_Lab3_ESP.CarModel.BrakeLineCircuit brakeLineSingleCircuitcopy( final splitConfig=splitConfig, final maxRear=maxRear, staticBrakeBias=brakeBias) annotation (Placement(transformation(extent={{-10,60},{10,80}}))); protected VehicleInterfaces.Interfaces.BrakesControlBus brakesControlBus annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={0,-56}))); public Claytex.Blocks.Math.LargestSignal largestSignal annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={-160,74}))); Claytex.Blocks.Math.LargestSignal largestSignal1 annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={-188,-22}))); Claytex.Blocks.Math.LargestSignal largestSignal2 annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=180, origin={200,-26}))); Claytex.Blocks.Math.LargestSignal largestSignal3 annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=180, origin={202,76}))); Modelica.Blocks.Sources.Constant const1(k=0) annotation (Placement(transformation(extent={{-146,-24},{-162,-8}}))); Modelica.Blocks.Sources.Constant const2(k=0) annotation (Placement(transformation(extent={{-32,72},{-48,88}}))); Modelica.Blocks.Sources.Constant const3(k=0) annotation (Placement(transformation(extent={{30,74},{46,90}}))); Modelica.Blocks.Sources.Constant const4(k=0) annotation (Placement(transformation(extent={{144,-16},{160,0}}))); Claytex.Blocks.Continuous.FirstOrder firstOrder(final T=filterT_1, k= maxESPPresure) annotation (Placement(transformation(extent={{-14,-78},{-26,-66}}))); Claytex.Blocks.Continuous.FirstOrder firstOrder1(final T=filterT_2, k= maxESPPresure) annotation (Placement(transformation(extent={{-4,38},{-16,50}}))); Claytex.Blocks.Continuous.FirstOrder firstOrder2(final T=filterT_3, k= maxESPPresure) annotation (Placement(transformation(extent={{2,38},{14,50}}))); Claytex.Blocks.Continuous.FirstOrder firstOrder3(final T=filterT_4, k= maxESPPresure) annotation (Placement(transformation(extent={{8,-78},{20,-66}}))); Claytex.Blocks.Continuous.FirstOrder firstOrder4(final T=filterT_1, k= maxESPPresure, initType=Claytex.Types.Init.InitialState) annotation (Placement(transformation(extent={{-54,-80},{-66,-68}}))); SmallestSignal smallestSignal annotation (Placement(transformation(extent={{-98,42},{-120,62}}))); SmallestSignal smallestSignal1 annotation (Placement(transformation(extent={{-142,-66},{-164,-46}}))); Claytex.Blocks.Continuous.FirstOrder firstOrder5(final T=filterT_2, k= maxESPPresure, initType=Claytex.Types.Init.InitialState) annotation (Placement(transformation(extent={{-36,18},{-48,30}}))); Claytex.Blocks.Continuous.FirstOrder firstOrder6(final T=filterT_4, k= maxESPPresure, initType=Claytex.Types.Init.InitialState) annotation (Placement(transformation(extent={{44,-80},{56,-68}}))); SmallestSignal smallestSignal2 annotation (Placement(transformation(extent={{148,-66},{170,-46}}))); Claytex.Blocks.Continuous.FirstOrder firstOrder7(final T=filterT_3, k= maxESPPresure, initType=Claytex.Types.Init.InitialState) annotation (Placement(transformation(extent={{34,14},{46,26}}))); SmallestSignal smallestSignal3 annotation (Placement(transformation(extent={{138,34},{160,54}}))); Modelica.Blocks.Math.Product product1 annotation (Placement(transformation(extent={{-38,-6},{-48,4}}))); Modelica.Blocks.Sources.Constant const5(k=2) annotation (Placement(transformation(extent={{-22,-18},{-30,-10}}))); Modelica.Blocks.Math.Product product2 annotation (Placement(transformation(extent={{-70,16},{-80,26}}))); Modelica.Blocks.Math.Product product3 annotation (Placement(transformation(extent={{-84,-40},{-94,-30}}))); Modelica.Blocks.Math.Product product4 annotation (Placement(transformation(extent={{46,-12},{56,-2}}))); Modelica.Blocks.Math.Product product5 annotation (Placement(transformation(extent={{84,22},{94,32}}))); Modelica.Blocks.Sources.Constant const6(k=2) annotation (Placement(transformation(extent={{32,-20},{38,-14}}))); Modelica.Blocks.Math.Product product6 annotation (Placement(transformation(extent={{84,-42},{94,-32}}))); Modelica.Blocks.Math.Add add_5(k2=-1) annotation (Placement(transformation( extent={{-4,-4},{4,4}}, rotation=0, origin={36,-4}))); Modelica.Blocks.Sources.Constant const7(k=1) annotation (Placement(transformation(extent={{20,2},{26,8}}))); equation connect(controlBus.brakesControlBus, brakesControlBus) annotation (Line( points={{-0.1,-100.1},{-0.1,-50},{0,-50},{0,-56}}, color={255,204,51}, thickness=0.5)); connect(brakeLineSingleCircuitcopy.wheel_2, add_2.u1) annotation (Line( points={{-10,76},{-20,76},{-20,56},{-24,56}}, color={0,0,127})); connect(brakeLineSingleCircuitcopy.wheel_4, add_4.u1) annotation (Line( points={{10,76},{20,76},{20,56},{26,56}}, color={0,0,127})); connect(brakeLineSingleCircuitcopy.wheel_1, add_1.u1) annotation (Line( points={{-10,64},{-18,64},{-18,-44},{-26,-44}}, color={0,0,127})); connect(brakeLineSingleCircuitcopy.wheel_3, add_3.u1) annotation (Line( points={{10,64},{16,64},{16,-44},{26,-44}}, color={0,0,127})); connect(largestSignal.y, espPressureWheel_2) annotation (Line(points={{-171,74}, {-178,74},{-178,48},{-194,48}}, color={0,0,127})); connect(largestSignal1.y, espPressureWheel_1) annotation (Line(points={{-199, -22},{-208,-22},{-208,-42},{-228,-42}}, color={0,0,127})); connect(largestSignal2.y, espPressureWheel_3) annotation (Line(points={{211,-26}, {216,-26},{216,-50},{230,-50}}, color={0,0,127})); connect(largestSignal3.y, espPressureWheel_4) annotation (Line(points={{213,76}, {218,76},{218,50},{232,50}}, color={0,0,127})); connect(const1.y, largestSignal1.u2) annotation (Line(points={{-162.8,-16},{-176,-16}}, color={0,0,127})); connect(largestSignal.u2, const2.y) annotation (Line(points={{-148,80},{-48.8,80}},color={0,0,127})); connect(largestSignal3.u2, const3.y) annotation (Line(points={{190,82},{46.8,82}},color={0,0,127})); connect(largestSignal2.u2, const4.y) annotation (Line(points={{188,-20},{174,-20},{174,-8},{160.8,-8}}, color={0,0,127})); connect(firstOrder1.y, add_2.u2) annotation (Line(points={{-16.6,44},{-24,44}}, color={0,0,127})); connect(firstOrder1.u, brakesControlBus.espWheel2) annotation (Line( points={{-2.8,44},{-2,44},{-2,-56},{0,-56}}, color={0,0,127})); connect(firstOrder2.y, add_4.u2) annotation (Line(points={{14.6,44},{26,44}}, color={0,0,127})); connect(firstOrder2.u, brakesControlBus.espWheel4) annotation (Line(points={{0.8,44},{0,44},{0,-56}}, color={0,0,127})); connect(firstOrder.u, brakesControlBus.espWheel1) annotation (Line( points={{-12.8,-72},{-8,-72},{-8,-56},{0,-56}}, color={0,0,127})); connect(add_1.u2, firstOrder.y) annotation (Line(points={{-26,-56},{-26, -56},{-20,-56},{-20,-62},{-34,-62},{-34,-62},{-34,-72},{-26.6,-72}}, color={0,0,127})); connect(firstOrder3.u, brakesControlBus.espWheel3) annotation (Line( points={{6.8,-72},{6,-72},{6,-56},{0,-56}}, color={0,0,127})); connect(firstOrder3.y, add_3.u2) annotation (Line(points={{20.6,-72},{22, -72},{22,-56},{26,-56}}, color={0,0,127})); connect(linePressure, brakeLineSingleCircuitcopy.linePressure) annotation (Line(points={{0,100},{0,80}}, color={0,0,127})); connect(brakesControlBus.deactivationFeedEBD, brakeLineSingleCircuitcopy.deactivationFeedEBD) annotation (Line( points={{0,-56},{14,-56},{14,80},{6,80}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(brakesControlBus.brakeBias, brakeLineSingleCircuitcopy.dynamicBrakeBias) annotation (Line( points={{0,-56},{-14,-56},{-14,80},{-6,80}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(brakesControlBus.absWheel1, firstOrder4.u) annotation (Line( points={{0,-56},{-38,-56},{-38,-74},{-52.8,-74}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(add_1.y, smallestSignal1.u1) annotation (Line(points={{-49,-50},{-139.8,-50}},color={0,0,127})); connect(smallestSignal1.y, largestSignal1.u1) annotation (Line(points={{-165.1, -56},{-165.1,-44},{-176,-44},{-176,-28}}, color={0,0,127})); connect(add_2.y, smallestSignal.u1) annotation (Line(points={{-47,50},{-68,50},{-68,58},{-95.8,58}}, color={0,0,127})); connect(smallestSignal.y, largestSignal.u1) annotation (Line(points={{-121.1, 52},{-136,52},{-136,68},{-148,68}}, color={0,0,127})); connect(brakesControlBus.absWheel2, firstOrder5.u) annotation (Line( points={{0,-56},{-14,-56},{-14,24},{-34.8,24}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(add_3.y, smallestSignal2.u1) annotation (Line(points={{49,-50},{145.8,-50}},color={0,0,127})); connect(smallestSignal2.y, largestSignal2.u1) annotation (Line(points={{171.1, -56},{180,-56},{180,-32},{188,-32}}, color={0,0,127})); connect(brakesControlBus.absWheel3, firstOrder6.u) annotation (Line( points={{0,-56},{21,-56},{21,-74},{42.8,-74}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(brakesControlBus.absWheel4, firstOrder7.u) annotation (Line( points={{0,-56},{14,-56},{14,20},{32.8,20}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(add_4.y, smallestSignal3.u1) annotation (Line(points={{49,50},{135.8,50}},color={0,0,127})); connect(smallestSignal3.y, largestSignal3.u1) annotation (Line(points={{161.1, 44},{174,44},{174,70},{190,70}}, color={0,0,127})); connect(product1.u1, brakeLineSingleCircuitcopy.brakeBias) annotation ( Line(points={{-37,2},{-2,2},{-2,64},{0,64}}, color={0,0,127})); connect(const5.y, product1.u2) annotation (Line(points={{-30.4,-14},{-37, -14},{-37,-4}}, color={0,0,127})); connect(product1.y, product2.u2) annotation (Line(points={{-48.5,-1},{ -59.25,-1},{-59.25,18},{-69,18}}, color={0,0,127})); connect(firstOrder5.y, product2.u1) annotation (Line(points={{-48.6,24},{-69,24}}, color={0,0,127})); connect(product2.y, smallestSignal.u2) annotation (Line(points={{-80.5,21}, {-80.5,46},{-95.8,46}}, color={0,0,127})); connect(product1.y, product3.u1) annotation (Line(points={{-48.5,-1},{ -48.5,-17.5},{-83,-17.5},{-83,-32}}, color={0,0,127})); connect(firstOrder4.y, product3.u2) annotation (Line(points={{-66.6,-74}, {-76,-74},{-76,-38},{-83,-38}}, color={0,0,127})); connect(product3.y, smallestSignal1.u2) annotation (Line(points={{-94.5, -35},{-117.25,-35},{-117.25,-62},{-139.8,-62}}, color={0,0,127})); connect(const6.y, product4.u2) annotation (Line(points={{38.3,-17},{42.15, -17},{42.15,-10},{45,-10}}, color={0,0,127})); connect(product4.y, product5.u2) annotation (Line(points={{56.5,-7},{ 70.25,-7},{70.25,24},{83,24}}, color={0,0,127})); connect(firstOrder7.y, product5.u1) annotation (Line(points={{46.6,20},{ 64,20},{64,30},{83,30}}, color={0,0,127})); connect(product5.y, smallestSignal3.u2) annotation (Line(points={{94.5,27}, {115.25,27},{115.25,38},{135.8,38}}, color={0,0,127})); connect(product4.y, product6.u1) annotation (Line(points={{56.5,-7},{ 64.25,-7},{64.25,-34},{83,-34}}, color={0,0,127})); connect(firstOrder6.y, product6.u2) annotation (Line(points={{56.6,-74},{ 70,-74},{70,-40},{83,-40}}, color={0,0,127})); connect(product6.y, smallestSignal2.u2) annotation (Line(points={{94.5, -37},{119.25,-37},{119.25,-62},{145.8,-62}}, color={0,0,127})); connect(brakeLineSingleCircuitcopy.brakeBias, add_5.u2) annotation (Line( points={{0,64},{14,64},{14,-6.4},{31.2,-6.4}}, color={0,0,127})); connect(add_5.y, product4.u1) annotation (Line(points={{40.4,-4},{45,-4}}, color={0,0,127})); connect(const7.y, add_5.u1) annotation (Line(points={{26.3,5},{26.3,0.5}, {31.2,0.5},{31.2,-1.6}}, color={0,0,127})); annotation ( Icon(coordinateSystem(preserveAspectRatio=false), graphics={Rectangle( extent={{-14.5,4.5},{14.5,-4.5}}, lineColor={0,0,0}, fillPattern=FillPattern.HorizontalCylinder, fillColor={244,125,35}, origin={-40.5,31.5}, rotation=90),Rectangle( extent={{-8,11},{8,-11}}, lineColor={0,0,0}, fillPattern=FillPattern.HorizontalCylinder, fillColor={244,125,35}, origin={0,-77}, rotation=90),Rectangle( extent={{-72,-12},{-54,-34}}, lineColor={0,0,0}, fillPattern=FillPattern.HorizontalCylinder, fillColor={175,175,175}),Rectangle( extent={{-12,-68},{12,-72}}, lineColor={0,0,0}, fillPattern=FillPattern.HorizontalCylinder, fillColor={255,170,85}),Rectangle( extent={{-14.5,4.5},{14.5,-4.5}}, lineColor={0,0,0}, fillPattern=FillPattern.HorizontalCylinder, fillColor={244,125,35}, origin={-14.5,31.5}, rotation=90),Rectangle( extent={{-14.5,4.5},{14.5,-4.5}}, lineColor={0,0,0}, fillPattern=FillPattern.HorizontalCylinder, fillColor={244,125,35}, origin={19.5,31.5}, rotation=90),Rectangle( extent={{-14.5,4.5},{14.5,-4.5}}, lineColor={0,0,0}, fillPattern=FillPattern.HorizontalCylinder, fillColor={244,125,35}, origin={45.5,31.5}, rotation=90),Rectangle( extent={{-43,55},{43,-55}}, lineColor={0,0,0}, fillColor={135,135,135}, fillPattern=FillPattern.HorizontalCylinder, origin={1,-25}, rotation=90)}), Diagram(coordinateSystem(preserveAspectRatio=false)), Documentation(revisions="

   


Copyright © 2015-2020, Claytex Services Limited

", info="

Depending upon the ESP control signal supplied, this model either generates an additional pressure to be inputted into the braking system, acting like a pump, or reduces the pressure in the system, acting like a valve. Each wheel receives an addition/reduction in brake line pressure depending upon the brake force distribution specified in the BrakeLineSingleCircuit model.

A first order filter is included between the pump and each wheel to give an initial representation of actuator dynamics and to reduce a large non-linear system created by the ESP system.

")); end ESPABSPump; model BrakeController extends Suspensions.Control.Interfaces.BaseStabilityController; Modelica.Blocks.Sources.Constant deactivationFeedESC(k=0) "Feeds a zero to the signal priority blocks to prevent errors when deactivating individual modules of the stability programme" annotation (Placement(transformation(extent={{-94,126},{-80,140}}))); TSFS02_Lab3_ESP.CarModel.MySC mySC annotation (Placement(transformation(extent={{-18,6},{36,56}}))); Modelica.Blocks.Sources.Constant deactivationFeedSC(k=0) "Feeds a zero to the signal priority blocks to prevent errors when deactivating individual modules of the stability programme" annotation (Placement(transformation(extent={{-64,48},{-50,62}}))); TSFS02_Lab3_ESP.CarModel.MyEBD myEBD annotation (Placement(transformation(extent={{-18,-62},{30,-14}}))); Modelica.Blocks.Sources.Constant deactivationFeedEBD(k=0) "Feeds a zero to the signal priority blocks to prevent errors when deactivating individual modules of the stability programme" annotation (Placement(transformation(extent={{-62,-18},{-48,-4}}))); Controllers.MyESP myESP annotation (Placement(transformation(extent={{-14,72},{36,122}}))); equation connect(mySC.wheel_1, brakesControlBus.absWheel1) annotation (Line(points={{36, 46.9091},{62,46.9091},{62,2},{100,2}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(mySC.wheel_2, brakesControlBus.absWheel2) annotation (Line(points={{36, 37.8182},{62,37.8182},{62,2},{100,2}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(mySC.wheel_3, brakesControlBus.absWheel3) annotation (Line(points={{36, 28.7273},{62,28.7273},{62,2},{100,2}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(mySC.wheel_4, brakesControlBus.absWheel4) annotation (Line(points={{36, 19.6364},{62,19.6364},{62,2},{100,2}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(myEBD.brakeBias, brakesControlBus.brakeBias) annotation (Line(points= {{30,-33.2},{76,-33.2},{76,2},{100,2}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(deactivationFeedEBD.y, brakesControlBus.deactivationFeedEBD) annotation (Line(points={{-47.3,-11},{72.35,-11},{72.35,2},{100,2}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(deactivationFeedSC.y, mySC.controllerActivationSignal) annotation ( Line(points={{-49.3,55},{-33.65,55},{-33.65,55.3182},{-17.19,55.3182}}, color={0,0,127})); connect(controlBus.chassisBus.longitudinalAcceleration, mySC.a_x) annotation ( Line( points={{0.1,-99.9},{-174,-99.9},{-174,51.4545},{-16.92,51.4545}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(controlBus.brakesBus.wheelSpeed_1, mySC.omega_1) annotation (Line( points={{0.1,-99.9},{-120,-99.9},{-120,34.4091},{-17.19,34.4091}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(controlBus.brakesBus.wheelSpeed_2, mySC.omega_2) annotation (Line( points={{0.1,-99.9},{-116,-99.9},{-116,29.4091},{-17.19,29.4091}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(controlBus.brakesBus.wheelSpeed_3, mySC.omega_3) annotation (Line( points={{0.1,-99.9},{-112,-99.9},{-112,24.8636},{-17.19,24.8636}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(controlBus.brakesBus.wheelSpeed_4, mySC.omega_4) annotation (Line( points={{0.1,-99.9},{-108,-99.9},{-108,19.8636},{-17.19,19.8636}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(controlBus.driverBus.brakePedalPosition, mySC.F_bp) annotation (Line( points={{0.1,-99.9},{-102,-99.9},{-102,10.5455},{-16.92,10.5455}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(myEBD.controllerActivationSignal, deactivationFeedEBD.y) annotation (Line(points={{-17.28,-14.72},{-30.64,-14.72},{-30.64,-11},{ -47.3,-11}}, color={0,0,127})); connect(myEBD.a_x, mySC.a_x) annotation (Line(points={{-17.04,-18.8},{ -174,-18.8},{-174,51.4545},{-16.92,51.4545}}, color={0,0,127})); connect(myEBD.F_bp, mySC.F_bp) annotation (Line(points={{-17.04,-62},{ -102,-62},{-102,10.5455},{-16.92,10.5455}}, color={0,0,127})); connect(myEBD.omega_4, mySC.omega_4) annotation (Line(points={{-17.28, -52.16},{-108,-52.16},{-108,19.8636},{-17.19,19.8636}}, color={0, 0,127})); connect(myEBD.omega_3, mySC.omega_3) annotation (Line(points={{-17.28, -46.88},{-112,-46.88},{-112,24.8636},{-17.19,24.8636}}, color={0, 0,127})); connect(myEBD.omega_2, mySC.omega_2) annotation (Line(points={{-17.28, -42.08},{-116,-44},{-116,29.4091},{-17.19,29.4091}}, color={0,0, 127})); connect(myEBD.omega_1, mySC.omega_1) annotation (Line(points={{-17.28, -36.8},{-120,-38},{-120,34.4091},{-17.19,34.4091}}, color={0,0, 127})); connect(deactivationFeedESC.y, myESP.controllerActivationSignal) annotation (Line(points={{-79.3,133},{-46.65,133},{-46.65,117},{-14,117}}, color={0,0,127})); connect(myESP.wheel_1, brakesControlBus.espWheel1) annotation (Line( points={{36,112},{68,112},{68,2},{100,2}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(myESP.wheel_2, brakesControlBus.espWheel2) annotation (Line( points={{36,102},{68,102},{68,2},{100,2}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(myESP.wheel_3, brakesControlBus.espWheel3) annotation (Line( points={{36,92},{68,92},{68,2},{100,2}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(myESP.wheel_4, brakesControlBus.espWheel4) annotation (Line( points={{36,82},{68,82},{68,2},{100,2}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(controlBus.chassisBus.lateralAcceleration, myESP.a_y) annotation ( Line( points={{0.1,-99.9},{-168,-99.9},{-168,107},{-14,107}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(controlBus.chassisBus.longitudinalVelocity, myESP.v_x) annotation (Line( points={{0.1,-99.9},{-160,-99.9},{-160,97},{-14,97}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(controlBus.chassisBus.yawRate, myESP.Omega_z) annotation (Line( points={{0.1,-99.9},{-154,-99.9},{-154,87},{-14,87}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(controlBus.driverBus.steeringWheelAngle, myESP.delta_sw) annotation (Line( points={{0.1,-99.9},{-146,-99.9},{-146,77},{-14,77}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(mySC.v_x, myESP.v_x) annotation (Line(points={{-17.19,43.5},{-160, 44},{-160,97},{-14,97}}, color={0,0,127})); connect(mySC.a_y, myESP.a_y) annotation (Line(points={{-16.92,47.3636},{ -168,47.3636},{-168,107},{-14,107}}, color={0,0,127})); connect(mySC.Omega_z, myESP.Omega_z) annotation (Line(points={{-17.19, 38.9545},{-154,38.9545},{-154,87},{-14,87}}, color={0,0,127})); connect(mySC.delta_sw, myESP.delta_sw) annotation (Line(points={{-16.92, 15.0909},{-146,16},{-146,77},{-14,77}}, color={0,0,127})); connect(myEBD.v_x, myESP.v_x) annotation (Line(points={{-17.28,-27.2},{ -160,-26},{-160,97},{-14,97}}, color={0,0,127})); connect(myEBD.a_y, myESP.a_y) annotation (Line(points={{-17.04,-23.12},{ -168,-24},{-168,107},{-14,107}}, color={0,0,127})); connect(myEBD.Omega_z, myESP.Omega_z) annotation (Line(points={{-17.28, -32},{-154,-32},{-154,87},{-14,87}}, color={0,0,127})); connect(myEBD.delta_sw, myESP.delta_sw) annotation (Line(points={{-17.04, -57.2},{-146,-58},{-146,77},{-14,77}}, color={0,0,127})); annotation ( Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(coordinateSystem(extent={{-100,-100},{100,100}}))); end BrakeController; model SmallFamilyCar "Small family car" extends Suspensions.Vehicles.FrontWheelDrive.SmallFamilyMT(redeclare replaceable TSFS02_Lab3_ESP.CarModel.HydraulicCircuit brakes( usingMultiBodyChassis=true, brake_2(redeclare replaceable Claytex.Mechanics.Rotational.Parts.ElasticBrake brake(cgeo=0.5, tau_max=10000)), brake_4(redeclare replaceable Claytex.Mechanics.Rotational.Parts.ElasticBrake brake(cgeo=0.5, tau_max=10000)), brake_3(redeclare replaceable Claytex.Mechanics.Rotational.Parts.ElasticBrake brake(cgeo=0.5, tau_max=10000)), brake_1(redeclare replaceable Claytex.Mechanics.Rotational.Parts.ElasticBrake brake(cgeo=0.5, tau_max=10000))), redeclare Suspensions.Bodies.Ideal.SmallFamilyBootPayload body); replaceable TSFS02_Lab3_ESP.CarModel.BrakeController stabilityControl constrainedby Suspensions.Control.Interfaces.BaseStabilityController annotation (Placement(transformation(extent={{60,90},{80,110}}))); equation connect(stabilityControl.controlBus, controlBus) annotation (Line( points={{70,90},{70,76},{100,76},{100,22},{-220,22}}, color={255,204,51}, thickness=0.5)); annotation ( Diagram(coordinateSystem( preserveAspectRatio=false, extent={{-220,-110},{220,110}}, initialScale=0.1)), Icon(coordinateSystem( preserveAspectRatio=false, extent={{-220,-110},{220,110}}, initialScale=0.1), graphics={Text( extent={{-210,94},{-144,60}}, lineColor={0,0,0}, lineThickness=0.5, textString="ESP")}), Documentation(info="

This example is a front wheel drive passenger car with a manual transmission; exactly the same as the FWDCarMT but with a brake actuated ESP controller and a boot payload mass.

By default, the hitch for towing a trailer is disabled, including hitchFrame, hitchTransformation and toHitch.

", revisions="

   


Copyright © 2015-2020, Claytex Services Limited

")); end SmallFamilyCar; model SmallestSignal "Detects and outputs the smallest input signal" extends Modelica.Blocks.Interfaces.SI2SO; equation y = noEvent(min(u1, u2)); annotation ( Diagram(graphics), Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ 100,100}}), graphics={Rectangle( extent={{-100,100},{100,-100}}, lineColor={0,0,127}, fillColor={255,255,255}, fillPattern=FillPattern.Solid),Text( extent={{-90,36},{90,-36}}, lineColor={160,160,164}, textString="min()"),Text( extent={{-100,95},{100,65}}, lineColor={0,0,255}, fillColor={234,234,234}, fillPattern=FillPattern.Solid, textString="noEvent")}), Documentation(revisions="

   


Copyright © 2008-2020, Claytex Services Limited

", info="

Returns the minimum of the two inputs (u1 and u2) and prevents events being generated.

")); end SmallestSignal; block ValueBlock extends Modelica.Blocks.Icons.Block; parameter Real value=0; annotation ( Icon(graphics={Text( extent={{-76,64},{80,-60}}, lineColor={28,108,200}, textString="%value")})); end ValueBlock; model MySC extends Claytex.Icons.Component; Modelica.Blocks.Interfaces.RealOutput wheel_1 annotation (Placement(transformation(extent={{90,50},{110,70}}))); Modelica.Blocks.Interfaces.RealOutput wheel_2 annotation (Placement(transformation(extent={{90,10},{110,30}}))); Modelica.Blocks.Interfaces.RealOutput wheel_3 annotation (Placement(transformation(extent={{90,-30},{110,-10}}))); Modelica.Blocks.Interfaces.RealOutput wheel_4 annotation (Placement(transformation(extent={{90,-70},{110,-50}}))); Modelica.Blocks.Interfaces.RealInput controllerActivationSignal annotation (Placement(transformation(extent={{-108,86},{-86,108}}), iconTransformation(extent={{-108,86},{-86,108}}))); // Sensor signals Modelica.Blocks.Interfaces.RealInput a_x annotation (Placement(transformation(extent={{-106,70},{-86,90}}), iconTransformation(extent={{-106,70},{-86,90}}))); Modelica.Blocks.Interfaces.RealInput a_y annotation (Placement(transformation(extent={{-106,52},{-86,72}}), iconTransformation(extent={{-106,52},{-86,72}}))); Modelica.Blocks.Interfaces.RealInput v_x annotation (Placement(transformation(extent={{-108,34},{-86,56}}), iconTransformation(extent={{-108,34},{-86,56}}))); Modelica.Blocks.Interfaces.RealInput Omega_z annotation (Placement(transformation(extent={{-108,14},{-86,36}}), iconTransformation(extent={{-108,14},{-86,36}}))); Modelica.Blocks.Interfaces.RealInput omega_1 annotation (Placement(transformation(extent={{-108,-6},{-86,16}}), iconTransformation(extent={{-108,-6},{-86,16}}))); Modelica.Blocks.Interfaces.RealInput omega_2 annotation (Placement(transformation(extent={{-108,-28},{-86,-6}}), iconTransformation(extent={{-108,-28},{-86,-6}}))); Modelica.Blocks.Interfaces.RealInput omega_3 annotation (Placement(transformation(extent={{-108,-48},{-86,-26}}), iconTransformation(extent={{-108,-48},{-86,-26}}))); Modelica.Blocks.Interfaces.RealInput omega_4 annotation (Placement(transformation(extent={{-108,-70},{-86,-48}}), iconTransformation(extent={{-108,-70},{-86,-48}}))); Modelica.Blocks.Interfaces.RealInput delta_sw annotation (Placement(transformation(extent={{-106,-90},{-86,-70}}), iconTransformation(extent={{-106,-90},{-86,-70}}))); Modelica.Blocks.Interfaces.RealInput F_bp annotation (Placement(transformation(extent={{-106,-110},{-86,-90}}), iconTransformation(extent={{-106,-110},{-86,-90}}))); // Normalized brake pressures // Limits the maximum brake pressure applied Real ub1; Real ub2; Real ub3; Real ub4; // ------------------------------------------------------------------------- // ----------------- Do not modify anything above this line ---------------- // Parameters parameter Real g = Modelica.Constants.g_n "Gravity constant"; parameter Real pi = Modelica.Constants.pi "Pi"; parameter Real m = 1242; parameter Real h = 0.45; parameter Real L = 2.65; parameter Real l_1 = 1.23; parameter Real R_w = 0.315; parameter Real J_w = 2.7; parameter Real A_cp = 7.9e-3; parameter Real p_bmax = 1.5e6; parameter Real R_disc = 0.25; parameter Real mu_bp = 1; // Variables equation ub1 = 1; //Replace this ub2 = 1; //Replace this ub3 = 1; //Replace this ub4 = 1; //Replace this // ----------------- Do not modify anything under this line ---------------- // ------------------------------------------------------------------------- // Output signal from model if controllerActivationSignal > 0 then wheel_1 = max(0, min(1, ub1)); wheel_2 = max(0, min(1, ub2)); wheel_3 = max(0, min(1, ub3)); wheel_4 = max(0, min(1, ub4)); else wheel_1 = 1; wheel_2 = 1; wheel_3 = 1; wheel_4 = 1; end if; annotation (Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(coordinateSystem(extent={{-100,-120},{100,100}}))); end MySC; model MyEBD extends Claytex.Icons.Component; Modelica.Blocks.Interfaces.RealOutput brakeBias annotation (Placement(transformation(extent={{90,10},{110,30}}))); Modelica.Blocks.Interfaces.RealInput controllerActivationSignal annotation (Placement(transformation(extent={{-108,86},{-86,108}}), iconTransformation(extent={{-108,86},{-86,108}}))); // Sensor signals Modelica.Blocks.Interfaces.RealInput a_x annotation (Placement(transformation(extent={{-106,70},{-86,90}}), iconTransformation(extent={{-106,70},{-86,90}}))); Modelica.Blocks.Interfaces.RealInput a_y annotation (Placement(transformation(extent={{-106,52},{-86,72}}), iconTransformation(extent={{-106,52},{-86,72}}))); Modelica.Blocks.Interfaces.RealInput v_x annotation (Placement(transformation(extent={{-108,34},{-86,56}}), iconTransformation(extent={{-108,34},{-86,56}}))); Modelica.Blocks.Interfaces.RealInput Omega_z annotation (Placement(transformation(extent={{-108,14},{-86,36}}), iconTransformation(extent={{-108,14},{-86,36}}))); Modelica.Blocks.Interfaces.RealInput omega_1 annotation (Placement(transformation(extent={{-108,-6},{-86,16}}), iconTransformation(extent={{-108,-6},{-86,16}}))); Modelica.Blocks.Interfaces.RealInput omega_2 annotation (Placement(transformation(extent={{-108,-28},{-86,-6}}), iconTransformation(extent={{-108,-28},{-86,-6}}))); Modelica.Blocks.Interfaces.RealInput omega_3 annotation (Placement(transformation(extent={{-108,-48},{-86,-26}}), iconTransformation(extent={{-108,-48},{-86,-26}}))); Modelica.Blocks.Interfaces.RealInput omega_4 annotation (Placement(transformation(extent={{-108,-70},{-86,-48}}), iconTransformation(extent={{-108,-70},{-86,-48}}))); Modelica.Blocks.Interfaces.RealInput delta_sw annotation (Placement(transformation(extent={{-106,-90},{-86,-70}}), iconTransformation(extent={{-106,-90},{-86,-70}}))); Modelica.Blocks.Interfaces.RealInput F_bp annotation (Placement(transformation(extent={{-106,-110},{-86,-90}}), iconTransformation(extent={{-106,-110},{-86,-90}}))); // Brake pressure distribution Real Kbf; // ------------------------------------------------------------------------- // ----------------- Do not modify anything above this line ---------------- // Parameters parameter Real g = Modelica.Constants.g_n "Gravity constant"; parameter Real pi = Modelica.Constants.pi "Pi"; parameter Real m = 1242; parameter Real h = 0.45; parameter Real L = 2.65; parameter Real l_1 = 1.23; parameter Real R_w = 0.3264; parameter Real J_w = 2.7; parameter Real A_cp = 7.9e-3; parameter Real p_bmax = 1.5e6; parameter Real R_disc = 0.25; parameter Real mu_bp = 1; // Variables equation Kbf = 0.5; //Replace this // ----------------- Do not modify anything under this line ---------------- // ------------------------------------------------------------------------- // Output signal from model if controllerActivationSignal > 0 then brakeBias = max(0, min(1, Kbf)); else brakeBias = 0.5; end if; annotation (); end MyEBD; end CarModel; annotation (uses( Modelica(version="3.2.3"), VeSyMA(version="2020.1"), Suspensions(version="2020.1"), Claytex(version="2020.1"), VehicleInterfaces(version="1.2.5"))); end TSFS02_Lab3_ESP;