ABSAssembly Icon
Examples.ABSAssembly
ABSAssembly(; name, mass, g_acc, R, v0, target_slip, dt_sample)Anti-lock Braking System assembly with discrete-time controller and continuous vehicle dynamics.
Parameters
mass: Vehicle mass in kg (default: 75)g_acc: Gravitational acceleration in m/s² (default: 9.81)R: Wheel radius in m (default: 1.25)v0: Initial velocity in m/s (default: 70)target_slip: Target wheel slip ratio (default: 0.2)dt_sample: Controller sampling period in s (default: 0.1)
Connectors
TrueOmega: Actual wheel angular velocity outputNoSlipOmega: Theoretical no-slip angular velocity output
Description
Complete ABS system combining:
- Continuous vehicle dynamics with friction and wheel slip
- Discrete-time bang-bang controller (sampled at dt_sample)
- Hydraulic actuator for brake torque generation
- Slip error feedback control targeting optimal slip ratio
The controller samples the slip error at regular intervals, applies bang-bang control logic, and outputs a held control signal to the hydraulic actuator.
Usage
PrimitiveComponents.Examples.ABSAssembly(mass=75, g_acc=9.81, R=1.25, v0=70, target_slip=0.2, dt_sample=0.1)
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
mass | kg | 75 | |
g_acc | m/s2 | 9.81 | |
R | m | 1.25 | |
v0 | m/s | 70 | |
target_slip | – | 0.2 | |
dt_sample | – | 0.1 |
Connectors
TrueOmega- This connector represents a real signal as an output from a component (RealOutput)NoSlipOmega- This connector represents a real signal as an output from a component (RealOutput)
Behavior
Behavior of this component cannot be rendered because it includes path variables.
Source
"""
ABSAssembly(; name, mass, g_acc, R, v0, target_slip, dt_sample)
Anti-lock Braking System assembly with discrete-time controller and continuous vehicle dynamics.
# Parameters
- `mass`: Vehicle mass in kg (default: 75)
- `g_acc`: Gravitational acceleration in m/s² (default: 9.81)
- `R`: Wheel radius in m (default: 1.25)
- `v0`: Initial velocity in m/s (default: 70)
- `target_slip`: Target wheel slip ratio (default: 0.2)
- `dt_sample`: Controller sampling period in s (default: 0.1)
# Connectors
- `TrueOmega`: Actual wheel angular velocity output
- `NoSlipOmega`: Theoretical no-slip angular velocity output
# Description
Complete ABS system combining:
- Continuous vehicle dynamics with friction and wheel slip
- Discrete-time bang-bang controller (sampled at dt_sample)
- Hydraulic actuator for brake torque generation
- Slip error feedback control targeting optimal slip ratio
The controller samples the slip error at regular intervals, applies
bang-bang control logic, and outputs a held control signal to the
hydraulic actuator.
"""
component ABSAssembly
TrueOmega = Dyad.RealOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 690, "y1": 250, "x2": 750, "y2": 310, "rot": 0}
},
"tags": []
}
}
NoSlipOmega = Dyad.RealOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 690, "y1": 380, "x2": 750, "y2": 440, "rot": 0}
},
"tags": []
}
}
vehicle = PrimitiveComponents.Examples.VehicleDynamics(mass = 75, g_acc = 9.81, R = 1.25, v0 = 70) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 400, "y1": 260, "x2": 570, "y2": 430, "rot": 0}
},
"tags": []
}
}
wheel_slip_des = BlockComponents.Constant(k = target_slip) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 426, "y1": 20, "x2": 526, "y2": 120, "rot": 0}
},
"tags": []
}
}
sub1 = BlockComponents.Add(k1 = 1, k2 = -1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 640, "y1": 50, "x2": 740, "y2": 150, "rot": 0}
},
"tags": []
}
}
sampler = PrimitiveComponents.DiscretePrimitives.Sampler() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 820, "y1": 50, "x2": 920, "y2": 150, "rot": 0}
},
"tags": []
}
}
binaryC = PrimitiveComponents.Examples.BinaryController() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 31, "y1": 227, "x2": 131, "y2": 327, "rot": 0}
},
"tags": []
}
}
periodicclock = PrimitiveComponents.DiscretePrimitives.PeriodicClock(dt = 0.1, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 250, "y1": 160, "x2": 330, "y2": 240, "rot": 0}
},
"tags": []
}
}
zeroorderhold = PrimitiveComponents.DiscretePrimitives.ZeroOrderHold(initial_condition = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 170, "y1": 390, "x2": 270, "y2": 490, "rot": 0}
},
"tags": []
}
}
hydraulicactuator = PrimitiveComponents.Examples.HydraulicActuator() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 286, "y1": 415, "x2": 386, "y2": 515, "rot": 0}
},
"tags": []
}
}
parameter mass::Mass = 75
parameter g_acc::Acceleration = 9.81
parameter R::Length = 1.25
parameter v0::Velocity = 70
parameter target_slip::Real = 0.2
parameter dt_sample::Real = 0.1
relations
initial hydraulicactuator.y = 0.0
connect(wheel_slip_des.y, sub1.u1) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
connect(sub1.y, sampler.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
connect(sampler.y, binaryC.u) {
"Dyad": {
"edges": [
{
"S": 1,
"M": [
{"x": 960, "y": 100},
{"x": 960, "y": 565},
{"x": 20, "y": 565},
{"x": 20, "y": 277}
],
"E": 2
}
],
"renderStyle": "standard"
}
}
connect(binaryC.y, zeroorderhold.u) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 150, "y": 277}, {"x": 150, "y": 440}], "E": 2}],
"renderStyle": "standard"
}
}
connect(periodicclock.y, binaryC.y) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 147, "y": 200}, {"x": 147, "y": 277}], "E": 2}],
"renderStyle": "standard"
}
}
connect(zeroorderhold.y, hydraulicactuator.u) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 268, "y": 440}, {"x": 268, "y": 442}], "E": 2}],
"renderStyle": "standard"
}
}
connect(hydraulicactuator.y, vehicle.brake_torque) {
"Dyad": {
"renderStyle": "standard",
"edges": [{"S": 1, "M": [{"x": 348, "y": 345}], "E": 2}]
}
}
connect(vehicle.TrueOmega, TrueOmega) {
"Dyad": {
"renderStyle": "standard",
"edges": [{"S": 1, "M": [{"x": 720, "y": 280.4}], "E": 2}]
}
}
connect(vehicle.wheel_slip, sub1.u2) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 610, "y": 345}, {"x": 610, "y": 130}], "E": 2}],
"renderStyle": "standard"
}
}
connect(vehicle.NoSlipOmega, NoSlipOmega) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 720, "y": 406.2}], "E": 2}],
"renderStyle": "standard"
}
}
metadata {"Dyad": {"doc": {"behavior": false}}}
end
Flattened Source
"""
ABSAssembly(; name, mass, g_acc, R, v0, target_slip, dt_sample)
Anti-lock Braking System assembly with discrete-time controller and continuous vehicle dynamics.
# Parameters
- `mass`: Vehicle mass in kg (default: 75)
- `g_acc`: Gravitational acceleration in m/s² (default: 9.81)
- `R`: Wheel radius in m (default: 1.25)
- `v0`: Initial velocity in m/s (default: 70)
- `target_slip`: Target wheel slip ratio (default: 0.2)
- `dt_sample`: Controller sampling period in s (default: 0.1)
# Connectors
- `TrueOmega`: Actual wheel angular velocity output
- `NoSlipOmega`: Theoretical no-slip angular velocity output
# Description
Complete ABS system combining:
- Continuous vehicle dynamics with friction and wheel slip
- Discrete-time bang-bang controller (sampled at dt_sample)
- Hydraulic actuator for brake torque generation
- Slip error feedback control targeting optimal slip ratio
The controller samples the slip error at regular intervals, applies
bang-bang control logic, and outputs a held control signal to the
hydraulic actuator.
"""
component ABSAssembly
TrueOmega = Dyad.RealOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 690, "y1": 250, "x2": 750, "y2": 310, "rot": 0}
},
"tags": []
}
}
NoSlipOmega = Dyad.RealOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 690, "y1": 380, "x2": 750, "y2": 440, "rot": 0}
},
"tags": []
}
}
vehicle = PrimitiveComponents.Examples.VehicleDynamics(mass = 75, g_acc = 9.81, R = 1.25, v0 = 70) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 400, "y1": 260, "x2": 570, "y2": 430, "rot": 0}
},
"tags": []
}
}
wheel_slip_des = BlockComponents.Constant(k = target_slip) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 426, "y1": 20, "x2": 526, "y2": 120, "rot": 0}
},
"tags": []
}
}
sub1 = BlockComponents.Add(k1 = 1, k2 = -1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 640, "y1": 50, "x2": 740, "y2": 150, "rot": 0}
},
"tags": []
}
}
sampler = PrimitiveComponents.DiscretePrimitives.Sampler() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 820, "y1": 50, "x2": 920, "y2": 150, "rot": 0}
},
"tags": []
}
}
binaryC = PrimitiveComponents.Examples.BinaryController() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 31, "y1": 227, "x2": 131, "y2": 327, "rot": 0}
},
"tags": []
}
}
periodicclock = PrimitiveComponents.DiscretePrimitives.PeriodicClock(dt = 0.1, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 250, "y1": 160, "x2": 330, "y2": 240, "rot": 0}
},
"tags": []
}
}
zeroorderhold = PrimitiveComponents.DiscretePrimitives.ZeroOrderHold(initial_condition = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 170, "y1": 390, "x2": 270, "y2": 490, "rot": 0}
},
"tags": []
}
}
hydraulicactuator = PrimitiveComponents.Examples.HydraulicActuator() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 286, "y1": 415, "x2": 386, "y2": 515, "rot": 0}
},
"tags": []
}
}
parameter mass::Mass = 75
parameter g_acc::Acceleration = 9.81
parameter R::Length = 1.25
parameter v0::Velocity = 70
parameter target_slip::Real = 0.2
parameter dt_sample::Real = 0.1
relations
initial hydraulicactuator.y = 0.0
connect(wheel_slip_des.y, sub1.u1) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
connect(sub1.y, sampler.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
connect(sampler.y, binaryC.u) {
"Dyad": {
"edges": [
{
"S": 1,
"M": [
{"x": 960, "y": 100},
{"x": 960, "y": 565},
{"x": 20, "y": 565},
{"x": 20, "y": 277}
],
"E": 2
}
],
"renderStyle": "standard"
}
}
connect(binaryC.y, zeroorderhold.u) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 150, "y": 277}, {"x": 150, "y": 440}], "E": 2}],
"renderStyle": "standard"
}
}
connect(periodicclock.y, binaryC.y) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 147, "y": 200}, {"x": 147, "y": 277}], "E": 2}],
"renderStyle": "standard"
}
}
connect(zeroorderhold.y, hydraulicactuator.u) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 268, "y": 440}, {"x": 268, "y": 442}], "E": 2}],
"renderStyle": "standard"
}
}
connect(hydraulicactuator.y, vehicle.brake_torque) {
"Dyad": {
"renderStyle": "standard",
"edges": [{"S": 1, "M": [{"x": 348, "y": 345}], "E": 2}]
}
}
connect(vehicle.TrueOmega, TrueOmega) {
"Dyad": {
"renderStyle": "standard",
"edges": [{"S": 1, "M": [{"x": 720, "y": 280.4}], "E": 2}]
}
}
connect(vehicle.wheel_slip, sub1.u2) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 610, "y": 345}, {"x": 610, "y": 130}], "E": 2}],
"renderStyle": "standard"
}
}
connect(vehicle.NoSlipOmega, NoSlipOmega) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 720, "y": 406.2}], "E": 2}],
"renderStyle": "standard"
}
}
metadata {"Dyad": {"doc": {"behavior": false}}}
endTest Cases
No test cases defined.
Related
- Examples
- Experiments
- Analyses