CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

package

Vehicles.Rdd2

RDD2 vehicle configuration and flight-control models

RDD2 multirotor

This package binds reusable dynamics and control to the RDD2 vehicle. RotorGeometry defines the motor order, positions in body FLU and yaw torque signs. Keep that order consistent through allocation and actuator connections.

Start with Test to compare truth, optical-flow-aided and GPS-aided waypoint missions. The alternate LogLinearController parameterizes the shared controller rather than duplicating its mathematics. Use mission sensor configuration, source timestamps and the local origin consistently when changing navigation options.

Members

NameKindDescription
RotorGeometryrecordRDD2 motor locations and reaction-torque directions in command order
RotorVibrationmodelNarrowband rotor unbalance and blade-pass airframe vibration
PlantmodelRDD2 quadrotor with native avionics-facing connectors
ControllerInterfacespackageTyped signal boundaries shared by the RDD2 controller blocks
CommandMappingblockMap pilot input into rate, attitude, and thrust demands
ProportionalControllerblockSampled proportional controller with symmetric output limiting
ScriptedTransmitterblockDeterministic pilot transmitter replayed from a table of channel settings
FlightModeSelectorblockDecode a transmitter mode switch into the RDD2 flight-mode enumeration
ManualTrajectorySourceblockTrajectory reference the pilot pushes along SE_2(3) with the sticks
MixerblockDesaturating X-quadrotor mixer
RateControlAllocatorblockSampled body-rate control and motor allocation task
GuidanceControllerblockPilot, attitude, and position guidance task
ControllerblockComposed RDD2 controller used by simulation and qualification
LogLinearControllerblockRDD2 parameterization of the log-linear controller
NavigationEstimatorblockRDD2 eFMU implementation of the stable navigation estimator boundary
standardNormalNoisefunctionReproducible standard-normal sample from an indexed sine hash
mocapRigToWorldfunctionMap a motion-capture pose from the rig frame into the estimator world frame
simulateOpticalFlowPlanefunctionGenerate raw plane-induced flow for a co-located nadir camera
PartialControllerblockSwappable whole-controller boundary for the RDD2 vehicle
AvionicsSystemblockIdeal RTOS composition of planning and the shared flight controller
ReducedRateControllerblockRDD2 flight controller with a reduced-authority body-rate loop
WaypointVehicleSystemmodelClosed-loop plant and ideal RTOS composition driven by a waypoint plan
TestpackageRDD2 model-level test missions

Modelica declarations and implementation

Show parameters, interfaces and source

Parameters, inputs, outputs, defaults and equations from the source file.

package Rdd2 "RDD2 vehicle configuration and flight-control models"
  record RotorGeometry
    "RDD2 motor locations and reaction-torque directions in command order"
    parameter Real armLength_m(unit = "m") = 0.25 annotation(Evaluate = true);
    Real effectiveMomentArm_m(unit = "m") = armLength_m / sqrt(2.0)
      "Quad-X roll/pitch lever arm";
    parameter Real rotorTorqueRatio_m(unit = "m") = 0.016 annotation(Evaluate = true);
    Real positionBodyFlu_m[4, 3] = [
       effectiveMomentArm_m, -effectiveMomentArm_m, 0.0;
      -effectiveMomentArm_m, -effectiveMomentArm_m, 0.0;
      -effectiveMomentArm_m,  effectiveMomentArm_m, 0.0;
       effectiveMomentArm_m,  effectiveMomentArm_m, 0.0];
    Real yawMomentPerThrust_m[4] =
      rotorTorqueRatio_m * {-1.0, 1.0, -1.0, 1.0};
  end RotorGeometry;
  annotation(Documentation(info = "<html>
    <h4>RDD2 multirotor</h4>
<p>This package binds reusable dynamics and control to the RDD2 vehicle.
<a href=\"modelica://Vehicles.Rdd2.RotorGeometry\">RotorGeometry</a> defines the
motor order, positions in body FLU and yaw torque signs. Keep that order
consistent through allocation and actuator connections.</p>
<p>Start with <a href=\"modelica://Vehicles.Rdd2.Test\">Test</a> to compare truth,
optical-flow-aided and GPS-aided waypoint missions. The alternate
<a href=\"modelica://Vehicles.Rdd2.LogLinearController\">LogLinearController</a>
parameterizes the shared controller rather than duplicating its mathematics.
Use mission sensor configuration, source timestamps and the local origin
consistently when changing navigation options.</p>
    </html>"));
end Rdd2;