From 6d859bd4170f5cb4bed75bb5f33569c74bd124c3 Mon Sep 17 00:00:00 2001 From: Robert Horvath Date: Wed, 21 Oct 2026 21:33:31 -0500 Subject: [PATCH] [Interfaces] Declare subsystem-owned control buses --- BobLib/Brakes/Interfaces/BrakesBus.mo | 16 ++++ BobLib/Brakes/Interfaces/BrakesControlBus.mo | 13 +++ BobLib/Brakes/Interfaces/package.mo | 6 ++ BobLib/Brakes/Interfaces/package.order | 2 + BobLib/Brakes/package.mo | 88 +++++++++++++++++++ BobLib/Brakes/package.order | 1 + BobLib/Chassis/Interfaces/ChassisBus.mo | 28 ++++++ BobLib/Chassis/Interfaces/package.mo | 7 ++ BobLib/Chassis/Interfaces/package.order | 1 + .../Chassis/Suspension/Interfaces/AxleBus.mo | 16 ++++ .../Chassis/Suspension/Interfaces/package.mo | 7 ++ .../Suspension/Interfaces/package.order | 1 + BobLib/Chassis/Suspension/package.order | 1 + BobLib/Chassis/package.order | 1 + BobLib/Drivelines/Interfaces/DrivelineBus.mo | 16 ++++ .../Interfaces/DrivelineControlBus.mo | 13 +++ BobLib/Drivelines/Interfaces/package.mo | 6 ++ BobLib/Drivelines/Interfaces/package.order | 2 + BobLib/Drivelines/package.order | 1 + .../Interfaces/DriverBus.mo | 19 ++++ .../DriverEnvironments/Interfaces/package.mo | 6 ++ .../Interfaces/package.order | 1 + BobLib/DriverEnvironments/package.order | 1 + .../Interfaces/ElectricMotorBus.mo | 17 ++++ .../Interfaces/ElectricMotorControlBus.mo | 19 ++++ BobLib/ElectricDrives/Interfaces/package.mo | 7 ++ .../ElectricDrives/Interfaces/package.order | 2 + BobLib/ElectricDrives/package.order | 1 + BobLib/EnergyStorage/Interfaces/BatteryBus.mo | 17 ++++ BobLib/EnergyStorage/Interfaces/package.mo | 7 ++ BobLib/EnergyStorage/Interfaces/package.order | 1 + BobLib/EnergyStorage/package.order | 1 + BobLib/Engines/Interfaces/EngineBus.mo | 13 +++ BobLib/Engines/Interfaces/package.mo | 7 ++ BobLib/Engines/Interfaces/package.order | 1 + BobLib/Engines/package.order | 1 + .../Interfaces/TransmissionBus.mo | 13 +++ .../Interfaces/TransmissionControlBus.mo | 13 +++ BobLib/Transmissions/Interfaces/package.mo | 7 ++ BobLib/Transmissions/Interfaces/package.order | 2 + BobLib/Transmissions/package.order | 1 + BobLib/Utilities/Interfaces/ControlBus.mo | 20 +++++ BobLib/Utilities/Interfaces/package.mo | 6 ++ BobLib/Utilities/Interfaces/package.order | 1 + BobLib/Utilities/package.order | 1 + BobLib/package.order | 1 + 46 files changed, 412 insertions(+) create mode 100644 BobLib/Brakes/Interfaces/BrakesBus.mo create mode 100644 BobLib/Brakes/Interfaces/BrakesControlBus.mo create mode 100644 BobLib/Brakes/Interfaces/package.mo create mode 100644 BobLib/Brakes/Interfaces/package.order create mode 100644 BobLib/Brakes/package.mo create mode 100644 BobLib/Brakes/package.order create mode 100644 BobLib/Chassis/Interfaces/ChassisBus.mo create mode 100644 BobLib/Chassis/Interfaces/package.mo create mode 100644 BobLib/Chassis/Interfaces/package.order create mode 100644 BobLib/Chassis/Suspension/Interfaces/AxleBus.mo create mode 100644 BobLib/Chassis/Suspension/Interfaces/package.mo create mode 100644 BobLib/Chassis/Suspension/Interfaces/package.order create mode 100644 BobLib/Drivelines/Interfaces/DrivelineBus.mo create mode 100644 BobLib/Drivelines/Interfaces/DrivelineControlBus.mo create mode 100644 BobLib/Drivelines/Interfaces/package.mo create mode 100644 BobLib/Drivelines/Interfaces/package.order create mode 100644 BobLib/DriverEnvironments/Interfaces/DriverBus.mo create mode 100644 BobLib/DriverEnvironments/Interfaces/package.mo create mode 100644 BobLib/DriverEnvironments/Interfaces/package.order create mode 100644 BobLib/ElectricDrives/Interfaces/ElectricMotorBus.mo create mode 100644 BobLib/ElectricDrives/Interfaces/ElectricMotorControlBus.mo create mode 100644 BobLib/ElectricDrives/Interfaces/package.mo create mode 100644 BobLib/ElectricDrives/Interfaces/package.order create mode 100644 BobLib/EnergyStorage/Interfaces/BatteryBus.mo create mode 100644 BobLib/EnergyStorage/Interfaces/package.mo create mode 100644 BobLib/EnergyStorage/Interfaces/package.order create mode 100644 BobLib/Engines/Interfaces/EngineBus.mo create mode 100644 BobLib/Engines/Interfaces/package.mo create mode 100644 BobLib/Engines/Interfaces/package.order create mode 100644 BobLib/Transmissions/Interfaces/TransmissionBus.mo create mode 100644 BobLib/Transmissions/Interfaces/TransmissionControlBus.mo create mode 100644 BobLib/Transmissions/Interfaces/package.mo create mode 100644 BobLib/Transmissions/Interfaces/package.order create mode 100644 BobLib/Utilities/Interfaces/ControlBus.mo create mode 100644 BobLib/Utilities/Interfaces/package.mo create mode 100644 BobLib/Utilities/Interfaces/package.order diff --git a/BobLib/Brakes/Interfaces/BrakesBus.mo b/BobLib/Brakes/Interfaces/BrakesBus.mo new file mode 100644 index 0000000..774a832 --- /dev/null +++ b/BobLib/Brakes/Interfaces/BrakesBus.mo @@ -0,0 +1,16 @@ +within BobLib.Brakes.Interfaces; +expandable connector BrakesBus + + "Typed BrakesBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.BrakesBus; + + SI.AngularVelocity wheelSpeed_1 "BrakeActuation: wheel-equivalent speed at corner 1; central brake uses differential gearing"; + SI.AngularVelocity wheelSpeed_2 "BrakeActuation: wheel-equivalent speed at corner 2; central brake uses differential gearing"; + SI.AngularVelocity wheelSpeed_3 "BrakeActuation: wheel-equivalent speed at corner 3; central brake uses differential gearing"; + SI.AngularVelocity wheelSpeed_4 "BrakeActuation: wheel-equivalent speed at corner 4; central brake uses differential gearing"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end BrakesBus; diff --git a/BobLib/Brakes/Interfaces/BrakesControlBus.mo b/BobLib/Brakes/Interfaces/BrakesControlBus.mo new file mode 100644 index 0000000..55466d6 --- /dev/null +++ b/BobLib/Brakes/Interfaces/BrakesControlBus.mo @@ -0,0 +1,13 @@ +within BobLib.Brakes.Interfaces; +expandable connector BrakesControlBus + + "Typed BrakesControlBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.BrakesControlBus; + + SI.Torque mechanicalBrakeTorqueRequest "VCU: mechanical brake torque request; consumed by bus-controlled brakes"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end BrakesControlBus; diff --git a/BobLib/Brakes/Interfaces/package.mo b/BobLib/Brakes/Interfaces/package.mo new file mode 100644 index 0000000..0b47a81 --- /dev/null +++ b/BobLib/Brakes/Interfaces/package.mo @@ -0,0 +1,6 @@ +within BobLib.Brakes; +package Interfaces "Brake subsystem contracts" + + extends Modelica.Icons.InterfacesPackage; + annotation(Icon(graphics = {Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.None)})); +end Interfaces; diff --git a/BobLib/Brakes/Interfaces/package.order b/BobLib/Brakes/Interfaces/package.order new file mode 100644 index 0000000..38ee9fe --- /dev/null +++ b/BobLib/Brakes/Interfaces/package.order @@ -0,0 +1,2 @@ +BrakesBus +BrakesControlBus diff --git a/BobLib/Brakes/package.mo b/BobLib/Brakes/package.mo new file mode 100644 index 0000000..02713a8 --- /dev/null +++ b/BobLib/Brakes/package.mo @@ -0,0 +1,88 @@ +within BobLib; +package Brakes + + "Brake implementations for the VehicleInterfaces brakes contract" + + // Package icon adapted from VehicleInterfaces 2.0.2 Icons.Brakes on 2026-10-16; instance-name text removed. + // Copyright (C) 2005-2013, Dassault Systemes, DLR and Modelon; (C) 2013-2025, Modelica Association. + // Modelica License 1.1: Resources/Licenses/LICENSE_VehicleInterfaces.txt. + extends Modelica.Icons.Package; + + annotation(Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}), + graphics = { + Rectangle( + extent = {{-100, 100}, {100, -100}}, + lineColor = {0, 0, 0}, + fillColor = {255, 255, 255}, + fillPattern = FillPattern.Solid, lineThickness = 0.5, pattern = LinePattern.Solid), + Ellipse( + extent = {{-80, 80}, {80, -80}}, + lineColor = {95, 95, 95}, + fillColor = {186, 186, 186}, + fillPattern = FillPattern.Solid), + Ellipse( + extent = {{-46, 46}, {46, -46}}, + lineColor = {95, 95, 95}, + fillColor = {255, 255, 255}, + fillPattern = FillPattern.Solid), + Ellipse( + extent = {{-28, 28}, {28, -28}}, + lineColor = {95, 95, 95}, + fillColor = {255, 255, 255}, + fillPattern = FillPattern.Solid), + Ellipse( + extent = {{-10, 10}, {10, -10}}, + lineColor = {0, 0, 0}, + fillColor = {95, 95, 95}, + fillPattern = FillPattern.Solid), + Ellipse( + extent = {{22, 30}, {30, 22}}, + lineColor = {0, 0, 0}, + fillColor = {255, 255, 255}, + fillPattern = FillPattern.Solid), + Ellipse( + extent = {{-30, 30}, {-22, 22}}, + lineColor = {0, 0, 0}, + fillColor = {255, 255, 255}, + fillPattern = FillPattern.Solid), + Ellipse( + extent = {{22, -22}, {30, -30}}, + lineColor = {0, 0, 0}, + fillColor = {255, 255, 255}, + fillPattern = FillPattern.Solid), + Ellipse( + extent = {{-30, -22}, {-22, -30}}, + lineColor = {0, 0, 0}, + fillColor = {255, 255, 255}, + fillPattern = FillPattern.Solid), + + Polygon( + points = {{-88, -20}, {-88, 20}, {-80, 48}, {-48, 44}, {-48, -44}, {-80, -46}, { + -88, -20}}, + lineColor = {0, 0, 0}, + fillPattern = FillPattern.HorizontalCylinder, + fillColor = {215, 215, 215}), + Line( + points = {{-66, 10}, {-80, 10}}, + thickness = 0.5), + Line( + points = {{-54, -14}, {-60, -10}, {-60, 10}, {-54, 14}}, + thickness = 0.5), + Line( + points = {{-64, 30}, {-80, 30}}, + thickness = 0.5), + Line( + points = {{-64, -30}, {-80, -30}}, + thickness = 0.5), + Line( + points = {{-66, -10}, {-80, -10}}, + thickness = 0.5)})); + + annotation(Documentation(info = " +

+Package BobLib.Brakes contains simple +wheel brake implementations that are physically attached at the chassis wheel +hubs while still exposing the standard VehicleInterfaces brakes boundary. +

+")); +end Brakes; diff --git a/BobLib/Brakes/package.order b/BobLib/Brakes/package.order new file mode 100644 index 0000000..8f81df7 --- /dev/null +++ b/BobLib/Brakes/package.order @@ -0,0 +1 @@ +Interfaces diff --git a/BobLib/Chassis/Interfaces/ChassisBus.mo b/BobLib/Chassis/Interfaces/ChassisBus.mo new file mode 100644 index 0000000..3c9178a --- /dev/null +++ b/BobLib/Chassis/Interfaces/ChassisBus.mo @@ -0,0 +1,28 @@ +within BobLib.Chassis.Interfaces; +expandable connector ChassisBus + + "Typed ChassisBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.ChassisBus; + + SI.Velocity longitudinalVelocity "Chassis: signed forward velocity"; + SI.Velocity vehicleSpeed "Chassis: nonnegative magnitude of body velocity"; + SI.Acceleration bodyAcceleration_2 "Chassis: lateral body acceleration"; + SI.Length rideHeight_1 "Chassis: ride height at corner 1"; + SI.Length rideHeight_2 "Chassis: ride height at corner 2"; + SI.Length rideHeight_3 "Chassis: ride height at corner 3"; + SI.Length rideHeight_4 "Chassis: ride height at corner 4"; + SI.Length frontLeftSpringLength "Front axle: left spring/damper length"; + SI.Length frontRightSpringLength "Front axle: right spring/damper length"; + SI.Length rearLeftSpringLength "Rear axle: left spring/damper length"; + SI.Length rearRightSpringLength "Rear axle: right spring/damper length"; + + SI.Force Fz_1 "Chassis: tire normal load at corner 1"; + SI.Force Fz_2 "Chassis: tire normal load at corner 2"; + SI.Force Fz_3 "Chassis: tire normal load at corner 3"; + SI.Force Fz_4 "Chassis: tire normal load at corner 4"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end ChassisBus; diff --git a/BobLib/Chassis/Interfaces/package.mo b/BobLib/Chassis/Interfaces/package.mo new file mode 100644 index 0000000..2987798 --- /dev/null +++ b/BobLib/Chassis/Interfaces/package.mo @@ -0,0 +1,7 @@ +within BobLib.Chassis; +package Interfaces + + "Subsystem contracts and signal buses" + extends Modelica.Icons.InterfacesPackage; + annotation(Icon(graphics = {Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.None)})); +end Interfaces; diff --git a/BobLib/Chassis/Interfaces/package.order b/BobLib/Chassis/Interfaces/package.order new file mode 100644 index 0000000..c80c31a --- /dev/null +++ b/BobLib/Chassis/Interfaces/package.order @@ -0,0 +1 @@ +ChassisBus diff --git a/BobLib/Chassis/Suspension/Interfaces/AxleBus.mo b/BobLib/Chassis/Suspension/Interfaces/AxleBus.mo new file mode 100644 index 0000000..e05cb74 --- /dev/null +++ b/BobLib/Chassis/Suspension/Interfaces/AxleBus.mo @@ -0,0 +1,16 @@ +within BobLib.Chassis.Suspension.Interfaces; +expandable connector AxleBus + + "Typed AxleBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.ChassisBus; + + SI.Force leftNormalLoad "Axle: left tire normal load"; + SI.Force rightNormalLoad "Axle: right tire normal load"; + SI.Length leftSpringLength "Axle: left spring/damper length"; + SI.Length rightSpringLength "Axle: right spring/damper length"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end AxleBus; diff --git a/BobLib/Chassis/Suspension/Interfaces/package.mo b/BobLib/Chassis/Suspension/Interfaces/package.mo new file mode 100644 index 0000000..e8cd115 --- /dev/null +++ b/BobLib/Chassis/Suspension/Interfaces/package.mo @@ -0,0 +1,7 @@ +within BobLib.Chassis.Suspension; + +package Interfaces "Shared suspension axle contracts" + + extends Modelica.Icons.InterfacesPackage; + annotation(Icon(graphics = {Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.None)})); +end Interfaces; diff --git a/BobLib/Chassis/Suspension/Interfaces/package.order b/BobLib/Chassis/Suspension/Interfaces/package.order new file mode 100644 index 0000000..bd334b8 --- /dev/null +++ b/BobLib/Chassis/Suspension/Interfaces/package.order @@ -0,0 +1 @@ +AxleBus diff --git a/BobLib/Chassis/Suspension/package.order b/BobLib/Chassis/Suspension/package.order index 9619889..4116d85 100644 --- a/BobLib/Chassis/Suspension/package.order +++ b/BobLib/Chassis/Suspension/package.order @@ -1,3 +1,4 @@ +Interfaces Tires Templates Linkages diff --git a/BobLib/Chassis/package.order b/BobLib/Chassis/package.order index ceb2291..f3e1bab 100644 --- a/BobLib/Chassis/package.order +++ b/BobLib/Chassis/package.order @@ -1,3 +1,4 @@ +Interfaces Body Suspension Brakes diff --git a/BobLib/Drivelines/Interfaces/DrivelineBus.mo b/BobLib/Drivelines/Interfaces/DrivelineBus.mo new file mode 100644 index 0000000..4d231be --- /dev/null +++ b/BobLib/Drivelines/Interfaces/DrivelineBus.mo @@ -0,0 +1,16 @@ +within BobLib.Drivelines.Interfaces; +expandable connector DrivelineBus + + "Typed DrivelineBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.DrivelineBus; + + SI.AngularVelocity diffInputSpeed "RearFinalDriveDifferential: differential input speed"; + SI.AngularVelocity motorSideSpeed "RearFinalDriveDifferential: motor-side shaft speed"; + SI.Torque leftHalfshaftTorque "RearFinalDriveDifferential: signed left halfshaft torque"; + SI.Torque rightHalfshaftTorque "RearFinalDriveDifferential: signed right halfshaft torque"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end DrivelineBus; diff --git a/BobLib/Drivelines/Interfaces/DrivelineControlBus.mo b/BobLib/Drivelines/Interfaces/DrivelineControlBus.mo new file mode 100644 index 0000000..3cca2ca --- /dev/null +++ b/BobLib/Drivelines/Interfaces/DrivelineControlBus.mo @@ -0,0 +1,13 @@ +within BobLib.Drivelines.Interfaces; +expandable connector DrivelineControlBus + + "Typed DrivelineControlBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.DrivelineControlBus; + + SI.Torque driveTorqueCommand "VCU: drive torque request for diagnostics, not a second physical actuator"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end DrivelineControlBus; diff --git a/BobLib/Drivelines/Interfaces/package.mo b/BobLib/Drivelines/Interfaces/package.mo new file mode 100644 index 0000000..b67a02c --- /dev/null +++ b/BobLib/Drivelines/Interfaces/package.mo @@ -0,0 +1,6 @@ +within BobLib.Drivelines; +package Interfaces "Driveline subsystem contracts" + + extends Modelica.Icons.InterfacesPackage; + annotation(Icon(graphics = {Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.None)})); +end Interfaces; diff --git a/BobLib/Drivelines/Interfaces/package.order b/BobLib/Drivelines/Interfaces/package.order new file mode 100644 index 0000000..8f7bea5 --- /dev/null +++ b/BobLib/Drivelines/Interfaces/package.order @@ -0,0 +1,2 @@ +DrivelineBus +DrivelineControlBus diff --git a/BobLib/Drivelines/package.order b/BobLib/Drivelines/package.order index 659931c..760d1ec 100644 --- a/BobLib/Drivelines/package.order +++ b/BobLib/Drivelines/package.order @@ -1,2 +1,3 @@ +Interfaces Internal RearFinalDriveDifferential diff --git a/BobLib/DriverEnvironments/Interfaces/DriverBus.mo b/BobLib/DriverEnvironments/Interfaces/DriverBus.mo new file mode 100644 index 0000000..c27dfb9 --- /dev/null +++ b/BobLib/DriverEnvironments/Interfaces/DriverBus.mo @@ -0,0 +1,19 @@ +within BobLib.DriverEnvironments.Interfaces; +expandable connector DriverBus + + "Typed DriverBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.DriverBus; + + Real acceleratorPedalPosition(unit = "1") "Driver environment: normalized accelerator position, zero to one"; + Real brakePedalPosition(unit = "1") "Driver environment: normalized brake position, zero to one"; + SI.Angle steeringWheelAngle "Driver environment: signed handwheel angle"; + Integer gearboxMode "Automatic driver environment: mode encoded using VI gearbox conventions"; + Integer ignition "Automatic driver environment: ignition state encoded using VI conventions"; + Integer requestedGear "Automatic driver environment: requested gear; interpreted according to gearbox mode"; + Boolean inverterEnable "EV driver environment or experiment: inverter enable request"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end DriverBus; diff --git a/BobLib/DriverEnvironments/Interfaces/package.mo b/BobLib/DriverEnvironments/Interfaces/package.mo new file mode 100644 index 0000000..f0bdb3f --- /dev/null +++ b/BobLib/DriverEnvironments/Interfaces/package.mo @@ -0,0 +1,6 @@ +within BobLib.DriverEnvironments; +package Interfaces "Driver environment contracts" + + extends Modelica.Icons.InterfacesPackage; + annotation(Icon(graphics = {Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.None)})); +end Interfaces; diff --git a/BobLib/DriverEnvironments/Interfaces/package.order b/BobLib/DriverEnvironments/Interfaces/package.order new file mode 100644 index 0000000..edf12e6 --- /dev/null +++ b/BobLib/DriverEnvironments/Interfaces/package.order @@ -0,0 +1 @@ +DriverBus diff --git a/BobLib/DriverEnvironments/package.order b/BobLib/DriverEnvironments/package.order index cc2633e..4eb93e3 100644 --- a/BobLib/DriverEnvironments/package.order +++ b/BobLib/DriverEnvironments/package.order @@ -1,3 +1,4 @@ +Interfaces AutomaticDriveByWire EVDriveByWire Internal diff --git a/BobLib/ElectricDrives/Interfaces/ElectricMotorBus.mo b/BobLib/ElectricDrives/Interfaces/ElectricMotorBus.mo new file mode 100644 index 0000000..70075c7 --- /dev/null +++ b/BobLib/ElectricDrives/Interfaces/ElectricMotorBus.mo @@ -0,0 +1,17 @@ +within BobLib.ElectricDrives.Interfaces; +expandable connector ElectricMotorBus + + "Typed ElectricMotorBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.ElectricMotorBus; + + SI.AngularVelocity speed "Motor: signed shaft speed"; + SI.Power electricalPower "Motor: electrical power, positive when motoring"; + SI.Power mechanicalPower "Motor: delivered shaft power, positive when motoring"; + SI.Torque torqueCommand "Motor: internal commanded torque"; + SI.Torque torqueLimit "Motor: active torque limit"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end ElectricMotorBus; diff --git a/BobLib/ElectricDrives/Interfaces/ElectricMotorControlBus.mo b/BobLib/ElectricDrives/Interfaces/ElectricMotorControlBus.mo new file mode 100644 index 0000000..651d043 --- /dev/null +++ b/BobLib/ElectricDrives/Interfaces/ElectricMotorControlBus.mo @@ -0,0 +1,19 @@ +within BobLib.ElectricDrives.Interfaces; +expandable connector ElectricMotorControlBus + + "Typed ElectricMotorControlBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.ElectricMotorControlBus; + + SI.Power availablePower "InverterDC: signed limited allocation consumed by the averaged motor"; + SI.Power powerRequest "VCU: signed requested electrical power sent to inverter"; + SI.Torque limitedTorqueCommand "VCU: limited signed torque command"; + SI.Torque regenTorqueLimit "VCU: regenerative torque limit"; + Boolean vcuActive "VCU: controller active state"; + SI.Torque driverTorqueCommand "EVDriveByWire: driver torque request; not consumed by the default averaged drive"; + SI.Torque driverRegenTorqueLimit "EVDriveByWire: driver regenerative torque limit; not consumed by the default averaged drive"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end ElectricMotorControlBus; diff --git a/BobLib/ElectricDrives/Interfaces/package.mo b/BobLib/ElectricDrives/Interfaces/package.mo new file mode 100644 index 0000000..d4a6d43 --- /dev/null +++ b/BobLib/ElectricDrives/Interfaces/package.mo @@ -0,0 +1,7 @@ +within BobLib.ElectricDrives; +package Interfaces + + "Subsystem contracts and signal buses" + extends Modelica.Icons.InterfacesPackage; + annotation(Icon(graphics = {Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.None)})); +end Interfaces; diff --git a/BobLib/ElectricDrives/Interfaces/package.order b/BobLib/ElectricDrives/Interfaces/package.order new file mode 100644 index 0000000..cf1b70b --- /dev/null +++ b/BobLib/ElectricDrives/Interfaces/package.order @@ -0,0 +1,2 @@ +ElectricMotorBus +ElectricMotorControlBus diff --git a/BobLib/ElectricDrives/package.order b/BobLib/ElectricDrives/package.order index b05bb1a..0679f0d 100644 --- a/BobLib/ElectricDrives/package.order +++ b/BobLib/ElectricDrives/package.order @@ -1,2 +1,3 @@ +Interfaces Motor Internal diff --git a/BobLib/EnergyStorage/Interfaces/BatteryBus.mo b/BobLib/EnergyStorage/Interfaces/BatteryBus.mo new file mode 100644 index 0000000..8016516 --- /dev/null +++ b/BobLib/EnergyStorage/Interfaces/BatteryBus.mo @@ -0,0 +1,17 @@ +within BobLib.EnergyStorage.Interfaces; +expandable connector BatteryBus + + "Typed BatteryBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.BatteryBus; + + SI.Current current "BatteryPack: discharge-positive terminal current"; + SI.Power power "BatteryPack: discharge-positive terminal power"; + Real soc(unit = "1") "BatteryPack: state of charge as a fraction"; + Real soe(unit = "1") "BatteryPack: state of energy as a fraction"; + SI.Voltage voltage "BatteryPack: positive-to-negative terminal voltage"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end BatteryBus; diff --git a/BobLib/EnergyStorage/Interfaces/package.mo b/BobLib/EnergyStorage/Interfaces/package.mo new file mode 100644 index 0000000..c74e243 --- /dev/null +++ b/BobLib/EnergyStorage/Interfaces/package.mo @@ -0,0 +1,7 @@ +within BobLib.EnergyStorage; +package Interfaces + + "Subsystem contracts and signal buses" + extends Modelica.Icons.InterfacesPackage; + annotation(Icon(graphics = {Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.None)})); +end Interfaces; diff --git a/BobLib/EnergyStorage/Interfaces/package.order b/BobLib/EnergyStorage/Interfaces/package.order new file mode 100644 index 0000000..e451d49 --- /dev/null +++ b/BobLib/EnergyStorage/Interfaces/package.order @@ -0,0 +1 @@ +BatteryBus diff --git a/BobLib/EnergyStorage/package.order b/BobLib/EnergyStorage/package.order index b2d2561..660f839 100644 --- a/BobLib/EnergyStorage/package.order +++ b/BobLib/EnergyStorage/package.order @@ -1,2 +1,3 @@ +Interfaces BatteryPack Internal diff --git a/BobLib/Engines/Interfaces/EngineBus.mo b/BobLib/Engines/Interfaces/EngineBus.mo new file mode 100644 index 0000000..1bb64de --- /dev/null +++ b/BobLib/Engines/Interfaces/EngineBus.mo @@ -0,0 +1,13 @@ +within BobLib.Engines.Interfaces; +expandable connector EngineBus + + "Typed EngineBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.EngineBus; + + SI.AngularVelocity speed "SimpleICEngine: engine shaft speed"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end EngineBus; diff --git a/BobLib/Engines/Interfaces/package.mo b/BobLib/Engines/Interfaces/package.mo new file mode 100644 index 0000000..5e0c438 --- /dev/null +++ b/BobLib/Engines/Interfaces/package.mo @@ -0,0 +1,7 @@ +within BobLib.Engines; +package Interfaces + + "Subsystem contracts and signal buses" + extends Modelica.Icons.InterfacesPackage; + annotation(Icon(graphics = {Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.None)})); +end Interfaces; diff --git a/BobLib/Engines/Interfaces/package.order b/BobLib/Engines/Interfaces/package.order new file mode 100644 index 0000000..c8eb08c --- /dev/null +++ b/BobLib/Engines/Interfaces/package.order @@ -0,0 +1 @@ +EngineBus diff --git a/BobLib/Engines/package.order b/BobLib/Engines/package.order index adb8feb..5f06513 100644 --- a/BobLib/Engines/package.order +++ b/BobLib/Engines/package.order @@ -1,2 +1,3 @@ +Interfaces SimpleICEngine Internal diff --git a/BobLib/Transmissions/Interfaces/TransmissionBus.mo b/BobLib/Transmissions/Interfaces/TransmissionBus.mo new file mode 100644 index 0000000..1eec5b1 --- /dev/null +++ b/BobLib/Transmissions/Interfaces/TransmissionBus.mo @@ -0,0 +1,13 @@ +within BobLib.Transmissions.Interfaces; +expandable connector TransmissionBus + + "Typed TransmissionBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.TransmissionBus; + + SI.AngularVelocity outputSpeed "FixedRatioTransmission: output shaft speed"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end TransmissionBus; diff --git a/BobLib/Transmissions/Interfaces/TransmissionControlBus.mo b/BobLib/Transmissions/Interfaces/TransmissionControlBus.mo new file mode 100644 index 0000000..b612575 --- /dev/null +++ b/BobLib/Transmissions/Interfaces/TransmissionControlBus.mo @@ -0,0 +1,13 @@ +within BobLib.Transmissions.Interfaces; +expandable connector TransmissionControlBus + + "Typed TransmissionControlBus contract for BobLib subsystem signals" + + import Modelica.Units.SI; + + extends VehicleInterfaces.Interfaces.TransmissionControlBus; + + Integer currentGear "FixedRatioTransmission: engaged gear, always one"; + + annotation(Documentation(info = "

Actual expandable subsystem bus. Declare every new BobLib signal here with its type, units and description before connecting it. Connections select the members present in an architecture; each signal has one publisher. Corner numbers are 1 front-left, 2 front-right, 3 rear-left, 4 rear-right. Compatible with the corresponding empty VehicleInterfaces bus.

")); +end TransmissionControlBus; diff --git a/BobLib/Transmissions/Interfaces/package.mo b/BobLib/Transmissions/Interfaces/package.mo new file mode 100644 index 0000000..1f3dcb3 --- /dev/null +++ b/BobLib/Transmissions/Interfaces/package.mo @@ -0,0 +1,7 @@ +within BobLib.Transmissions; +package Interfaces + + "Subsystem contracts and signal buses" + extends Modelica.Icons.InterfacesPackage; + annotation(Icon(graphics = {Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.None)})); +end Interfaces; diff --git a/BobLib/Transmissions/Interfaces/package.order b/BobLib/Transmissions/Interfaces/package.order new file mode 100644 index 0000000..e76e58c --- /dev/null +++ b/BobLib/Transmissions/Interfaces/package.order @@ -0,0 +1,2 @@ +TransmissionBus +TransmissionControlBus diff --git a/BobLib/Transmissions/package.order b/BobLib/Transmissions/package.order index e46697b..2d13be9 100644 --- a/BobLib/Transmissions/package.order +++ b/BobLib/Transmissions/package.order @@ -1,2 +1,3 @@ +Interfaces FixedRatioTransmission Internal diff --git a/BobLib/Utilities/Interfaces/ControlBus.mo b/BobLib/Utilities/Interfaces/ControlBus.mo new file mode 100644 index 0000000..6cc155b --- /dev/null +++ b/BobLib/Utilities/Interfaces/ControlBus.mo @@ -0,0 +1,20 @@ +within BobLib.Utilities.Interfaces; +expandable connector ControlBus "Typed vehicle control bus with subsystem-owned contracts" + + extends Modelica.Icons.SignalBus; + + BobLib.EnergyStorage.Interfaces.BatteryBus batteryBus "Battery bus" annotation(Dialog(enable = false)); + BobLib.Brakes.Interfaces.BrakesBus brakesBus "Brakes bus" annotation(Dialog(enable = false)); + BobLib.Brakes.Interfaces.BrakesControlBus brakesControlBus "Brakes control bus" annotation(Dialog(enable = false)); + BobLib.Chassis.Interfaces.ChassisBus chassisBus "Chassis bus" annotation(Dialog(enable = false)); + BobLib.Drivelines.Interfaces.DrivelineBus drivelineBus "Driveline bus" annotation(Dialog(enable = false)); + BobLib.Drivelines.Interfaces.DrivelineControlBus drivelineControlBus "Driveline control bus" annotation(Dialog(enable = false)); + BobLib.DriverEnvironments.Interfaces.DriverBus driverBus "Driver bus" annotation(Dialog(enable = false)); + BobLib.ElectricDrives.Interfaces.ElectricMotorBus electricMotorBus "Electric motor bus" annotation(Dialog(enable = false)); + BobLib.ElectricDrives.Interfaces.ElectricMotorControlBus electricMotorControlBus "Electric motor control bus" annotation(Dialog(enable = false)); + BobLib.Engines.Interfaces.EngineBus engineBus "Engine bus" annotation(Dialog(enable = false)); + BobLib.Transmissions.Interfaces.TransmissionBus transmissionBus "Transmission bus" annotation(Dialog(enable = false)); + BobLib.Transmissions.Interfaces.TransmissionControlBus transmissionControlBus "Transmission control bus" annotation(Dialog(enable = false)); + + annotation(Documentation(info = "

Uses the VehicleInterfaces control-bus member names with BobLib typed subsystem contracts. Only implemented subsystem buses are included; every member uses a BobLib-owned contract. Used by all BobLib subsystem interfaces; can also connect to upstream VI control buses. Chassis axle measurements are flat for OpenModelica compatibility.

")); +end ControlBus; diff --git a/BobLib/Utilities/Interfaces/package.mo b/BobLib/Utilities/Interfaces/package.mo new file mode 100644 index 0000000..48916fb --- /dev/null +++ b/BobLib/Utilities/Interfaces/package.mo @@ -0,0 +1,6 @@ +within BobLib.Utilities; +package Interfaces "Shared signal interfaces" + + extends Modelica.Icons.InterfacesPackage; + annotation(Icon(graphics = {Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.None)})); +end Interfaces; diff --git a/BobLib/Utilities/Interfaces/package.order b/BobLib/Utilities/Interfaces/package.order new file mode 100644 index 0000000..14bdfca --- /dev/null +++ b/BobLib/Utilities/Interfaces/package.order @@ -0,0 +1 @@ +ControlBus diff --git a/BobLib/Utilities/package.order b/BobLib/Utilities/package.order index 9e28cec..07bea9b 100644 --- a/BobLib/Utilities/package.order +++ b/BobLib/Utilities/package.order @@ -1,3 +1,4 @@ +Interfaces Math Mechanics FMI diff --git a/BobLib/package.order b/BobLib/package.order index bf6aeeb..dd32912 100644 --- a/BobLib/package.order +++ b/BobLib/package.order @@ -2,6 +2,7 @@ UsersGuide Experiments Aero Atmospheres +Brakes Chassis Controllers Drivelines