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:
Sravan Balaji
2020-04-21 02:00:05 -04:00
parent 81426af0ce
commit 691da16e93
3 changed files with 64 additions and 40 deletions

View File

@@ -2,7 +2,7 @@
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

View File

@@ -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 -->
- [Contributors](#contributors)
- [Documents](#documents)
- [Source Code](#source-code)
## Contributors
@@ -23,3 +24,21 @@
1. [Project Proposal](1.%20ME%20561%20Project%20Proposal.pdf)
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.

View File

@@ -1,9 +1,14 @@
% Clear workspace
clear all; close all; clc;
clear all;
close all;
clc;
% Parameters source: https://sal.aalto.fi/publications/pdf-files/eluu11_public.pdf
g = 9.81; m = 0.468; Ix = 4.856*10^-3;
Iy = 4.856*10^-3; Iz = 8.801*10^-3;
g = 9.81;
m = 0.468;
Ix = 4.856*10^-3;
Iy = 4.856*10^-3;
Iz = 8.801*10^-3;
% States:
% X1: x X4: x'
@@ -86,12 +91,12 @@ x_0_up = [0, 0, -1, ...
x_0_pitchroll = [0, 0, 0, ...
0, 0, 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, ...
0, 0, 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.
x_0_trans = [-1, -1, 0, ...