Optimal Control of Pitch/Travel and Elevation with Feedback:
In this task we include the dynamics of elevation, . The helicopter is moved from to past a restriction causing the elevation angle to change during the flight. We must therefore add the elevation to the state vector; the setpoint is a new manipulated variable in the system.
Preparations
1)
Task
Write the system on continuous state space form with the two extra states and . Use and .
We remember from Helicopter Lab Day 2
Transclude of Helicopter-Lab-Day-2#1-state-space-formulation
Extending this according to the task give us
Where the relevant formulas can be found here page=13
2)
Task
Discretize the model using the forward Euler method (Euler Discretization) and write the resulting model on discrete state space form.
We know that the discretized system is given by
Link to originalWhere is the discretization time. This gives us
Where and are unchanged from 1)
3)
Task
Add an inequality constraint on the elevation
nonlinear constraint so we must use theMatlab function
fmincon
, as this is an SQP type algorithmNote that this is a
We now want to minimize
We need to solve this similarly as we did in 3) Calculating the Optimal Path
We want to express the cost function, as
Finding : We therefore get
Giving us
Same reasoning for finding :
Which gives us
See the Matlab file init08.m
for implementation.
On The Lab
6)
Yes
7)
8)
TEST PLAN
Testing different horizons:
- BEST Testing different objective function weights q1 and q2.
- q1=q2= 1
- q1=q2=0.1 BEST
- q1=q2=10
^Everything above is with
Testing with different LQR:
- good: Q = [3 0.3 2 0.5 3 0.5], R = [0.1 0.1] BEST
- unit: Q = [1 1 1 1 1 1], R = [1 1]
Row vs data
- Time
- Travel
- Travel rate
- Pitch
- Pitch rate
- Elevation
- Elevation rate
- Pitch reference
- Elevation reference
- V_d
- V_s 13-17. x_star (row 13-17)
- Constraint