.5 Đồ thị sai lệch vị trí của xe đẩy

Một phần của tài liệu Ch­¬ng 1: tæng quan vò ®iòu khión tèi ­u, ®iòu khión LQR (Trang 68 - 74)

Số hóa bởi Trung tâm Học liệu – ĐHTN http://www.lrc-tnu.edu.vn

64

Bảng 1: Các kết quả khi sử dụng phương pháp LQR-GA cho góc con lắc

Đối tƣợng LQR-GA

Gía trị phản hồi, K [-29.8724,20.2218,71.5782,14.4192]

Thời gian thiết lập, ts 1.83 s

Khoảng sai số tối đa [11.24°, -24.54°]

Sai lệch tĩnh ess 0

Bảng 2: Các kết quả khi sử dụng phương pháp LQR-GA cho vị trí xe đẩy

Đối tƣợng LQR-GA

Thời gian khởi động, tr 0.58 s

Thời gian thiết lập ts 1.16 s

Phần trăm sai số, OS 0.94 %

Số hóa bởi Trung tâm Học liệu – ĐHTN http://www.lrc-tnu.edu.vn

65

KẾT LUẬN

LQR là một phƣơng pháp dùng để thiết kế bộ điều khiển phản hồi trạng thái tuyến tính. Theo phƣơng pháp này ma trận phản hồi trạng thái đƣợc tính tốn sao cho chất lƣợng của hệ thống điều khiển cực tiểu hoá hàm mục tiêu chất lƣợng dạng tồn phƣơng tuyến tính. Việc xác định ma trận phản hồi trạng thái bằng cách giải phƣơng trình RICATI.

Trong phƣơng trình RICATI nếu khơng biết đƣợc mơ hình tốn tuyến tính của đối tƣợng điều khiển thì khơng thể tìm đƣợc lời giải cho bài tốn điều khiển LQR theo các biểu thức giải tích (1.134) đƣợc.

Trong luận văn dùng giải thuật di truyền để tìm lời giải tối ƣu cho bài tốn LQR mà mơ hình tốn của đối tƣợng điều khiển khơng phải dạng tuyến tính. Với đối tƣợng điều khiển là con lắc ngƣợc, các kết quả mô phỏng cho thấy với bộ điều khiển phản hồi trạng thái có các tham số đƣợc xác định bằng GA chất lƣợng điều khiển đáp ứng đƣợc các yêu cầu chất lƣợng để ra.

Số hóa bởi Trung tâm Học liệu – ĐHTN http://www.lrc-tnu.edu.vn

66

TÀI LIỆU THAM KHẢO

[1] Nguyễn Thị Phƣơng Hà (2008), “Lý thuyết điều khiển hiện đại”,Nhà xuất bản Đại học Bách khoa, Đại học QG tp.HCM

[2] Nguyễn Doãn Phƣớc (2005), “Lý thuyết điều khiển nâng cao”, Nhà xuất bản Khoa học và kỹ thuật, Hà Nội

[3] Hoàn Kiếm - Lê Hoàng Thái (2000), “ Giải thuật di truyền, cách giải

tự nhiên các bài tốn trên máy tính”, Nhà xuất bản Giáo dục, Hà Nội.

[4] Vũ Xuân Mạnh (2006), “Phát triển một số kỹ thuật trong tính tốn mềm”, Luận án Tiến sĩ, Viện công nghệ thông tin - Hà Nội.

[5] Nguyễn Phùng Quang (2003), “ MATLAB & Simulink dành cho kỹ sư

điều khiển tự động”, Nhà xuất bản Khoa học và kỹ thuật, Hà Nội.

[5] David A.Coley: An Instroduction to Genetic Algorithm. [6] Bách khoa toàn thƣ mở: Http://vi.wikipedia.org, 2006.

[7] Http://ieeexplore.ieee.org [8] Http://www.library.cmu.edu (adsbygoogle = window.adsbygoogle || []).push({});

Số hóa bởi Trung tâm Học liệu – ĐHTN http://www.lrc-tnu.edu.vn

67

PHỤ LỤC

Đoạn chƣơng trình

% GA_scr_v1.m

% solution of improving edge detection of tracker by % genetic algorithm optimization.

% preliminaries clear all close all clc warning off dbstop if error

if exist('GA_lqr_param.mat','file')==2,load GA_lqr_param, end

num_elements = 15;% number of elements evaluated each genertion maxgen = 50;% maximum number of generation (iterations)

num_xovers = 3; % number of cross overs

nvar = 11; % number of variables (see next line) filtr_pole = 0.9;

% field_max_vec = [5*ones(1,4),1000*ones(1,2),2000,1000*ones(1,2),120];

field_max_vec = [5*ones(1.4),1500*ones(1,2),3000];

GA_field_max(:,1) = field_max_vec(1)*ones(num_elements,1); %state wt1 GA_field_max(:,2) = field_max_vec(2)*ones(num_elements,1); %state wt2 GA_field_max(:,3) = field_max_vec(3)*ones(num_elements,1); %state wt3 GA_field_max(:,4) = field_max_vec(4)*ones(num_elements,1); %state wt4 GA_field_max(:,5) = field_max_vec(1)*ones(num_elements,1); %control wt1 GA_field_max(:,6) = field_max_vec(2)*ones(num_elements,1); %control wt2 GA_field_max(:,7) = field_max_vec(3)*ones(num_elements,1); %control wt3

% GA_field_max(:,8) = field_max_vec(1)*ones(num_elements,1); %control wt1 % GA_field_max(:,9) = field_max_vec(2)*ones(num_elements,1); %control wt2 % GA_field_max(:,10) = field_max_vec(3)*ones(num_elements,1); %control wt3

% field_min_vec = [zeros(1,2),2*ones(1,2),200,2*ones(1,2),200];

field_min_vec = [zeros(1,),2*ones(1,2),200];

GA_field_min(:,1) = field_min_vec(1)*ones(num_elements,1); %state wt1 GA_field_min(:,2) = field_min_vec(2)*ones(num_elements,1); %state wt2 GA_field_min(:,3) = field_min_vec(3)*ones(num_elements,1); %state wt3 GA_field_min(:,4) = field_min_vec(4)*ones(num_elements,1); %state wt4 GA_field_min(:,7) = field_min_vec(1)*ones(num_elements,1); %control wt1 GA_field_min(:,8) = field_min_vec(2)*ones(num_elements,1); %control wt2 GA_field_min(:,9) = field_min_vec(3)*ones(num_elements,1); %control wt3

%GA_field_min(:,10) = field_min_vec(1)*ones(num_elements,1); %control wt1 %GA_field_min(:,11) = field_min_vec(2)*ones(num_elements,1); %control wt2 %GA_field_min(:,12) = field_min_vec(3)*ones(num_elements,1); %control wt3

GA_field = GA_field_min + (GA_field_max - GA_field_min).*rand(size(GA_field_min)); if exist('global_best','var'), GA_field = [GA_field(1:end-1,:);global_best(1,:)]; end if exist('global_2nd_best','var'), GA_field = [GA_field(2:end,:);global_2nd_best(1,:)]; end GA_best = GA_field; GA_best_cum = GA_field; perf_index_vec = contr_opt(GA_field); % [perf_index_vec,edge_PI_vec] = get_GA_optim(GA_field); [PImin,ind_PImin] = min(perf_index_vec); glob_best = ones(num_elements,1)*GA_field(ind_PImin,:); xcum = GA_field; perf_index_cum = perf_index_vec;

Số hóa bởi Trung tâm Học liệu – ĐHTN http://www.lrc-tnu.edu.vn 68 [val ncp] = min(perf_index_cum,[],2); [val1 ncg] = min(val); [temp,nc2b] = sort(val); global_2nd_best = GA_best(nc2b(2),:); glob_best_filt = glob_best(1,:);

for gen = 1:MAXGEN;

temp1 = [glob_best(1,:);glob_best_filt];

temp1 = [temp1;(rand(1,nvar)/15+1).*global_2nd_best(1,:)]; glob_best_mute = ceil(num_elememts/2);

end

for k = 1:glob_best_mute_xovers-1 % mutation computations

temp = (rand(1,nvar)/15+1).*glob_best(1,:); temp1 = [temp1;temp];

end

for k = 1:num_xovers-1 % crossover computation

temp = randi(nvar,[1,5]);% select from 5 variables to get better (adsbygoogle = window.adsbygoogle || []).push({});

spread

minx = min(temp); maxx = max(temp);

temp = GA_field(randi([2 num_elements],1),:); temp(minx:maxx) = glob_best(1,minx:maxx); temp1 = [temp1;temp]; end [nr,nc] = size(temp1); chromo_mute = randi(num_elements,[num_elements-nr,1]); temp2 = [];

for k = 1:num_elements-nr % mutation computations

temp = (randn(1,nvar)/15+1).*GA_field(chromo_mute(k),:); temp2 = [temp2;temp];

end

GA_field = [temp1;temp2];

GA_field = min(GA_field,GA_field_max); % unper constraint GA_field = max(GA_field,GA_field_min); % lower constraint xcum = [xcum,GA_field];

perf_index_vec = contr_opt(GA_field);

% [perf_index_vec,edge_PI_vec] = get_GA_optim(GA_field);

perf_index_cum = [perf_index_cum perf perf_index_vec]; [val_ncp] = min(perf_index_cum,[],2); for j = 1:length(ncp) GA_best(j,:) = xcum(j,... [nvar*(ncp(j)-1)+1:nvar*(ncp(j)-1)+nvar]); end GA_best_cum = [GA_best_cum,GA_best]; [temp,nc2b] = sort(val); glob_best = ones(num_elements,1)*GA_best(nc2b(1),:); global_2nd_best = GA_best(nc2b(2),:); glob_best_filt = filt_pole*glob_best_filt + (1- filtr_pole)*global_2nd_best;

%[val nedge_best] = min(sum(edge_PI_vec,2)); %edge_glob_best = edge_PI_vec(nedge_best,:);

%save GA_LQR_param perf_index_cum glob_best GA_best_cum xcum %global_2nd_best edge_glob_best

save GA_LQR_param perf_index_cum glob_best GA_best_cum xcum

global_2nd_best

glob_best(1,:),perf_index_vec',%edge_glob_best end

Số hóa bởi Trung tâm Học liệu – ĐHTN http://www.lrc-tnu.edu.vn 69 LQR LQR-GA

Một phần của tài liệu Ch­¬ng 1: tæng quan vò ®iòu khión tèi ­u, ®iòu khión LQR (Trang 68 - 74)