0% found this document useful (0 votes)
58 views20 pages

Project Submission

The document describes 4 plots for simulations done in a Simulink model: 1) Classical PD controller with feedback but no feedforward assuming no knowledge of dynamics 2) Exact model knowledge controller with feedforward and PD feedback assuming known dynamics 3) Adaptive controller with uncertain dynamics and adaptive estimation of parameters 4) DCAL based output feedback design assuming only position measurements and avoiding velocity terms in parameter estimation.

Uploaded by

PoonamTripathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views20 pages

Project Submission

The document describes 4 plots for simulations done in a Simulink model: 1) Classical PD controller with feedback but no feedforward assuming no knowledge of dynamics 2) Exact model knowledge controller with feedforward and PD feedback assuming known dynamics 3) Adaptive controller with uncertain dynamics and adaptive estimation of parameters 4) DCAL based output feedback design assuming only position measurements and avoiding velocity terms in parameter estimation.

Uploaded by

PoonamTripathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Plots for the simulations done in Simulink model

(1) Classical PD (Pure feedback, no feedforward) Assume that


nothing is
known about the dynamics.
(a)The Tracking Error

(b)The Control Input ‘tau’


© Plot showing how q tracks q_d with time

2.Control Objective : Exact Model Knowledge Controller


(Feedforward +PD Feedback ) Assuming that the terms
M(q),Vm(q,q_dot),F_d are known .
(a) Tracking Error

(b) Exact Model Knowledge Based Controller ‘tau’


(c) How q tracks q_d with time

3.Control Obejective : Adaptive Controller .The terms


M(q),Vm(q,q_dot),F_d are uncertain
(a) Tracking Error (Adaptive )
(b) Adaptive Controller ‘tau’
(c) q tracking q_d adaptively with time

4.(a)DCAL based output Feedback Design . Assuming only


positions q_1(t) and q_2(t) are available for measurement
.Noting that velocity terms are not to be used in generating
the parameter estimates .-semiglobal
(a) Tracking Error:
(b) Control Input tau(for semi global) case

(c) Parameter Estimation Error (theta_tilda)


Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
APPENDIX: SIMULINK MODEL CODES USED IN THE
BLOCKS
(1) Codes for Classical (Pure Feedback, No
Feedforward)PD :
Controller Dynamics
function [e,tau,qd] = controller(t,q,q_dot)
%#codegen
%q=[q(1);q(2)];
c2=cos(q(2));
s2=sin(q(2));
p1=3.473;
p2=0.196;
p3=0.242;
fd1=5.3;
fd2=1.1;
qd=[2*sin(t);cos(t)]
k1=35;
k2=8;
qd_dot=[2*cos(t);-sin(t)];
qd_dot_dot=[-2*sin(t);-cos(t)];
e=q-qd;
e_dot=q_dot-qd_dot;
tau=-k1*e-k2*e_dot; % PD controller implantation

Plant Dynamics

function q_ddot = dynamics(tau,q_dot,q)


%#codegen
p1=3.473;
p2=0.196;
p3=0.242;
fd1=5.3;
fd2=1.1;
c2=cos(q(2));
s2=sin(q(2));
M=[p1+2*p3*c2 p2+p3*c2;p2+p3*c2 p2];% Inertia matrix
Vm=[-p3*s2*q_dot(2) -
p3*s2*(q_dot(1)+q_dot(2));p3*s2*q_dot(1)0];%Centripetal coriolis matrix
fd=[fd1 0;0 fd2]; % Friction matrix
q_ddot=-inv(M)*Vm*q_dot-inv(M)*fd*q_dot+inv(M)*Tau %System EL dynamics
(2)Exact Model Knowledge Controller(Feedforward + PD Feedback)

Controller Dynamics

function [e,tau,qd] = controller(t,q,q_dot)


%#codegen
%q=[q(1);q(2)];
c2=cos(q(2));
s2=sin(q(2));
alpha=1;
p1=3.473;
p2=0.196;
p3=0.242;
fd1=5.3;
fd2=1.1;
qd=[2*sin(t);cos(t)]
k=10;
M=[p1+2*p3*c2 p2+p3*c2;p2+p3*c2 p2];% Inertia matrix
Vm=[-p3*s2*q_dot(2) -
p3*s2*(q_dot(1)+q_dot(2));p3*s2*q_dot(1)0];%Centripetal coriolis matrix
fd=[fd1 0;0 fd2]; % Friction matrix
qd_dot=[2*cos(t);-sin(t)];
qd_dot_dot=[-2*sin(t);-cos(t)];
e=q-qd;
e_dot=q_dot-qd_dot;
r=e_dot+alpha*e
tau=+Vm*q_dot+fd*q_dot+M*qd_dot_dot-alpha*M*e_dot-Vm*r-k*r; % EMK
controller implementation

Plant Dynamics:

function q_dot_dot = dynamics(tau,q_dot,q)


%#codegen
p1=3.473;
p2=0.196;
p3=0.242;
fd1=5.3;
fd2=1.1;
c2=cos(q(2));
s2=sin(q(2));
M=[p1+2*p3*c2 p2+p3*c2;p2+p3*c2 p2];% Inertia matrix
Vm=[-p3*s2*q_dot(2) -p3*s2*(q_dot(1)+q_dot(2));p3*s2*q_dot(1) 0];
%Centripetal coriolis matrix
fd=[fd1 0;0 fd2]; % Friction matrix
q_ddot=-inv(M)*Vm*q_dot-inv(M)*fd*q_dot+inv(M)*tau %EL dynamics

(3)Adaptive Controller :
The termsM(q); Vm(q; q_); Fd are uncertain, i.e. their
structure is known as in (1) but the parameters p1; p2; p3; fd1 ; fd2are unknown

Adaptive controller :

function [e,tau,theta_hat_dot,e_theta,qd,theta] =
controller(t,q,q_dot,theta_hat)
%#codegen
%q=[q(1);q(2)];
c2=cos(q(2));
s2=sin(q(2));
alpha=1;
kr=5;
rhotheta=[1];
p1=3.473;
p2=0.196;
p3=0.242;
fd1=5.3;
fd2=1.1;
theta=[p1;p2;p3;fd1;fd2];
qd=[2*sin(t);cos(t)]
qd_dot=[2*cos(t);-sin(t)];
qd_ddot=[-2*sin(t);-cos(t)];
e=q-qd;
e_dot=q_dot-qd_dot;
r=e_dot+alpha*e;
z11=-q_dot(1)+e_dot(1)
z12=-qd_ddot(2)+e_dot(2)
z13=-2*c2*qd_ddot(1)-
c2*qd_ddot(2)+2*(s2*q_dot(2)*q_dot(1))+s2*(q_dot(2))^2-
s2*q_dot(2)*e_dot(1)-s2*q_dot(2)*e(1)-s2*q_dot(1)*e_dot(2)-
s2*q_dot(1)*e(2)-s2*q_dot(2)*e_dot(2)-
s2*q_dot(2)*e(2)+2*c2*e_dot(1)+c2*e_dot(2);
z14=q_dot(1);
z15=0;
z21=0;
z22=-qd_dot_dot(1)-qd_dot_dot(2)+e_dot(1)+e_dot(2);
z23=-c2*qd_dot_dot(1)-
s2*q_dot(1)*q_dot(1)+s2*q_dot(1)*e(1)+s2*q_dot(1)*e(1)+c2*e_dot(1);
z24=0;
z25=q_dot(2);
z=[z11 z12 z13 z14 z15;z21 z22 z23 z24 z25];
theta_hat_dot=rhotheta*z'*r; % Update Law
tau=-Z*theta_hat-kr*r-e; % Adaptive Controller
e_theta=theta-theta_hat;

Robot / Plant Dynamics


function q_ddot = dynamics(tau,q_dot,q)
%#codegen
p1=3.473;
p2=0.196;
p3=0.242;
fd1=5.3;
fd2=1.1;
c2=cos(q(2));
s2=sin(q(2));
M=[p1+2*p3*c2 p2+p3*c2;p2+p3*c2 p2];% Inertia matrix
Vm=[-p3*s2*q_dot(2) -
p3*s2*(q_dot(1)+q_dot(2));p3*s2*q_dot(1)0];%Centripetal coriolis matrix
fd=[fd1 0;0 fd2]; % Friction matrix
q_ddot=-inv(M)*Vm*q_dot-inv(M)*fd*q_dot+inv(M)*tau %The Euler- Lagrange
Dynamics

You might also like