# Chapter 12 Controllers and Their Optimisation¶

## Example12.1,Pg.no.37¶

In [1]:
import math
V=40 #gain of the controller in volts
P=100/(1+V)        #permanent error of p controller in percent
print 'permanent Error of P controller=P=',P,'percent'

permanent Error of P controller=P= 2 percent


## Example12.2,Pg.no.37¶

In [2]:
import math
P=1.8        #permanent error of p controller in percent
V=100/1.8-1  #gain of the controller in volts
V=round(V,1)
print 'gain of the controller=V=',V,'volts'
G=8       #sum of all time constants in milliseconds
T1=2*G*V       #motor armature time constant
T1=round(T1,1)
print 'Motor armature time constant=T1=',T1,'milliseconds'

gain of the controller=V= 54.6 volts
Motor armature time constant=T1= 873.6 milliseconds


## Example12.3,Pg.no.38¶

In [3]:
import math
f=50    #frequency in hz
p=6     #pulse number
t1=1000/(2*f*p)          #time constant for the current loop in ms
print 'time constant for the current loop=t1=',t1,'ms'
t2=1.5  #time constant of feedback channel in ms
G=t1+t2    #smaller time constant in ms
print 'Smaller time constant=G=',G,'ms'
T1=30        #bigger time constant in ms
Tn=T1        #time constant of the controller in ms
print 'Time constant of the controller in AVO=Tn=',Tn,'ms'
V=T1/(2*G)     #gain of the control system
print 'Gain of the control system=V=',V
Vg=14        #gain of the regulating current link
Vr=V/Vg      #gain of the PI controller
Vr=round(Vr,2)
print 'Gain of the PI controller=Vr=',Vr
R2=11           #R2 in KiloOhms
R1=R2/Vr        #R1 in kiloohms
R1=round(R1,1)
print 'R1=',R1,'Kiloohms'
C1=round(C1,1)

time constant for the current loop=t1= 1 ms
Smaller time constant=G= 2.5 ms
Time constant of the controller in AVO=Tn= 30 ms
Gain of the control system=V= 6.0
Gain of the PI controller=Vr= 0.43
R1= 25.6 Kiloohms


## Example12.4,Pg.no.39¶

In [4]:
import math
G=20.0        #smaller time constant in ms
T1=350.0      #bigger time constant in ms
Tn=4*G      #time constant of the controller in ms
print 'Time constant of the controller in SO=Tn=',Tn,'ms'
V=T1/(2*G)        #gain of the control system
print 'Gain of the control system=V=',V
Vg=1.0           #gain of the regulating current link
Vr=V/Vg        #gain of the PI regulator
print 'Gain of the PI regulator=Vr=',Vr
R1=11.0          #R1 in KiloOhms
R2=R1*Vr       #R2 in kiloohms
print 'R2=',R2,'Kiloohms'
C2=round(C2,1)

Time constant of the controller in SO=Tn= 80.0 ms
Gain of the control system=V= 8.75
Gain of the PI regulator=Vr= 8.75
R2= 96.25 Kiloohms


## Example12.5,Pg.no.39¶

In [5]:
import math
from math import sqrt
G=6        #smaller time constant in ms
T1=80      #bigger time constant in ms
Tn=T1      #time constant of the controller in ms
print 'Time constant of the controller=Tn=',Tn,'ms'
V=T1/(2*G)   #gain of the control system
print 'Gain of the control system=V=',V
Wn=1/(sqrt(2)*G)    #Natural frequency of the system in rad/ms
Wn=round(Wn,3)
print 'Natural frequency of the system=Wn=',Wn,'rad/ ms'
Tf=4.7*G      #time taken by the system to achiecve i t s desired output for firsttime
print 'time taken by the system to achieve its desired value=Tf=',Tf,'ms'
print 'Maximum overshoot for a symmetrically optimised system is 4.3 percent'
Tmax=6.24*G         #time at which maximum overload will occur in ms
print 'Time at which maximum overload will occur= Tmax=',Tmax,'ms'

Time constant of the controller=Tn= 80 ms
Gain of the control system=V= 6
Natural frequency of the system=Wn= 0.118 rad/ ms
time taken by the system to achieve its desired value=Tf= 28.2 ms
Maximum overshoot for a symmetrically optimised system is 4.3 percent
Time at which maximum overload will occur= Tmax= 37.44 ms


## Example12.6,Pg.no.40¶

In [6]:
import math
G=20      #smaller time constant in ms
Tn=4*G    #time constant of the controller in ms
print 'time constant of the controller=Tn=',Tn,'ms'
T1=170       #bigger time constant in ms
V=T1/(2*G)   #gain of the control system
print 'Gain of the control system=V=',V
Tf=3.1*G    #time taken by the system to achiecve its final value on step input
print 'time taken by the system to achieve its final value=Tf=',Tf,'ms'
print 'Maximum overshoot for a symmetrically optimised system is 43 percent'

time constant of the controller=Tn= 80 ms
Gain of the control system=V= 4
time taken by the system to achieve its final value=Tf= 62.0 ms
Maximum overshoot for a symmetrically optimised system is 43 percent


## Example12.7,Pg.no.40¶

In [7]:
import math
G=10         #smaller time constant in ms
Tf=4.7*G     #time taken by the system to achiecve its final output for firsttime
print 'time taken by the system to achieve its final value=Tf=',Tf,'ms'
print 'Maximum overshoot for a symmetrically optimised system is 4.3 percent'
Tmax=6.24*G      #time at which maximum overshoot will occur in ms
print 'Time at which maximum overshoot will occur =Tmax=',Tmax,'ms'
Ts=8.4*G         #settling time in ms
print 'Settling time=Ts=',Ts,'ms'

time taken by the system to achieve its final value=Tf= 47.0 ms
Maximum overshoot for a symmetrically optimised system is 4.3 percent
Time at which maximum overshoot will occur =Tmax= 62.4 ms
Settling time=Ts= 84.0 ms


## Example12.8,Pg.no.41¶

In [8]:
import math
print 'Response for an AVO system:'
G=10    #smaller time constant in ms
Tf=4.7*G       #time taken by the system to achiecve its f i n a l output for firsttime
print 'time taken by the system to achieve its final value=Tf=',Tf,'ms'
print 'Maximum overshoot for a symmetrically optimised system is 4.3 percent'
Ts=8.4*G   #settling time in ms
print 'Settling time=Ts=',Ts,'ms'
print 'Response for an SO system:'
G=10               #smaller time constant in ms
Tf=3.1*G           #time taken by the system to achiecve its f i n a l output for firsttime
print 'time taken by the system to achieve its final value=Tf=',Tf,'ms'
Ts=16.6*G       #settling time in ms
print 'Settling time=Ts=',Ts,'ms'

Response for an AVO system:
time taken by the system to achieve its final value=Tf= 47.0 ms
Maximum overshoot for a symmetrically optimised system is 4.3 percent
Settling time=Ts= 84.0 ms
Response for an SO system:
time taken by the system to achieve its final value=Tf= 31.0 ms
Settling time=Ts= 166.0 ms