text
stringlengths
1
4.74k
code
stringlengths
69
637k
Collection of controllers subsystem definitions
within VehicleInterfaces; package Controllers "Collection of controllers subsystem definitions" extends Modelica.Icons.VariantsPackage; end Controllers;
Controllers Tutorial.
within VehicleInterfaces.Controllers; class Tutorial "Controllers Tutorial" extends Modelica.Icons.Information; end Tutorial;
Basic interface definition for a controller. This partial model defines the interfaces required for a&nbsp;controller subsystem. This class should be extended to form a&nbsp;particular controller model. See the <a href=\"modelica://VehicleInterfaces.Controllers\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Controllers.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Controllers.Interfaces; partial model Base "Basic interface definition for a controller" VehicleInterfaces.Interfaces.ControlBus controlBus "Control signal bus" end Base;
Collection of interface definitions for controller
within VehicleInterfaces.Controllers; package Interfaces "Collection of interface definitions for controller" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Basic data dictionary example. A&nbsp;simple data dictionary example that creates a&nbsp;new signal called <strong>v_veh</strong> within the <strong>chassisBus</strong> sub-bus of the control bus.
within VehicleInterfaces.DataDictionaries; model MinimalExample "Basic data dictionary example" extends VehicleInterfaces.Icons.DataDictionary; extends VehicleInterfaces.DataDictionaries.Interfaces.Base; protected Modelica.Blocks.Routing.RealPassThrough v_veh VehicleInterfaces.Interfaces.ChassisBus chassisBus equation connect(chassisBus, controlBus.chassisBus) connect(v_veh.u, chassisBus.longitudinalVelocity) connect(chassisBus.v_veh, v_veh.y) end MinimalExample;
Empty data dictionary. Empty data dictionary model. Using this empty model in overall vehicle architecture the functionality of data dictionary can be eliminated.
within VehicleInterfaces.DataDictionaries; model NoDataDictionary "Empty data dictionary" extends VehicleInterfaces.Icons.DataDictionary; extends VehicleInterfaces.Icons.Empty; extends VehicleInterfaces.DataDictionaries.Interfaces.Base; end NoDataDictionary;
Collection of data dictionary definitions
within VehicleInterfaces; package DataDictionaries "Collection of data dictionary definitions" extends Modelica.Icons.VariantsPackage; end DataDictionaries;
Data Dictionary Tutorial.
within VehicleInterfaces.DataDictionaries; class Tutorial "Data Dictionary Tutorial" extends Modelica.Icons.Information; end Tutorial;
Basic interface definition for a data dictionary. This partial model defines the interfaces required for a&nbsp;data dictionary within the VehicleInterfaces package. Especially, it provide alias names for the controBus. See the <a href=\"modelica://VehicleInterfaces.DataDictionaries\">documentation</a> and <a href=\"modelica://VehicleInterfaces.DataDictionaries.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.DataDictionaries.Interfaces; partial model Base "Basic interface definition for a data dictionary" VehicleInterfaces.Interfaces.ControlBus controlBus "Control signal bus" end Base;
Collection of interface definitions for data dictionary
within VehicleInterfaces.DataDictionaries; package Interfaces "Collection of interface definitions for data dictionary" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Front wheel drive, 4 wheeled vehicle. This driveline model is of a&nbsp;front-wheel drive 4-wheeled vehicle. The front differential is modelled using an ideal gear and planetary gear. The model does include the 3D mount effects if the <strong>driveTrainMechanics3D</strong> in the world object is set to true. To properly include these effects the additional constant and FrameForceAndTorque actuators are required on the front wheel hubs. A&nbsp;constant zero torque is applied to the rear wheelhubs and the reaction paths in to the wheelhubs are included.
within VehicleInterfaces.Drivelines; model MinimalDriveline "Front wheel drive, 4 wheeled vehicle" extends VehicleInterfaces.Icons.Driveline; extends VehicleInterfaces.Drivelines.Interfaces.TwoAxleBase(includeMount=world.driveTrainMechanics3D); parameter SI.Inertia halfshaftInertia=0.1 "Inertia of each halfshaft"; parameter Real finalDriveRatio=3 "Final drive ratio"; Modelica.Mechanics.MultiBody.Parts.Rotor1D rightHalfShaft( J=halfshaftInertia) Modelica.Mechanics.MultiBody.Parts.Rotor1D leftHalfShaft( J=halfshaftInertia) Modelica.Mechanics.Rotational.Components.IdealPlanetary differential( ratio=1) protected outer Modelica.Mechanics.MultiBody.World world; public Modelica.Mechanics.Rotational.Components.IdealGear finalDrive( ratio=finalDriveRatio, useSupport=false) equation connect(rightHalfShaft.flange_a, wheelHub_2.flange) connect(leftHalfShaft.flange_a, wheelHub_1.flange) connect(leftHalfShaft.flange_b, differential.sun) connect(differential.ring, rightHalfShaft.flange_b) connect(rightHalfShaft.frame_a, drivelineMount) connect(leftHalfShaft.frame_a, drivelineMount) connect(finalDrive.flange_b, differential.carrier) connect(finalDrive.flange_a, transmissionFlange.flange) end MinimalDriveline;
Empty driveline model for a 4 wheeled vehicle. Zero torque is applied to all the wheelhubs and the reaction paths in to the wheel hubs included if the <strong>driveTrainMechanics3D</strong> flag in the world object is true.
within VehicleInterfaces.Drivelines; model NoDriveline "Empty driveline model for a 4 wheeled vehicle" extends VehicleInterfaces.Icons.Driveline; extends VehicleInterfaces.Icons.Empty; extends VehicleInterfaces.Drivelines.Interfaces.TwoAxleBase( includeWheelBearings=world.driveTrainMechanics3D); protected outer Modelica.Mechanics.MultiBody.World world; end NoDriveline;
Collection of drivelines subsystem definitions
within VehicleInterfaces; package Drivelines "Collection of drivelines subsystem definitions" extends Modelica.Icons.VariantsPackage; end Drivelines;
Driveline Tutorial.
within VehicleInterfaces.Drivelines; class Tutorial "Driveline Tutorial" extends Modelica.Icons.Information; end Tutorial;
Basic interface definition for a driveline. This partial model defines the basic interfaces required for any driveline subsystem. This class should be extended to form a&nbsp;driveline interface definition with the correct number of wheelHub connectors for the type of vehicle being modelled. See the <a href=\"modelica://VehicleInterfaces.Drivelines\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Drivelines.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Drivelines.Interfaces; partial model Base "Basic interface definition for a driveline" parameter Boolean usingMultiBodyChassis=false "= true, if connecting to a MultiBody chassis" parameter Boolean usingMultiBodyTransmission=false "= true, if connecting to a MultiBody transmission" protected parameter Boolean includeWheelBearings=false "Include wheel bearing connectors"; parameter Boolean includeMount=false "Include the driveline mount"; parameter Boolean includeTransmissionBearing=false "Include the transmission bearing"; public Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing transmissionFlange( final includeBearingConnector=includeTransmissionBearing or usingMultiBodyTransmission) "Connection to the Transmission output shaft" Modelica.Mechanics.MultiBody.Interfaces.Frame_a drivelineMount if includeMount "Driveline mount connection (optional)" VehicleInterfaces.Interfaces.ControlBus controlBus "Control signal bus" Mechanics.MultiBody.MultiBodyEnd end_0( final includeBearingConnector=includeTransmissionBearing or usingMultiBodyTransmission) equation connect(end_0.flange, transmissionFlange) end Base;
Interface definition for a driveline of a 8 wheeled vehicle. This partial model defines the interfaces required for the driveline subsystem of a&nbsp;four axled vehicle within the VehicleInterfaces package. See the <a href=\"modelica://VehicleInterfaces.Drivelines\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Drivelines.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Drivelines.Interfaces; partial model FourAxleBase "Interface definition for a driveline of a 8 wheeled vehicle" extends VehicleInterfaces.Drivelines.Interfaces.Base; Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_1( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Front left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_2( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Front right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_3( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Second axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_4( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Second axle right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_5( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Third axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_6( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Third axle right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_7( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Fourth axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_8( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Fourth axle right wheel" Mechanics.MultiBody.MultiBodyEnd end_1( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_2( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_3( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_4( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_5( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_6( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_7( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_8( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) equation connect(end_1.flange, wheelHub_1) connect(end_2.flange, wheelHub_2) connect(end_3.flange, wheelHub_3) connect(end_4.flange, wheelHub_4) connect(end_5.flange, wheelHub_5) connect(end_6.flange, wheelHub_6) connect(end_7.flange, wheelHub_7) connect(end_8.flange, wheelHub_8) end FourAxleBase;
Collection of interface definitions for driveline
within VehicleInterfaces.Drivelines; package Interfaces "Collection of interface definitions for driveline" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Interface definition for a driveline of a 6 wheeled vehicle. This partial model defines the interfaces required for the driveline subsystem of a&nbsp;three axled vehicle within the VehicleInterfaces package. See the <a href=\"modelica://VehicleInterfaces.Drivelines\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Drivelines.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Drivelines.Interfaces; partial model ThreeAxleBase "Interface definition for a driveline of a 6 wheeled vehicle" extends VehicleInterfaces.Drivelines.Interfaces.Base; Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_1( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Front left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_2( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Front right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_3( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Second axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_4( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Second axle right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_5( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Third axle left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_6( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Third axle right wheel" Mechanics.MultiBody.MultiBodyEnd end_1( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_2( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_3( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_4( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_5( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_6( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) equation connect(end_1.flange, wheelHub_1) connect(end_2.flange, wheelHub_2) connect(end_3.flange, wheelHub_3) connect(end_4.flange, wheelHub_4) connect(end_5.flange, wheelHub_5) connect(end_6.flange, wheelHub_6) end ThreeAxleBase;
Interface definition for a driveline of a 4 wheeled vehicle. This partial model defines the interfaces required for the driveline subsystem of a&nbsp;two axled vehicle within the VehicleInterfaces package. See the <a href=\"modelica://VehicleInterfaces.Drivelines\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Drivelines.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Drivelines.Interfaces; partial model TwoAxleBase "Interface definition for a driveline of a 4 wheeled vehicle" extends Base; Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_1( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Front left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_2( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Front right wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_3( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Rear left wheel" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing wheelHub_4( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) "Rear right wheel" Mechanics.MultiBody.MultiBodyEnd end_1( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_2( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_3( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) Mechanics.MultiBody.MultiBodyEnd end_4( final includeBearingConnector=includeWheelBearings or usingMultiBodyChassis) equation connect(end_1.flange, wheelHub_1) connect(end_2.flange, wheelHub_2) connect(end_3.flange, wheelHub_3) connect(end_4.flange, wheelHub_4) end TwoAxleBase;
Minimal Driver-Vehicle Interface, manual transmission, uses physical pedal connections. Constant acceleration driver with the capabilitiy to step between two constant throttle values. Fixed gear and constant clutch position.
within VehicleInterfaces.DriverEnvironments; model ConventionalManual "Minimal Driver-Vehicle Interface, manual transmission, uses physical pedal connections" extends VehicleInterfaces.Icons.DriverEnvironment; extends Interfaces.BaseManualTransmission( includeManualShiftConnector=true, includeAcceleratorPedal=true, includeBrakePedal=true, includeClutchPedal=true); public parameter Real initialAccelRequest(min=0, max=1) = 1 "Initial accelerator pedal position"; parameter Real initialBrakeRequest(min=0, max=1) = 0 "Initial brake pedal position"; parameter Real finalAccelRequest(min=0, max=1) = 1 "Final accelerator pedal position"; parameter Real finalBrakeRequest(min=0, max=1) = 0 "Final brake pedal position"; parameter SI.Time accelTime=10 "Time of accel apply"; parameter SI.Time brakeTime=10 "Time of brake apply"; parameter VehicleInterfaces.Types.Gear selectedGear=2 "Requested gear in manual mode"; parameter Real clutchRequest=0 "Clutch position (constant during simulation)"; Modelica.Blocks.Sources.Step brakeDemand( height=finalBrakeRequest, offset=initialBrakeRequest, startTime=brakeTime) Modelica.Blocks.Sources.Step acceleratorDemand( height=finalAccelRequest, offset=initialAccelRequest, startTime=accelTime) Modelica.Blocks.Sources.IntegerConstant gear(k=selectedGear) Modelica.Blocks.Sources.Constant clutchDemand(k=clutchRequest) VehicleInterfaces.Interfaces.ShiftInput shiftInput Modelica.Mechanics.Translational.Sources.Position acceleratorPosition Modelica.Mechanics.Translational.Sources.Position clutchPosition Modelica.Mechanics.Translational.Sources.Position brakePosition Modelica.Blocks.Sources.IntegerStep ignition( height=-1, startTime=0.5, offset=VehicleInterfaces.Types.IgnitionSetting.Start) protected VehicleInterfaces.Interfaces.DriverBus driverBus equation connect(acceleratorDemand.y, acceleratorPosition.s_ref) connect(acceleratorPosition.flange, acceleratorPedal) connect(brakeDemand.y, brakePosition.s_ref) connect(brakePosition.flange, brakePedal) connect(clutchDemand.y, clutchPosition.s_ref) connect(clutchPosition.flange, clutchPedal) connect(shiftInput.shiftConnector, shiftConnector) connect(gear.y, shiftInput.gear) connect(controlBus.driverBus, driverBus) connect(ignition.y, driverBus.ignition) end ConventionalManual;
Minimal Drive-by-wire Driver-Vehicle Interface. Constant acceleration driver with the capabilitiy to step between two constant throttle values and to step on/off the brakes.
within VehicleInterfaces.DriverEnvironments; model DriveByWireAutomatic "Minimal Drive-by-wire Driver-Vehicle Interface" extends VehicleInterfaces.Icons.DriverEnvironment; extends VehicleInterfaces.DriverEnvironments.Interfaces.BaseAutomaticTransmission; public parameter Real initialAccelRequest(min=0, max=1) = 1 "Initial accelerator pedal position"; parameter Real initialBrakeRequest(min=0, max=1) = 0 "Initial brake pedal position"; parameter Real finalAccelRequest(min=0, max=1) = 1 "Final accelerator pedal position"; parameter Real finalBrakeRequest(min=0, max=1) = 0 "Final brake pedal position"; parameter SI.Time accelTime=10 "Time of accel apply"; parameter SI.Time brakeTime=10 "Time of brake apply"; parameter VehicleInterfaces.Types.GearMode.Temp selectedGearboxMode= VehicleInterfaces.Types.GearMode.Drive "Current gearbox mode"; parameter VehicleInterfaces.Types.Gear manualGearRequest=0 "Requested gear in manual mode"; Modelica.Blocks.Sources.Step brakeDemand( height=finalBrakeRequest, offset=initialBrakeRequest, startTime=brakeTime) Modelica.Blocks.Sources.Step acceleratorDemand( height=finalAccelRequest, offset=initialAccelRequest, startTime=accelTime) Modelica.Blocks.Sources.IntegerConstant gearSelect(k=manualGearRequest) Modelica.Blocks.Sources.IntegerConstant gearMode(k=selectedGearboxMode) Modelica.Blocks.Sources.IntegerStep ignition( height=-1, startTime=0.5, offset=VehicleInterfaces.Types.IgnitionSetting.Start) protected VehicleInterfaces.Interfaces.DriverBus driverBus equation connect(controlBus.driverBus, driverBus) connect(acceleratorDemand.y, driverBus.acceleratorPedalPosition) connect(gearSelect.y, driverBus.requestedGear) connect(driverBus.brakePedalPosition, brakeDemand.y) connect(gearMode.y, driverBus.gearboxMode) connect(ignition.y, driverBus.ignition) end DriveByWireAutomatic;
Minimal drive-by-wire driver-vehicle interface with external driver model. Driver environment that requires an external driver model. Signals received from external driver model are simply propagated throug withouth any modification.
within VehicleInterfaces.DriverEnvironments; model DriveByWireAutomaticExternalDriver "Minimal drive-by-wire driver-vehicle interface with external driver model" extends VehicleInterfaces.Icons.DriverEnvironment; extends Interfaces.BaseAutomaticTransmissionExternalDriver; public Mechanics.NormalisedTranslational.PositionSensor acceleratorPosition Mechanics.NormalisedTranslational.PositionSensor brakePosition Modelica.Blocks.Routing.IntegerPassThrough gearboxMode Modelica.Blocks.Routing.IntegerPassThrough requestedGear Modelica.Blocks.Routing.IntegerPassThrough ignition protected VehicleInterfaces.Interfaces.DriverBus driverBus equation connect(driverBus, controlBus.driverBus) connect(driverInterface.gearboxMode, gearboxMode.u) connect(gearboxMode.y, driverBus.gearboxMode) connect(driverInterface.requestedGear, requestedGear.u) connect(requestedGear.y, driverBus.requestedGear) connect(driverInterface.ignition, ignition.u) connect(ignition.y, driverBus.ignition) connect(driverInterface.brakePedal, brakePosition.flange_a) connect(driverInterface.acceleratorPedal, acceleratorPosition.flange_a) connect(acceleratorPosition.position, driverBus.acceleratorPedalPosition) connect(brakePosition.position, driverBus.brakePedalPosition) end DriveByWireAutomaticExternalDriver;
Empty driver-vehicle interface. Empty driver environment. Using this empty model in overall vehicle architecture the functionality of driver environment can be eliminated.
within VehicleInterfaces.DriverEnvironments; model NoDriverEnvironment "Empty driver-vehicle interface" extends VehicleInterfaces.Icons.DriverEnvironment; extends VehicleInterfaces.Icons.Empty; extends Interfaces.Base; end NoDriverEnvironment;
Collection of driver environment subsystem definitions
within VehicleInterfaces; package DriverEnvironments "Collection of driver environment subsystem definitions" extends Modelica.Icons.VariantsPackage; end DriverEnvironments;
Driver Environment Tutorial.
within VehicleInterfaces.DriverEnvironments; class Tutorial "Driver Environment Tutorial" extends Modelica.Icons.Information; end Tutorial;
Basic interface definition for the driver-vehicle interface. This partial model defines the interfaces required for the driver environment subsystem. See the <a href=\"modelica://VehicleInterfaces.DriverEnvironments\">documentation</a> and <a href=\"modelica://VehicleInterfaces.DriverEnvironments.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.DriverEnvironments.Interfaces; partial model Base "Basic interface definition for the driver-vehicle interface" VehicleInterfaces.Interfaces.ControlBus controlBus "Control signal bus" Modelica.Mechanics.MultiBody.Interfaces.Frame_a chassisFrame if includeDriverSeat "Chassis reference frame (optional)" Modelica.Mechanics.Rotational.Interfaces.Flange_a steeringWheel if includeSteeringWheel "Steering wheel connection (optional)" Modelica.Mechanics.Translational.Interfaces.Flange_a acceleratorPedal if includeAcceleratorPedal "Accelerator pedal connection (optional)" Modelica.Mechanics.Translational.Interfaces.Flange_a brakePedal if includeBrakePedal "Brake pedal connection (optional)" protected parameter Boolean includeDriverSeat=false "Include the drivers seat connection to the body"; parameter Boolean includeSteeringWheel=false "Include the steering wheel connection"; parameter Boolean includeAcceleratorPedal=false "Include the accelerator pedal connection"; parameter Boolean includeBrakePedal=false "Include the brake pedal connection"; end Base;
Interface definition for the driver-vehicle interface with an automatic transmission. Base class for driver models for vehicles with automatic transmissions where the driver control logic is contained within the derived model.
within VehicleInterfaces.DriverEnvironments.Interfaces; partial model BaseAutomaticTransmission "Interface definition for the driver-vehicle interface with an automatic transmission" extends Base; end BaseAutomaticTransmission;
Interface definition for the driver-vehicle interface with an automatic transmission and external driver. Base class for driver models for vehicles with automatic transmissions where the driver control logic is contained in an <a href=\"modelica://VehicleInterfaces.Drivers\">external driver model</a>.
within VehicleInterfaces.DriverEnvironments.Interfaces; partial model BaseAutomaticTransmissionExternalDriver "Interface definition for the driver-vehicle interface with an automatic transmission and external driver" extends BaseAutomaticTransmission; replaceable VehicleInterfaces.Interfaces.DriverInterface driverInterface "Driver Interaction Bus" end BaseAutomaticTransmissionExternalDriver;
Interface definition for the driver-vehicle interface with a manual transmission. Base class for driver models for vehicles with manual transmissions where the driver control logic is contained within the derived model.
within VehicleInterfaces.DriverEnvironments.Interfaces; partial model BaseManualTransmission "Interface definition for the driver-vehicle interface with a manual transmission" extends Base; protected parameter Boolean includeClutchPedal=false "Include the clutch pedal connection"; parameter Boolean includeManualShiftConnector=false "Include the manual shift connection"; public Modelica.Mechanics.Translational.Interfaces.Flange_a clutchPedal if includeClutchPedal "Clutch pedal connection (optional)" VehicleInterfaces.Interfaces.ShiftConnector shiftConnector if includeManualShiftConnector "Manual transmission shift connection (optional)" end BaseManualTransmission;
Interface definition for the driver-vehicle interface with a manual transmission and external driver. Base class for driver models for vehicles with manual transmissions where the driver control logic is contained in an <a href=\"modelica://VehicleInterfaces.Drivers\">external driver model</a>.
within VehicleInterfaces.DriverEnvironments.Interfaces; partial model BaseManualTransmissionExternalDriver "Interface definition for the driver-vehicle interface with a manual transmission and external driver" extends BaseManualTransmission; replaceable VehicleInterfaces.Interfaces.DriverInterface driverInterface "Driver Interaction Bus" end BaseManualTransmissionExternalDriver;
Collection of interface definitions for driver environment
within VehicleInterfaces.DriverEnvironments; package Interfaces "Collection of interface definitions for driver environment" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Collection of internal material involving driver environments
within VehicleInterfaces.DriverEnvironments; package Internal "Collection of internal material involving driver environments" extends Modelica.Icons.InternalPackage; end Internal;
Constant acceleration Driver. Constant acceleration driver with the capabilitiy to step between two constant throttle values.
within VehicleInterfaces.Drivers; model MinimalDriver "Constant acceleration Driver" extends VehicleInterfaces.Icons.Driver; extends VehicleInterfaces.Drivers.Interfaces.Base; parameter Real initialAccelRequest(min=0, max=1) = 1 "Initial accelerator pedal position"; parameter Real initialBrakeRequest(min=0, max=1) = 0 "Initial brake pedal position"; parameter Real finalAccelRequest(min=0, max=1) = 1 "Final accelerator pedal position"; parameter Real finalBrakeRequest(min=0, max=1) = 0 "Final brake pedal position"; parameter SI.Time accelTime=10 "Time of accel apply"; parameter SI.Time brakeTime=10 "Time of brake apply"; parameter VehicleInterfaces.Types.GearMode.Temp selectedGearboxMode= VehicleInterfaces.Types.GearMode.Drive "Current gearbox mode"; parameter VehicleInterfaces.Types.Gear manualGearRequest=0 "Requested gear in manual mode"; Modelica.Blocks.Sources.Step brakeDemand( height=finalBrakeRequest, offset=initialBrakeRequest, startTime=brakeTime) Modelica.Blocks.Sources.Step acceleratorDemand( height=finalAccelRequest, offset=initialAccelRequest, startTime=accelTime) Modelica.Blocks.Sources.Constant steeringAngle(k=0) Modelica.Blocks.Sources.IntegerConstant gearboxMode(k=selectedGearboxMode) Modelica.Blocks.Sources.IntegerConstant requestedGear(k=manualGearRequest) Mechanics.NormalisedRotational.Position steeringWheelAngle Mechanics.NormalisedTranslational.Position brakePosition Mechanics.NormalisedTranslational.Position acceleratorPosition Modelica.Blocks.Sources.IntegerStep ignition( height=-1, startTime=0.5, offset=VehicleInterfaces.Types.IgnitionSetting.Start) equation connect(gearboxMode.y, driverInterface.gearboxMode) connect(requestedGear.y, driverInterface.requestedGear) connect(ignition.y, driverInterface.ignition) connect(steeringAngle.y, steeringWheelAngle.phi_ref) connect(brakeDemand.y, brakePosition.position) connect(acceleratorDemand.y, acceleratorPosition.position) connect(brakePosition.flange_b, driverInterface.brakePedal) connect(acceleratorPosition.flange_b, driverInterface.acceleratorPedal) connect(steeringWheelAngle.flange_b, driverInterface.steeringWheel) end MinimalDriver;
Empty driver. Empty driver model. Using this empty model in overall vehicle architecture the functionality of driver can be eliminated.
within VehicleInterfaces.Drivers; model NoDriver "Empty driver" extends VehicleInterfaces.Drivers.Interfaces.Base; extends VehicleInterfaces.Icons.Driver; extends VehicleInterfaces.Icons.Empty; end NoDriver;
Collection of driver subsystem definitions
within VehicleInterfaces; package Drivers "Collection of driver subsystem definitions" extends Modelica.Icons.VariantsPackage; end Drivers;
Drivers Tutorial
within VehicleInterfaces.Drivers; class Tutorial "Drivers Tutorial" extends Modelica.Icons.Information; end Tutorial;
Basic interface definition for a driver. This partial model defines the interfaces required for the driver subsystem. This class should be extended to form a particular driver model. See the <a href=\"modelica://VehicleInterfaces.Drivers\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Drivers.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Drivers.Interfaces; partial model Base "Basic interface definition for a driver" VehicleInterfaces.Interfaces.DriverInterface driverInterface "Driver Interaction Bus" end Base;
Collection of interface definitions for driver
within VehicleInterfaces.Drivers; package Interfaces "Collection of interface definitions for driver" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Collection of internal material involving driver
within VehicleInterfaces.Drivers; package Internal "Collection of internal material involving driver" extends Modelica.Icons.InternalPackage; end Internal;
Collection of electric drive subsystem definitions
within VehicleInterfaces; package ElectricDrives "Collection of electric drive subsystem definitions" extends Modelica.Icons.VariantsPackage; end ElectricDrives;
Simple DC electric motor. A simple DC electric motor with inductance and internal resistance.
within VehicleInterfaces.ElectricDrives; model SimpleMotorDC "Simple DC electric motor" extends Interfaces.BaseDCMachine; extends VehicleInterfaces.Icons.ElectricMotor; parameter SI.Inductance L=1e-3 "Inductance"; parameter SI.Resistance R=10 "Resistance"; parameter SI.ElectricalTorqueConstant k=0.4 "Transformation coefficient"; Modelica.Electrical.Analog.Basic.Resistor resistor(R=R) Modelica.Electrical.Analog.Basic.Inductor inductor(L=L) Modelica.Electrical.Analog.Basic.RotationalEMF eMF(k=k) equation connect(eMF.flange, shaft_b.flange) connect(inductor.n, resistor.p) connect(resistor.n, eMF.n) connect(eMF.p, pin_p) connect(inductor.p, pin_n) end SimpleMotorDC;
Electric Drives Tutorial.
within VehicleInterfaces.ElectricDrives; class Tutorial "Electric Drives Tutorial" extends Modelica.Icons.Information; end Tutorial;
Basic interface for an electric drives. This partial model defines the interfaces required for an electric machine subsystem. This class should be extended to form an electric machine interface definition with propper electrical connectors. See the <a href=\"modelica://VehicleInterfaces.ElectricDrives\">documentation</a> and <a href=\"modelica://VehicleInterfaces.ElectricDrives.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.ElectricDrives.Interfaces; partial model Base "Basic interface for an electric drives" parameter Boolean usingMultiBodySystem=false "= true, if connecting to a MultiBody system" protected parameter Boolean includeBearing=false "Include bearing connector"; public Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing shaft_b( includeBearingConnector=includeBearing or usingMultiBodySystem) "Mechanical shaft" VehicleInterfaces.Interfaces.ControlBus controlBus "Control signal bus" Mechanics.MultiBody.MultiBodyEnd end_1( includeBearingConnector=includeBearing or usingMultiBodySystem) equation connect(end_1.flange, shaft_b) end Base;
Base interface for electric drive in series. This partial model defines the interfaces required for an electric machine subsystem. This class should be extended to form a particular electric machine model. See the <a href=\"modelica://VehicleInterfaces.ElectricDrives\">documentation</a> and <a href=\"modelica://VehicleInterfaces.ElectricDrives.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.ElectricDrives.Interfaces; partial model BaseDCMachine "Base interface for electric drive in series" extends VehicleInterfaces.ElectricDrives.Interfaces.Base; Modelica.Electrical.Analog.Interfaces.PositivePin pin_p "Positive electrical pin" Modelica.Electrical.Analog.Interfaces.NegativePin pin_n "Negative electrical pin" end BaseDCMachine;
Collection of interface definitions for electric drive
within VehicleInterfaces.ElectricDrives; package Interfaces "Collection of interface definitions for electric drive" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Simple battery. An ideal battery with a constant voltage. No state of charge is introduced.
within VehicleInterfaces.EnergyStorage; model Battery "Simple battery" parameter SI.Voltage V(start=1) "Value of constant voltage"; extends .VehicleInterfaces.Icons.Battery; extends .VehicleInterfaces.EnergyStorage.Interfaces.Base(heatPort(Q_flow=0)); Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage(V=V) equation connect(constantVoltage.p, pin_p) connect(constantVoltage.n, pin_n) end Battery;
Collection of energy storage subsystem definitions
within VehicleInterfaces; package EnergyStorage "Collection of energy storage subsystem definitions" extends Modelica.Icons.VariantsPackage; end EnergyStorage;
Energy Storage Device Tutorial.
within VehicleInterfaces.EnergyStorage; class Tutorial "Energy Storage Device Tutorial" extends Modelica.Icons.Information; end Tutorial;
Basic interface for an energy storage device. This partial model defines the interfaces required for an electrical energy storage subsystem. Additionally, the ground is connected to the connector pin_n. It can be disabled when <code>includeGround=false</code>.
within VehicleInterfaces.EnergyStorage.Interfaces; partial model Base "Basic interface for an energy storage device" parameter Boolean includeGround=false "Include inner electrical ground at pin_n" parameter Boolean includeHeatPort = false "Include the battery heat port" parameter Boolean usingMultiBodyChassis=false "Include secondary ground node on the right port" VehicleInterfaces.Interfaces.ControlBus controlBus if not usingMultiBodyChassis "Control signal bus" Modelica.Electrical.Analog.Interfaces.PositivePin pin_p "Positive electrical pin" Modelica.Electrical.Analog.Interfaces.NegativePin pin_n "Negative electrical pin" Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPort if includeHeatPort "Conditional port for exhaust heat flow" protected Modelica.Electrical.Analog.Basic.Ground ground if includeGround "Conditional electrical ground" equation connect(ground.p, pin_n) end Base;
Collection of interface definitions for energy storage
within VehicleInterfaces.EnergyStorage; package Interfaces "Collection of interface definitions for energy storage" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Simple engine model with torque proportional to accelerator pedal position. A simple engine model with flywheel and where the torque output is proportional to the accelerator pedal position. This engine model uses a&nbsp;drive-by-wire accelerator, i.e. the accelerator pedal position is read from the control bus.
within VehicleInterfaces.Engines; model MinimalEngine "Simple engine model with torque proportional to accelerator pedal position" extends VehicleInterfaces.Icons.Engine; extends Interfaces.Base( includeMount=world.driveTrainMechanics3D, includeAccessoriesBearing=world.driveTrainMechanics3D); parameter SI.AngularVelocity engineSpeed_start(displayUnit="rev/min") = 104.7197551196598 "Initial engine speed"; parameter SI.Torque requestedTorque=50 "Engine torque = requested_torque*accelerator_pedal_position"; parameter SI.Inertia flywheelInertia=0.08 "Flywheel inertia"; parameter Modelica.Mechanics.MultiBody.Types.Axis axisOfRotation={1,0,0} "Axis of rotation of engine resolved in engineMount"; Modelica.Mechanics.MultiBody.Parts.Rotor1D flywheel( J=flywheelInertia, n=axisOfRotation, a(fixed=false), phi(fixed=false), w(fixed=true, start=engineSpeed_start)) Modelica.Mechanics.Rotational.Sources.Torque engine(useSupport=true) Modelica.Mechanics.Rotational.Sensors.SpeedSensor engineSpeed Modelica.Mechanics.Rotational.Sensors.TorqueSensor engineTorque Modelica.Mechanics.Rotational.Sensors.PowerSensor enginePower Modelica.Blocks.Math.Gain gain(k=requestedTorque) Modelica.Mechanics.MultiBody.Parts.Mounting1D mounting1D(n=axisOfRotation) protected VehicleInterfaces.Interfaces.EngineBus engineBus VehicleInterfaces.Interfaces.DriverBus driverBus outer Modelica.Mechanics.MultiBody.World world; equation connect(engine.flange, flywheel.flange_a) connect(flywheel.flange_b,engineSpeed.flange) connect(flywheel.flange_b, engineTorque.flange_a) connect(engineTorque.flange_b, enginePower.flange_a) connect(controlBus.engineBus, engineBus) connect(controlBus.driverBus, driverBus) connect(gain.y, engine.tau) connect(flywheel.frame_a, engineMount) connect(mounting1D.flange_b,engine.support) connect(mounting1D.frame_a, engineMount) connect(gain.u, driverBus.acceleratorPedalPosition) connect(enginePower.flange_b, transmissionFlange.flange) connect(flywheel.flange_a, accessoryFlange.flange) connect(accessoryFlange.bearingFrame, mounting1D.frame_a) connect(engineSpeed.w, engineBus.speed) end MinimalEngine;
Simple engine model with torque proportional to accelerator pedal position, uses accelerator pedal connection. A&nbsp;simple engine model with flywheel and where the torque output is proportional to the accelerator pedal position. This engine model uses the physical connection between the driver and the engine for the accelerator pedal.
within VehicleInterfaces.Engines; model MinimalEngineUsingPedal "Simple engine model with torque proportional to accelerator pedal position, uses accelerator pedal connection" extends VehicleInterfaces.Icons.Engine; extends Interfaces.Base( includeMount=world.driveTrainMechanics3D, includeAcceleratorPedal=true, includeAccessoriesBearing=world.driveTrainMechanics3D); parameter SI.AngularVelocity engineSpeed_start(displayUnit="rev/min") = 104.7197551196598 "Initial engine speed"; parameter SI.Force pedalPositionToTorque = 50 "Engine torque = pedalPositionToTorque*accelerator_pedal_position"; parameter SI.Inertia flywheelInertia = 0.08 "Flywheel inertia"; parameter Modelica.Mechanics.MultiBody.Types.Axis axisOfRotation = {1,0,0} "Axis of rotation resolved in engineMount"; Modelica.Mechanics.MultiBody.Parts.Rotor1D flywheel( J=flywheelInertia, n=axisOfRotation, a(fixed=false), phi(fixed=false), w(fixed=true, start=engineSpeed_start)) Modelica.Mechanics.Rotational.Sources.Torque engine(useSupport=true) Modelica.Mechanics.Rotational.Sensors.SpeedSensor engineSpeed Modelica.Mechanics.Rotational.Sensors.TorqueSensor engineTorque Modelica.Mechanics.Rotational.Sensors.PowerSensor enginePower Modelica.Blocks.Math.Gain gain(k(unit="N")=pedalPositionToTorque) Modelica.Mechanics.MultiBody.Parts.Mounting1D mounting1D(n=axisOfRotation) Modelica.Mechanics.Translational.Sensors.PositionSensor acceleratorPedalPosition protected VehicleInterfaces.Interfaces.EngineBus engineBus outer Modelica.Mechanics.MultiBody.World world; equation connect(engine.flange, flywheel.flange_a) connect(flywheel.flange_b, engineSpeed.flange) connect(flywheel.flange_b, engineTorque.flange_a) connect(engineTorque.flange_b, enginePower.flange_a) connect(gain.y, engine.tau) connect(flywheel.frame_a, engineMount) connect(mounting1D.flange_b, engine.support) connect(mounting1D.frame_a, engineMount) connect(acceleratorPedalPosition.flange, acceleratorPedal) connect(acceleratorPedalPosition.s, gain.u) connect(controlBus.engineBus, engineBus) connect(flywheel.flange_a, accessoryFlange.flange) connect(enginePower.flange_b, transmissionFlange.flange) connect(accessoryFlange.bearingFrame, mounting1D.frame_a) connect(engineSpeed.w, engineBus.speed) end MinimalEngineUsingPedal;
Empty engine. Empty engine model (just rigid connection between accessory and transmission flange). Using this empty model in overall vehicle architecture the functionality of engine can be eliminated.
within VehicleInterfaces.Engines; model NullEngine "Empty engine" extends VehicleInterfaces.Icons.Engine; extends VehicleInterfaces.Icons.Empty; extends Interfaces.Base; equation connect(accessoryFlange, transmissionFlange) end NullEngine;
Collection of combustion engine subsystem definitions
within VehicleInterfaces; package Engines "Collection of combustion engine subsystem definitions" extends Modelica.Icons.VariantsPackage; end Engines;
Engines Tutorial.
within VehicleInterfaces.Engines; class Tutorial "Engines Tutorial" extends Modelica.Icons.Information; end Tutorial;
Basic interface definition for an engine. This partial model defines the interfaces required for an engine subsystem. This class should be extended to form a particular engine model. See the <a href=\"modelica://VehicleInterfaces.Engines\">documentation</a> and <a href=\"modelica://VehicleInterfaces.Engines.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.Engines.Interfaces; partial model Base "Basic interface definition for an engine" parameter Boolean usingMultiBodyAccessories=false "= true, if connecting to a MultiBody accessories" parameter Boolean usingMultiBodyTransmission=false "= true, if connecting to a MultiBody transmission" protected parameter Boolean includeAcceleratorPedal=false "Include the accelerator pedal connection"; parameter Boolean includeMount=false "Include the engine mount connection"; parameter Boolean includeTransmissionBearing=false "Include the transmission bearing"; parameter Boolean includeAccessoriesBearing=false "Include the accessories bearing"; public Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing accessoryFlange( final includeBearingConnector=includeAccessoriesBearing or usingMultiBodyAccessories) "Connection for the engine accessories" Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing transmissionFlange( final includeBearingConnector=includeTransmissionBearing or usingMultiBodyTransmission) "Connection to the transmission" Modelica.Mechanics.MultiBody.Interfaces.Frame_a engineMount if includeMount "Engine mount connection (optional)" Modelica.Mechanics.Translational.Interfaces.Flange_a acceleratorPedal if includeAcceleratorPedal "Accelerator pedal connection (optional)" VehicleInterfaces.Interfaces.ControlBus controlBus "Control signal bus" Mechanics.MultiBody.MultiBodyEnd end_1(final includeBearingConnector= includeAccessoriesBearing or usingMultiBodyAccessories) Mechanics.MultiBody.MultiBodyEnd end_2(final includeBearingConnector= includeTransmissionBearing or usingMultiBodyTransmission) equation connect(end_2.flange, transmissionFlange) connect(end_1.flange, accessoryFlange) end Base;
Collection of interface definitions for engine
within VehicleInterfaces.Engines; package Interfaces "Collection of interface definitions for engine" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Collection of internal material involving engine
within VehicleInterfaces.Engines; package Internal "Collection of internal material involving engine" extends Modelica.Icons.InternalPackage; end Internal;
Conventional automatic transmission vehicle. Example model architecture of a passenger car with an automatic transmission. In this architecture variant the PowerTrain systems are rigidly mounted to the chassis when MultiBody effects are included.
within VehicleInterfaces.Examples; model ConventionalAutomaticVehicle "Conventional automatic transmission vehicle" extends Modelica.Icons.Example; replaceable Engines.MinimalEngine engine constrainedby VehicleInterfaces.Engines.Interfaces.Base "Engine subsystem" replaceable Transmissions.SingleGearAutomaticTransmission transmission constrainedby VehicleInterfaces.Transmissions.Interfaces.BaseAutomaticTransmission "Transmission subsystem" replaceable Chassis.MinimalChassis chassis constrainedby VehicleInterfaces.Chassis.Interfaces.TwoAxleBase "Chassis subsystem" replaceable Drivelines.MinimalDriveline driveline constrainedby VehicleInterfaces.Drivelines.Interfaces.TwoAxleBase "Driveline subsystem" replaceable Brakes.MinimalBrakes brakes constrainedby VehicleInterfaces.Brakes.Interfaces.TwoAxleBase "Brakes subsystem" replaceable Accessories.MinimalAccessories accessories constrainedby VehicleInterfaces.Accessories.Interfaces.Base "Accessories subsystem" replaceable DriverEnvironments.DriveByWireAutomatic driverEnvironment constrainedby VehicleInterfaces.DriverEnvironments.Interfaces.BaseAutomaticTransmission "Driver environment" inner replaceable Roads.FlatRoad road constrainedby VehicleInterfaces.Roads.Interfaces.Base "Road model" inner replaceable Atmospheres.ConstantAtmosphere atmosphere constrainedby VehicleInterfaces.Atmospheres.Interfaces.Base "Atmospheric model" inner replaceable Modelica.Mechanics.MultiBody.World world( enableAnimation=false, n={0,0,-1}, driveTrainMechanics3D=false) constrainedby Modelica.Mechanics.MultiBody.World "Global co-ordinate system" protected Interfaces.ControlBus controlBus "Control bus connector" equation connect(accessories.engineFlange, engine.accessoryFlange) connect(engine.transmissionFlange, transmission.engineFlange) connect(transmission.drivelineFlange, driveline.transmissionFlange) connect(chassis.wheelHub_2, driveline.wheelHub_2) connect(driveline.wheelHub_4, chassis.wheelHub_4) connect(chassis.wheelHub_4, brakes.wheelHub_4) connect(brakes.wheelHub_2, chassis.wheelHub_2) connect(driveline.wheelHub_3, chassis.wheelHub_3) connect(chassis.wheelHub_1, driveline.wheelHub_1) connect(chassis.wheelHub_3, brakes.wheelHub_3) connect(chassis.wheelHub_1, brakes.wheelHub_1) connect(controlBus, engine.controlBus) connect(controlBus, transmission.controlBus) connect(controlBus, driveline.controlBus) connect(controlBus, chassis.controlBus) connect(controlBus, brakes.controlBus) connect(accessories.controlBus, controlBus) connect(controlBus, driverEnvironment.controlBus) connect(driveline.drivelineMount, chassis.chassisFrame) connect(transmission.transmissionMount, chassis.chassisFrame) connect(engine.engineMount, chassis.chassisFrame) connect(driverEnvironment.acceleratorPedal, engine.acceleratorPedal) connect(driverEnvironment.brakePedal, brakes.brakePedal) connect(driverEnvironment.steeringWheel, chassis.steeringWheel) connect(driverEnvironment.chassisFrame, chassis.chassisFrame) end ConventionalAutomaticVehicle;
Conventional automatic transmission vehicle using separate driver and driver-interface components. Example model architecture of a&nbsp;passenger car with an automatic transmission and a&nbsp;driver model that is defined separately from the driverEnvironment. In this architecture variant the PowerTrain systems are rigidly mounted to the chassis when MultiBody effects are included.
within VehicleInterfaces.Examples; model ConventionalAutomaticVehicleExternalDriver "Conventional automatic transmission vehicle using separate driver and driver-interface components" extends Modelica.Icons.Example; replaceable Engines.MinimalEngine engine constrainedby VehicleInterfaces.Engines.Interfaces.Base "Engine subsystem" replaceable Transmissions.SingleGearAutomaticTransmission transmission constrainedby VehicleInterfaces.Transmissions.Interfaces.BaseAutomaticTransmission "Transmission subsystem" replaceable Chassis.MinimalChassis chassis constrainedby VehicleInterfaces.Chassis.Interfaces.TwoAxleBase "Chassis subsystem" replaceable Drivelines.MinimalDriveline driveline constrainedby VehicleInterfaces.Drivelines.Interfaces.TwoAxleBase "Driveline subsystem" replaceable Brakes.MinimalBrakes brakes constrainedby VehicleInterfaces.Brakes.Interfaces.TwoAxleBase "Brakes subsystem" replaceable Accessories.MinimalAccessories accessories constrainedby VehicleInterfaces.Accessories.Interfaces.Base "Accessories subsystem" replaceable VehicleInterfaces.DriverEnvironments.DriveByWireAutomaticExternalDriver driverEnvironment constrainedby VehicleInterfaces.DriverEnvironments.Interfaces.BaseAutomaticTransmissionExternalDriver "Driver environment" replaceable Drivers.MinimalDriver driver constrainedby Drivers.Interfaces.Base "Driver model" inner replaceable Roads.FlatRoad road constrainedby VehicleInterfaces.Roads.Interfaces.Base "Road model" inner replaceable Atmospheres.ConstantAtmosphere atmosphere constrainedby VehicleInterfaces.Atmospheres.Interfaces.Base "Atmospheric model" inner replaceable Modelica.Mechanics.MultiBody.World world( enableAnimation=false, n={0,0,-1}, driveTrainMechanics3D=false) constrainedby Modelica.Mechanics.MultiBody.World "Global co-ordinate system" protected Interfaces.ControlBus controlBus "Control bus connector" equation connect(accessories.engineFlange, engine.accessoryFlange) connect(engine.transmissionFlange, transmission.engineFlange) connect(transmission.drivelineFlange, driveline.transmissionFlange) connect(chassis.wheelHub_2, driveline.wheelHub_2) connect(driveline.wheelHub_4, chassis.wheelHub_4) connect(chassis.wheelHub_4, brakes.wheelHub_4) connect(brakes.wheelHub_2, chassis.wheelHub_2) connect(driveline.wheelHub_3, chassis.wheelHub_3) connect(chassis.wheelHub_1, driveline.wheelHub_1) connect(chassis.wheelHub_3, brakes.wheelHub_3) connect(chassis.wheelHub_1, brakes.wheelHub_1) connect(controlBus, engine.controlBus) connect(controlBus, transmission.controlBus) connect(controlBus, driveline.controlBus) connect(controlBus, chassis.controlBus) connect(controlBus, brakes.controlBus) connect(accessories.controlBus, controlBus) connect(controlBus, driverEnvironment.controlBus) connect(driveline.drivelineMount, chassis.chassisFrame) connect(transmission.transmissionMount, chassis.chassisFrame) connect(engine.engineMount, chassis.chassisFrame) connect(driverEnvironment.acceleratorPedal, engine.acceleratorPedal) connect(driverEnvironment.brakePedal, brakes.brakePedal) connect(driverEnvironment.steeringWheel, chassis.steeringWheel) connect(driverEnvironment.chassisFrame, chassis.chassisFrame) connect(driverEnvironment.driverInterface, driver.driverInterface) end ConventionalAutomaticVehicleExternalDriver;
Conventional manual transmission vehicle. Example model architecture of a&nbsp;passenger car with a&nbsp;manual transmission. In this architecture variant the PowerTrain systems are rigidly mounted to the chassis when MultiBody effects are included.
within VehicleInterfaces.Examples; model ConventionalManualVehicle "Conventional manual transmission vehicle" extends Modelica.Icons.Example; replaceable Engines.MinimalEngineUsingPedal engine constrainedby VehicleInterfaces.Engines.Interfaces.Base "Engine subsystem" replaceable Transmissions.SingleGearManualTransmission transmission( clutch( phi_rel(fixed=true, start=0))) constrainedby VehicleInterfaces.Transmissions.Interfaces.BaseManualTransmission "Transmission subsystem" replaceable Chassis.MinimalChassis chassis( body(v(fixed=true))) constrainedby VehicleInterfaces.Chassis.Interfaces.TwoAxleBase "Chassis subsystem" replaceable Drivelines.MinimalDriveline driveline constrainedby VehicleInterfaces.Drivelines.Interfaces.TwoAxleBase "Driveline subsystem" replaceable Brakes.MinimalBrakesUsingPedal brakes constrainedby VehicleInterfaces.Brakes.Interfaces.TwoAxleBase "Brakes subsystem" replaceable Accessories.MinimalAccessories accessories constrainedby VehicleInterfaces.Accessories.Interfaces.Base "Accessory subsystem" replaceable DriverEnvironments.ConventionalManual driverEnvironment( acceleratorPosition(v(fixed=true)), brakePosition(v(fixed=true)), clutchPosition(v(fixed=true))) constrainedby VehicleInterfaces.DriverEnvironments.Interfaces.BaseManualTransmission "Driver environment" inner replaceable Roads.FlatRoad road constrainedby VehicleInterfaces.Roads.Interfaces.Base "Road model" inner replaceable Atmospheres.ConstantAtmosphere atmosphere constrainedby VehicleInterfaces.Atmospheres.Interfaces.Base "Atmospheric model" inner replaceable Modelica.Mechanics.MultiBody.World world( enableAnimation=false, n={0,0,-1}, driveTrainMechanics3D=false) constrainedby Modelica.Mechanics.MultiBody.World "Global co-ordinate system" protected Interfaces.ControlBus controlBus "Control bus connector" equation connect(accessories.engineFlange, engine.accessoryFlange) connect(engine.transmissionFlange, transmission.engineFlange) connect(transmission.drivelineFlange, driveline.transmissionFlange) connect(chassis.wheelHub_2, driveline.wheelHub_2) connect(driveline.wheelHub_4, chassis.wheelHub_4) connect(chassis.wheelHub_4, brakes.wheelHub_4) connect(brakes.wheelHub_2, chassis.wheelHub_2) connect(driveline.wheelHub_3, chassis.wheelHub_3) connect(chassis.wheelHub_1, driveline.wheelHub_1) connect(chassis.wheelHub_3, brakes.wheelHub_3) connect(chassis.wheelHub_1, brakes.wheelHub_1) connect(controlBus, engine.controlBus) connect(controlBus, transmission.controlBus) connect(controlBus, driveline.controlBus) connect(controlBus, chassis.controlBus) connect(controlBus, brakes.controlBus) connect(accessories.controlBus, controlBus) connect(controlBus, driverEnvironment.controlBus) connect(driveline.drivelineMount, chassis.chassisFrame) connect(transmission.transmissionMount, chassis.chassisFrame) connect(engine.engineMount, chassis.chassisFrame) connect(driverEnvironment.acceleratorPedal, engine.acceleratorPedal) connect(driverEnvironment.brakePedal, brakes.brakePedal) connect(driverEnvironment.steeringWheel, chassis.steeringWheel) connect(driverEnvironment.chassisFrame, chassis.chassisFrame) connect(driverEnvironment.shiftConnector, transmission.shiftConnector) connect(driverEnvironment.clutchPedal, transmission.clutchPedal) end ConventionalManualVehicle;
Extension of ConventionalAutomaticVehicle demonstrating the data dictionary. Example model architecture of a&nbsp;passenger car with an automatic transmission. Based on <a href=\"modelica://VehicleInterfaces.Examples.ConventionalAutomaticVehicle\">ConventionalAutomaticVehicle</a> this example shows how the DataDictionary can be used.
within VehicleInterfaces.Examples; model ConventionalVehicle_AltNames "Extension of ConventionalAutomaticVehicle demonstrating the data dictionary" extends ConventionalAutomaticVehicle; replaceable DataDictionaries.MinimalExample dataDictionary constrainedby DataDictionaries.Interfaces.Base "Data dictionary" equation connect(dataDictionary.controlBus, controlBus) end ConventionalVehicle_AltNames;
A conventional front-wheel drive manual transmission vehicle including the powertrain mounting systems. Example model architecture of a&nbsp;front wheel drive passenger car with an automatic transmission. In this architecture variant the PowerTrain systems can be elastically mounted in the chassis when MultiBody effects are included.
within VehicleInterfaces.Examples; model FrontWheelDriveManualVehicle "A conventional front-wheel drive manual transmission vehicle including the powertrain mounting systems" extends Modelica.Icons.Example; replaceable Engines.MinimalEngineUsingPedal engine constrainedby VehicleInterfaces.Engines.Interfaces.Base "Engine subsystem" replaceable Transmissions.SingleGearManualTransmission transmission( clutch( phi_rel(fixed=true))) constrainedby VehicleInterfaces.Transmissions.Interfaces.BaseManualTransmission "Transmission subsystem" replaceable Chassis.MinimalChassis3 chassis( constraint(v(fixed=true))) constrainedby VehicleInterfaces.Chassis.Interfaces.TwoAxleBase "Chassis subsystem" replaceable Drivelines.MinimalDriveline driveline( usingMultiBodyChassis=true) constrainedby VehicleInterfaces.Drivelines.Interfaces.TwoAxleBase "Driveline subsystem" replaceable Brakes.MinimalBrakesUsingPedal brakes( usingMultiBodyChassis=true) constrainedby VehicleInterfaces.Brakes.Interfaces.TwoAxleBase "Brakes subsystem" replaceable Accessories.MinimalAccessories accessories constrainedby VehicleInterfaces.Accessories.Interfaces.Base "Accessories subsystem" replaceable DriverEnvironments.ConventionalManual driverEnvironment( acceleratorPosition(v(fixed=true)), clutchPosition(v(fixed=true)), brakePosition(v(fixed=true))) constrainedby VehicleInterfaces.DriverEnvironments.Interfaces.BaseManualTransmission "Driver environment" replaceable PowertrainMounts.ThreeSystemRigidMount powertrainMounts constrainedby PowertrainMounts.Interfaces.TripleSystemMount "Powertrain mounting system" inner replaceable Roads.FlatRoad road constrainedby VehicleInterfaces.Roads.Interfaces.Base "Road models" inner replaceable Atmospheres.ConstantAtmosphere atmosphere constrainedby VehicleInterfaces.Atmospheres.Interfaces.Base "Atmospheric model" inner replaceable Modelica.Mechanics.MultiBody.World world( enableAnimation=false, n={0,0,-1}, driveTrainMechanics3D=true) constrainedby Modelica.Mechanics.MultiBody.World "Global co-ordinate system" protected Interfaces.ControlBus controlBus "Control bus connector" equation connect(accessories.engineFlange, engine.accessoryFlange) connect(engine.transmissionFlange, transmission.engineFlange) connect(transmission.drivelineFlange, driveline.transmissionFlange) connect(chassis.wheelHub_2, driveline.wheelHub_2) connect(driveline.wheelHub_4, chassis.wheelHub_4) connect(chassis.wheelHub_4, brakes.wheelHub_4) connect(brakes.wheelHub_2, chassis.wheelHub_2) connect(driveline.wheelHub_3, chassis.wheelHub_3) connect(chassis.wheelHub_1, driveline.wheelHub_1) connect(chassis.wheelHub_3, brakes.wheelHub_3) connect(chassis.wheelHub_1, brakes.wheelHub_1) connect(controlBus, engine.controlBus) connect(controlBus, transmission.controlBus) connect(controlBus, driveline.controlBus) connect(controlBus, chassis.controlBus) connect(controlBus, brakes.controlBus) connect(accessories.controlBus, controlBus) connect(controlBus, driverEnvironment.controlBus) connect(driverEnvironment.acceleratorPedal, engine.acceleratorPedal) connect(driverEnvironment.clutchPedal, transmission.clutchPedal) connect(driverEnvironment.shiftConnector, transmission.shiftConnector) connect(driverEnvironment.brakePedal, brakes.brakePedal) connect(driverEnvironment.steeringWheel, chassis.steeringWheel) connect(driverEnvironment.chassisFrame, chassis.chassisFrame) connect(powertrainMounts.chassisFrame, chassis.chassisFrame) connect(engine.engineMount, powertrainMounts.mount_1) connect(transmission.transmissionMount, powertrainMounts.mount_2) connect(driveline.drivelineMount, powertrainMounts.mount_3) end FrontWheelDriveManualVehicle;
Collection of vehicle model examples
within VehicleInterfaces; package Examples "Collection of vehicle model examples" extends Modelica.Icons.ExamplesPackage; end Examples;
Basic model for a four wheeled vehicle, requires powertrain components. Base model architecture of a&nbsp;passenger car that can be extended to add any type of powertrain. In this architecture variant the Driveline subsystem is rigidly mounted to the chassis when MultiBody effects are included.
within VehicleInterfaces.Examples; partial model PartialVehicle "Basic model for a four wheeled vehicle, requires powertrain components" extends Modelica.Icons.Example; replaceable Chassis.MinimalChassis chassis constrainedby VehicleInterfaces.Chassis.Interfaces.TwoAxleBase "Chassis subsystem" replaceable Drivelines.MinimalDriveline driveline constrainedby VehicleInterfaces.Drivelines.Interfaces.TwoAxleBase "Driveline subsystem" replaceable Brakes.MinimalBrakes brakes constrainedby VehicleInterfaces.Brakes.Interfaces.TwoAxleBase "Brakes subsystem" replaceable DriverEnvironments.DriveByWireAutomatic driverEnvironment constrainedby VehicleInterfaces.DriverEnvironments.Interfaces.BaseAutomaticTransmission "Driver environment" inner replaceable Roads.FlatRoad road constrainedby VehicleInterfaces.Roads.Interfaces.Base "Road model" inner replaceable Atmospheres.ConstantAtmosphere atmosphere constrainedby VehicleInterfaces.Atmospheres.Interfaces.Base "Atmospheric model" inner replaceable Modelica.Mechanics.MultiBody.World world( enableAnimation=false, n={0,0,-1}, driveTrainMechanics3D=false) constrainedby Modelica.Mechanics.MultiBody.World "Global co-ordinate system" protected Interfaces.ControlBus controlBus "Control bus connector" equation connect(chassis.wheelHub_2, driveline.wheelHub_2) connect(driveline.wheelHub_4, chassis.wheelHub_4) connect(chassis.wheelHub_4, brakes.wheelHub_4) connect(brakes.wheelHub_2, chassis.wheelHub_2) connect(driveline.wheelHub_3, chassis.wheelHub_3) connect(chassis.wheelHub_1, driveline.wheelHub_1) connect(chassis.wheelHub_3, brakes.wheelHub_3) connect(chassis.wheelHub_1, brakes.wheelHub_1) connect(controlBus, driveline.controlBus) connect(controlBus, chassis.controlBus) connect(controlBus, brakes.controlBus) connect(controlBus, driverEnvironment.controlBus) connect(driveline.drivelineMount, chassis.chassisFrame) connect(driverEnvironment.brakePedal, brakes.brakePedal) connect(driverEnvironment.steeringWheel, chassis.steeringWheel) connect(driverEnvironment.chassisFrame, chassis.chassisFrame) end PartialVehicle;
Power-split hybrid vehicle model. Example model architecture of a&nbsp;passenger car with a&nbsp;power-split hybrid powertrain. In this architecture variant the PowerTrain systems are rigidly mounted to the chassis when MultiBody effects are included.
within VehicleInterfaces.Examples; model PowerSplitHybrid "Power-split hybrid vehicle model" extends VehicleInterfaces.Examples.PartialVehicle(chassis(body(v(fixed=true)))); replaceable Engines.MinimalEngine engine( flywheel(phi(fixed=true))) constrainedby VehicleInterfaces.Engines.Interfaces.Base "Engine subsystem" replaceable Accessories.MinimalAccessories accessories constrainedby VehicleInterfaces.Accessories.Interfaces.Base "Accessories subsystem" replaceable VehicleInterfaces.ElectricDrives.SimpleMotorDC motor1( inductor( i(start=0, fixed=true))) constrainedby ElectricDrives.Interfaces.BaseDCMachine "Electric Motor 1" replaceable VehicleInterfaces.ElectricDrives.SimpleMotorDC motor2( inductor( i(start=0, fixed=true))) constrainedby ElectricDrives.Interfaces.BaseDCMachine "Electric Motor 2" replaceable Transmissions.PowerSplitDevice powerSplitDevice constrainedby Transmissions.Interfaces.BaseTwoInputTransmission "Power-split device" replaceable EnergyStorage.Battery battery(V=1) constrainedby EnergyStorage.Interfaces.Base "Energy storage subsystem" Modelica.Electrical.Analog.Basic.Ground ground equation connect(accessories.engineFlange, engine.accessoryFlange) connect(controlBus, engine.controlBus) connect(accessories.controlBus, controlBus) connect(driverEnvironment.acceleratorPedal, engine.acceleratorPedal) connect(motor2.shaft_b, driveline.transmissionFlange) connect(motor1.controlBus, controlBus) connect(motor2.controlBus, controlBus) connect(powerSplitDevice.drivelineFlange, driveline.transmissionFlange) connect(powerSplitDevice.motorFlange, motor1.shaft_b) connect(powerSplitDevice.engineFlange, engine.transmissionFlange) connect(powerSplitDevice.controlBus, controlBus) connect(battery.pin_p, motor1.pin_p) connect(battery.pin_n, motor1.pin_n) connect(battery.pin_p, motor2.pin_p) connect(battery.pin_n, motor2.pin_n) connect(ground.p, battery.pin_n) connect(battery.controlBus, controlBus.batteryBus) connect(engine.engineMount, chassis.chassisFrame) connect(powerSplitDevice.transmissionMount, chassis.chassisFrame) end PowerSplitHybrid;
A conventional front-wheel drive automatic transmission vehicle with separate powertrain mounting system for the front axle and engine-transmission systems. Example model architecture of a&nbsp;rear wheel drive passenger car with an automatic transmission. In this architecture variant the PowerTrain systems can be elastically mounted in the chassis when MultiBody effects are included.
within VehicleInterfaces.Examples; model RearWheelDriveAutomaticVehicle "A conventional front-wheel drive automatic transmission vehicle with separate powertrain mounting system for the front axle and engine-transmission systems" extends Modelica.Icons.Example; replaceable Engines.MinimalEngine engine constrainedby VehicleInterfaces.Engines.Interfaces.Base "Engine subsystem" replaceable Transmissions.SingleGearAutomaticTransmission transmission constrainedby VehicleInterfaces.Transmissions.Interfaces.BaseAutomaticTransmission "Transmission subsystem" replaceable Chassis.MinimalChassis3 chassis constrainedby VehicleInterfaces.Chassis.Interfaces.TwoAxleBase "Chassis subsystem" replaceable Drivelines.MinimalDriveline driveline( usingMultiBodyChassis=true) constrainedby VehicleInterfaces.Drivelines.Interfaces.TwoAxleBase "Driveline subsystem" replaceable Brakes.MinimalBrakes brakes(usingMultiBodyChassis=true) constrainedby VehicleInterfaces.Brakes.Interfaces.TwoAxleBase "Brakes subsystem" replaceable Accessories.MinimalAccessories accessories constrainedby VehicleInterfaces.Accessories.Interfaces.Base "Accessories subsystem" replaceable DriverEnvironments.DriveByWireAutomaticExternalDriver driverEnvironment constrainedby VehicleInterfaces.DriverEnvironments.Interfaces.BaseAutomaticTransmissionExternalDriver "Driver environment" replaceable PowertrainMounts.TwoSystemRigidMount engineTransmissionMount constrainedby PowertrainMounts.Interfaces.DualSystemMount "Engine and Transmission mounting system" replaceable PowertrainMounts.SingleSystemRigidMount diffMount constrainedby PowertrainMounts.Interfaces.SingleSystemMount "Differential mounting system" replaceable Drivers.MinimalDriver driver constrainedby Drivers.Interfaces.Base "Driver model" inner replaceable Roads.FlatRoad road constrainedby VehicleInterfaces.Roads.Interfaces.Base "Road model" inner replaceable Atmospheres.ConstantAtmosphere atmosphere constrainedby VehicleInterfaces.Atmospheres.Interfaces.Base "Atmospheric model" inner replaceable Modelica.Mechanics.MultiBody.World world( enableAnimation=false, n={0,0,-1}, driveTrainMechanics3D=false) constrainedby Modelica.Mechanics.MultiBody.World "Global co-ordinate system" protected Interfaces.ControlBus controlBus "Control bus connector" equation connect(accessories.engineFlange, engine.accessoryFlange) connect(engine.transmissionFlange, transmission.engineFlange) connect(transmission.drivelineFlange, driveline.transmissionFlange) connect(chassis.wheelHub_2, driveline.wheelHub_2) connect(driveline.wheelHub_4, chassis.wheelHub_4) connect(chassis.wheelHub_4, brakes.wheelHub_4) connect(brakes.wheelHub_2, chassis.wheelHub_2) connect(driveline.wheelHub_3, chassis.wheelHub_3) connect(chassis.wheelHub_1, driveline.wheelHub_1) connect(chassis.wheelHub_3, brakes.wheelHub_3) connect(chassis.wheelHub_1, brakes.wheelHub_1) connect(controlBus, engine.controlBus) connect(controlBus, transmission.controlBus) connect(controlBus, driveline.controlBus) connect(controlBus, chassis.controlBus) connect(controlBus, brakes.controlBus) connect(accessories.controlBus, controlBus) connect(controlBus, driverEnvironment.controlBus) connect(driverEnvironment.acceleratorPedal, engine.acceleratorPedal) connect(driverEnvironment.brakePedal, brakes.brakePedal) connect(driverEnvironment.steeringWheel, chassis.steeringWheel) connect(driverEnvironment.chassisFrame, chassis.chassisFrame) connect(engineTransmissionMount.chassisFrame, chassis.chassisFrame) connect(diffMount.chassisFrame, chassis.chassisFrame) connect(engineTransmissionMount.mount_2, transmission.transmissionMount) connect(engineTransmissionMount.mount_1, engine.engineMount) connect(diffMount.mount_1, driveline.drivelineMount) connect(driverEnvironment.driverInterface, driver.driverInterface) end RearWheelDriveAutomaticVehicle;
Series hybrid vehicle model. Example model architecture of a passenger car with a&nbsp;series hybrid powertrain. In this architecture variant the PowerTrain systems are rigidly mounted to the chassis when MultiBody effects are included.
within VehicleInterfaces.Examples; model SeriesHybrid "Series hybrid vehicle model" extends VehicleInterfaces.Examples.PartialVehicle( redeclare DriverEnvironments.DriveByWireAutomatic driverEnvironment( initialAccelRequest=0, finalAccelRequest=0.9, accelTime=2), chassis( body(v(fixed=true)))); replaceable Engines.MinimalEngine engine( flywheel(phi(fixed=true))) constrainedby VehicleInterfaces.Engines.Interfaces.Base "Engine model" replaceable Accessories.MinimalAccessories accessories constrainedby VehicleInterfaces.Accessories.Interfaces.Base "Accessories model" replaceable VehicleInterfaces.ElectricDrives.SimpleMotorDC generator( inductor(i(start=0, fixed=true))) constrainedby ElectricDrives.Interfaces.BaseDCMachine "Generator subsystem" replaceable VehicleInterfaces.ElectricDrives.SimpleMotorDC driveMotor( inductor(i(start=0, fixed=true))) constrainedby ElectricDrives.Interfaces.BaseDCMachine "Traction motor subsystem" replaceable EnergyStorage.Battery battery(V=1) constrainedby EnergyStorage.Interfaces.Base "Energy storage subsystem" Modelica.Electrical.Analog.Basic.Ground ground equation connect(controlBus, engine.controlBus) connect(accessories.controlBus, controlBus) connect(driverEnvironment.acceleratorPedal, engine.acceleratorPedal) connect(driveMotor.shaft_b, driveline.transmissionFlange) connect(generator.controlBus, controlBus) connect(driveMotor.controlBus, controlBus) connect(generator.shaft_b, engine.transmissionFlange) connect(battery.pin_p, generator.pin_p) connect(battery.pin_p, driveMotor.pin_p) connect(battery.pin_n, driveMotor.pin_n) connect(battery.pin_n, generator.pin_n) connect(battery.pin_n, ground.p) connect(battery.controlBus, controlBus.batteryBus) connect(accessories.engineFlange, engine.accessoryFlange) connect(engine.engineMount, chassis.chassisFrame) end SeriesHybrid;
Collection of general interface definitions
within VehicleInterfaces; package Interfaces "Collection of general interface definitions" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Convert an integer signal to a position in the manual shift connector. Converts an integer signal in to positions on the <strong>intoGear</strong> and <strong>crossGate</strong> sub-connectors of the ShiftConnector.
within VehicleInterfaces.Interfaces; model ShiftInput "Convert an integer signal to a position in the manual shift connector" parameter Integer numberOfGears=5 "Number of forward gears"; parameter SI.Distance crossGateDisplacement=0.1 "Total distance across the gate"; parameter SI.Distance intoGearDisplacement=0.1 "Distance to move in to gear"; ShiftConnector shiftConnector "Gear shift connection" Modelica.Blocks.Interfaces.IntegerInput gear "Gear number" equation if gear == 0 then shiftConnector.crossGate.s = 0; shiftConnector.intoGear.s = 0; elseif gear == 1 then shiftConnector.crossGate.s = -crossGateDisplacement/2; shiftConnector.intoGear.s = intoGearDisplacement; elseif gear == 2 then shiftConnector.crossGate.s = -crossGateDisplacement/2; shiftConnector.intoGear.s = -intoGearDisplacement; elseif gear == 3 then shiftConnector.crossGate.s = 0; shiftConnector.intoGear.s = intoGearDisplacement; elseif gear == 4 then shiftConnector.crossGate.s = 0; shiftConnector.intoGear.s = -intoGearDisplacement; elseif gear == 5 then shiftConnector.crossGate.s = crossGateDisplacement/2; shiftConnector.intoGear.s = intoGearDisplacement; else //Reverse gear shiftConnector.crossGate.s = crossGateDisplacement/2; shiftConnector.intoGear.s = -intoGearDisplacement; end if; end ShiftInput;
Convert a position in the manual shift connector to an integer value. Converts positions on the <strong>intoGear</strong> and <strong>crossGate</strong> sub-connectors of the ShiftConnector into an integer gear signal.
within VehicleInterfaces.Interfaces; model ShiftOutput "Convert a position in the manual shift connector to an integer value" parameter Integer numberOfGears=5 "Number of forward gears"; parameter SI.Distance crossGateDisplacement=0.1 "Total distance across the gate"; parameter SI.Distance intoGearDisplacement=0.1 "Distance to move in to gear"; ShiftConnector shiftConnector "Gear shift connection" Modelica.Blocks.Interfaces.IntegerOutput gear "Gear number" equation shiftConnector.crossGate.f = 0; shiftConnector.intoGear.f = 0; if shiftConnector.crossGate.s <= -0.9*crossGateDisplacement/2 then if shiftConnector.intoGear.s >= 0.9*intoGearDisplacement then gear = 1; else gear = 2; end if; elseif shiftConnector.crossGate.s >= 0.9*crossGateDisplacement/2 then if shiftConnector.intoGear.s >= 0.9*intoGearDisplacement then gear = 5; else gear = -1; end if; else if shiftConnector.intoGear.s >= 0.9*intoGearDisplacement then gear = 3; elseif shiftConnector.intoGear.s <= 0.9*intoGearDisplacement then gear = 4; else gear = 0; end if; end if; end ShiftOutput;
Internal class declarations - should not be used directly in any models (used to built up default menus for buses)
within VehicleInterfaces.Interfaces; package Internal "Internal class declarations - should not be used directly in any models (used to built up default menus for buses)" extends Modelica.Icons.InternalPackage; end Internal;
Collection of additional mechanical components
within VehicleInterfaces; package Mechanics "Collection of additional mechanical components" extends Modelica.Icons.Package; end Mechanics;
Ends a MultiBody chain. This component is used to end a chain of multi-body components by applying zero force and torque to the end of the chain. Uses the <a href=\"modelica://Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing\">FlangeWithBearing</a> connector where the <strong>flange</strong> connector has zero torque applied to it and the <strong>bearingFrame</strong> can be optionally included through the parameter <code>includeBearingConnector</code>. If <code>includeBearingConnector=true</code> then zero force and torque is applied to the bearingFrame.
within VehicleInterfaces.Mechanics.MultiBody; model MultiBodyEnd "Ends a MultiBody chain" parameter Boolean includeBearingConnector=false "= true, if bearing frame connector is present, otherwise not present"; Modelica.Mechanics.MultiBody.Interfaces.FlangeWithBearing flange( includeBearingConnector=includeBearingConnector) "Flange with zero force and torque applied" protected Modelica.Mechanics.MultiBody.Forces.Internal.ZeroForceAndTorque zeroForceAndTorque if includeBearingConnector public Modelica.Mechanics.Rotational.Sources.ConstantTorque zeroTorque1D( final tau_constant=0) equation connect(zeroTorque1D.flange, flange.flange) connect(zeroForceAndTorque.frame_a, flange.bearingFrame) end MultiBodyEnd;
Collection of additional MultiBody components
within VehicleInterfaces.Mechanics; package MultiBody "Collection of additional MultiBody components" extends Modelica.Icons.Package; end MultiBody;
Ideal sensor to measure the rotation of a Flange. Measures a&nbsp;normalized angle in a&nbsp;1D normalized rotational system. Cannot be connected to components from the Modelica.Mechanics.Rotational library.
within VehicleInterfaces.Mechanics.NormalisedRotational; model AngleSensor "Ideal sensor to measure the rotation of a Flange" extends Modelica.Icons.RoundSensor; Interfaces.Flange flange_a "flange to be measured" Modelica.Blocks.Interfaces.RealOutput phi "Absolute angle of flange as output signal" equation phi = flange_a.phi; 0 = flange_a.tau; end AngleSensor;
Collection of normalized rotational mechanics
within VehicleInterfaces.Mechanics; package NormalisedRotational "Collection of normalized rotational mechanics" extends Modelica.Icons.Package; end NormalisedRotational;
Applies a rotation to a Flange. Applies a&nbsp;normalized angle to a&nbsp;1D normalized rotational system. Cannot be connected to components from the Modelica.Mechanics.Rotational library.
within VehicleInterfaces.Mechanics.NormalisedRotational; model Position "Applies a rotation to a Flange" parameter Boolean exact=true "True/false exact treatment/filtering the input signal"; parameter SI.Frequency f_crit=50 "If exact=false: critical frequency of filter to filter input signal" Interfaces.Flange flange_b "flange to be rotated" Modelica.Blocks.Interfaces.RealInput phi_ref "position to be applied" Types.NormalizedReal phi; protected parameter Real w_crit=2*Modelica.Constants.pi*f_crit "critical frequency in [1/s]"; constant Real af=1.3617 "Coefficient s of Bessel filter"; constant Real bf=0.6180 "Coefficient s*s of Bessel filter"; Real w; Real a; equation phi = flange_b.phi; w = der(phi); a = der(w); if exact then phi = phi_ref; else a = ((phi_ref - phi)*w_crit - af*w)*(w_crit/bf); end if; initial equation if not exact then phi = phi_ref; end if; end Position;
Applies a torque to a Flange. Applies a&nbsp;torque to a&nbsp;1D normalized rotational system. Cannot be connected to components from the Modelica.Mechanics.Rotational library.
within VehicleInterfaces.Mechanics.NormalisedRotational; model Torque "Applies a torque to a Flange" Interfaces.Flange flange_b "Flange to be turned" Modelica.Blocks.Interfaces.RealInput tau "Torque to be applied" equation tau = -flange_b.tau; end Torque;
Collection of connector definitions
within VehicleInterfaces.Mechanics.NormalisedRotational; package Interfaces "Collection of connector definitions" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Applies a force to a Flange. Applies a force to a 1D normalized translational system. Cannot be connected to components from the Modelica.Mechanics.Translational library.
within VehicleInterfaces.Mechanics.NormalisedTranslational; model Force "Applies a force to a Flange" Interfaces.Flange flange_b "Flange to be forced" Modelica.Blocks.Interfaces.RealInput force "Force to be applied" equation force = -flange_b.f; end Force;
Collection of normalized translational mechanics
within VehicleInterfaces.Mechanics; package NormalisedTranslational "Collection of normalized translational mechanics" extends Modelica.Icons.Package; end NormalisedTranslational;
Applies a position to a Flange. Applies a normalized position to a 1D normalized translational system. Cannot be connected to components from the Modelica.Mechanics.Translational library.
within VehicleInterfaces.Mechanics.NormalisedTranslational; model Position "Applies a position to a Flange" parameter Boolean exact=true "True/false exact treatment/filtering the input signal"; parameter SI.Frequency f_crit=50 "If exact=false: critical frequency of filter to filter input signal" Interfaces.Flange flange_b "flange to be positioned" Modelica.Blocks.Interfaces.RealInput position "position to be applied" Types.NormalizedReal s "Normalized position"; protected parameter Real w_crit=2*Modelica.Constants.pi*f_crit "Critical frequency in [1/s]"; constant Real af=1.3617 "Coefficient s of Bessel filter"; constant Real bf=0.6180 "Coefficient s*s of Bessel filter"; Real v; Real a; equation s = flange_b.s; if exact then s = position; v = 0; a = 0; else v = der(s); a = der(v); a = ((position - s)*w_crit - af*v)*(w_crit/bf); end if; initial equation if not exact then s = position; end if; end Position;
Ideal sensor to measure the position of a Flange. Measures a&nbsp;normalized position in a&nbsp;1D normalized translational system. Cannot be connected to components from the Modelica.Mechanics.Translational library.
within VehicleInterfaces.Mechanics.NormalisedTranslational; model PositionSensor "Ideal sensor to measure the position of a Flange" extends Modelica.Icons.RectangularSensor; Interfaces.Flange flange_a "Flange to be measured" Modelica.Blocks.Interfaces.RealOutput position "Absolute position of flange as output signal" equation position = flange_a.s; 0 = flange_a.f; end PositionSensor;
Collection of connector definitions
within VehicleInterfaces.Mechanics.NormalisedTranslational; package Interfaces "Collection of connector definitions" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Collection of powertrain mounts subsystem definition
within VehicleInterfaces; package PowertrainMounts "Collection of powertrain mounts subsystem definition" extends Modelica.Icons.VariantsPackage; end PowertrainMounts;
1 system rigid mount. Rigidly mounts one power train system such as the engine or transmission on one supporting system, usually the chassis.
within VehicleInterfaces.PowertrainMounts; model SingleSystemRigidMount "1 system rigid mount" extends Interfaces.SingleSystemMount; extends VehicleInterfaces.Icons.SingleMount; parameter SI.Position r_ChassisToMount1[3]={0,0,0} "Vector from chassis frame to mount_1 frame" Modelica.Mechanics.MultiBody.Parts.FixedTranslation chassisFrameToMount1(r= r_ChassisToMount1) equation connect(chassisFrameToMount1.frame_a, chassisFrame) connect(chassisFrameToMount1.frame_b, mount_1) end SingleSystemRigidMount;
3 system rigid mount. Rigidly mounts three power train systems such as the engine, transmission and driveline on one supporting system, usually the chassis.
within VehicleInterfaces.PowertrainMounts; model ThreeSystemRigidMount "3 system rigid mount" extends Interfaces.TripleSystemMount; extends VehicleInterfaces.Icons.MultipleMounts; parameter SI.Position r_ChassisToMount1[3]={0,0,0} "Vector from chassis frame to mount_1 frame" parameter SI.Position r_ChassisToMount2[3]={0,0,0} "Vector from chassis frame to mount_2 frame" parameter SI.Position r_ChassisToMount3[3]={0,0,0} "Vector from chassis frame to mount_3 frame" Modelica.Mechanics.MultiBody.Parts.FixedTranslation chassisFrameToMount1(r= r_ChassisToMount1, animation=false) Modelica.Mechanics.MultiBody.Parts.FixedTranslation chassisFrameToMount2( animation=false, r=r_ChassisToMount2) Modelica.Mechanics.MultiBody.Parts.FixedTranslation chassisFrameToMount3( animation=false, r=r_ChassisToMount3) equation connect(chassisFrameToMount1.frame_a, chassisFrame) connect(chassisFrameToMount1.frame_b, mount_1) connect(chassisFrameToMount2.frame_b, mount_2) connect(chassisFrameToMount3.frame_b, mount_3) connect(chassisFrameToMount2.frame_a, chassisFrame) connect(chassisFrameToMount3.frame_a, chassisFrame) end ThreeSystemRigidMount;
Powertrain Mounts Tutorial.
within VehicleInterfaces.PowertrainMounts; class Tutorial "Powertrain Mounts Tutorial" extends Modelica.Icons.Information; end Tutorial;
2 system rigid mount. Rigidly mounts two power train systems such as the engine and transmission on one supporting system, usually the chassis.
within VehicleInterfaces.PowertrainMounts; model TwoSystemRigidMount "2 system rigid mount" extends Interfaces.DualSystemMount; extends VehicleInterfaces.Icons.TwoMounts; parameter SI.Position r_ChassisToMount1[3]={0,0,0} "Vector from chassis frame to mount_1 frame" parameter SI.Position r_ChassisToMount2[3]={0,0,0} "Vector from chassis frame to mount_2 frame" Modelica.Mechanics.MultiBody.Parts.FixedTranslation chassisFrameToMount1( r=r_ChassisToMount1) Modelica.Mechanics.MultiBody.Parts.FixedTranslation chassisFrameToMount2( r=r_ChassisToMount2) equation connect(chassisFrameToMount1.frame_a, chassisFrame) connect(chassisFrameToMount2.frame_b, mount_2) connect(chassisFrameToMount1.frame_b, mount_1) connect(chassisFrameToMount2.frame_a, chassisFrame) end TwoSystemRigidMount;
Basic interface definition for a mounting system. This partial model defines the common interfaces required for a&nbsp;mounting subsystem. See the <a href=\"modelica://VehicleInterfaces.PowertrainMounts\">documentation</a> and <a href=\"modelica://VehicleInterfaces.PowertrainMounts.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.PowertrainMounts.Interfaces; partial model Base "Basic interface definition for a mounting system" Modelica.Mechanics.MultiBody.Interfaces.Frame_a chassisFrame "Chassis frame" end Base;
Two powertrain subsystem mounting interface definition. This partial model defines the interfaces required for two powertrain system mounting subsystem. This class should be extended to form a&nbsp;particular powertrain mounting model. See the <a href=\"modelica://VehicleInterfaces.PowertrainMounts\">documentation</a> and <a href=\"modelica://VehicleInterfaces.PowertrainMounts.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.PowertrainMounts.Interfaces; partial model DualSystemMount "Two powertrain subsystem mounting interface definition" extends Base; Modelica.Mechanics.MultiBody.Interfaces.Frame_b mount_1 "Powertrain system 1" Modelica.Mechanics.MultiBody.Interfaces.Frame_b mount_2 "Powertrain system 2" end DualSystemMount;
Collection of interface definitions for powertrain mounting system
within VehicleInterfaces.PowertrainMounts; package Interfaces "Collection of interface definitions for powertrain mounting system" extends Modelica.Icons.InterfacesPackage; end Interfaces;
Single powertrain subsystem mounting interface definition. This partial model defines the interfaces required for a&nbsp;single powertrain system mounting subsystem. This class should be extended to form a particular powertrain mounting model. See the <a href=\"modelica://VehicleInterfaces.PowertrainMounts\">documentation</a> and <a href=\"modelica://VehicleInterfaces.PowertrainMounts.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.PowertrainMounts.Interfaces; partial model SingleSystemMount "Single powertrain subsystem mounting interface definition" extends Base; Modelica.Mechanics.MultiBody.Interfaces.Frame_b mount_1 "Powertrain system 1" end SingleSystemMount;
Three powertrain subsystem mounting interface definition. This partial model defines the interfaces required for three powertrain system mounting subsystem. This class should be extended to form a&nbsp;particular powertrain mounting model. See the <a href=\"modelica://VehicleInterfaces.PowertrainMounts\">documentation</a> and <a href=\"modelica://VehicleInterfaces.PowertrainMounts.Tutorial\">tutorial</a> for more information.
within VehicleInterfaces.PowertrainMounts.Interfaces; partial model TripleSystemMount "Three powertrain subsystem mounting interface definition" extends Base; Modelica.Mechanics.MultiBody.Interfaces.Frame_b mount_1 "Powertrain system 1" Modelica.Mechanics.MultiBody.Interfaces.Frame_b mount_2 "Powertrain system 2" Modelica.Mechanics.MultiBody.Interfaces.Frame_b mount_3 "Powertrain system 3" end TripleSystemMount;
Circular road (perpendicular to world z-axis). The road is a&nbsp;circle described by "radius" and "width". The road surface parameters are defined as:
within VehicleInterfaces.Roads; model CircleRoad "Circular road (perpendicular to world z-axis)" extends VehicleInterfaces.Roads.Interfaces.Base( redeclare final function position = circlePosition (radius=radius, width=width), redeclare final function trackOffset = constantOffset, redeclare final function normal = circleNormal, redeclare final function headingDirection = circleHeadingDirection (radius=radius), redeclare final function frictionCoefficient = circleFrictionCoefficient (mu_fixed=mu)); parameter Boolean animation=true "= true, if road shall be visualized"; parameter SI.Radius radius "Radius of road"; parameter SI.Length width "Width of road"; parameter Real mu "Friction coefficient of road"; parameter Modelica.Mechanics.MultiBody.Types.Color roadColor={255,0,0} "Color of road"; constant Real pi=Modelica.Constants.pi; protected outer Modelica.Mechanics.MultiBody.World world; VehicleInterfaces.Roads.Internal.VisualizeSimpleRoads roadShape( ns=100, nw=10, s_min=0, s_max=2*pi*radius, w_min=-width/2, w_max=width/2, color=roadColor) if animation and world.enableAnimation; function r_middle "Determine point on road in the middle of the circle (w=0" extends Modelica.Icons.Function; input Real s=0 "Roads surface parameter 1 (usually arc length along road)"; input Real radius=1 "Radius of circle"; output Real r_0[3]={radius*sin(s/radius),-radius*cos(s/radius),0}; algorithm r_0 := {radius*sin(s/radius),-radius*cos(s/radius),0}; end r_middle; function circlePosition "Determine point on road" import Modelica.Math.Vectors.normalize; extends VehicleInterfaces.Roads.Interfaces.positionBase; input SI.Radius radius=1 "Radius of circle"; input SI.Length width=1 "Width of road"; algorithm r_0 := r_middle(s, radius) + w*normalize(r_middle(s, radius)); end circlePosition; function constantOffset "Determine offset from road centre line" extends VehicleInterfaces.Roads.Interfaces.trackOffsetBase; algorithm trackOffset := {0,0,0}; end constantOffset; function circleNormal "Determine unit normal on road, given road surface parameters" extends VehicleInterfaces.Roads.Interfaces.normalBase; algorithm e_n_0 := {0,0,1}; end circleNormal; function circleHeadingDirection "Determine unit heading direction on road" extends VehicleInterfaces.Roads.Interfaces.headingDirectionBase; input SI.Radius radius=1 "Radius of circle"; algorithm e_s_0 := {cos(s/radius),sin(s/radius),0}; end circleHeadingDirection; function circleFrictionCoefficient "Determine friction coefficient at point on road" extends VehicleInterfaces.Roads.Interfaces.frictionCoefficientBase; input Real mu_fixed=1 "Friction coefficient"; algorithm mu := mu_fixed; end circleFrictionCoefficient; end CircleRoad;
Straight road along x-axis (perpendicular to world z-axis). The road is a line along the x-axis of the world system. The road surface parameters are defined as:
within VehicleInterfaces.Roads; model FlatRoad "Straight road along x-axis (perpendicular to world z-axis)" extends VehicleInterfaces.Icons.Road; extends VehicleInterfaces.Roads.Interfaces.Base( redeclare final function position = linePosition, redeclare final function trackOffset = constantOffset (offset=offset), redeclare final function normal = lineNormal, redeclare final function headingDirection = lineHeadingDirection, redeclare final function frictionCoefficient = lineFrictionCoefficient (mu_fixed=mu)); parameter Boolean animation=true "= true, if road shall be visualized"; parameter Real mu=0.5 "Friction coefficient of road"; parameter Modelica.Mechanics.MultiBody.Types.Color roadColor={255,0,0} "Color of road" parameter SI.Length width=8 "Width of road" parameter SI.Position x_min=-100 "Roads is visualized in the range [x_min .. x_max]" parameter SI.Position x_max=100 "Roads is visualized in the range [x_min .. x_max]" parameter SI.Distance offset=0 "Offset from the road centre line"; protected outer Modelica.Mechanics.MultiBody.World world; VehicleInterfaces.Roads.Internal.VisualizeSimpleRoads roadShape( ns=2, nw=2, s_min=x_min, s_max=x_max, w_min=-width/2, w_max=width/2, color=roadColor) if animation and world.enableAnimation; function linePosition "Determine point on road" extends VehicleInterfaces.Roads.Interfaces.positionBase; algorithm r_0 := {s,w,0}; end linePosition; function constantOffset "Determine offset from road centre line" extends VehicleInterfaces.Roads.Interfaces.trackOffsetBase; input SI.Distance offset=0; algorithm trackOffset := {0,offset,0}; end constantOffset; function lineNormal "Determine unit normal on road" extends VehicleInterfaces.Roads.Interfaces.normalBase; algorithm e_n_0 := {0,0,1}; end lineNormal; function lineHeadingDirection "Determine unit heading direction on road" extends VehicleInterfaces.Roads.Interfaces.headingDirectionBase; algorithm e_s_0 := {1,0,0}; end lineHeadingDirection; function lineFrictionCoefficient "Determine friction coefficient at point on road" extends VehicleInterfaces.Roads.Interfaces.frictionCoefficientBase; input Real mu_fixed=1 "Friction coefficient"; algorithm mu := mu_fixed; end lineFrictionCoefficient; end FlatRoad;
Collection of road definitions
within VehicleInterfaces; package Roads "Collection of road definitions" extends Modelica.Icons.VariantsPackage; end Roads;
Roads Tutorial
within VehicleInterfaces.Roads; class Tutorial "Roads Tutorial" extends Modelica.Icons.Information; //rest of definition ... <strong>end</strong> FlatRoad; </pre></blockquote> </li> <li>In redeclaring the functions we have also introduced new parameters <strong>mu</strong> and <strong>offset</strong> that need to be added to the model to define the friction coefficient of the road and the track offset from the road centre line.</li> <li>The <strong>FlatRoad</strong> model included in this package also includes animation of the road surface but this is not essential to the definition of the road and will not be described in this tutorial.</li> <li>The road model is complete and can now be used.</li> </ol> </html>")); end Tutorial;
Check that wheel contact point calculation is properly working with road model. Model to check that the tire contact patch calculation is working correctly with the road models.
within VehicleInterfaces.Roads.Examples; model CheckContactCalculation "Check that wheel contact point calculation is properly working with road model" extends Modelica.Icons.Example; parameter SI.Radius wheelRadius=1 "Radius of wheel"; SI.Angle phi; SI.Radius radius_wheel; Real axis_wheel[3]; SI.Position r_circle[3]={road.radius*sin(phi),-road.radius*cos(phi),0}; VehicleInterfaces.Roads.Examples.Utilities.DummyTyre tyre( wheelRadius=wheelRadius, e_axis=Modelica.Math.Vectors.normalize(axis_wheel), r_wheel={radius_wheel*sin(phi),-radius_wheel*cos(phi),1 + sin(phi)/20}) inner VehicleInterfaces.Roads.CircleRoad road( radius=50, width=8, mu=0.5, roadColor={100,100,100}) inner Modelica.Mechanics.MultiBody.World world( enableAnimation=true, axisLength=20, n={0,0,-1}) protected constant SI.AngularVelocity w = 1; equation // Define movement of center of wheel r_wheel and of wheel axis axis_wheel phi = w*time; radius_wheel = road.radius + (road.radius/20)*sin(20*phi); axis_wheel = {sin(phi),-cos(phi),sin(10*phi)/10}; end CheckContactCalculation;