VehicleDynamics.Drivers

VehicleDynamics.Drivers.LaneChange VehicleDynamics.Drivers.OpenLoopDriver VehicleDynamics.Drivers.Interfaces

NameDescription
LaneChange  
OpenLoopDriver  
Interfaces Driver Interfaces


VehicleDynamics.Drivers.OpenLoopDriver VehicleDynamics.Drivers.OpenLoopDriver

VehicleDynamics.Drivers.OpenLoopDriver

Parameters

NameDefaultDescription
kLaneChange1 Gain of Lane Change output, use this to turn on/off output
t1LaneChange0.5 start time of sine1
t2LaneChange3.5start time of sine2
p1LaneChange2period of sine1
p2LaneChange2 period of sine2
a1LaneChange0.5 amplitude of sine1
a2LaneChange-0.5 amplitude of sine2
generateEventfalse generate event for discontinuities
kRampSteering0 Gain of Ramp output, use this to turn on/off output
heightRampSteering0.5 Height of ramp [m]
durationRampSteering2 Duration of ramp
offsetRampSteering0 Ramp offset
startTimeRampSteering0 Output = offset for time < startTime [s]
kTableSteering0 Gain of Table output, use this to turn on/off output
tableSteering[:, :][0, 0; 1, 1; 2, 4] Table matrix (time = first column)
kRampDrive0 Gain of Ramp output, use this to turn on/off output
heightRampDrive50 Height of ramp [m]
durationRampDrive2 Duration of ramp
offsetRampDrive0 Ramp offset
startTimeRampDrive0 Output = offset for time < startTime [s]
kTableDrive0 Gain of Table output, use this to turn on/off output
tableDrive[:, :][0, 0; 1, 1; 2, 4] Table matrix (time = first column)

Modelica definition

model OpenLoopDriver 
  import SI = Modelica.SIunits;
  extends Interfaces.DriverInterface;
  
  // STEERING
  
  parameter Real kLaneChange=1 
    "|Steering|LaneChange| Gain of Lane Change output, use this to turn on/off output";
  parameter Real t1LaneChange=0.5 "|Steering|LaneChange| start time of sine1 ";
  parameter Real t2LaneChange=3.5 "|Steering|LaneChange|start time of sine2";
  parameter Real p1LaneChange=2 "|Steering|LaneChange|period of sine1";
  parameter Real p2LaneChange=2 "|Steering|LaneChange| period of sine2";
  parameter Real a1LaneChange=0.5 "|Steering|LaneChange| amplitude of sine1";
  parameter Real a2LaneChange=-0.5 "|Steering|LaneChange| amplitude of sine2";
  parameter Boolean generateEvent=false 
    "|Steering|LaneChange| generate event for discontinuities";
  
  parameter Real kRampSteering=0 
    "|Steering|Ramp| Gain of Ramp output, use this to turn on/off output";
  parameter SI.Position heightRampSteering=0.5 "|Steering|Ramp| Height of ramp";
  parameter Real durationRampSteering(min=Modelica.Constants.SMALL) = 2 
    "|Steering|Ramp| Duration of ramp";
  parameter Real offsetRampSteering=0 "|Steering|Ramp| Ramp offset";
  parameter SI.Time startTimeRampSteering=0 
    "|Steering|Ramp| Output = offset for time < startTime";
  
  parameter Real kTableSteering=0 
    "|Steering|TimeTable| Gain of Table output, use this to turn on/off output";
  parameter Real tableSteering[:, :]=[0, 0; 1, 1; 2, 4] 
    "|Steering|TimeTable| Table matrix (time = first column)";
  
  // DRIVE
  parameter Real kRampDrive=0 
    "|Drive|Ramp| Gain of Ramp output, use this to turn on/off output";
  parameter SI.Position heightRampDrive=50 "|Drive|Ramp| Height of ramp";
  parameter Real durationRampDrive(min=Modelica.Constants.SMALL) = 2 
    "|Drive|Ramp| Duration of ramp";
  parameter Real offsetRampDrive=0 "|Drive|Ramp| Ramp offset";
  parameter SI.Time startTimeRampDrive=0 
    "|Drive|Ramp| Output = offset for time < startTime";
  
  parameter Real kTableDrive=0 
    "|Drive|TimeTable| Gain of Table output, use this to turn on/off output";
  parameter Real tableDrive[:, :]=[0, 0; 1, 1; 2, 4] 
    "|Drive|TimeTable| Table matrix (time = first column)";
  
  Modelica.Mechanics.Rotational.Position steeringWheelPosition(
    f_crit=10, 
    phi(stateSelect=StateSelect.always), 
    w(stateSelect=StateSelect.always));
  Drivers.LaneChange laneChangeSteering(
    t1=t1LaneChange, 
    t2=t2LaneChange, 
    p1=p1LaneChange, 
    p2=p2LaneChange, 
    a1=a1LaneChange, 
    a2=a2LaneChange, 
    generateEvent=generateEvent);
  Modelica.Blocks.Sources.Ramp rampSteering(
    height={heightRampSteering}, 
    offset={offsetRampSteering}, 
    startTime={startTimeRampSteering}, 
    duration={durationRampSteering});
  Modelica.Blocks.Sources.TimeTable timeTableSteering(table=tableSteering);
  Modelica.Blocks.Sources.TimeTable TimeTableDrive(table=tableDrive);
  Modelica.Blocks.Math.Add3 addSteering(
    k1=kLaneChange, 
    k2=kRampSteering, 
    k3=kTableSteering);
  Modelica.Blocks.Sources.Ramp rampDrive(
    duration={durationRampDrive}, 
    offset={offsetRampDrive}, 
    startTime={startTimeRampDrive}, 
    height={heightRampDrive});
  Modelica.Blocks.Math.Add addDrive(k1=kRampDrive, k2=kTableDrive);
  Modelica.Mechanics.Rotational.Position acceleratorBrakePosition(f_crit=10);
equation 
  
  connect(timeTableSteering.outPort, addSteering.inPort3);
  connect(laneChangeSteering.outPort, addSteering.inPort1);
  connect(rampSteering.outPort, addSteering.inPort2);
  connect(addSteering.outPort, steeringWheelPosition.inPort);
  connect(rampDrive.outPort, addDrive.inPort1);
  connect(TimeTableDrive.outPort, addDrive.inPort2);
  connect(addDrive.outPort, acceleratorBrakePosition.inPort);
  connect(acceleratorBrakePosition.flange_b, flange_Long);
  connect(steeringWheelPosition.flange_b, flange_Lat);
end OpenLoopDriver;

VehicleDynamics.Drivers.LaneChange VehicleDynamics.Drivers.LaneChange

VehicleDynamics.Drivers.LaneChange

Parameters

NameDefaultDescription
t10.5start time of sine1
t23.5start time of sine2
p12period of sine1
p22period of sine2
a170*3.14/180amplitude of sine1
a2-70*3.14/180amplitude of sine2
generateEventfalsegenerate event for discontinuities

Modelica definition

model LaneChange 
  parameter Real t1=0.5 "start time of sine1";
  parameter Real t2=3.5 "start time of sine2";
  parameter Real p1=2 "period of sine1";
  parameter Real p2=2 "period of sine2";
  parameter Real a1=70*3.14/180 "amplitude of sine1";
  parameter Real a2=-70*3.14/180 "amplitude of sine2";
  parameter Boolean generateEvent=false "generate event for discontinuities";
  
public 
  Modelica.Blocks.Interfaces.OutPort outPort;
equation 
  outPort.signal[1] = if generateEvent then if time < t1 then 0 else if time < 
    t1 + p1 then a1*sin((2*Modelica.Constants.pi/p1)*(time - t1)) else if time
     < t2 then 0 else if time < t2 + p2 then a2*sin((2*Modelica.Constants.pi/p2)
    *(time - t2)) else 0 else noEvent(if time < t1 then 0 else if time < t1 + 
    p1 then a1*sin((2*Modelica.Constants.pi/p1)*(time - t1)) else if time < t2
     then 0 else if time < t2 + p2 then a2*sin((2*Modelica.Constants.pi/p2)*(
    time - t2)) else 0);
  
end LaneChange;

HTML-documentation generated by Dymola Tue Jul 15 13:22:07 2003 .