How I will study quadrotors
🌷My messy (at least for now) preliminary game plan to building my own quadrotor simulators and quadrotors.
I've always been fascinated by Quadrotors ever since I've learned about the amazing acrobatic flips they can do from Raffaello D'Andrea's Ted Talks But I've never built one and I've never understood them fully.
Why?Because research papers are hard to read and I don't like MatLab.
Contents
- My game plan
- Resources: What I've gathered so far
- An overview of some concepts
- Final thoughts
My Game Plan
First things first
- Further short list what I will read first from this collection and explain why.
- Create a simple interactive visualization (using my humble npm package), on how to convert from body reference frame to world reference frame by rotating 3 angles
- Create a simple drone model (5 spheres and two sticks) and be able to manipulate its position and orientation (6 degrees of freedom) interactively
- Add functionality to bare minimum 3d to be able to draw a 2d circle in 3d
Theory and Simulations
What I cannot create, I do not understand - Richard Feynman
- Read about quadrotors dynamics and control. The mathematical model and theory.
- Write notes and articles explaining what I learned
- Write simple interactive visualizations of mathematical building blocks to create a quadcopter simulation
- Read the code of simplest quadrotor simulators i've seen online
- Write pseudocode and explain the algorithms
- Write a quadrotor simulator with Python and Matplotlib
- Write a quadrotor simulator with Javascript and React
Understand algorithm implementation behind terminologies
- Minimum snap trajectory
- Linear Quadratic Regulator
- Model Predictive Control for Quadrotors
Hardware
- Learn more about hardware
- Shop for parts and buy them
- Build it and make it fly!
- Document every part of the process
- Expand this list further and expound on a separate note
Resources: What I've gathered so far
Daniel Stefanovic's repository does not have a Build Your Own Drone / Quadrotor /Quadropter or something like that. Which is a bad thing, because I can't study it, but maybe a good thing, because I'll be contributing something new to the world, or something like that I guess.
I've collected a few slides, papers, blog post, code examples here.
My collection of PDFs and other stuff I intend to read about quadrotors
An overview of some concepts
I've skimmed through some papers and code, so that I have a high level overview.
- The four step feedback loop
- Sensor fusion and kalman filters
- Path planning with A* and Minimum Snap Trajectory
- Control Engineering for Highschoolers: wtf is LQR
The four step feedback loop
Basically as with any robotics system with a goal, it's roughly like this:
I want my quadcopter to go from point A to point B. But I don't want it to slam into walls or other obstacles. Also, I may want it to go travel a specific trajectory (go from one waypoint to another until it reaches the endpoint).
Use the sensors to gain knowledge of its current state (like position, velocity, acceleration, obstacles around) (maybe use sensor fusion like kalman filters)
Generate a trajectory (an ordered set of future states that we plan to ideally be in at a particular point in time, x seconds into the future) based on knowledge of its current state, surroundings and goals
Use a controller to tell the actuators how to move based to our next ideal state.
Repeat step 1 to 3 until necessary.
Sensor fusion and kalman filters
I already know a lot about the basics of kalman filters.
Best introduction to sensor fusion and kalman filters:
- my old article about sensor fusion
- my old sample code about unscented kalman filters
- understanding the basis of the kalman filter via a simple and intuitive derivation by ramsey faragher
- how a kalman filter works, in pictures, bzarg, tim babb
- kalman and bayesian filters in python: roger labbe
Path planning with A* and Minimum Snap Trajectory
When generating a trajectory given known obstacle locations. I always see A*star, Dikjstra, and RRT algorithms being thrown around.
TODO: Learn more about
A\*star
,Dijkstra
etc in the context of quadcopters
And for smoothening about the trajectory, I always see
minimum snap trajectory
generation and control, being thrown around
TODO: Learn more about Minimum snap trajectory generation and control and polynomial planning (in 3 dimensions)
I think it is like JMT (Jerk Minimized Trajectory) which I in 2 dimensions implemented before
Snap/jounce, is the fourth derivative of the position vector with respect to time, or the rate of change of the jerk with respect to time. It is the second derivative of acceleration or the third derivative of velocity. Jerk is the change in acceleration, just like acceleration is a change in velocity. Snap is a change in jerk.
Control Engineering for Highschoolers
Control theory and control engineering is basically what to tell the actuators given that we know what our state is probably (based on the sensors) so that the quadrotor will be at the desired goal state.
Some settle for the most basic control PID
control, but I also see
MPC
model predictive control and LQR
, linear quadratic regulator being thrown
a lot.
Brushup on control theory, this looks awesome! Tyler Veness: Graduate-level control theory for high schoolers
Final thoughts
This might seem like a hodge podge for now, but these things has been on my mind for a couple of months now. I'm glad I released it in here. I still have a lot of things I want to get off my brain, but this is all for now.