LIBRARY
ControlMixer
Static thrust mixer: maps three control channels into four thruster commands using fixed gain vectors. The 3-vector input u_in is interpreted as [u_alt, u_roll, u_pitch]; each thruster command is Galt[i]*u_in[1] + Groll[i]*u_in[2] + Gpitch[i]*u_in[3].
Usage
MultibodyComponents.ControlMixer(Galt=[1, 1, 1, 1], Groll=[1, 0, -1, 0], Gpitch=[0, -1, 0, 1])
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
Galt | Altitude-channel gain for each thruster | – | [1, 1, 1, 1] |
Groll | Roll-channel gain for each thruster | – | [1, 0, -1, 0] |
Gpitch | Pitch-channel gain for each thruster | – | [0, -1, 0, 1] |
Connectors
u_in- This connector represents a real signal as an input to a component (RealInput)u_out- This connector represents a real signal as an output from a component (RealOutput)
Behavior
Source
dyad
"""
Static thrust mixer: maps three control channels into four thruster commands
using fixed gain vectors. The 3-vector input `u_in` is interpreted as
`[u_alt, u_roll, u_pitch]`; each thruster command is
`Galt[i]*u_in[1] + Groll[i]*u_in[2] + Gpitch[i]*u_in[3]`.
"""
component ControlMixer
"Control commands as a 3-vector: [altitude, roll, pitch]. Bundle three scalar PID outputs with a `Mux3` before connecting here."
u_in = [RealInput() for i in 1:3] {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 0, "y1": 450, "x2": 100, "y2": 550, "rot": 0}
},
"tags": []
}
}
"Thrust commands for the four thrusters (in the order expected by RotorCraft.u)"
u_out = [RealOutput() for i in 1:4] {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 900, "y1": 450, "x2": 1000, "y2": 550, "rot": 0}
},
"tags": []
}
}
"Altitude-channel gain for each thruster"
parameter Galt::Real[4] = [1, 1, 1, 1]
"Roll-channel gain for each thruster"
parameter Groll::Real[4] = [1, 0, -1, 0]
"Pitch-channel gain for each thruster"
parameter Gpitch::Real[4] = [0, -1, 0, 1]
relations
for i in 1:4
u_out[i] = Galt[i] * u_in[1] + Groll[i] * u_in[2] + Gpitch[i] * u_in[3]
end
metadata {
"Dyad": {
"icons": {"default": "dyad://MultibodyComponents/ControlMixer.svg"},
"labels": [
{
"label": "$(instance)",
"x": 500,
"y": 150,
"rot": 0,
"attrs": {"font-size": "160"}
}
]
}
}
endFlattened Source
dyad
"""
Static thrust mixer: maps three control channels into four thruster commands
using fixed gain vectors. The 3-vector input `u_in` is interpreted as
`[u_alt, u_roll, u_pitch]`; each thruster command is
`Galt[i]*u_in[1] + Groll[i]*u_in[2] + Gpitch[i]*u_in[3]`.
"""
component ControlMixer
"Control commands as a 3-vector: [altitude, roll, pitch]. Bundle three scalar PID outputs with a `Mux3` before connecting here."
u_in = [RealInput() for i in 1:3] {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 0, "y1": 450, "x2": 100, "y2": 550, "rot": 0}
},
"tags": []
}
}
"Thrust commands for the four thrusters (in the order expected by RotorCraft.u)"
u_out = [RealOutput() for i in 1:4] {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 900, "y1": 450, "x2": 1000, "y2": 550, "rot": 0}
},
"tags": []
}
}
"Altitude-channel gain for each thruster"
parameter Galt::Real[4] = [1, 1, 1, 1]
"Roll-channel gain for each thruster"
parameter Groll::Real[4] = [1, 0, -1, 0]
"Pitch-channel gain for each thruster"
parameter Gpitch::Real[4] = [0, -1, 0, 1]
relations
for i in 1:4
u_out[i] = Galt[i] * u_in[1] + Groll[i] * u_in[2] + Gpitch[i] * u_in[3]
end
metadata {
"Dyad": {
"icons": {"default": "dyad://MultibodyComponents/ControlMixer.svg"},
"labels": [
{
"label": "$(instance)",
"x": 500,
"y": 150,
"rot": 0,
"attrs": {"font-size": "160"}
}
]
}
}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses