|
|
|
|
|
|
|
Control System Mini Project |
Motor and load : Obtain the transfer function model
for the motor. The constants are given in figure 2 for the motor, load and gear trains. J is the moment of inertia and B is the coefficient of the viscous friction for
the motor and its load. The field of the motor is separately excited with a constant field
current If. the armature produces torque. Which is proportional to the product
of the armature current and the field current.
- A magnetic disk drive is a position control system in which a
read/ write head is positioned over tracks of data on a spinning disk. The system responds
to a command from a computer to position itself at a particular track on the disk. The
objective of this project is to have the output position, x0(t) follow the command input,
xr(t) rapidly with a negligible overshoot. A physical representation of the system and a
schematic with more detailed layout is shown in figure 1 as in question sheet.
Input and Output Potentiometers:
From the information given;
Vr(s)/Xr(s)=Vo(s)/Xo(s)=Kpot=0.5
By assuming the operational amplifier is ideal; we can derive the summing point
equation:
Firstly, we find V+ using voltage divider rule:
V+= (RVr)/2R = Vr/2
Since V+ = V- ;
V- = Vr/2
Find current flowing thru the op-amp:
I = (Vo-V-)/R
Substitute V- which has been obtained before;
I = (Vo-Vr/2)/R
Find the summing point equation:
Ve = V- - (Vo-Vr/2)
= V- -Vo + Vr/2
= Vr/2 Vo + Vr/2
= Vr Vo
also, by using the information of the input and output potentiometer constants;
Ve = 0.5( Xr Xo )
Motor and Load:
Derivation of the transfer function of the motor:
From the circuit of servomotor ( Figure 2 ); by using KVL;
RaIa(s) + sLaIa(s) + Ea(s) = Vm(s) ....(1)
From the information given;
T = KmIa Ea = Kmwm
Substitute T & Ea in (1);
( Ra + sLa )T/Km + Kmwm = Vm(s) ......(2)
From the motor;
( Js2 + Bs )wm = T ......(3)
Substitute (3) in (2);
( Ra + sLa )( Js2 + B )wm/Km + Kmwm = Vm(s)
wm/Vm = Km/[ ( Ra + sLa )( Js2 + Bs ) + Km2 ]
= Km/( RaJs2 + BRas + JLas3 + BLas2 + Km2 )
= Km/[ s2 + s( JRa + BLa)/JLa + BRa/JLa +Km2/JLa ][ sJLa ]
= ( Km/JLa ) / { s[ s2 + ( B/J + Ra/ La )s + ( BRa + Km2 )/JLa ] }
mathlab:
PI Design :
clf
numg=[1];
deng=poly([0 -2 -10]);
'G(s)'
G=tf(numg,deng)
rlocus(G)
z=0.8;
sgrid(z,0)
title('Root Locus for Z=0.8')
[K,p]=rlocfind(G)
pause
'Ramp Input'
numsg=conv([1,0],numg);
densg=poly([0 -2 -10]);
sG=tf(numsg,densg);
sG=minreal(sG);
Kv=dcgain(sG)
ess=1/Kv
pause
'T(s)'
T=feedback(K*G,1)
t=0:0.001:8;
step(T,t)
title(['Step Response for K=',num2str(K)])
pause
'Ramp input'
numg=[1];
deng=poly([0 -2 -10]);
G=tf(numg,deng);
s=tf([1 0],1);
sG=s*G;
sG=minreal(sG);
Kv=3.5;
K=dcgain(Kv/sG);
ess=1/Kv
pause
'T(s)'
T=feedback(K*G,1)
t=0:0.001:8;
step(T,t)
title(['Step Response for K=',num2str(K)])
pause
- Lead Compensator
z=input('Type z');
Tp=input('Type peak time');
Kv=input('Type value of Kv');
numg=[1];
deng=poly([0 -2 -10]);
G=tf(numg,deng);
s=tf([1 0],1);
sG=s*G;
sG=minreal(sG);
K=dcgain(Kv/sG);
'G(s)'
T=feedback(G,1);
t=0:0.001:8;
step(T,t)
title('Lead Compensator Step Response')
pause
G=zpk(K*G)
Pm=atan(2*z/(sqrt(-2*z^2+sqrt(1+4*z^4))))*(180/pi);
wn=pi/(Tp*sqrt(1-z^2));
wBW=wn*sqrt((1-2*z^2)+sqrt(4*z^4-4*z^2+2));
w=0.01:0.5:1000;
[M,P]=bode(G,w);
[M,P]=bode(Ge,w);
[Gm,Pm,Wcg,Wcp]=margin(G);
Pmreq=atan(2*z/(sqrt(-2*z^2+sqrt(1+4*z^4))))*(180/pi);
Pc=Pmreq-Pm+10;
%Design lead compensator.
beta=(1-sin(Pc*pi/180))/(1+sin(Pc*pi/180));
magpc=1/sqrt(beta);
for k=1:1:length(M);
if M(k)-(1/magpc)<=0;
wmax=w(k);
break
end
end
%Calculate lead compensator zero, pole, and gain.
zc=wmax*sqrt(beta);
pc=zc/beta;
Kc=1/beta;
'Gc(s)'
Gc=tf(Kc*[1 zc],[1 pc]);
Gc=zpk(Gc);
'Ge(s)=G(s)Gc(s)'
Ge=G*Gc
sGe=s*Ge;
sGe=minreal(sGe);
Kv=dcgain(sGe)
T=feedback(Ge,1);
t=0:0.001:8;
step(T,t)
title('Lead Compensator Step Response')
pause
margins=[20*log10(Gm),Pm,Wcg,Wcp]
grid on
bode(G)
title('Open Loop for Uncompensated')
pause
[Gm,Pm,Wcg,Wcp]=margin(Ge);
margins=[20*log10(Gm),Pm,Wcg,Wcp]
grid on
bode(Ge)
title('Open Loop for Compensated')
pause
-
-
- 'p
i design'
%display
label
- clf
% Clear graph on screen.
- numg=[1]
% Define numerator of G(s)
- deng=poly([0
-2 -10]); % Define denominator of G(s)
- 'G(s)'
%
Display label.
- G=tf(numg,deng)
% Create G(s) and display.
- rlocus(G)
% Draw root locus.
- z=0.8;
% Define damping ratio values: 0.8
- sgrid(z,0)
% Generate damping ratio and natural
-
% frequency grid lines for root
-
% locus.
- title(['Root Locus with 0.8 damping ratio line'])
- [K,p]=rlocfind(G)
% Generate gain, K, and closed-loop
-
% poles, p,
-
% for point selected
interactively on
-
% the root locus.
-
- 'Ramp
Input'
- numkv=conv([1
0],numg);
- denkv=deng;
- sG=tf(numkv,denkv);
- sG=minreal(sG);
- Kv=dcgain(K*sG)
- ess=1/Kv
% steady state error
- 'T(s)'
- T=feedback(K*G,1)
% Find closed-loop transfer function
- t=0:0.001:8;
- step(T,t)
% Generate closed-loop step response
- title(['Step Response for K='num2str(K)])
- pause
|
|
|
|
|
|
-
- %Lead
Compensator
- z=0.8;
%declare z
- Tp=0.2;
%define peak time
- Kv=3.5;
%define velocity constant
- numg=[1];
- deng=poly([0
-2 -10]); %define transfer function
- G=tf(numg,deng); %define transfer function
- s=tf([1
0],1);
%define transfer function
- sG=s*G;
%set operation
- sG=minreal(sG);
- K=dcgain(Kv/sG);
- 'G(s)'
- T=feedback(G,1);
- t=0:0.001:8;
- step(T,t)
%obtaining step response
- title('Lead Compensator Step Response')
- pause
- G=zpk(K*G)
%convert to zero/pole/gain format
- Pm=atan(2*z/(sqrt(-2*z^2+sqrt(1+4*z^4))))*(180/pi); %set
operation
- wn=pi/(Tp*sqrt(1-z^2));
%set operation
- wBW=wn*sqrt((1-2*z^2)+sqrt(4*z^4-4*z^2+2));
%set operation
- w=0.01:0.5:1000;
- [M,P]=bode(G,w); %make bode plot
- [M,P]=bode(Ge,w); %make bode plot
- [Gm,Pm,Wcg,Wcp]=margin(G);
- Pmreq=atan(2*z/(sqrt(-2*z^2+sqrt(1+4*z^4))))*(180/pi); %set operation
- Pc=Pmreq-Pm+10;
%set operation
-
-
- %Design
- beta=(1-sin(Pc*pi/180))/(1+sin(Pc*pi/180));
%set operation
- magpc=1/sqrt(beta);
%set operation
- for
k=1:1:length(M);
- if M(k)-(1/magpc)<=0;
- wmax=w(k);
- break
- end
- end
-
- %Zero,
Pole and Gain for Lead Compensator.
- zc=wmax*sqrt(beta);
- pc=zc/beta;
- Kc=1/beta;
- 'Gc(s)'
- Gc=tf(Kc*[1
zc],[1 pc]);
- Gc=zpk(Gc);
%convert to zero/pole/gain format
- 'Ge(s)=G(s)Gc(s)'
- Ge=G*Gc
%set operation
- sGe=s*Ge;
%set operation
- sGe=minreal(sGe);
%transfer function
- Kv=dcgain(sGe)
%transfer function
- T=feedback(Ge,1);
- t=0:0.001:8;
- step(T,t)
%obtaining step response
- title('Step Response for Lead Compensator')
- pause
- margins=[20*log10(Gm),Pm,Wcg,Wcp]
- bode(G)
%make bode plot
- title('Open Loop for Uncompensated')
- pause
- [Gm,Pm,Wcg,Wcp]=margin(Ge);
- margins=[20*log10(Gm),Pm,Wcg,Wcp]
- bode(Ge)
%make bode plot
- title('Open Loop for Compensated')
- pause
|
|
|