You are on page 1of 4

Dynamic Systems and Controls Project

ME 3543.001
Parker Bradshaw
@01337418
4/29/2016
Statement and Project Objectives:
The design problem is to propose a controller Gc(s) to control the vertical height, Y(s), of rowdy
to take him from the bottom left corner to the top right corner of the graph without him bumping
into pipes on the way. The figure 2 shows the block diagram of the control system. The input
1
R(s) is a step input. The plant is given by () = (+2)(+3) . In this case the steady state error is
zero, the percent error overshoot is at 10% and the settling time should be 1.33 sec.
The objective is to design a controller, Gc(s), to meet all three specifications stated above. If a
controller with proportional specifications is not able to be performed, then a controller of choice
will be created to meet the specifications.

Technical Approach:
In order to achieve
clc
clear all
close all

Put your compensator here %%


For example compensator = 123.45*(s+2)/(s+10) is written as %%%%%
num_compensator = conv([1 20.0],[1 .5]);
den_compensator = [1 0];
K = 1.0;

%%%%%%%%% No need to modify the part below this line %%%%%%%%%


num_sys = 1;
den_sys = conv([1 2],[1 3]);

num = conv(num_compensator,num_sys);
den = conv(den_compensator,den_sys);
sys = tf(num,den);
tfinal = 50;

T_closedloop = feedback(K*sys,1);
[y,t] = step(T_closedloop,tfinal);

column_scale = (1100-150)/50;
row_scale = (70-800)/1;

start_col = 150;
start_row = 750;
t_pixels = start_col+round(t*column_scale);
y_pixels = start_row+round(y*row_scale);

big=imread('background.png');
small=imread('rowdy.jpg');

[m1,n1,p1] = size(big);
[m2,n2,p2] = size(small);
%
%%%%%% move left to right %%%
figure(1)
m = length(t);
n = round(m*(1.33/50));
index = [1:2:n n+1:20:m];
set(gcf,'DoubleBuffer','on');
traj = [];
for i=1:length(index)
im = big;
traj = [traj; y_pixels(index(i))+ round((1+m2)/2), t_pixels(index(i))+ round((1+n2)/2)];
im(y_pixels(index(i))+1:y_pixels(index(i))+m2,...
t_pixels(index(i))+1:t_pixels(index(i))+n2,...
:) = small;
imshow(im);
for j=1:size(traj)
text(traj(j,2),traj(j,1),'o','Color','red','FontSize',14);
end
pause(0.001);
end

Published with MATLAB R2015b

You might also like