Sei sulla pagina 1di 16

FACULTY OF MANUFACTURING ENGINEERING

COMPUTER SIMULATION

(BFM3002)

GROUP PROJECT ( PROBLEM NO.3)

NAME ID. NO

AMIIR HAAMZAH BIN MOHAMED ISMAIL FB17086

CZARUL AMRI B. ZAINAN FB17044

MUHAMMAD ZAHIN BIN MUHAMMAD ZAKIR FB17090

MUHAMMAD NUR QAYYUM BIN KAMARULBAHRIN FB17096

MUHAMMAD FAUZAN FAKHRI BIN NAZARIANI FB17013

Date of Submission :
17th MAY 2019

Lecturer :
DR. AMIRIL SAHAB BIN ABDUL SANI
INDIVIDUAL PROGRESS REPORT

Amiir Haamzah Bin Mohamed Ismail (Fb17086)

Our group have been chosen to do problem no.3 for our final project. The question of problem
3 are as such:
At first, our group was confused of what the problem we need to solve. After several discussion,
our group concluded that we need to simulate the motion of the tool along the path shown in
the previous figure. We have to follow the parameters given in problem 3. The workflow of
our group is shown in the following process flowchart below.

Dot/Circle to
Make it rotate Compile as one
illustrate
around a point system
movement of tool

Program a
Adjust the speed of Adjust speed of tool
rectangular path for
rotation of movement on
the system to move
dot/circle straight path
on

Adjust speed of toll


Adjust tool
movement on
rotational speed
curved path

These are process we needed to do in order to make our program run as require by the
question.Every group member has been given their own task. For my part, I was in
charge of compiling all the code into one program. My responsibility also to provide a
general code and to code the rectangular tool path for the tool to follow (The black line
shown by the yellow arrow.).
The problem I faced was to make sure the tool moves in a continuous path from start until
end. I solved this problem by repeating the same loop for four times which is equal to each
sides of the rectangular path.

I would rate this program is 75% to 80% completed and functional.


Czarul Amri Bin Zainan (FB17044)

For my part in this programming was to make sure the speed and the starting point are
properly function. As for the speed of the tool I used an array coding which from 0 to 1. As
for the sequence I calculated it based on the speed required for the tool during horizontal
and vertical movement. For horizontal the sequence I used is 0.00056. As for the vertical
movement sequence I used is 0.0016 which I able to make the movement of the machine
match with the requested speed.

For the starting point of the machine, I make the program read the started point for the
rectangle we make. From the task I have been given I was only able to completely around
60% to 70% because I was only able to programed the vertical speed and horizontal speed
as for the curve speed I wasn’t able to complete it.
Muhammad Fauzan Fakhri Bin Nazariani (FB17013)

earth
moon
sun

The problem I faced was to make sure the tool rotates and follow the path. I implement the
orbit system to overcome the problem, repeating path that the moon in space takes around
the earth while the earth moves around the sun. The sun as a centre of rectangular, the orbit
of earth as parameter of the rectangle and the orbit of moon as parameter of the circle. From
this situation, we can see rotation of the moon as a rotation of the tools

I would rate this program is 80% to 85% completed and functional.


Muhammad Zahin Bin Muhammad Zakir (FB17090)

My task just same like Fauzan but more to control the speed of rotation of tool. From the
problem,there have state a specific speed required,like speed of tool must be 80 rpm.This
tool will move around the workpiece for polishing. The rotation of tool is clockwise, as a
prove there have a small circle that rotating in circle rotation along a rectangular curve
line like moon rotating around the earth just like Fauzan explain.I’m also try to make the
tool move at curve direction by specific speed required in the problem and try to find the
way from the google how to control it,but still don’t make it. From this, program will
able to completely functional about 80% to 85%.
Muhammad Nur Qayyum Bin Kamarulbahrin (FB17090)

The problem I faced is how to present the animation using GUI by clicking the play
button. In order to present the animation using GUI I rearrange the program from the
main and put into specific function at GUI programming code. Before that I have to
create some button to make sure it can play the animation. Home position is where when
we press the button it shows the tool position starting point at the base. Whereas Play
animation button will play the animation according to the program. Axes is to make sure
that the graph or any plot can be plotted. . Based on the figure below these are the designs
I created

The program is then insert on the push button function which we can get from m.file so it
will execute the flow that we want on the push button.
Coding Kinematic motion of the Polishing Tool

function varargout = Project3KinematicMotionOfTool(varargin)


% PROJECT3KINEMATICMOTIONOFTOOL MATLAB code for
Project3KinematicMotionOfTool.fig
% PROJECT3KINEMATICMOTIONOFTOOL, by itself, creates a new
PROJECT3KINEMATICMOTIONOFTOOL or raises the existing
% singleton*.
%
% H = PROJECT3KINEMATICMOTIONOFTOOL returns the handle to a new
PROJECT3KINEMATICMOTIONOFTOOL or the handle to
% the existing singleton*.
%
%
PROJECT3KINEMATICMOTIONOFTOOL('CALLBACK',hObject,eventData,handles,.
..) calls the local
% function named CALLBACK in PROJECT3KINEMATICMOTIONOFTOOL.M
with the given input arguments.
%
% PROJECT3KINEMATICMOTIONOFTOOL('Property','Value',...) creates a new
PROJECT3KINEMATICMOTIONOFTOOL or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Project3KinematicMotionOfTool_OpeningFcn gets
called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Project3KinematicMotionOfTool_OpeningFcn via
varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help Project3KinematicMotionOfTool

% Last Modified by GUIDE v2.5 16-May-2019 22:30:55

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Project3KinematicMotionOfTool_OpeningFcn, ...
'gui_OutputFcn', @Project3KinematicMotionOfTool_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT

% --- Executes just before Project3KinematicMotionOfTool is made visible.


function Project3KinematicMotionOfTool_OpeningFcn(hObject, eventdata, handles,
varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Project3KinematicMotionOfTool (see
VARARGIN)
% Choose default command line output for Project3KinematicMotionOfTool
handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

% UIWAIT makes Project3KinematicMotionOfTool wait for user response (see


UIRESUME)
% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = Project3KinematicMotionOfTool_OutputFcn(hObject, eventdata,
handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure


varargout{1} = handles.output;

% --- Executes on button press in pushbutton1.


function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clc
clear all
rectangle('Position',[ 0 0 178 62],'Curvature',0.7)
axis([-50 225 -50 100])
hold on
t=-111*pi:0.01:111*pi;
x1=25*cos(t);
y1=25*sin(t);
xplot = plot(x1,y1,'m')
hold on
yplot = plot(x1(25-14*1),y1(25-14*1),'ok','MarkerSize',5,'MarkerFaceColor','w')

% --- Executes on button press in pushbutton2.


function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clc
clear all
t=0:0.00056:1; % the middle is velocity of movement along rectangular path
xt=180.*t;
yt=0.*t;

t1=0:0.0016:1;
xt3=0*t1;
yt3=60.*t1;

t2=1:-0.00056:0;
xt5=180.*t2;
yt5=60;

t3=1:-0.0016:0;
xt7=0.*t3;
yt7=60.*t3;

n=length(xt);
n1=length(xt3);
n2=length(xt5);
n3=length(xt7);
%Movement of both system

for i=1:1:n
xt2=xt(i); %Position of center circle pink
yt2=yt(i); %Center of dot
al=25; % horizontal radius of pink circle *100
bl=25; % vertical radius of pink circle *100
%Movement of dot in circle
x0l=xt2; % x01,y01 coordinated for pink circle movement
y0l=yt2;
t=-111*pi:0.01:111*pi;
xl=x0l+al*cos(t);
yl=y0l+bl*sin(t);
m=length(xl);

plot(xl,yl,'m') %dot circular movement


hold on
plot(xl(m-14*i),yl(m-14*i),'ok','MarkerSize',5,'MarkerFaceColor','w') %animation of
dot and pink circle
hold on
rectangle('Position',[0 0 178 62],'Curvature',0.7) %rectangular movement
hold on

hold off
axis([-50 225 -50 100])
pause(.0000000001)

end
% for the next code is a loop with different parameters but same structure.
for i=1:1:n1
xt4=180;
yt4=yt3(i);
al=25;
bl=25;

x02=xt4;
y02=yt4;
t=-111*pi:0.01:111*pi;
x2=x02+al*cos(t);
y2=y02+bl*sin(t);
m=length(x2);

plot(x2,y2,'m')
hold on
plot(x2(m-14*i),y2(m-14*i),'ok','MarkerSize',5,'MarkerFaceColor','w')
hold on
rectangle('Position',[ 0 0 178 62],'Curvature',0.7)
hold on
hold off
axis([-50 225 -50 100])
pause(.0000000001)

end
for i=1:1:n2
xt6=xt5(i);
yt6=60;
al=25;
bl=25;

x03=xt6;
y03=yt6;
t=-111*pi:0.01:111*pi;
x3=x03+al*cos(t);
y3=y03+bl*sin(t);
m=length(x3);

plot(x3,y3,'m')
hold on
plot(x3(m-14*i),y3(m-14*i),'ok','MarkerSize',5,'MarkerFaceColor','w')
hold on
rectangle('Position',[0 0 178 62],'Curvature',0.7)
hold on

hold off
axis([-50 225 -50 100])
pause(.0000000001)

end
for i=1:1:n3
xt8=0;
yt8=yt7(i);
al=25;
bl=25;

x04=xt8;
y04=yt8;
t=-111*pi:0.01:111*pi;
x4=x04+al*cos(t);
y4=y04+bl*sin(t);
m=length(x4);

plot(x4,y4,'m')
hold on
plot(x4(m-14*i),y4(m-14*i),'ok','MarkerSize',5,'MarkerFaceColor','w')
hold on
rectangle('Position',[0 0 178 62],'Curvature',0.7)
hold on

hold off
axis([-50 225 -50 100])
pause(.0000000001)

end

Potrebbero piacerti anche