1 of 43

Modeling and Control�Of Multirotor Aerial Vehicles

Azarakhsh Keipour

July 2020

AirLab Summer 2020�Virtual Tutorial Week

2 of 43

Contents

  • Introduction
  • Modeling Multirotors
  • Controller Architecture
  • PID Controllers
  • Additional Topics
  • About the Code

2

3 of 43

Contents

  • Introduction
  • Modeling Multirotors
  • Controller Architecture
  • PID Controllers
  • Additional Topics
  • About the Code

3

4 of 43

What is Control?

  • Control is an (often unsuccessful) attempt to make the robot do what we want!
  • Controller is the magic box that can make the robot fly.
  • This is how the robot goes from a desire to action.
  • From Wikipedia: The objective is to develop a control model for controlling systems using a control action [...] and ensuring control stability

4

5 of 43

Multirotor Flight Stack Overview

5

Computer / RC

Controller

Perception

Environment

6 of 43

Isn’t It a Solved Problem?

  • For many applications yes!
    • Most UAVs come with a “decent” controller
    • But for better performance you need to tune it!

  • And we need to expand the UAV applications. We need UAVs:
    • To be more agile (e.g., to fly faster among obstacles)
    • To carry cargo for us
    • To be able to physically interact with the environment
    • To have new designs for new applications (e.g., taxi UAVs)

6

7 of 43

Some Examples

7

8 of 43

Some More Examples

8

9 of 43

Contents

  • Introduction
  • Modeling Multirotors
  • Controller Architecture
  • PID Controllers
  • Additional Topics
  • About the Code

9

10 of 43

So Many Quadrotors!

10

11 of 43

And So Many Other Multirotors!

11

12 of 43

What is Modeling?

  • A mathematical estimation of the robot’s motion:
    • Kinematics: Modeling the motion without the forces
      • Example: If the robot moves, its rotors move
    • Dynamics: Modeling the motion caused by forces
      • Example: If rotors generate force, the robot accelerates

12

13 of 43

Why Modeling?

  • We need to formalize the behaviour of the system:
    • So we can control it,
    • We can estimate its operational limits,
    • We can improve the multirotor’s design,
    • And we can understand the problems

13

14 of 43

Multirotor Models

  • A perfect model does not exist!
  • The simplest model is to assume the robot is a point mass:
    • Too general, cannot deal with the rotations
  • Can be modeled as a second-order system:
    • Can be close within some operation region
  • Can become extremely complex:
    • Adding drag and many other low order effects

14

15 of 43

System Identification

  • Trying to estimate the mathematical model from the data
    • Input commands and output of the system
  • Still needs an initial guess about the model to estimate
  • To collect data you need to fly the UAV
    • Requires a well-enough modeled system already

15

16 of 43

Why so Many Different Models?

  • Multirotor dynamics is very nonlinear and complex
  • Each application uses a model that:
    • Is the simplest for the purpose,
    • Is based on the available/required variables,
      • E.g., roll/pitch/yaw vs. quaternions
    • Captures the operation region in that application,
    • And can be combined with their controller

16

17 of 43

Kinematics Example

  • Define coordinate frames:
    • Inertial (NED, ENU), body-fixed (FRD), rotors, etc.
  • Define the relations between frames
    • For example, given roll (𝜑), pitch (𝜃) and yaw (𝜓):

  • Define any other required conversions:
    • E.g., Roll and pitch derivatives to angular velocity

17

18 of 43

Dynamics Example

  • Decide on the formalism:
    • Example: Newton-Euler

  • Find the forces (gravity, generated by rotors, etc.)
  • Find the moments (rotor’s reaction torques, from rotor’s thrust, gravity, etc.)

18

19 of 43

Are We Done?

  • No!
  • You may also model the motors to control them
  • There are many other effects that can be modeled
    • But makes the model more complex
  • There are limits that we need to define:
    • Maximum of speed, tilt, acceleration, etc
    • Limits are also depend on the purpose for modeling

19

20 of 43

Contents

  • Introduction
  • Modeling Multirotors
  • Controller Architecture
  • PID Controllers
  • Additional Topics
  • About the Code

20

21 of 43

What is the Multirotor Controller?

  • It is a magical box:
    • Receives the current and the desired states of the robot
    • Calculates the motor commands to achieve the desired state

21

Multirotor Controller

Motor Commands

Desired State

Current State

22 of 43

Multirotor Controller Components

  • Trajectory Controller (to follow a desired trajectory)
  • Position Controller (to reach the desired position)
  • Attitude Controller (to reach the desired attitude)
  • Rate Controller (to reach the desired angular rates)
  • Control Allocation (converts forces and moments to motor commands)
  • Velocity, Acceleration, Motor Controllers, etc.

22

23 of 43

Multirotor Controller Components

  • Not every architecture has all of the mentioned components
  • Some may have more components
  • Or many or all components can be summed into one:
    • E.g., end-to-end reinforcement learning
    • However, in practice, nested loops make life simpler

23

24 of 43

Example Controller Architecture: PX4

24

25 of 43

Control Method Classifications

  • Open-loop Controller / Feedback Controller
  • Linear Controller / Nonlinear Controller
  • Adaptive Control / Optimal Control / Robust Control / etc.
  • Univariable Controller / Multivariable Controller
  • Geometric Control

25

26 of 43

Choosing a Control Method

  • The type of the controlled system
  • What are the objectives:
    • Optimality, execution speed, adaptivity, simplicity?
  • What is the role of the controller in overall architecture?
    • Can it rely on other controllers to fix errors?
  • What is the loop rate?
  • What are and how important are the limits?

26

27 of 43

Common Control Methods in UAVs

  • Open-loop Controller
  • Proportional–Integral–Derivative (PID) Controller
  • Linear–Quadratic Regulator (LQR)
  • H-infinity Methods
  • Feedback Linearization
  • Geometric Controller
  • Backstepping
  • Learning

27

28 of 43

PX4 Components: Control Allocation

  • Called mixer in PX4
  • Is usually open-loop
    • Or can be just a function
  • Calculates the PWM commands or rotor speeds. Inputs:
    • Linear and angular accelerations (forces and moments)
      • Expressed in body-fixed or inertial frame
  • Common types:
    • Control allocation matrix / Dynamic inversion

28

29 of 43

PX4 Components: Rate Controller

  • Angular rate controller
  • Inputs:
    • Current angular velocity
    • Desired angular velocity
  • Usually a simple PID controller
  • In most systems considered a part of the attitude controller
  • Requires a high-rate feedback loop ( > 500 Hz )

29

30 of 43

PX4 Components: Attitude Controller

  • Controls attitude:
    • Roll/pitch/yaw
    • Rotation matrix
    • Quaternion
  • Common types:
    • PID (PD), Geometric, System Identification, Backstepping
  • Requires a high-rate feedback loop ( > 300 Hz)

30

31 of 43

PX4 Components: Position Controller

  • Controls position
  • Outputs:
    • Desired attitude
    • Acceleration (Forces)
      • Can be expressed in body-fixed or inertial frame
  • Common control type: PID (P)
  • Usually requires a lower loop rate (50-300 Hz):
    • Can be moved to the onboard computer

31

32 of 43

Trajectory Controller

  • Controls the UAV to follow a given trajectory
    • Input is the current state of the robot
    • Outputs the position and yaw to the position controller
  • Can be just a loop monitoring if UAV is at the next waypoint
  • Usually there is an objective to achieve:
    • Optimizing time, minimizing the tracking error, etc.
  • Normally requires a low loop rate
    • Almost always in on the onboard or the ground computer

32

33 of 43

Contents

  • Introduction
  • Modeling Multirotors
  • Controller Architecture
  • PID Controllers
  • Additional Topics
  • About the Code

33

34 of 43

PID Controllers

  • Is the most common type of controller
  • Has three parameters:
    • Proportional Gain (KP), Integral Gain (KI), Derivative Gain (KD)
      • Either KI or KD or both can be zero (PD, PI, P)
  • Output can be interpreted as input’s first or second derivative
  • Linear method but works for some non-linear systems
  • In its purest form does not respect any physical limits

34

35 of 43

PID Controllers

35

36 of 43

PID Controllers: Considerations

  • The output signal is unbounded:
    • Should add a maximum limit to bound it
  • Some other limits are not considered:
    • E.g., if output is the second derivative, limit the first derivative
  • Integrator windup should be handled
  • The system is nonlinear:
    • Gain tuning can have unexpected results
  • Tuning one module depends on other modules as well

36

37 of 43

Contents

  • Introduction
  • Modeling Multirotors
  • Controller Architecture
  • PID Controllers
  • Additional Topics
  • About the Code

37

38 of 43

Underactuated vs. Fully-Actuated UAVs

  • Common multirotors are underactuated:
    • Flying in 6-D space with only 4 degrees-of-freedom
    • Have to tilt to generate horizontal acceleration
    • Not suitable for all applications
  • We can make structural changes to achieve full actuation:
    • Modifying the available underactuated structures (e.g., tilting rotors)
    • Designing new vehicle types from scratch

38

39 of 43

Some Fully-Actuated UAVs

39

40 of 43

Fully-Actuated UAVs

  • Cons:
    • Require at least 6 actuators (rotors, servos, etc.)
    • Lose some energy efficiency compared to underactuated
    • Require new controller designs to benefit from full actuation
  • Pros:
    • Eliminates the need for a gimbal in cinematography
    • Eliminates the need for an multi-DoF arm for physical interaction
    • Has a higher-rate control over end-effector’s pose
    • Allows many new applications for the UAV

40

41 of 43

Contents

  • Introduction
  • Modeling Multirotors
  • Controller Architecture
  • PID Controllers
  • Additional Topics
  • About the Code

41

42 of 43

The Code

  • https://bitbucket.org/castacks/multirotor_control_tutorial
  • Runs on MATLAB R2019b
  • Three tasks:
    • Task 1: Tune the PID for

Attitude Controller

    • Task 2: Calculate the acceleration and

Attitude outputs for Position Controller

    • Task 3: Explore the concept of the fully-actuated robots

42

43 of 43

Thank You!