Praktikum Sistem Kontrol Digital
Eksperimen 3 : Kontrol PID
Tujuan
1. Mempelajari konsep dan karakteristik PID (Proposional, Integral, Derivatif). 2. Membuat pemodelan PID menggunakan Scilab dan Xcos.
Dasar Teori
Pada suatu sistem closed-loop feedback, main system didefinisikan sebagai sistem yang akan dikontrol, kemudian controller menyediakan sebuah design untuk mengontrol keseluruhan dari sebuah sistem seperti terlihat pada Gambar 1. Sebuah sistem memiliki feedback processing yang digunakan untuk mereduksi error yang terjadi hingga mendekati 0, secepat mungkin hingga tidak ada osilasi.
Gambar 1. Sistem Closed-Loop Feedback
Variabel (Xe) merepresentasikan pelacakan error, perbedaan antara input value (Xi) dan output saat ini (Xo). Sinyal error ini akan dikirim ke PID Controller, controller menghitung sinyal error dari proporsional gain, derivatif dan integral. Sinyal (u) melewati controller saat ini sama dengan proposional gain (Kp), ditambah dengan integral gain (Ki), ditambah dengan derivatif gain (Kd).
( ) ( ) ∫ ( )
Sinyal (u) di kirim ke main system, dan output yang baru (Xo), akan diperoleh. Output ini akan dikirim kembali ke sensor untuk memperoleh sinyal error yang baru. Fungsi alih dari persamaan PID tersebut sebagai berikut :
Proportional Control
Proportional control adalah gain yang digunakan untuk mengatur perilaku dari sinyal error terhadap input dari sistem. Proposional digunakan untuk mengatur speed
dari sistem. Nilai gain yang semakin besar dapat menghasilkan overshoot dari sistem. Karakteristik Proporsional controller :
mereduksi risetime
tidak pernah mengeliminasi steady-state error
Gambar 2. Proportional Control
Integral Control
Integral control sangat berguna untuk mencegah offset error yang terjadi dan terkait dengan akurasi dari sebuah sistem control. Output akan berkembang sampai sistem merespon dan mereduksi error yang terjadi hingga nilainya 0.
Persamaannya sebagai berikut: ( ) ∫
∫ ( )
dimana Ti adalah integral nilai konstannya. Karakteristik integral control, sebagai berikut:
Mengeliminasi steady state error Buruk pada respon transientnya
Gambar 3. Integral Control
Derivatif Control
Aksi dari derivatif control berguna untuk meningkatkan damping sistem, memungkinkan respon yang cepat tanpa adanya overshoot. Persamaan derivatif control adalah : ( ) ( ) ( ) ( )
dimana Kp adalah konstanta proporsional dan Td adalah differential time constant. Karakteristik dari derivatif control adalah sebagai berikut:
Meningkatkan Kestabilan dari sistem Mereduksi overshoot
Meningkatkan respons transient
Integral Xe e 𝑢 𝐾𝑖 ∫ 𝑋𝑒𝑑𝑡 Proportional Xe u = KpXe
Gambar 4. Derivatif Control
Tabel 1 menunjukkan karakteristik P,I,D controller.
Tabel 1. Karakteristik Kp, Ki, dan Kd
Type Rise Time Overshoot Settling Time Steady State Error
Kp Decrease Increase Small change Decrease Ki Decrease Increase Increase Eliminate Kd Small change Decrase Decrease Small Change
Eksperimen
Eksperimen 1 : Pemodelan Sistem Cruise Control
Gambar 5. Sistem Cruise Control
Sumber: http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=SystemModeling Persamaannya adalah ̇ , karena difokuskan pada pengaturan kecepatan maka keluarannya dengan . Representasi state space nya menjadi:
̇ [ ̇] [ ] [ ] [ ] [ ] [ ][ ]
Transfer functionnya menjadi :
( ) ( ) ( ) [ ] Spesifikasi performa: Rise time < 5s Overshoot < 10% Steady state error < 2%
Differential
Xe 𝑈(𝑡) 𝐾𝑑𝑑𝑋𝑒
Instruksi Scilab
Buatlah SciNotes baru untuk menyimpan fungsi menghitung rise time, peak time, overshoot max dan settling time berikut:
steady_state adalah masukan nilai steady state sistem
step_response adalah step response sistem
step_t dan max_t yaitu apabila t = 0:0.1:20 maka t = 0:step_t:max_t
function [rise_t, peak_t, overshoot, settling_t] = compute(steady_state, step_response, step_t, max_t) k = 1; c = 1;
while step_response(c) < (0.9 * steady_state)
if (step_response(c) > (0.1 * steady_state)) then k = k + 1; end c = c + 1; end rise_t = step_t*(k - 1); [step_response_max, rp] = max(step_response) peak_t = (rp - 1)*step_t;
overshoot = abs(step_response_max - steady_state) / steady_state * 100;
rmax = max_t/step_t; k = rmax +1;
while step_response(k) > (steady_state - 0.02 *
steady_state) & step_response(k) < (steady_state + 0.02 * steady_state) k = k - 1; end settling_t = (k-1)*step_t; disp(steady_state, 'steady_state') disp(rise_t, 'rise_time'); disp(peak_t, 'peak_time'); disp(overshoot, 'overshoot'); disp(settling_t, 'settling_time'); endfunction
Buatlah SciNotes baru untuk program menghitung fungsi alih PID berikut:
// fungsi alih PID
function c = pid(Kp, Ki, Kd) s = %s;
c = syslin('c', Kp + Ki/s + Kd*s); endfunction
Buatlah SciNotes baru untuk program berikut:
clear; clc; xdel ( winsid ());
cd "lokasi folder dimana anda menyimpan fungsi" exec("compute.sci"); exec("pid.sci"); m = 1000; b = 50; u = 10; A = -b/m; B = 1/m; C = 1; D = 0; s = %s; state_space = syslin('c',A,B,C,D); tf_sistem = syslin('c', 1/(1000*s+50)); tb = syslin('c',(1+0*s)/(1+0*s));
// open-loop & close-loop ol_sistem = tf_sistem*tb; cl_sistem = tf_sistem/.tb;
t = 0:0.1:20;
step_response = csim('step', t, ol_sistem); scf(1); clf(1); xgrid();
xtitle('Step Respons', 'time', 'response'); plot(t, step_response, 'r-');
Eksperimen 2 : Propotional (P) Control
Instruksi Scilab:
scf(2); clf(2); xgrid();
xtitle('Step Respons', 'time', 'response'); drawlater()
Kp = 500; Ki = 0; Kd = 0; tf_pid = pid(Kp, Ki, Kd);
cl_pid = tf_pid*ol_sistem/.tb; disp(cl_pid) step_response = csim('step', t, u*cl_pid); plot(t, step_response, 'g-');
Kp = 5000; Ki = 0; Kd = 0; tf_pid = pid(Kp, Ki, Kd);
cl_pid = tf_pid*ol_sistem/.tb; disp(cl_pid) step_response = csim('step', t, u*cl_pid); plot(t, step_response, 'b-');
Lengkapi tabel berikut ini :
Kp Rise Time Settling Time Steady State Peak Response
500 5000
Eksperimen 3 : Propotional-Integral (PI) Control
Instruksi Scilab
Kp = 600; Ki = 1; Kd = 0; tf_pid = pid(Kp, Ki, Kd);
cl_pid = tf_pid*ol_sistem/.tb; disp(cl_pid) step_response = csim('step', t, u*cl_pid); plot(t, step_response, 'y-');
Kp = 800; Ki = 40; Kd = 0; tf_pid = pid(Kp, Ki, Kd);
cl_pid = tf_pid*ol_sistem/.tb; disp(cl_pid) step_response = csim('step', t, u*cl_pid); step_respons = step_response;
plot(t, step_response, 'm-');
Lengkapi tabel berikut ini :
Kp Ki Rise Time Settling
Time Steady State
Peak Response
600 1 800 40
Eksperimen 4 : Propotional-Integral-Derivatif (PID) Control
Instruksi Scilab
// contoh penerapan PID Control Kp = 300; Ki = 1; Kd = 1;
tf_pid = pid(Kp, Ki, Kd);
cl_pid = tf_pid*ol_sistem/.tb; disp(cl_pid) step_response = csim('step', t, u*cl_pid); plot(t, step_response, 'k-');
drawnow();
Lengkapi tabel berikut ini :
Kp Ki Kd Rise Time Settling Time Steady State Peak Response 300 1 1 Instruksi Scilab
Contoh cara menghitung Rise Time, Settling Time, Steady State, dan Peak Response Misal untuk Eksperimen 3 dengan Kp = 800 dan Ki = 40.
x = 0;
// steady state
steady_state = (u*(800*x + 40))/(1000*x^2 + 850*x + 40);
[rise_time, peak_time, overshoot_max, settling_time] = compute(steady_state, step_respons, 0.1, 20);
Eksperimen 5 : Menggunakan Xcos
1. Buatlah Blok Sistem seperti Gambar 6 berikut.
Note:
Superblok yang ada pada Blok (c) adalah Blok (b) kemudian Blok (a) secara berurutan.
(a)
(b)
(c)
Gambar 6. Blok Cruiser Control pada XCos
2. Klik kanan pada sistem kemudian pilih Set Context dan isikan variabel dibawah ini:
m = 1000; Kp = 800; b = 50; Ki = 40; u = 10; Kd = 0;
3. Set scope >> ymin = 0, ymax = 1, dan refresh period = 10, kemudian set simulation >> setup, isikan final integration time 10.
Tugas
1. Jelaskan karakteristik masing-masing P, I, D dan perpaduan antar kedua atau ketiganya!
2. Apa pengaruh Kp, Ki, Kd pada rise time, overshoot, settling time, steady state error?