modelcontrolModule

Information

This is a discrete PID controller. It has inputs that account for the dictated position of the quadcopter and yaw. It compares the actual XYZ position of the quadcopter to the commanded XYZ position and controls the current applied to each of the motors as a result.

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.TimesamplePeriod0.01
RealmaxTilt2Upper limits of input signals
Yaw PID
RealYaw_ki0I gain for yaw
RealYaw_kd0.08D gain for yaw
RealYaw_kp0.04P gain for yaw
X position PID
Realx_ki0.03I gain for x position
Realx_kd0.1D gain for x position
Realx_kp0.1P gainfor x position
Y position PID
Realy_ki0.03I gain for y position
Realy_kd0.1D gain for y position
Realy_kp0.1P gain for y position
Z position PID
Realz_ki1I gain for z position
Realz_kd2D gain for z position
Realz_kp1.5P gain for z position
Gyroscope PID
Realgyro_x_ki2I gain for gyroscope measurements in the x direction
Realgyro_x_kd1D gain for the gyroscope measurements in the x direction
Realgyro_x_kp1P gain for the gyroscope measurements in the x dire3ction
Realgyro_y_ki2I gain for the gyroscope measurements in the y direction
Realgyro_y_kd1D gain for the gyroscope measurements in the y direction
Realgyro_y_kp1P gain for the gyroscope measurements in the y direction

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealOutputy
Modelica.Blocks.Interfaces.RealOutputy1
Modelica.Blocks.Interfaces.RealOutputy2
Modelica.Blocks.Interfaces.RealOutputy3
Modelica.Blocks.Interfaces.RealInput[3]GPS
Modelica.Blocks.Interfaces.RealInput[3]Gyero
Modelica.Blocks.Interfaces.RealInput[3]position
Modelica.Blocks.Interfaces.RealInputyaw

Components

TypeNameDefaultDescription
DroneLibrary.Blocks.Control.discretePIDdiscretePID
DroneLibrary.Blocks.Routing.RealExtractrealExtract
DroneLibrary.Blocks.Routing.RealExtractrealExtract1
DroneLibrary.Blocks.Routing.RealExtractrealExtract2
DroneLibrary.Blocks.Control.discretePIDdiscretePID1
DroneLibrary.Blocks.Control.discretePIDdiscretePID2
DroneLibrary.Blocks.Routing.RealExtractrealExtract3
DroneLibrary.Blocks.Routing.RealExtractrealExtract4
DroneLibrary.Blocks.Routing.RealExtractrealExtract5
DroneLibrary.Blocks.Control.discretePIDdiscretePID3
Modelica.Blocks.Nonlinear.Limiterlimiter
DroneLibrary.Blocks.Routing.RealExtractrealExtract6
Modelica.Blocks.Nonlinear.Limiterlimiter1
DroneLibrary.Blocks.Control.discretePIDdiscretePID4
DroneLibrary.Blocks.Routing.RealExtractrealExtract7
DroneLibrary.Blocks.Routing.RealExtractrealExtract8
DroneLibrary.Blocks.Control.discretePIDdiscretePID5
Modelica.Blocks.Nonlinear.Limiterlimiter2
Modelica.Blocks.Math.Gaingain
Modelica.Blocks.Math.Add3add3_2
Modelica.Blocks.Sources.RealExpressionrealExpression3
Modelica.Blocks.Sources.RealExpressionrealExpression4
Modelica.Blocks.Sources.RealExpressionrealExpression5
Modelica.Blocks.Math.Add3add3_3
Modelica.Blocks.Sources.RealExpressionrealExpression6
Modelica.Blocks.Sources.RealExpressionrealExpression7
Modelica.Blocks.Sources.RealExpressionrealExpression8
Modelica.Blocks.Math.Add3add3_4
Modelica.Blocks.Sources.RealExpressionrealExpression9
Modelica.Blocks.Sources.RealExpressionrealExpression10
Modelica.Blocks.Sources.RealExpressionrealExpression11
Modelica.Blocks.Math.Add3add3_1
Modelica.Blocks.Sources.RealExpressionrealExpression
Modelica.Blocks.Sources.RealExpressionrealExpression1
Modelica.Blocks.Sources.RealExpressionrealExpression2