Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

FAKULTAS TEKNIK

UNIVERSITAS NEGERI YOGYAKARTA


LABSHEET PRAKTIKUM KENDALI CERDAS
No.:01 Revisi:01 Selasa031018 Hal.1 dari6 hal.
Sem.:5 Neural PIDControl 4x50 menit

A. Teori Singkat
1. Neural PID Conttrol
PID Intelligent Control Based on Single Neuron Network Single Neuron Adaaptive Intelligent PID
Controller consists of single neurons with self-learning and self-adaptive abillity, not onlly simple
structure, but it can also adapt to environmental changes and has strong robustness. Dalam single
neuron, tthere are several typical llearning rules, including:
(1) Unssupervised Hebb learning rules
Hebb learning iis a kind of rrelated learning. The bassic idea is that if two neurons are acttivated at
thesame time, tthe connection strength between them is enhanced with them. The product of the
excitation is proportional toO, which represents theactivation value of neuron i, Oj represents the
actiivation value of neuron jj, and we represents theconnectionweight of neeuron i andneuron j,
then the Hebb learning rulecan be expressed as:

Dw ij k hoj (1)
The activation value, w, represents the connection weight of neuron i and neeuron j, thenthe Hebb
learrning rule can be expressed as: Dm /((k)= ho(k)o(k), where h i s
(2) Supervised Deltta learning rules
In tthe Hebb learrning rules, tthe signal isintroduced,that is, O isreplaced by the desiredoutput d,
and the difference betweenthe actual output and the actual output constituttes the Delta learning
rule with supervised learning;

(2)
Dw ij k hdj oi k
(3) The supervisedHebb learning rules
Combination off unsupervised Hebb learrning rules with supervised Delta learrning rules is to form
supervised Hebb learning rules:

(3)
Dw ij k hdj j

2. Singlee Neuron Adaptive PID Control


Single Neuron Adaptive PID Control Structure is shown iin Figure 1.

Figure 1 Single Neuron Adaptive PID Controll Structure


FAKULTAS TEKNIK
UNIVERSITAS NEGERI YOGYAKARTA
LABSHEET PRAKTIKUM KENDALI CERDAS
No.:01 Revisi:01 Selasa031018 Hal.2 dari6 hal.
Sem.:5 Neural PIDControl 4x50 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 algorrithm and
learningalgorithm arre self-organizing function, weight coefficient

K wi k x i k (4)
i1

(5)
wi k

hz k u k x 1 k
(6)
hz k u k x 2k
hz k u k x 3 k

where,
ek;
ek
2e k 1 e k 2;

z k e k

h, h, h are. the integrral, proportio onal, differential learning rate, K is tthe proportional coefficient of the
neuron,K for the inttegral 1, the ratio P and tthe differentiial D respecttively use diffferent learning rates,
so that different weight coefficie nts are adjussted separately. The faster the better,but the overrshoot are
large, and may even make the ssystem unstable. To ensure the stabiility of the ssystem, the choose K
value istoo small, which makes t the selection of the system's fast K value very important. The larger K
is, the K value mustt be reduced d. When the controlled object delay is increased, the perforrmance is
worse.

3. Improved single neuron adapptive PID control


In a large number off practical appplications, itt has been shown through practice that the online learning
correction of PID parameters iis mainly related to e(k) and De(k). Based on this, the weighting
coefficient learning correction part in the single neurron adaptive PID contrrol algorithm can be
modified, that is, (k)is changed to
t dk) + De(k), and the improved algorithm is as ffollows:
3
k (7)
u k uk 1 K
i1

wi k 3 wi k
i1

h P z k uk e k De k
FAKULTAS TEKNIK
UNIVERSITAS NEGERI YOGYAKARTA
LABSHEET PRAKTIKUM KENDALI CERDAS
No.:01 Revisi:01 Selasa031018 Hal.3 dari6 hal.
Sem.:5 Neural PIDControl 4x50 menit

h Dz k uk ek De k
Dimana k e k 1 ,z k ek

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 anallysis simulattion example set the contrrolled objectt 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 commandis a square wave signal:r in(k)= 0.5sgn(sin(4pt), tthe samplingtime is 1 mss, and the
four control laws are used for single neurron PID control, i.e. unsupervised Hebb learning rule:
supervised Delta learning ruless: supervised Hebb learrning rules; improved Hebb learning rules,
trackingresults are shown in Figure 2 ~ Figure 5.

Figure 2 Location tracking based on unsupervised Hebb llearning rule s (M = 1)


FAKULTAS TEKNIK
UNIVERSITAS NEGERI YOGYAKARTA
LABSHEET PRAKTIKUM KENDALI CERDAS
No.:01 Revisi:01 Selasa031018 Hal.4 dari6 hal.
Sem.:5 Neural PIDControl 4x50 menit

Figure 3 Location T racking Based on Supervised Delta Learning Rulles (M-2)

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.:01 Revisi:01 Selasa031018 Hal.5 dari6 hal.
Sem.:5 Neural PIDControl 4x50 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 he bb learning algorithm
M=4; vised Heb learning algorithm
l

if M==1 %No Super


; %P
wkp(k)=wkp_1+xiteP*u_1*x(1)
%

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

end %P
x(1)=error ( %I
x(2)=error((k); or_2; %D
x(3)=error((k)-2*error_1+err (k))+abs((wkd(k));
wadd(k)=abs(wkp(k))+abs(wki
w11(k)=wkp((k)/wadd(k);
w22(k)=wki((k)/wadd(k);
w33(k)=wkd((k)/wadd(k);
%Control law
w=[[w11(k),w22(k),w33(k)];
u(k)=u_1+K*w*x;
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.:01 Revisi:01 Selasa031018 Hal.6 dari6 hal.
Sem.:5 Neural PIDControl 4x50 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,
');
figure(2);
plot(time,error,'r'); yout');
xlabel('time(s)');ylabel('erro r');
figure(3);
plot(time,u,'r');
xlabel('time(s)');ylabel('u');

C. Percobaan
1. Tulislah program sebagaimana pada percobaan diatas, dan lakukan eksekusi,amati hasilnya.
2. ikasi junlah llearningnya,amati hasilnya
3. Lakukan Perubahan persamaan plant menjadi gelombang sinus, amati hasilnya
4. Lakukan perubahan/modifikasi nilai besaran PID mendjadi Neurral PI controlller, amati hasilnya.
5. Buat Rangkaian mikrokontrroller menggunakan Proteus dan buatllah programnya, buat laporan.

You might also like