Comment: | Updated for new ppp_qp (using qp_mu from Will Heath/Adrian Wills |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
63e8024414b5ff08f4c7862914ab3dc7 |
User & Date: | gawthrop@users.sourceforge.net on 2002-08-27 17:34:36 |
Other Links: | branch diff | manifest | tags |
2002-08-28
| ||
15:48:01 | Updated mttrc to make standalone C++ compilation configuration clearer. check-in: 7654be3275 user: geraint@users.sourceforge.net tags: origin/master, trunk | |
2002-08-27
| ||
17:34:36 | Updated for new ppp_qp (using qp_mu from Will Heath/Adrian Wills check-in: 63e8024414 user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
16:09:01 | Added port_name to error message when multiple bonds are near a port. check-in: c7b42b1371 user: geraint@users.sourceforge.net tags: origin/master, trunk | |
Modified mttroot/mtt/lib/control/PPP/ppp_ex11.m from [8afbccc82d] to [b816bab9e6].
︙ | |||
29 30 31 32 33 34 35 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | - + - + | t = [6:0.02:7]; # Time horizon A_w = 0; # Setpoint A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); # Input functions Q = ones(n_y,1);; |
︙ | |||
72 73 74 75 76 77 78 | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | - + + - + - + + - + - - - - - + + + + + | [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); ## Unconstrained OL simulation disp("Computing unconstrained ol response"); [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); |
Modified mttroot/mtt/lib/control/PPP/ppp_ex12.m from [4b9ce5134a] to [03125b8f94].
︙ | |||
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - + | 1 0 0 0 1 0]; B = [1 0 0]; C = [0 -0.5 1]; D = 0; |
︙ | |||
52 53 54 55 56 57 58 | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | - + | [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ Tau,Min,Max,Order, \ [],[],[],[], W,x_0); title("y,y*,u and u*"); xlabel("t"); grid; |
︙ |
Modified mttroot/mtt/lib/control/PPP/ppp_ex15.m from [a26d3cfd27] to [d1ae59f7c7].
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - + - + - + + - + - + + | x_0 = zeros(n_x,1); # Initial state ## Closed-loop intermittent solution Delta_ol = 0.5 # Intermittent time disp("Intermittent control simulation"); |
Modified mttroot/mtt/lib/control/PPP/ppp_ex17.m from [0cc0c0d748] to [fd73fba900].
︙ | |||
69 70 71 72 73 74 75 | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | + - + - + - + - + - + | ## Unconstrained OL simulation [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); title("Constained and unconstrained y*"); xlabel("t"); grid; figure(1); |
Modified mttroot/mtt/lib/control/PPP/ppp_ex19.m from [667d1947d8] to [8863f79b17].
︙ | |||
79 80 81 82 83 84 85 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | - + - + + - + | ## Unconstrained OL simulation [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); title("Constrained and unconstrained y*"); xlabel("t"); grid; |
Modified mttroot/mtt/lib/control/PPP/ppp_ex6.m from [ba0ffb029f] to [2c0684bb49].
︙ | |||
34 35 36 37 38 39 40 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | - + - + | i_u = 1; ## Simulation W=1; x_0 = 0; ## Linear |
Modified mttroot/mtt/lib/control/PPP/ppp_lin_plot.m from [e00d3bd973] to [460292101c].
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | function [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w,cond_uu] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W,x_0) |
︙ | |||
36 37 38 39 40 41 42 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | - + | endif [n_t,m_t] = size(t); ## Default Q if nargin<8 |
︙ |
Modified mttroot/mtt/lib/control/PPP/ppp_qp.m from [519bc8a390] to [3e26f7769e].
︙ | |||
43 44 45 46 47 48 49 50 51 52 53 54 55 56 | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | + | [U,iterations] = qp_mu(J_uu,(J_ux*x - J_uw*W),Gamma,gamma,mu); # QP solution for weights U ##U = qp(J_uu,(J_ux*x - J_uw*W),Gamma,gamma); # QP solution for weights U ##U = pd_lcp04(J_uu,(J_ux*x - J_uw*W),Gamma,gamma); # QP solution for weights U u = Us0*U; # Control signal else # Do the unconstrained solution ## Compute the open-loop gains iterations = 0; K_w = J_uu\J_uw; K_x = J_uu\J_ux; ## Closed-loop control U = K_w*W - K_x*x; # Basis functions weights - U(t) u = Us0*U; # Control u(t) endif |
︙ |
Modified mttroot/mtt/lib/control/PPP/ppp_qp_sim.m from [3484a100c1] to [3b08bbc64d].
︙ | |||
43 44 45 46 47 48 49 | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | - + | [Gamma_y,gamma_y] = ppp_output_constraint (A,B,C,D,x_0,A_u,Tau_y,Min_y,Max_y,Order_y); ## Composite constraints - t=0 Gamma = [Gamma_u; Gamma_y]; gamma = [gamma_u; gamma_y]; ## Design the controller |
︙ | |||
83 84 85 86 87 88 89 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | - + | X = []; u = []; Iterations = []; du = []; J = []; tick= time; i = 0; |
︙ | |||
120 121 122 123 124 125 126 | 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | - + | ## Save the last values X = [X x]; # Save state u = [u ut]; # Save input Iterations = [Iterations iterations]; # Save iteration count tock = time; |