SlideShare a Scribd company logo
1 of 43
Download to read offline
QUADCOPTER
FLIGHT CONTROLLER
building & programming a
from scratch
I’m Ryan Boland

Web Developer

@ Tanooki Labs
@bolandrm (github, twitter)
1. Components
2. Quadcopter Physics
3. The Flight Loop
FRAME
Electronic Speed Controllers (ESCs)
& Motors
Lithium Polymer (LiPo) Battery
Remote Control Transmitter & Receiver
Flight Controller
Microprocessor &
Inertial measurement Unit (IMU)
My Project - Custom Flight Controller
Arduino Mega 2560
& Prototyping Shield
8-bit AVR
16 MHz clock
256K Flash
8K Ram
Arduino Nano Clone
8-bit AVR
16 MHz clock
32K Flash
2K Ram
Teensy 3.1
32-bit ARM
96 MHz clock
256K Flash
64K Ram
$5$55 $20
Custom
PCB
Inertial Measurement Unit
MPU6050 - 3 axis gyroscope, 3 axis accelerometer
HMC5883L - 3 axis magnetometer
BMP180 - Barometer
GY-87
$8
Flight
Configuration: + vs X
Orientation
x axis <-> roll
y axis <-> pitch
z axis <-> yaw
Maneuvering
Stabilization
Rate mode - gyroscopes only
Remote control determines the rate at which the
quadcopter is rotating on any given axis.
Also known as Acro or Manual.
Attitude mode - accelerometers & gyros
Remote control determines the desired angle of the
quadcopter.
Also known as self-level or auto-level.
Wait for data ready interrupt
Read & filter gyroscope data
Read remote control data (user input)
Use PID (proportional, integral, derivative) algorithm
to compute required adjustment for each axis
Map adjustment for each axis to motors (Mixer)
Safety checks
Output to motors
Flight Loop (1000 Hz)
Wait for data ready interrupt
Read & filter gyroscope data
Read remote control data (user input)
Use PID (proportional, integral, derivative) algorithm
to compute required adjustment for each axis
Map adjustment for each axis to motors (Mixer)
Safety checks
Output to motors
Flight Loop (1000 Hz)
Wait for data ready interrupt
Read & filter gyroscope data
Read remote control data (user input)
Use PID (proportional, integral, derivative) algorithm
to compute required adjustment for each axis
Map adjustment for each axis to motors (Mixer)
Safety checks
Output to motors
Flight Loop (1000 Hz)
Gyroscope data
Actual rotational rate in °/sec
Remote control data
Pilot’s desired rotation rate in °/sec
Error
Difference between actual and desired rotational rate
e = gyro_rate - rc_rate
Wait for data ready interrupt
Read & filter gyroscope data
Read remote control data (user input)
Use PID (proportional, integral, derivative) algorithm
to compute required adjustment for each axis
Map adjustment for each axis to motors (Mixer)
Safety checks
Output to motors
Flight Loop (1000 Hz)
3 errors to correct
PID Controllers
(proportional, integral, derivative)
For each axis (yaw, pitch, roll):
PID for dummies:

http://www.csimn.com/CSI_pages/PIDforDummies.html
PID Controllers
(proportional, integral, derivative)
PID for dummies:

http://www.csimn.com/CSI_pages/PIDforDummies.html
Motor Output
Rotational rate (from gyro)
error

e(t)
Pilot

RC

input
3 constants - Kp, Ki, Kd
PID Controllers
(proportional, integral, derivative)
PID for dummies:

http://www.csimn.com/CSI_pages/PIDforDummies.html
Motor Output
Rotational rate (from gyro)
error

e(t)
Pilot
RC
input
3 constants - Kp, Ki, Kd
PID Controllers
(proportional, integral, derivative)
PID for dummies:

http://www.csimn.com/CSI_pages/PIDforDummies.html
Motor Output
Rotational rate (from gyro)
error
e(t)
Pilot

RC

input
3 constants - Kp, Ki, Kd
PID Controllers
(proportional, integral, derivative)
PID for dummies:

http://www.csimn.com/CSI_pages/PIDforDummies.html
Motor Output
Rotational rate (from gyro)
error

e(t)
Pilot

RC

input
3 constants - Kp, Ki, Kd
PID Controllers
(proportional, integral, derivative)
PID for dummies:

http://www.csimn.com/CSI_pages/PIDforDummies.html
Motor Output
Rotational rate (from gyro)
error

e(t)
Pilot

RC

input
3 constants - Kp, Ki, Kd
PID Controllers
(proportional, integral, derivative)
PID for dummies:

http://www.csimn.com/CSI_pages/PIDforDummies.html
Motor Output
Rotational rate (from gyro)
error

e(t)
Pilot

RC

input
3 constants - Kp, Ki, Kd
PID Controllers
(proportional, integral, derivative)
PID for dummies:

http://www.csimn.com/CSI_pages/PIDforDummies.html
Motor Output
Rotational rate (from gyro)
error

e(t)
Pilot

RC

input
3 constants - Kp, Ki, Kd
Wait for data ready interrupt
Read & filter gyroscope data
Read remote control data (user input)
Use PID (proportional, integral, derivative) algorithm
to compute required adjustment for each axis
Map adjustment for each axis to motors (Mixer)
Safety checks
Output to motors
Flight Loop (1000 Hz)
Maneuvering
Flight Controller Code
motor1 = rc_throttle - roll_adjust - pitch_adjust - yaw_adjust;
motor2 = rc_throttle + roll_adjust + pitch_adjust - yaw_adjust;
motor3 = rc_throttle - roll_adjust + pitch_adjust + yaw_adjust;
motor4 = rc_throttle + roll_adjust - pitch_adjust + yaw_adjust;
correcting roll, pitch, yaw
Flight Controller Code
motor1 = rc_throttle - roll_adjust - pitch_adjust - yaw_adjust;
motor2 = rc_throttle + roll_adjust + pitch_adjust - yaw_adjust;
motor3 = rc_throttle - roll_adjust + pitch_adjust + yaw_adjust;
motor4 = rc_throttle + roll_adjust - pitch_adjust + yaw_adjust;
correcting roll, pitch, yaw
Flight Controller Code
motor1 = rc_throttle - roll_adjust - pitch_adjust - yaw_adjust;
motor2 = rc_throttle + roll_adjust + pitch_adjust - yaw_adjust;
motor3 = rc_throttle - roll_adjust + pitch_adjust + yaw_adjust;
motor4 = rc_throttle + roll_adjust - pitch_adjust + yaw_adjust;
correcting roll, pitch, yaw
Flight Controller Code
motor1 = rc_throttle - roll_adjust - pitch_adjust - yaw_adjust;
motor2 = rc_throttle + roll_adjust + pitch_adjust - yaw_adjust;
motor3 = rc_throttle - roll_adjust + pitch_adjust + yaw_adjust;
motor4 = rc_throttle + roll_adjust - pitch_adjust + yaw_adjust;
correcting roll, pitch, yaw
Wait for data ready interrupt
Read & filter gyroscope data
Read remote control data (user input)
Use PID (proportional, integral, derivative) algorithm
to compute required adjustment for each axis
Map adjustment for each axis to motors (Mixer)
Safety checks
Output to motors
Flight Loop (1000 Hz)
Safety & Handling Failure
Stale IMU values

Stale remote control values

Angles too high?

Motor outputs too high? (indoor safe mode)

Watchdog
Wait for data ready interrupt
Read & filter gyroscope data
Read remote control data (user input)
Use PID (proportional, integral, derivative) algorithm
to compute required adjustment for each axis
Map adjustment for each axis to motors (Mixer)
Safety checks
Output to motors
Flight Loop (1000 Hz)
Wait for data ready interrupt
Read & filter gyroscope data
Read remote control data (user input)
Use PID (proportional, integral, derivative) algorithm
to compute required adjustment for each axis
Map adjustment for each axis to motors (Mixer)
Safety checks
Output to motors
Flight Loop (1000 Hz)
Some Takeaways
Be Safe

Start small (mini quad
or balancing robot?)

Break things down
into subcomponents
Thanks!
@bolandrm

More Related Content

What's hot

UAV Building a quadcopter project
UAV Building a quadcopter projectUAV Building a quadcopter project
UAV Building a quadcopter projecthossam gouda
 
Quadcopter Final Report
Quadcopter Final ReportQuadcopter Final Report
Quadcopter Final ReportKevin Osman
 
Modeling and Roll, Pitch and Yaw Simulation of Quadrotor.
Modeling and Roll, Pitch and Yaw Simulation of Quadrotor.Modeling and Roll, Pitch and Yaw Simulation of Quadrotor.
Modeling and Roll, Pitch and Yaw Simulation of Quadrotor.Oka Danil
 
Project seminar quadcopter
Project seminar quadcopterProject seminar quadcopter
Project seminar quadcopterShazaan Sayeed
 
Design and Implementation of a Quadrotor Helicopter
Design and Implementation of a Quadrotor HelicopterDesign and Implementation of a Quadrotor Helicopter
Design and Implementation of a Quadrotor HelicopterHicham Berkouk
 
DREAM QUADCOPTER
DREAM QUADCOPTERDREAM QUADCOPTER
DREAM QUADCOPTERAJILMON
 
Presentation of quadcopter drone
Presentation of quadcopter dronePresentation of quadcopter drone
Presentation of quadcopter droneAshish Patel
 
Fabrication of drone
Fabrication of droneFabrication of drone
Fabrication of droneRajnish Kumar
 
DESIGN AND FABRICATION OF QUADCOPTER
DESIGN AND FABRICATION OF QUADCOPTERDESIGN AND FABRICATION OF QUADCOPTER
DESIGN AND FABRICATION OF QUADCOPTERPrasanna Achanti
 
Drone Building 101
Drone Building 101Drone Building 101
Drone Building 101Aaron Buma
 
Ppt. Micro air vehicel
Ppt. Micro air vehicelPpt. Micro air vehicel
Ppt. Micro air vehicelMukesh kumar
 
Lecture 1: Quadrotor
Lecture 1: QuadrotorLecture 1: Quadrotor
Lecture 1: QuadrotorWong Kiong
 
State space modelling of a quadcopter
State space modelling of a quadcopterState space modelling of a quadcopter
State space modelling of a quadcopterSrinibashSahoo3
 

What's hot (20)

Qaudcopters
QaudcoptersQaudcopters
Qaudcopters
 
Control of a Quadcopter
Control of a QuadcopterControl of a Quadcopter
Control of a Quadcopter
 
quadcopter
quadcopterquadcopter
quadcopter
 
UAV Building a quadcopter project
UAV Building a quadcopter projectUAV Building a quadcopter project
UAV Building a quadcopter project
 
Quadcopter Final Report
Quadcopter Final ReportQuadcopter Final Report
Quadcopter Final Report
 
Quadcopter
QuadcopterQuadcopter
Quadcopter
 
Modeling and Roll, Pitch and Yaw Simulation of Quadrotor.
Modeling and Roll, Pitch and Yaw Simulation of Quadrotor.Modeling and Roll, Pitch and Yaw Simulation of Quadrotor.
Modeling and Roll, Pitch and Yaw Simulation of Quadrotor.
 
Quadcopter Technology
Quadcopter TechnologyQuadcopter Technology
Quadcopter Technology
 
Project seminar quadcopter
Project seminar quadcopterProject seminar quadcopter
Project seminar quadcopter
 
Design and Implementation of a Quadrotor Helicopter
Design and Implementation of a Quadrotor HelicopterDesign and Implementation of a Quadrotor Helicopter
Design and Implementation of a Quadrotor Helicopter
 
DREAM QUADCOPTER
DREAM QUADCOPTERDREAM QUADCOPTER
DREAM QUADCOPTER
 
Presentation of quadcopter drone
Presentation of quadcopter dronePresentation of quadcopter drone
Presentation of quadcopter drone
 
Fabrication of drone
Fabrication of droneFabrication of drone
Fabrication of drone
 
Quadcopter
QuadcopterQuadcopter
Quadcopter
 
DESIGN AND FABRICATION OF QUADCOPTER
DESIGN AND FABRICATION OF QUADCOPTERDESIGN AND FABRICATION OF QUADCOPTER
DESIGN AND FABRICATION OF QUADCOPTER
 
Drone Building 101
Drone Building 101Drone Building 101
Drone Building 101
 
FYP 2 SLIDE
FYP 2 SLIDEFYP 2 SLIDE
FYP 2 SLIDE
 
Ppt. Micro air vehicel
Ppt. Micro air vehicelPpt. Micro air vehicel
Ppt. Micro air vehicel
 
Lecture 1: Quadrotor
Lecture 1: QuadrotorLecture 1: Quadrotor
Lecture 1: Quadrotor
 
State space modelling of a quadcopter
State space modelling of a quadcopterState space modelling of a quadcopter
State space modelling of a quadcopter
 

Viewers also liked

Quadcopter final report anand
Quadcopter final report anandQuadcopter final report anand
Quadcopter final report anandAnand kumar
 
Drone (Quadcopter) full project report by Er. ASHWANI DIXIT
Drone (Quadcopter) full project report by    Er. ASHWANI DIXITDrone (Quadcopter) full project report by    Er. ASHWANI DIXIT
Drone (Quadcopter) full project report by Er. ASHWANI DIXITAshwani Dixit
 
Quadcopter designing
Quadcopter designingQuadcopter designing
Quadcopter designingKaran Shaw
 
Algorithms and hardware designs for quadcopters
Algorithms and hardware designs for quadcoptersAlgorithms and hardware designs for quadcopters
Algorithms and hardware designs for quadcoptersShipeng Xu
 
Quadcopter navigation using aakash tablet with on board image processing
Quadcopter navigation using aakash tablet with on board image processingQuadcopter navigation using aakash tablet with on board image processing
Quadcopter navigation using aakash tablet with on board image processingD Yogendra Rao
 
Quadcopter Presentation
Quadcopter PresentationQuadcopter Presentation
Quadcopter PresentationJoe Loftus
 
Config interface
Config interfaceConfig interface
Config interfaceRyan Boland
 
Arduino electronics cookbook
Arduino electronics cookbookArduino electronics cookbook
Arduino electronics cookbookFelipe Belarmino
 
I2 c and mpu6050 basics
I2 c and mpu6050 basicsI2 c and mpu6050 basics
I2 c and mpu6050 basicsironstein1994
 

Viewers also liked (14)

QUADCOPTER
QUADCOPTERQUADCOPTER
QUADCOPTER
 
Quadcopter final report anand
Quadcopter final report anandQuadcopter final report anand
Quadcopter final report anand
 
Drone (Quadcopter) full project report by Er. ASHWANI DIXIT
Drone (Quadcopter) full project report by    Er. ASHWANI DIXITDrone (Quadcopter) full project report by    Er. ASHWANI DIXIT
Drone (Quadcopter) full project report by Er. ASHWANI DIXIT
 
Quadcopter presentation by chomp
Quadcopter presentation by chompQuadcopter presentation by chomp
Quadcopter presentation by chomp
 
Quadcopter designing
Quadcopter designingQuadcopter designing
Quadcopter designing
 
Algorithms and hardware designs for quadcopters
Algorithms and hardware designs for quadcoptersAlgorithms and hardware designs for quadcopters
Algorithms and hardware designs for quadcopters
 
Quadcopter navigation using aakash tablet with on board image processing
Quadcopter navigation using aakash tablet with on board image processingQuadcopter navigation using aakash tablet with on board image processing
Quadcopter navigation using aakash tablet with on board image processing
 
Quadcopter Presentation
Quadcopter PresentationQuadcopter Presentation
Quadcopter Presentation
 
Config interface
Config interfaceConfig interface
Config interface
 
Fuzzy logic control vs. conventional pid
Fuzzy logic control vs. conventional pidFuzzy logic control vs. conventional pid
Fuzzy logic control vs. conventional pid
 
Arduino electronics cookbook
Arduino electronics cookbookArduino electronics cookbook
Arduino electronics cookbook
 
Reglamento
ReglamentoReglamento
Reglamento
 
Quadcopter
QuadcopterQuadcopter
Quadcopter
 
I2 c and mpu6050 basics
I2 c and mpu6050 basicsI2 c and mpu6050 basics
I2 c and mpu6050 basics
 

Similar to Quadcopter Talk (Abstractions)

Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...
Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...
Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...thenickdude
 
Design & Fabrication of a Ground Survellance Robot
Design & Fabrication of a Ground Survellance RobotDesign & Fabrication of a Ground Survellance Robot
Design & Fabrication of a Ground Survellance RobotIEEEP Karachi
 
Fuzzy Gain Scheduling PID Control for Position of the AR.Drone
Fuzzy Gain Scheduling PID Control for Position of  the AR.Drone Fuzzy Gain Scheduling PID Control for Position of  the AR.Drone
Fuzzy Gain Scheduling PID Control for Position of the AR.Drone IJECEIAES
 
IISC CPDM Task 1 Report
IISC CPDM Task 1 ReportIISC CPDM Task 1 Report
IISC CPDM Task 1 ReportPARNIKA GUPTA
 
Microprocessor based autonomous control system
Microprocessor based autonomous control systemMicroprocessor based autonomous control system
Microprocessor based autonomous control systemDr. Rajesh P Barnwal
 
Trash Robotic Router Platform - David Melendez - Codemotion Rome 2015
Trash Robotic Router Platform - David Melendez - Codemotion Rome 2015Trash Robotic Router Platform - David Melendez - Codemotion Rome 2015
Trash Robotic Router Platform - David Melendez - Codemotion Rome 2015Codemotion
 
Oral Report Rev2
Oral Report Rev2Oral Report Rev2
Oral Report Rev2guest845037
 
Introduction to-cleanflight
Introduction to-cleanflightIntroduction to-cleanflight
Introduction to-cleanflightZachary Scally
 
Orientation of Radar Antenna
Orientation of Radar AntennaOrientation of Radar Antenna
Orientation of Radar AntennaIOSR Journals
 
Orientation of Radar Antenna
Orientation of Radar AntennaOrientation of Radar Antenna
Orientation of Radar AntennaIOSR Journals
 
Cataloge ge 3.control and_automation-21_vat300_e_c6-6-4_2_rev_a
Cataloge ge 3.control and_automation-21_vat300_e_c6-6-4_2_rev_aCataloge ge 3.control and_automation-21_vat300_e_c6-6-4_2_rev_a
Cataloge ge 3.control and_automation-21_vat300_e_c6-6-4_2_rev_aDien Ha The
 
Simulation and experimental study on PID control of a quadrotor MAV with pert...
Simulation and experimental study on PID control of a quadrotor MAV with pert...Simulation and experimental study on PID control of a quadrotor MAV with pert...
Simulation and experimental study on PID control of a quadrotor MAV with pert...journalBEEI
 
Viewpoint_PnP.ppt
Viewpoint_PnP.pptViewpoint_PnP.ppt
Viewpoint_PnP.pptAmit yadav
 
Crmt Open ecu
Crmt Open ecuCrmt Open ecu
Crmt Open ecuFabMob
 
Gesture Controlled Chair
Gesture Controlled ChairGesture Controlled Chair
Gesture Controlled Chairtheijes
 
Reviews of Cascade Control of Dc Motor with Advance Controller
Reviews of Cascade Control of Dc Motor with Advance ControllerReviews of Cascade Control of Dc Motor with Advance Controller
Reviews of Cascade Control of Dc Motor with Advance Controllerijsrd.com
 

Similar to Quadcopter Talk (Abstractions) (20)

Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...
Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...
Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...
 
Design & Fabrication of a Ground Survellance Robot
Design & Fabrication of a Ground Survellance RobotDesign & Fabrication of a Ground Survellance Robot
Design & Fabrication of a Ground Survellance Robot
 
Quadcopter Presentation
Quadcopter PresentationQuadcopter Presentation
Quadcopter Presentation
 
Fuzzy Gain Scheduling PID Control for Position of the AR.Drone
Fuzzy Gain Scheduling PID Control for Position of  the AR.Drone Fuzzy Gain Scheduling PID Control for Position of  the AR.Drone
Fuzzy Gain Scheduling PID Control for Position of the AR.Drone
 
IISC CPDM Task 1 Report
IISC CPDM Task 1 ReportIISC CPDM Task 1 Report
IISC CPDM Task 1 Report
 
An 706
An 706An 706
An 706
 
Microprocessor based autonomous control system
Microprocessor based autonomous control systemMicroprocessor based autonomous control system
Microprocessor based autonomous control system
 
Trash Robotic Router Platform - David Melendez - Codemotion Rome 2015
Trash Robotic Router Platform - David Melendez - Codemotion Rome 2015Trash Robotic Router Platform - David Melendez - Codemotion Rome 2015
Trash Robotic Router Platform - David Melendez - Codemotion Rome 2015
 
Oral Report Rev2
Oral Report Rev2Oral Report Rev2
Oral Report Rev2
 
Introduction to-cleanflight
Introduction to-cleanflightIntroduction to-cleanflight
Introduction to-cleanflight
 
Orientation of Radar Antenna
Orientation of Radar AntennaOrientation of Radar Antenna
Orientation of Radar Antenna
 
L010127578
L010127578L010127578
L010127578
 
Orientation of Radar Antenna
Orientation of Radar AntennaOrientation of Radar Antenna
Orientation of Radar Antenna
 
Cataloge ge 3.control and_automation-21_vat300_e_c6-6-4_2_rev_a
Cataloge ge 3.control and_automation-21_vat300_e_c6-6-4_2_rev_aCataloge ge 3.control and_automation-21_vat300_e_c6-6-4_2_rev_a
Cataloge ge 3.control and_automation-21_vat300_e_c6-6-4_2_rev_a
 
Simulation and experimental study on PID control of a quadrotor MAV with pert...
Simulation and experimental study on PID control of a quadrotor MAV with pert...Simulation and experimental study on PID control of a quadrotor MAV with pert...
Simulation and experimental study on PID control of a quadrotor MAV with pert...
 
Viewpoint_PnP.ppt
Viewpoint_PnP.pptViewpoint_PnP.ppt
Viewpoint_PnP.ppt
 
Crmt Open ecu
Crmt Open ecuCrmt Open ecu
Crmt Open ecu
 
Control Memory
Control MemoryControl Memory
Control Memory
 
Gesture Controlled Chair
Gesture Controlled ChairGesture Controlled Chair
Gesture Controlled Chair
 
Reviews of Cascade Control of Dc Motor with Advance Controller
Reviews of Cascade Control of Dc Motor with Advance ControllerReviews of Cascade Control of Dc Motor with Advance Controller
Reviews of Cascade Control of Dc Motor with Advance Controller
 

Recently uploaded

JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseWSO2
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 

Recently uploaded (20)

JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

Quadcopter Talk (Abstractions)

  • 1. QUADCOPTER FLIGHT CONTROLLER building & programming a from scratch
  • 2. I’m Ryan Boland Web Developer @ Tanooki Labs @bolandrm (github, twitter)
  • 3.
  • 4. 1. Components 2. Quadcopter Physics 3. The Flight Loop
  • 10. My Project - Custom Flight Controller Arduino Mega 2560 & Prototyping Shield 8-bit AVR 16 MHz clock 256K Flash 8K Ram Arduino Nano Clone 8-bit AVR 16 MHz clock 32K Flash 2K Ram Teensy 3.1 32-bit ARM 96 MHz clock 256K Flash 64K Ram $5$55 $20
  • 12. Inertial Measurement Unit MPU6050 - 3 axis gyroscope, 3 axis accelerometer HMC5883L - 3 axis magnetometer BMP180 - Barometer GY-87 $8
  • 15. Orientation x axis <-> roll y axis <-> pitch z axis <-> yaw
  • 17. Stabilization Rate mode - gyroscopes only Remote control determines the rate at which the quadcopter is rotating on any given axis. Also known as Acro or Manual. Attitude mode - accelerometers & gyros Remote control determines the desired angle of the quadcopter. Also known as self-level or auto-level.
  • 18. Wait for data ready interrupt Read & filter gyroscope data Read remote control data (user input) Use PID (proportional, integral, derivative) algorithm to compute required adjustment for each axis Map adjustment for each axis to motors (Mixer) Safety checks Output to motors Flight Loop (1000 Hz)
  • 19. Wait for data ready interrupt Read & filter gyroscope data Read remote control data (user input) Use PID (proportional, integral, derivative) algorithm to compute required adjustment for each axis Map adjustment for each axis to motors (Mixer) Safety checks Output to motors Flight Loop (1000 Hz)
  • 20. Wait for data ready interrupt Read & filter gyroscope data Read remote control data (user input) Use PID (proportional, integral, derivative) algorithm to compute required adjustment for each axis Map adjustment for each axis to motors (Mixer) Safety checks Output to motors Flight Loop (1000 Hz)
  • 21. Gyroscope data Actual rotational rate in °/sec Remote control data Pilot’s desired rotation rate in °/sec Error Difference between actual and desired rotational rate e = gyro_rate - rc_rate
  • 22. Wait for data ready interrupt Read & filter gyroscope data Read remote control data (user input) Use PID (proportional, integral, derivative) algorithm to compute required adjustment for each axis Map adjustment for each axis to motors (Mixer) Safety checks Output to motors Flight Loop (1000 Hz)
  • 23. 3 errors to correct
  • 24. PID Controllers (proportional, integral, derivative) For each axis (yaw, pitch, roll): PID for dummies: http://www.csimn.com/CSI_pages/PIDforDummies.html
  • 25. PID Controllers (proportional, integral, derivative) PID for dummies: http://www.csimn.com/CSI_pages/PIDforDummies.html Motor Output Rotational rate (from gyro) error e(t) Pilot RC input 3 constants - Kp, Ki, Kd
  • 26. PID Controllers (proportional, integral, derivative) PID for dummies: http://www.csimn.com/CSI_pages/PIDforDummies.html Motor Output Rotational rate (from gyro) error e(t) Pilot RC input 3 constants - Kp, Ki, Kd
  • 27. PID Controllers (proportional, integral, derivative) PID for dummies: http://www.csimn.com/CSI_pages/PIDforDummies.html Motor Output Rotational rate (from gyro) error e(t) Pilot RC input 3 constants - Kp, Ki, Kd
  • 28. PID Controllers (proportional, integral, derivative) PID for dummies: http://www.csimn.com/CSI_pages/PIDforDummies.html Motor Output Rotational rate (from gyro) error e(t) Pilot RC input 3 constants - Kp, Ki, Kd
  • 29. PID Controllers (proportional, integral, derivative) PID for dummies: http://www.csimn.com/CSI_pages/PIDforDummies.html Motor Output Rotational rate (from gyro) error e(t) Pilot RC input 3 constants - Kp, Ki, Kd
  • 30. PID Controllers (proportional, integral, derivative) PID for dummies: http://www.csimn.com/CSI_pages/PIDforDummies.html Motor Output Rotational rate (from gyro) error e(t) Pilot RC input 3 constants - Kp, Ki, Kd
  • 31. PID Controllers (proportional, integral, derivative) PID for dummies: http://www.csimn.com/CSI_pages/PIDforDummies.html Motor Output Rotational rate (from gyro) error e(t) Pilot RC input 3 constants - Kp, Ki, Kd
  • 32. Wait for data ready interrupt Read & filter gyroscope data Read remote control data (user input) Use PID (proportional, integral, derivative) algorithm to compute required adjustment for each axis Map adjustment for each axis to motors (Mixer) Safety checks Output to motors Flight Loop (1000 Hz)
  • 34. Flight Controller Code motor1 = rc_throttle - roll_adjust - pitch_adjust - yaw_adjust; motor2 = rc_throttle + roll_adjust + pitch_adjust - yaw_adjust; motor3 = rc_throttle - roll_adjust + pitch_adjust + yaw_adjust; motor4 = rc_throttle + roll_adjust - pitch_adjust + yaw_adjust; correcting roll, pitch, yaw
  • 35. Flight Controller Code motor1 = rc_throttle - roll_adjust - pitch_adjust - yaw_adjust; motor2 = rc_throttle + roll_adjust + pitch_adjust - yaw_adjust; motor3 = rc_throttle - roll_adjust + pitch_adjust + yaw_adjust; motor4 = rc_throttle + roll_adjust - pitch_adjust + yaw_adjust; correcting roll, pitch, yaw
  • 36. Flight Controller Code motor1 = rc_throttle - roll_adjust - pitch_adjust - yaw_adjust; motor2 = rc_throttle + roll_adjust + pitch_adjust - yaw_adjust; motor3 = rc_throttle - roll_adjust + pitch_adjust + yaw_adjust; motor4 = rc_throttle + roll_adjust - pitch_adjust + yaw_adjust; correcting roll, pitch, yaw
  • 37. Flight Controller Code motor1 = rc_throttle - roll_adjust - pitch_adjust - yaw_adjust; motor2 = rc_throttle + roll_adjust + pitch_adjust - yaw_adjust; motor3 = rc_throttle - roll_adjust + pitch_adjust + yaw_adjust; motor4 = rc_throttle + roll_adjust - pitch_adjust + yaw_adjust; correcting roll, pitch, yaw
  • 38. Wait for data ready interrupt Read & filter gyroscope data Read remote control data (user input) Use PID (proportional, integral, derivative) algorithm to compute required adjustment for each axis Map adjustment for each axis to motors (Mixer) Safety checks Output to motors Flight Loop (1000 Hz)
  • 39. Safety & Handling Failure Stale IMU values Stale remote control values Angles too high? Motor outputs too high? (indoor safe mode) Watchdog
  • 40. Wait for data ready interrupt Read & filter gyroscope data Read remote control data (user input) Use PID (proportional, integral, derivative) algorithm to compute required adjustment for each axis Map adjustment for each axis to motors (Mixer) Safety checks Output to motors Flight Loop (1000 Hz)
  • 41. Wait for data ready interrupt Read & filter gyroscope data Read remote control data (user input) Use PID (proportional, integral, derivative) algorithm to compute required adjustment for each axis Map adjustment for each axis to motors (Mixer) Safety checks Output to motors Flight Loop (1000 Hz)
  • 42. Some Takeaways Be Safe Start small (mini quad or balancing robot?) Break things down into subcomponents