mirror of
https://github.com/ME-561-W20-Quadcopter-Project/Quadcopter-Control.git
synced 2025-09-05 06:53:13 +00:00
Code Cleanup & Project Name Update
- Cleanup LQR.m and add whitespaces - Change project name in README and home - Add Source Code section to home.md describing each file
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
UMICH EECS / MECHENG 561: Design of Digital Control Systems WN 2020
|
UMICH EECS / MECHENG 561: Design of Digital Control Systems WN 2020
|
||||||
|
|
||||||
Full State Feedback and Control of a Quadcopter Drone
|
A Comparison of Quadcopter Drone Control Methods
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
21
docs/home.md
21
docs/home.md
@@ -1,8 +1,9 @@
|
|||||||
# Full State Feedback and Control of a Quadcopter Drone <!-- omit in toc -->
|
# A Comparison of Quadcopter Drone Control Methods <!-- omit in toc -->
|
||||||
|
|
||||||
## Table of Contents <!-- omit in toc -->
|
## Table of Contents <!-- omit in toc -->
|
||||||
- [Contributors](#contributors)
|
- [Contributors](#contributors)
|
||||||
- [Documents](#documents)
|
- [Documents](#documents)
|
||||||
|
- [Source Code](#source-code)
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
@@ -23,3 +24,21 @@
|
|||||||
|
|
||||||
1. [Project Proposal](1.%20ME%20561%20Project%20Proposal.pdf)
|
1. [Project Proposal](1.%20ME%20561%20Project%20Proposal.pdf)
|
||||||
2. [Final Report - Overleaf (Read-Only)](https://www.overleaf.com/read/kyjvdsxkfnmg)
|
2. [Final Report - Overleaf (Read-Only)](https://www.overleaf.com/read/kyjvdsxkfnmg)
|
||||||
|
|
||||||
|
## Source Code
|
||||||
|
|
||||||
|
### [LQR.m](../src/LQR.m) <!-- omit in toc -->
|
||||||
|
|
||||||
|
Finite and infinite time horizon LQR implementation in MATLAB. Gains determined for linearized discrete time system, then simulated on nonlinear system (see LQRNonlinearSim.slx below).
|
||||||
|
|
||||||
|
### [LQRNonlinearSim.slx](../src/LQRNonlinearSim.slx) <!-- omit in toc -->
|
||||||
|
|
||||||
|
Simulink nonlinear model that is run from within LQR.m. Takes gain matrix **K** and initial condition **x_0** as input.
|
||||||
|
|
||||||
|
### [PlantModel.m](../src/PlantModel.m) <!-- omit in toc -->
|
||||||
|
|
||||||
|
Parameters for PID controller (see PlantModelSim.slx below).
|
||||||
|
|
||||||
|
### [PlantModelSim.slx](../src/PlantModelSim.slx) <!-- omit in toc -->
|
||||||
|
|
||||||
|
PID control of nonlinear and linear system.
|
||||||
|
15
src/LQR.m
15
src/LQR.m
@@ -1,9 +1,14 @@
|
|||||||
% Clear workspace
|
% Clear workspace
|
||||||
clear all; close all; clc;
|
clear all;
|
||||||
|
close all;
|
||||||
|
clc;
|
||||||
|
|
||||||
% Parameters source: https://sal.aalto.fi/publications/pdf-files/eluu11_public.pdf
|
% Parameters source: https://sal.aalto.fi/publications/pdf-files/eluu11_public.pdf
|
||||||
g = 9.81; m = 0.468; Ix = 4.856*10^-3;
|
g = 9.81;
|
||||||
Iy = 4.856*10^-3; Iz = 8.801*10^-3;
|
m = 0.468;
|
||||||
|
Ix = 4.856*10^-3;
|
||||||
|
Iy = 4.856*10^-3;
|
||||||
|
Iz = 8.801*10^-3;
|
||||||
|
|
||||||
% States:
|
% States:
|
||||||
% X1: x X4: x'
|
% X1: x X4: x'
|
||||||
@@ -86,12 +91,12 @@ x_0_up = [0, 0, -1, ...
|
|||||||
x_0_pitchroll = [0, 0, 0, ...
|
x_0_pitchroll = [0, 0, 0, ...
|
||||||
0, 0, 0, ...
|
0, 0, 0, ...
|
||||||
10*(pi/180), 10*(pi/180), 0, ...
|
10*(pi/180), 10*(pi/180), 0, ...
|
||||||
0, 0, 0]'; %Pitch and roll of 10 degrees
|
0, 0, 0]'; %Pitch and roll of 10 degrees (convert to radians)
|
||||||
|
|
||||||
x_0_roll = [0, 0, 0, ...
|
x_0_roll = [0, 0, 0, ...
|
||||||
0, 0, 0, ...
|
0, 0, 0, ...
|
||||||
0, 10*(pi/180), 0, ...
|
0, 10*(pi/180), 0, ...
|
||||||
0, 0, 0]'; %Roll of 10 degrees
|
0, 0, 0]'; %Roll of 10 degrees (convert to radians)
|
||||||
|
|
||||||
% Goal 3: Move from position (0,0,0) to within 5 cm of (1,1,1) within 5 seconds.
|
% Goal 3: Move from position (0,0,0) to within 5 cm of (1,1,1) within 5 seconds.
|
||||||
x_0_trans = [-1, -1, 0, ...
|
x_0_trans = [-1, -1, 0, ...
|
||||||
|
Reference in New Issue
Block a user