---
# System prepended metadata

title: Results & Observations
tags: [Results]

---

# Results & Observations
###### tags: `Results`

## Cruise Control
Control Objective:
To control the velocity of car and make it reach desired velocity. 

Here the cars expriences drag due to air proportional to its velocity which is $bv$
and it is given an input $u$
![](https://i.imgur.com/FIlLlOb.png =400x200 )
Model Dynamics:
$m \dot v + bv = u$
PID controller is used to reach the given desired value of velocity 
P : Proportional gain (helps to reach desired value but does not reachs desired value)
I : Integral gain (helps to reach desired value but overshoots)
D : Derivate gain (helps to reduce overshoot due to integral gain)

​Desired value of velocity: $60 km/hr$

![](https://i.imgur.com/jRODjp4.png)
​



## 1D Control of Quadrotor
We implemented a PD controller for height control of the quadrotor. We tuned the proportional gain(kP) and derivative gain(kD) for two different cases. 



### Hover Control
The first case was of hover control where the quadrotor was simply stabilized at the height of 0m. 
![](https://i.imgur.com/sjb3Hax.gif)


### Step Response
The second case was of step response where the quadrotor was given an input height of 1m.
The rise time was kept as less than 1 second and the maximum overshoot was capped at 5%. 
![](https://i.imgur.com/hUNL5Cy.gif)



## 2D Control of Quadrotor
After controlling quadrotor in 1 Dimension, our next objective is to build a PD controller to control the motion of quadrotor in Y-Z (2D) plane. Below are results ,we moved the quadrotor from some y postion to another, keeping heigth (z) constant.

### Hover Controller
The Quadcopter was moved to a desired position in y direction
![](https://i.imgur.com/RBx20Oo.gif)

### Trajectory Controller

The Quadcoptor followed the desired trajectory.
![](https://i.imgur.com/alDXe4I.gif)

## 3D Control of Quadrotor

Since now we have applied 1D and 2D to our Quadcopter, Now we will be extending it to 3D control and then to trajectory generation. We will firstly make the drone to follow Line and Helix trajectory, whose corresponding gifs are shown below. 

**The position and attitude control loops can be given as:**

![](https://i.imgur.com/4aPewDa.png)


### Line Trajectory

![](https://i.imgur.com/IXZikkK.gif)

#### **Quad Velocity**
![](https://i.imgur.com/giXTM5l.jpg)

### **Quad Position**
![](https://i.imgur.com/5B75MVU.jpg)


### Helix Trajectory

![](https://i.imgur.com/U2YcQ1g.gif)

#### **Quad Velocity**
![](https://i.imgur.com/5pvjgz5.png =500x300)




#### **Quad Position**
![](https://i.imgur.com/nsXInF3.jpg)


### Trajectory Generation

We generated a minimum snap trajectory using a $7^{th}$ order polynomial. In Trajectory generation we are given a cerain number of waypoints, and the drone has to follow the path from one way point to other. In this way if we increase the number of waypoints bascially we can improve drone's trajectory.

![](https://i.imgur.com/agvmTQC.gif)

#### **Quad Velocity**
![](https://i.imgur.com/m5QtAeB.jpg)

#### **Quad Position**
![](https://i.imgur.com/426y7HL.jpg)


### PID Control of Inverted Pendulum
Here PID control was used to stabilize the inverted pendulum in upright position. It was observed that a large amount of force is applied initially. From the graphs it can be seen that the value of x is increasing ie the cart keeps on moving towards right.
![](https://i.imgur.com/AD1bufn.png)
![](https://i.imgur.com/8mvxrjP.png)
![](https://i.imgur.com/SAmLpDJ.png)



### LQR Control of Inverted Pendulum
Here we build an LQR controller to stabilize the pendulum in upright position. We tunned the Q (penalty on states) and R (penalty on actuators) matrix to obtain the desired results. Below graphs shows variation of theta, force, postion(x) with time. In animation we can see pendulum stabilize in upright postion at desired (x=5).
![](https://i.imgur.com/ngM1cxZ.png =300x300)
![](https://i.imgur.com/xl6qyeq.gif)

 

### Inverted Pendulum(LQR + Energy Control)

This is a hybrid approach to Inverted pendulum. Here we use Energy Control along with LQR to make the pendulum stand at upright position.
What we observed is LQR is unable to take the pendulum directly to the upright position in a efficient manner and it also gives absurd results when did so. 
So In hybrid model the changes done are intially directly the corresponding energy at upright position is given to the pendulum and as it reaches close to vertical force is applied through LQR model. In this way we get better graphs and there is no need to apply caps on any of the quantity. 

![](https://i.imgur.com/8nesENw.gif)


![](https://i.imgur.com/OWmoDA0.png)

![](https://i.imgur.com/ZjSmaVA.png)

![](https://i.imgur.com/Ody72rV.png)

### Human State Aware Controller for Tethered UAV
#### Version 1.1
- In the first version of the code, we did not involve the direction of force and gave the human constant velocity in the desired direction of motion. 
- If the x and y components of force becomes too less, the velocity of human becomes zero. 
- Euler dynamics is used to calculate both the position and velocity of drone as well as human.
- A disturbance in the velocity of human was introduced at a particular instant(iteration), which caused spike in some of the graphs.
![](https://i.imgur.com/mLgLdzh.png)
![](https://i.imgur.com/PwJhtbZ.png)
![](https://i.imgur.com/Nl8y3dM.png)

![](https://i.imgur.com/7cMYpq0.png)
![](https://i.imgur.com/sh8M50V.png)
![](https://i.imgur.com/eiuxIVv.png)


![](https://i.imgur.com/OR8q1tl.png)
![](https://i.imgur.com/HSnN5TQ.png)
![](https://i.imgur.com/xi3NHwa.png)
![](https://i.imgur.com/spDNXIO.png)

![](https://i.imgur.com/JzNymPC.png)

#### Version 1.2
- We changed the direction of velocity of human according to the direction of f_c (tension in the cable). 
- If lc_norm - lc_bar (difference between magnitude of position vector between drone & human and original length of tether) is less or equal to zero, then f_c(tension in the cable) is zero.
- If the x and y components of force becomes too less, the velocity of human becomes zero.
- If the magnitude of force becomes zero at any instant, velocity of human becomes zero.
- Human is capable of varying its damping coefficient to achieve constant velocity.
-![](https://i.imgur.com/ptLfTse.png)
![](https://i.imgur.com/WACm5CH.png)
![](https://i.imgur.com/x5hymy0.png)
![](https://i.imgur.com/ecpyu1t.png)
![](htt]ps://i.imgur.com/yWCgzPP.png)



#### Version 1.3
- Includes all assumptions from version 1.2
- Near the final position, when x and y components of force are very small and the z component is greater than zero, the human leaves the handle i.e. we make the magnitude of f_c as zero. 
- The magnitude of the human velocity has been increased to 0.5 m/s

#### Version 1.4
 - The cable force is assumed to be constant (represented by gamma) which implies the control force is constant.
 - Human and drone have the same velocity and follow a constant velocity trajectory
 - The product of kH and e_R is assumed to be constant

![](https://i.imgur.com/waxhaUS.png)
![](https://i.imgur.com/WbQDnMy.png)
![](https://i.imgur.com/fKYnOc0.png)


#### Version 1.5
 - For the initial 50 seconds it was assumed that the product of kH and e_R,  i.e. the control force, is large and was considered to be constant(represented by gamma). And for the rest of the time span proportional was implemented. 

![](https://i.imgur.com/Pof45W0.png)
![](https://i.imgur.com/p5IqwUE.png)
![](https://i.imgur.com/dkO9oAY.png)
![](https://i.imgur.com/eU7GXzA.png)


#### Tasks Ahead
 
 - Make the fixed position of winch visible in animation.(done)
 - Change initial position of drone and check whether the trajectories for all these positions are similar/circular.(done?)
 - Push code in the repo after gaining access.(done)

#### Regarding Papers
 - Start reading ETH Zurich paper on TAV.(done)
 - Find other papers to understand the dynamics of winch with variable position(post such papers on channel).

#### For main project

 - Length of cable is fixed and position of winch is variable (winch can be considered like a human).
 -  Tension will serve as feedback, when it is zero(or cable is slack), drone will move to make it non zero (make the cable taut).
 - At the end final position of drone should be directly above the final position of winch.


 
