Permalink
Browse files

penalize pitch rate a lot; update controller

  • Loading branch information...
1 parent ccd5bea commit 51ef67f817529dc71d044b1aeebe0cfd469e6166 @amcameron committed Mar 18, 2011
Showing with 6 additions and 4 deletions.
  1. +4 −4 controller.m
  2. +2 −0 simplant.m
View
@@ -4,13 +4,13 @@
x3d = [ x(4) x(6) x(11) x(8) x(5) x(10) x(12) x(7) x(9) ]';
Kstate = [ ...
- 0.00228579428659108 -0.0166873081541561 0.142696553245183 0.448733407528170 -4.89434360180788e-17 4.14810275173425e-17 2.88686535089178e-16 4.05369054540226e-17 -2.02298055463092e-16; ...
- 7.98915436459252e-16 -6.82427137912550e-16 1.70529998389573e-15 1.31303932545330e-14 -0.125417502149324 0.439991169988528 0.170680187083551 7.72939950997889 0.0707644420934317; ...
+ 0.00810309552458979 -0.0400603139073245 0.880119980923609 0.830415914303863 -8.30383591879514e-17 6.67648319281354e-17 6.65779132202186e-16 -1.23728454635484e-15 -8.08311418034920e-17; ...
+ -1.83777985774039e-15 -1.48317281697540e-15 -3.06675517673273e-15 1.10046051388706e-15 -0.125417502149331 0.439991169988530 0.170680187083617 7.72939950997870 0.0707644420934246; ...
];
Kref = [ ...
- 0.0447213595499900 -1.62131079808177e-16; ...
- 1.08835189774928e-14 1 ; ...
+ 0.0447213595499945 1.47613512560626e-16; ...
+ -1.33796062521931e-14 0.999999999999995; ...
];
d = (-[Kstate Kref]*[x3d; z])';
end
View
@@ -43,7 +43,9 @@
%P = 0.005*[-1, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14];
% Let's try LQR control.
% Q is the penalty for state variables. Let's penalize them all.
+% Penalize pitch rate especially hard.
Q = eye(size(Atilde));
+Q(3, 3) = 500;
% R is the penalty for control signals. Let's penalize them both, especially
% the longitudinal control input.
R = [500 0; 0 1];

0 comments on commit 51ef67f

Please sign in to comment.