Sie sind auf Seite 1von 6

FAKULTAS TEKNIK

UNIVERSITAS NEGERI YOGYAKARTA


LABSHEET PRAKTIKUM KENDALI CERDAS
No. : 03 Revisi : 02 Kamis 17092020 Hal. 1 dari 6 hal.
Sem.:5 Single Neural PID Control 4 x 50 menit

A. Teori Singkat
1. Neural PID Control
PID Intelligent Control Based on Single Neuron Network Single Neuron Adaptive Intelligent PID
Controller consists of single neurons with self-learning and self-adaptive ability, not only simple
structure, but it can also adapt to environmental changes and has strong robustness. Dalam single neuron,
there are several typical learning rules, including:
(1) Unsupervised Hebb learning rules
Hebb learning is a kind of related learning. The basic idea is that if two neurons are activated at the
same time, the connection strength between them is enhanced with them. The product of the
excitation is proportional to O, which represents the activation value of neuron i, Oj represents the
activation value of neuron j, and we represents the connection weight of neuron i and neuron j, then
the Hebb learning rule can be expressed as:

Dw ij (k ) = ho j (k )oi (k ) (1)

The activation value, w, represents the connection weight of neuron i and neuron j, then the Hebb
learning rule can be expressed as: Dm /(k)= ho(k)o(k), where h is learning rate.
(2) Supervised Delta learning rules
In the Hebb learning rules, the signal is introduced, that is, O is replaced by the desired output d,
and the difference between the actual output and the actual output constitutes the Delta learning
rule with supervised learning;

Dw ij (k ) = h(d j (k ) − o j (k ))oi (k ) (2)

(3) The supervised Hebb learning rules


Combination of unsupervised Hebb learning rules with supervised Delta learning rules is to form
supervised Hebb learning rules:

Dw ij (k ) = h(d j (k ) − o j (k ))o j (k )oi (k ) (3)

2. Single Neuron Adaptive PID Control


Single Neuron Adaptive PID Control Structure is shown in Figure 1.
e
+
-

rin
x1 Yout
x2 u
PID + PLANT
-
x3 -1
Z

Figure 1 Single Neuron Adaptive PID Control Structure


FAKULTAS TEKNIK
UNIVERSITAS NEGERI YOGYAKARTA
LABSHEET PRAKTIKUM KENDALI CERDAS
No. : 03 Revisi : 02 Kamis 17092020 Hal. 2 dari 6 hal.
Sem.:5 Single Neural PID Control 4 x 50 menit

The single neuron adaptive controller is adaptive by adjusting the weighting coefficients. The adjustment
is implemented according to the supervised Hebb learning rules. Control algorithm and learning
algorithm are self-organizing function, weight coefficient

3
u ( k ) = u ( k − 1) + K wi ( k ) xi ( k )
 (4)
i =1
3
w i (k ) = w i (k ) /  w i (k ) (5)
i =1

w1 ( k ) = w1 ( k − 1) +  P z ( k ) u ( k ) x1 ( k )
w2 ( k ) = w2 ( k − 1) +  I z ( k ) u ( k ) x2 ( k ) (6)
w3 ( k ) = w3 ( k − 1) +  D z ( k ) u ( k ) x3 ( k )

where,
x1 (k ) = e(k );
x 2 (k ) = e(k ) − e(k − 1);
x 3 (k ) = D2e(k ) = e(k ) − 2e(k − 1) + e(k − 2);
z(k ) = e(k ) .

where ηP, ηI, ηD are the proportional, the integral, and the differential learning rate. K is the proportional
coefficient of the neuron, K for the ratio P, the integral I, and the differential D, respectively. The
learning rate are different value, so that different weight coefficients are adjusted separately. The faster
the better, but the overshoot are large, and may even make the system unstable. To ensure the stability
of the system, the choose K value is too small, which makes the selection of the system's fast K value
very important. The larger K is, the K value must be reduced. When the controlled object delay is
increased, the performance is worse.

3. Improved single neuron adaptive PID control


In a large number of practical applications, it has been shown through practice that the online learning
correction of PID parameters is mainly related to e(k) and De(k). Based on this, the weighting coefficient
learning correction part in the single neuron adaptive PID control algorithm can be modified, that is, (k)
is changed to dk) + De(k), and the improved algorithm is as follows:
3
u (k ) = u (k − 1) + K  w i (k )x i (k ) (7)
i =1
3
w i (k ) = w i (k ) /  w i (k )
i =1

w1 (k ) = w1 (k − 1) + h I z(k )u(k )(e(k ) + De(k ))


w 2 (k ) = w 2 (k − 1) + h Pz(k )u(k )(e(k ) + De(k ))
FAKULTAS TEKNIK
UNIVERSITAS NEGERI YOGYAKARTA
LABSHEET PRAKTIKUM KENDALI CERDAS
No. : 03 Revisi : 02 Kamis 17092020 Hal. 3 dari 6 hal.
Sem.:5 Single Neural PID Control 4 x 50 menit

w 3 (k ) = w 3 (k − 1) + h D z(k )u (k )(e(k ) + De(k ))


Dimana De(k ) = e(k ) − e(k − 1), z(k ) = e(k )

After adopting the above improved algorithm, the online correction of the weight coefficient is not
completely based on the neural network learning principle, but is based on practical experience.

4. The simulation program


The analysis simulation example set the controlled object to be

y(k) = 0.368y (k-1) + 0.26 y(k-2) + 0.10 u(k-1) + 0.632 u(k-2).

The input command is a square wave signal: rin(k)=0.5*sign(sin(2*2*pi*k*ts)), the sampling time is
1 mS (ts=0.001), and the four control laws are used for single neuron PID control, i.e. unsupervised
Hebb learning rule, supervised Delta learning rules, supervised Hebb learning rules, and improved Hebb
learning rule. The tracking results are shown in Figure 2 ~ Figure 5.

Figure 2 Location tracking based on unsupervised Hebb learning rules (M = 1)

Figure 3 Location Tracking Based on Supervised Delta Learning Rules (M-2)


FAKULTAS TEKNIK
UNIVERSITAS NEGERI YOGYAKARTA
LABSHEET PRAKTIKUM KENDALI CERDAS
No. : 03 Revisi : 02 Kamis 17092020 Hal. 4 dari 6 hal.
Sem.:5 Single Neural PID Control 4 x 50 menit

Figure 4 Position Tracking (M-3) based on supervised Hebb learning rules

Figure 5 Position Tracking Based on Improved Learning Rules (M-4)

B. Program
%Single Neural Adaptive PID Controller
clear all;
close all;

x=[0,0,0]';

xiteP=0.40;
xiteI=0.35;
xiteD=0.40;

%Initilizing kp, ki and kd


wkp_1=0.10;
wki_1=0.10;
wkd_1=0.10;

error_1=0;
error_2=0;
FAKULTAS TEKNIK
UNIVERSITAS NEGERI YOGYAKARTA
LABSHEET PRAKTIKUM KENDALI CERDAS
No. : 03 Revisi : 02 Kamis 17092020 Hal. 5 dari 6 hal.
Sem.:5 Single Neural PID Control 4 x 50 menit

y_1=0;y_2=0;y_3=0;
u_1=0;u_2=0;u_3=0;

ts=0.001;
for k=1:1:1000
time(k)=k*ts;
rin(k)=0.5*sign(sin(2*2*pi*k*ts));
yout(k)=0.368*y_1+0.26*y_2+0.1*u_1+0.632*u_2;
error(k)=rin(k)-yout(k);

% Adjusting Weight Value by hebb learning algorithm


M=4;
if M==1 %No Supervised Heb learning algorithm
wkp(k)=wkp_1+xiteP*u_1*x(1); %P
wki(k)=wki_1+xiteI*u_1*x(2); %I
wkd(k)=wkd_1+xiteD*u_1*x(3); %D
K=0.06;
elseif M==2 %Supervised Delta learning algorithm
wkp(k)=wkp_1+xiteP*error(k)*u_1; %P
wki(k)=wki_1+xiteI*error(k)*u_1; %I
wkd(k)=wkd_1+xiteD*error(k)*u_1; %D
K=0.12;
elseif M==3 %Supervised Heb learning algorithm
wkp(k)=wkp_1+xiteP*error(k)*u_1*x(1); %P
wki(k)=wki_1+xiteI*error(k)*u_1*x(2); %I
wkd(k)=wkd_1+xiteD*error(k)*u_1*x(3); %D
K=0.12;
elseif M==4 %Improved Heb learning algorithm
wkp(k)=wkp_1+xiteP*error(k)*u_1*(2*error(k)-error_1);
wki(k)=wki_1+xiteI*error(k)*u_1*(2*error(k)-error_1);
wkd(k)=wkd_1+xiteD*error(k)*u_1*(2*error(k)-error_1);
K=0.12;
end

x(1)=error(k)-error_1; %P
x(2)=error(k); %I
x(3)=error(k)-2*error_1+error_2; %D

wadd(k)=abs(wkp(k))+abs(wki(k))+abs(wkd(k));
w11(k)=wkp(k)/wadd(k);
w22(k)=wki(k)/wadd(k);
w33(k)=wkd(k)/wadd(k);
w=[w11(k),w22(k),w33(k)];

u(k)=u_1+K*w*x; %Control law

if u(k)>10
u(k)=10;
end
if u(k)<-10
u(k)=-10;
FAKULTAS TEKNIK
UNIVERSITAS NEGERI YOGYAKARTA
LABSHEET PRAKTIKUM KENDALI CERDAS
No. : 03 Revisi : 02 Kamis 17092020 Hal. 6 dari 6 hal.
Sem.:5 Single Neural PID Control 4 x 50 menit

end

error_2=error_1;
error_1=error(k);

u_3=u_2;
u_2=u_1;
u_1=u(k);

y_3=y_2;
y_2=y_1;
y_1=yout(k);

wkp_1=wkp(k);
wkd_1=wkd(k);
wki_1=wki(k);
end

figure(1);
plot(time,rin,'b',time,yout,'r');
xlabel('time(s)');ylabel('rin,yout');
figure(2);
plot(time,error,'r');
xlabel('time(s)');ylabel('error');
figure(3);
plot(time,u,'r');
xlabel('time(s)');ylabel('u');

C. Tugas Praktikum
1. Tulislah program sebagaimana pada percobaan diatas, dan lakukan eksekusi, amati hasilnya.
2. Ubahlah/modifikasi junlah learningnya, amati hasilnya
3. Lakukan Perubahan persamaan plant menjadi gelombang sinus, amati hasilnya
4. Lakukan perubahan/modifikasi nilai besaran PID menjadi Neural PI controller, amati hasilnya.
5. Lakukan perubahan transfer function PLANT menjadi y(k) = 0.5y (k-1) + 0.12 y(k-2) + 0.004
u(k-1) + 0.23 u(k-2)., Amati yang terjadi dan tunjukan perubahan outputnya.
6. Jelaskan apa yang dimaksud learning pada Neural Network, dan diantara ke-empat learning pada
program tersebut diatas, mana yang hasil outputnya terbaik.

Das könnte Ihnen auch gefallen