Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. g1_dot= [1 0 0 0;
  2. 0 1 (cos(phi)*tan(the)+sin(phi)*sec(the)^2) (-sin(phi)*tan(the)+cos(phi)*sec(the)^2);
  3. 0 0 -sin(phi) -cos(phi);
  4. 0 0 (cos(phi)*sec(the)+sin(phi)*sec(the)*tan(the)) (-sin(phi)*sec(the)+cos(phi)*sec(the)*tan(the))];
  5.  
  6. g2= [ -(cos(phi)*cos(the))/m 0 0 0;
  7. 0 1/Jx 0 0;
  8. 0 0 1/Jy 0;
  9. 0 0 0 1/Jz];
  10.  
  11. f2 = [g-(Cd/m)*vz;
  12. Jbarx*q*r;
  13. Jbary*p*r;
  14. Jbarz*p*q];
  15.  
  16.  
  17. Lamda= diag([1 0 0 0]);
  18.  
  19. I_theta= diag([1-THETA_hat 1 1 1]);
  20.  
  21. c1=diag([1 1 1 1]);
  22. c2=diag([1 1 1 1]);
  23. c3=diag([10 10 10 10]);
  24.  
  25.  
  26.  
  27. x1 = [zE ; phi; the; psi];
  28. x1d= [z_d; phi_d; the_d; psi_d];
  29. x1d_dot= [z_d_dot; phi_d_dot; the_d_dot; psi_d_dot];
  30. x1d_ddot= [z_d_ddot; phi_d_ddot; the_d_ddot; psi_d_ddot];
  31.  
  32. x2= [vz; p; q; r];
  33.  
  34. z1=x1-x1d;
  35. q1 = (c1*g1)\(c1*x1d_dot - c2*z1);
  36. z2= x2-q1;
  37. z1_dot= c1*g1*z2-c2*z1;
  38. q1_dot= (c1*g1_dot)\(c1*x1d_ddot - c2*z1_dot);
  39. z2=x2-q1;
  40.  
  41.  
  42.  
  43. Omega_bar= (g2*Map*I_theta)\(q1_dot - f2 - (c1*g1)'*z1-c3*z2);
  44.  
  45.  
  46. THETA_hat_dot= -gamma*(z2'*g2*Map*Lamda*Omega_bar);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement