You are on page 1of 11

Mathematical

Modelling and
Parameter Estimation of
a RC Circuit and
Control of the Capacitor
Voltage

Erandi M.A.U
200161V
Assignment tasks
Part a)

Using Kirchhoff’s Voltage law for the circuit,


ei(t) = i(t)R + eo(t) (1)
For the capacitor,
𝑑𝑒𝑜(𝑡)
i(t) = C 𝑑𝑡
(2)

Using equation (1) and (2) ,


𝑑𝑒𝑜(𝑡)
ei(t) = R C 𝑑𝑡
+ eo(t)

Taking Laplace Transform,


𝑑𝑒𝑜(𝑡)
L{ ei(t) } = L{ R C 𝑑𝑡
+ eo(t)}

Ei(s) = RC[sEo(s) – eo(0)] + Eo(s)


Assume eo(0) = 0,
𝐸𝑖(𝑠) = RC[sEo(s) ] + Eo(s)

Ei(s)
Eo(s) = 1+sRC
Ei(s) 1
Eo(s) = 1 . RC
s+
RC

Taking inverse Laplace transform,


ei(t)
eo (t) = (1 – e-t/RC )
RC

Here we got the same type of given equation eo (t) = A (1 – e-t/τ ).


By comparing the constants,
ei(t)
A = RC

𝜏 = RC
Using the given Step response figure,
𝜏 is the time taken for the response to reach (1-e-1).
A = 5 * 63.2% = 3.16
According to the given figure when amplitude is 3.16 the time taken is 1second.
Then,

𝜏 = 1.
Part b)
From the previous part we got 𝜏 = 1 ,
Then RC= 1,
Ei(s)
Eo(s) = .1
s+1
Eo(s) 1
Gp(s) = = s+1
Ei(s)

Proportional control Gc(s) = K Feedback element H(s) = 1

Step response of the closed loop system with Proportional Control


K
M(s) = s+1+K

When K=10,

Step response is not settled at 1 when K=10. That means a steady state error has in the model.To
minimize the error we can increase the K value and check the step response.When we increasing
the K value we got the best step response at K = 100.But still the steady state error remains.
K = 100,

Step response of the closed loop system with Proportional Integral Control

M(s) = Kp .s + KI
s2 + (Kp + 1)s + KI
The characteristic equation is,
s2 + (Kp + 1)s + KI
The Routh’s array is,

s2 1 KI
s Kp + 1 0
s0 KI 0
For stability,
Kp + 1 > 0 and KI > 0
Kp > -1 and KI > 0
Step response when Kp = 20 and Ki = 2,
The steady state error has now minimized but the step response is still not ideal.

Step response when Kp = 100 and Ki = 20, After increasing the Kp and Ki we got the ideal step
response.
c)
The system can be modelled as follows with Proportional integral Controler
𝑀(𝑠) = 𝐸𝑜(𝑠) = 𝐾𝑃 + KI
𝑅(𝑠) 𝑠2 + (𝐾𝑃 + 1)s + KI
(𝑠2 + (𝐾𝑃 + 1)s + KI)𝐸𝑜(𝑠) =( 𝐾𝑃 s +KI )𝑅(𝑠)
Taking Laplace transform,

d2eo(t) + (Kp +1) deo(t) + KI eo (t) = Kp dr(t) + KI r(t)


d2t dt dt

Taking Kp = 100 and Ki = 50 obtained following voltage profile.


The obtained supply voltage graph.

The obtained power graph


d)
If the same supply voltage we obtained above have send through an open circuit loop control
system the output voltage waveform will be much similar to that supply voltage waveform
because of the unity feedback.
Without employing feedback control, the differential equation of the plant cannot be solved to
create the input. Therefore, open-loop control cannot be used to complete the specified control
task. The simplicity and reduced complexity of open-loop control may be advantages. The
assumption that the input-output relationship is known with absolute certainty and that the
dynamics of the system do not change over time leads to this, though. Obviously, this is not the
case in real-world situations. A system's dynamics and model may be impacted by a variety of
disturbances and uncertainties, which may have an impact on the system's real behavior and
cause it to behave differently than what is expected. Because of this, the system operates
unstably.
Appendix
Part b)

%%P control k=10 (fig1)

K = 10;
M = tf(K,[1 1+K]);
step(M),grid on

%%P control k=100 (fig2)

K = 100;
M = tf(K,[1 1+K]);
step(M),grid on

%%PI control (fig3)


Kp=20;
Ki = 2;
M=tf([Kp Ki],[1 Kp+1 Ki]);
step(M),grid on

%%PI control (fig4)


Kp=100;
Ki = 20;
M=tf([Kp Ki],[1 Kp+1 Ki]);
step(M),grid on

part c)
%% PI control parameters
Kp = 100;
Ki = 50;
R = 100;
C = 0.01;

%% reference voltage profile


t = 0:0.01:15;
ref = zeros(size(t));
ref(1:500) = (5/5)*t(1:500);
ref(501:1000) = 5;
ref(1001:end) = 15 - (5/5)*t(1001:end);
%% actual voltage profile
system_with_PI= tf([Kp Ki],[1 Kp+1 Ki]);
y_pI=lsim(system_with_PI,ref,t);

figure
plot(t,y_pI,'g',t,ref,'r--')
title('Voltage Profile')
ylabel('Voltage (V)')
xlabel('Time (s)')

%% supply voltage
ei = R*C*diff(PI_Y)./diff(t) + PI_Y(1:end-1);
figure
plot(t(1:end-1),ei)
xlabel('Time (s)')
ylabel('Supply Voltage (V)')
title('Supply Voltage vs Time')

%% power
i = C*diff(PI_Y)./diff(t);
p = PI_Y(1:end-1).*i;
figure
plot(t(1:end-1),p)
title('Power vs Time')
xlabel('Time (s)')
ylabel('Power (W)')

You might also like