xy plotter

44
DEPARTMENT OF MECHANICAL ENGINEERING BANGLADESH UNIVERSITY OF ENGINEERING AND TECHNOLOGY, DHAKA-1000,BANGLADESH 2D DRAWING MACHINE PROJECT REPORT INSTRUMENTATION AND MEASUREMENT SESSIONAL (ME 362) SUBMITTED BY SHAFKAT AHMED (1010062) MD. TAFSIR HOSSAIN VHUIYAN (1010070) MD. MASUDUR RAHMAN (1001078) MD. SYAM HASAN (1001087)

Upload: sazal-rahman

Post on 12-Nov-2015

138 views

Category:

Documents


9 download

DESCRIPTION

Project Report on XY Plotter

TRANSCRIPT

The project we have worked on is Automatic Drawing Machine

DEPARTMENT OF MECHANICAL ENGINEERINGBANGLADESH UNIVERSITY OF ENGINEERING AND TECHNOLOGY,DHAKA-1000,BANGLADESH 2D DRAWING MACHINE PROJECT REPORT INSTRUMENTATION AND MEASUREMENT SESSIONAL(ME 362)SUBMITTED BY SHAFKAT AHMED (1010062)

MD. TAFSIR HOSSAIN VHUIYAN (1010070)

MD. MASUDUR RAHMAN (1001078)

MD. SYAM HASAN (1001087)

GROUP NO- B12 SUPERVISED BY AMINUL ISLAM KHAN, LECTURER KAZI ARAFAT RAHMAN, LECTURER KM RAFIDH HASSAN, LECTURERAll rights reserved by Bangladesh university of Engineering and technology (BUET), Dhaka-1000, Bangladesh . BUET can use and reproduce fully or partially the work being presented if needed.

ACKNOWLEDGEMENT `

At the first we would like to be grateful to Allah by whose mercy we complete our project successfully. It is really an exciting project and for the first time we were given the chance of creative work under academic course. In this particular project we received kind guideline and help of many persons. We would like to express humble respect to our parents as their inspiration and blessing were always with us. Then we want to express our special gratitude to our respective teacher Abdur Rashid Sarkar.We also like to thank our honorable teachers Aminul Islam Khan, Kazi Arafat Rahman, KM Rafidh Hassan for their instructive suggestions and guidelines. Without their proper guideline it would be impossible for us to complete the project.

ABSTRACTThe project we have worked on is Automatic Drawing Machine. It is very handy in real life problem facing. Perhaps you have never been gifted at drawing, or you dont have the time to do it yourself, so why not let a simple Automatic Drawing Machine draw it for you. This simple two axis device can accurately moves a pen according to the instruction given to it to draw out anything.It has a two axis control and a special mechanism to raise and lower the pen. We have used rack and pinion system to control the placement of the pen to draw on the paper. It can draw not only on paper but also on any plane surface placed horizontally below the particular position of the drawing machine. Each pinion is powered using a single DC motor and it moves along the rack. The intersection point of the two shafts protude from the motor holder holds the pen holder. Another rack and pinion system and a small dc motor is used to control the vertical movement of the Pen above the writing plane. For precession in drawing we also used pully mechanism. In our project we only concentrated on drawing geometric shape. If we will have given enough scope to work on it we can make further improvement like free sketching, engineering structure drawing and so so. TABLE OF CONTENTS CAPTER NO.CHAPTER NAME PAGE NUMBER

1INTRODUCTION01

2METHODOLOGY

3PROBLEMS& LIMITATION

4CONCLUSION& RECOMENDATION

5REFERENCE

6APPENDICES

CHAPTER 1INTRODUCTION1.1 BACKGROUNDDrawing is a very important aspect in our daily life. It is a part and parcel of education system. We can not even think of a single day without drawing in study. It is also a very essential part of any engineering structure design. Again in official affairs we have to perform certain drawings. Sometimes manual approach to any drawing may be time consuming and errors may occur. In this case Automatic Drawing Machine can serve the following purposes with maximum accuracy. It also performs swiftly and smoothly which save our time and effort. 1.2 STATEMENT OF PROBLEMS Our project is under the academic course ME 362. We were given the oportunity of choosing any project according to our will and we chose this very project. We had to complete this project alongside our academic study. So we could not give our maximum effort to our project and we had to face certain problems. We had very limited time to finish this project and we faced difficulties to collect and assemble our desired and required machine parts. 1.2 APPLICATIONSOur project 2D Drawing Machine is very useful in educational and official works .Because we cant think of a single day without drawing anything. Our main purpose of this project is to make a simple and feasible machine which can draw such things that we draw frequently in our everyday life. The main applications of our project are given below-

We are engineering students. So we have to draw a lot of things. Our machine will help us to draw simple geometric shape, best fitted curve, graphs and many other 2D shapes.

In structural and mechanical design accuracy is obvious. Sometimes it becomes quite difficult to draw exactly and precisely by hand. In such case our machine can help to draw the structure and machine part accurately and quickly with minimum percentage of deviation.

In official affairs, the monthly and annual reports have to be presented in graphical form. Sometimes they need the best fitted curve. In such case our drawing machine can help to a great extent.

CHAPTER 2METHODOLOGY

2.1 Project Design

The entire design can be described by dividing into two subcategories. 1. Mechanical Design

2. Electrical Design

2.1.1 Mechanical Design

The mechanical design of the 2D curve drawing machine is the most important as it involves higher accuracy in designing different parts for the successful running of the machine. The mechanical design is developed in SolidWorks2013 software. The entire assembly of the machine consists of the following sub assemblies or sections.

1. Pen holder Sub assembly.

2. Motor holder sub assembly.

3. Slider sub assembly.4. Wooden frame.

5. Rack and pinion system .6. Pulley mechanism.(In the real view) Rack and Pinion system Wooden frame Motor holder sub assembly

Slider sub assembly Pen holder sub assembly

Figure 2-1 Solidworks Assembly of the entire structure Pulley Mechanism Figure 2-2 Real view of the Entire structureThe Solidworks drawing (2D+3D) of different parts has given below. 1 2 3

4 5Figure 2-1 Rack and pinion system(All dimension are in millimeter)(1) Rack (Module-1.25, Pitch height-25, Pressure Angle-20 degree, Face width-5mm);(2) Pinion for x axis and y axis movement controlling motor ( Module-1.25, Number of teeth-12, Pressure Angle-20 degree, Face width-5mm);(3) Pinion of motor for controlling vertical movement of pen (Module-1.25, Number of teeth-12, Pressure Angle-20 degree, Face width-5mm);(4) 3D drawing of pinion.

(5) 3D drawing of Rack And pinion system

Figure 2-2a 2D drawing of Different parts of Penholder(All dimensions are in millimeter)

Figure 2-2b 2D drawing of Different parts of Penholder(All dimensions are in millimeter) Figure 2-3 Solidworks Design of a part which was collected from CD-Drive Figure 2-4 Pen holder Assembly (Real & Solidworks Assembly)

Figure 2-5a 2D drawing of different parts of motor holder (All dimension are in millimeter)

Figure 2-5b 2D drawing of different parts of motor holder (All dimension are in millimeter) Figure 2-6 3D drawing of Motor holder sub assembly

Figure 2-7 2D drawing of different parts of slider sub assembly(All dimension are in millimeter)

Figure 2-8 3D drawing of Slider sub assembly PulleyFigure 2-9 Pulley mechanism used in the machine2.1.1.1 Material

The material that is used to made different parts is Acrylic. Different parts of the project has been cut from an Acrylic sheet of 5mm thickness using a leaser cutting machine. 2.1 ELECTRICAL DESIGN The electric design consists of the following components:

(1)Atmega32 Microcontroller(2 )

(2)L2983 Motor driver IC (2 Piece)

(3)L293D Motor driver IC (1 Piece)(4) 7805 IC

(5) 7812 IC(6)20*4 LCD display

(7) Crystal (16Mhz)

(8) Capacitors(100nF)

(9) Wires

(10) Heat sink

(11) Diodes(1N4148,1N4007)

(12) Push switch

(13) Led

(14) Bread board

(15) Vero board

(16) DC geared MotorTwo motor driver IC (L298) is used to control motors which control x axis and y axis movement. Another motor driver IC (L393D) is used to control the motor which control the vertical movement of the pen .One microcontroller control x axis movement controlling motor and the LCD display .Another microcontroller control y axis movement controlling motor And pen movement controlling motor.Circuit diagram of different section of the full diagram has given in the following page.

Figure 2-10 Keypad circuit diagram

Figure 2-11 LCD Display connections

Figure 2-12 Motor Driver IC connections Figure 2-13 Full circuit diagram

Figure 2-14 Real view of full circuit diagram3. WORKING PRICIPLE

When a object move along a curve path with constant velocity than x and y component of the velocity varies with time .If we consider parametric or polar equation of the curve than it can be said that the velocity components varies with the angle theta.And the angle theta varies with time.

=vX

=vy

Again So if the x and y component of velocity(Vx and Vy) of a object moving at a constant velocity can be controlled according a specific polar equation of path than the object must travel along that path.

By using PWM( pulse width modulation ) rotational speed of a motor can be controlled with higher accuracy. On the other hand the linear speed is proportional to the rotational speed (v=wr).

In PWM applied voltage to a motor is controlled by a higher frequency signal by controlling the width of the signal .To control the width of the signal value of a resister called output compare resister (OCR1A or OCR1B) is controlled with time using a loop according to a desired equation in the programming .As a result the x and y component of velocity of the motor is changed with time and the pen moves along that curved path.

PWM (pulse width modulation)A Pulse Width Modulated signal is a type of digital waveform. It alternates between bursts of On and Off, also known as high and low respectively, at a fixed frequency. The PWM signal differs from other digital signals (e.g. square waves) because the time that the signal is high and low can be varied. This is useful because when the PWMsignal is averaged with a simple analogue filter, a DC voltage is produced thatis proportional to the duty cycle (which is the percentage of time that the PWM signal is high). Since a vibration motor's speed and frequency of vibration is directly proportional to the voltage applied to the motor, we can use PWM to control precisely how the motor runs.

The PWM signal has three separate components:

A Voltage, - the value of the on or high voltage level (typically between 2 ~ 5V if PWM signal is produced by a microcontroller / CMOS logic).

A Frequency - the period of one clock cycle, i.e. one high pulse and one low pulse.

A Duty Cycle - the ratio of the on-time to the off-time, which controls the resulting voltage, explained in detail below.

The Duty Cycle represents the length of the On pulse compared to one period cycle. It is expressed as a percentage. To illustrate the difference in Duty Cycles, there are example waveforms below:

The resulting voltage, which is seen by the motor, is the average voltage over the period. It is easily calculated using the following formula:

We can see from the formula that the we can adjust the voltage by changing the Duty Cycle. For example, if we have a 3 V PWM signal with a 50% Duty Cycle, the average output voltage is:

If we wanted to increase the voltage to 2.25V we can rearrange the formula to find the appropriate Duty Cycle

This means that controlling the speed of the motor, the vibration frequency and also the vibration strength, can easily be achieved by altering the PWM signals Duty Cycle in the microcontroller. The advantage of this technique is that the microcontroller can make a simple adjustment to its output depending upon the input conditions and its programme. Also certain events., specific output waveforms can be stored in libraries or memory which can be recalled for

A Real-life ExampleConsider the simple waveform below:

Figure PWM Example WaveformHere we have a simple waveform which starts with a Duty Cycle of 25%, then increasing to 50%, and finally 75%. Note again that the maximum voltage and frequency have remained constant, and only the Duty Cycle has changed. We can calculate the average voltage over each section:

25% :: 50% :: 75% :: The output voltage, which is the voltage seen by the motor, of the above waveform is shown below:

Figure Output Voltage of Different Duty CyclesPlease note this is an example aimed at demonstrating the effect of change in the output voltage with differing the Duty Cycles and that the actual performance may differ. For instance the acceleration between voltage levels can differ depending on available current and other circuit components.

Driving Motors with PWM

As demonstrated above, a microcontroller can easily change the voltage applied to a motor using a PWM signal. It can build quite complex waveform to increase haptic feedback performance, and even store these waveforms in libraries or some remote memory location.

Unfortunately, it is not possible to drive the motor directly from the microcontroller itself due to the current draw of the motor. Hence a switching amplifier is needed which with appropriate PWM signals to tackle two issues:

Supplying enough current to drive the motor.

Supplying enough voltage to meet the required motor start voltage.

Microcontrollers are usually designed to be as efficient as possible with fast switching capabilities. As a result they use low voltage and low current signals for their inputs and outputs. Vibration motors, as with most DC motors, have a maximum operating current much higher than the microcontroller can provide.In addition, ignoring the current supply problem, the DC output voltage from the microcontroller may also be too small.Due to this reasons Motor driver ICs are used. Motor drive chips have multiple benefits. They can have built in H-bridges for advanced driving techniques, help with voltage regulation, and often accept PWM signals as control.LIMITATIONS

Our 2D Drawing Machine is very helpful in our life. But it has some limitations, because we faced some difficulties during making this machine. So we couldnt make it according to our desire. The main limitations are given below- Our drawing machine can draw only 2D drawings. It cant draw any kind of 3D drawings, it is the main limitations.

It can draw only some specific geometrical shapes depending on the computer program. We cant draw anything according to our wish.

We dont use computer interfacing in our project. If that was used our program will become capable and more feasible to draw any shapes.

It can draw only on a horizontal plane, if we want to draw anything in a vertical or a inclined plane , we dont use this machine.

RECOMMENDATIONSOur 2D Drawing Machine has a number of applications. But it also has some limitations. So, further improvements of our project are recommended. The main sectors of improvements are given below-

We use rack and pinion system only in two sides and on other two sides we use slider. So it became quite difficult for us to maintain the horizontal balance between the motors and the sliders. So if rack and pinion system is used on four sides, the balance will be perfect and the percentage of accuracy will be high.

We use a small rack and pinion system to control the vertical movements of the pen. If servo motor is used the movements will be controlled more precisely.

If we improve our computer program then the machine can draw different more shapes according to our wish.

Computer interfacing should be included in the project. Then the machine will be used in more sectors and it will draw easily different shapes.

CONCLUSIONS The 2D Drawing machine is very helpful and essential in our everyday life. But we cant fulfill our requirement that was given to us . Our machine can draw different straight geometrical shapes like straight line, triangle ,rectangle etc. but it face some problems to draw the curves. In computer simulations it doesnt show any difficulties but when it starts drawing curves it cant finish the figure. It may be caused due to connection problems. We tried our best to solve these problems, but due to time limitations it was difficult for us to find out the problems. If we have given little more time, then our machine will give better performance. We hope that after correcting these problems our 2D Drawing Machine will be a useful and essential machine for our daily life.CHAPTER 5

REFERENCE Mechanical Measurement By Thomas G. Beckwith Sixth Edition (Pearson Publicatons)

The Arts of Electronics By Paul Horrowitz (Megrawill)

Introduction to Mechatronics and Measurements systems By Macheal B Histand (Third edition)

Experimental Methods For Engineers By J.P. Holman (TATA Megrawill)

http://en.wikipedia.org/wiki/Simple_Sensor_Interface_protocol http://www.instructables.com http://www.precisionmicrodrives.com/application-notes-technical-guides/application-bulletins/ab- 012-driving-vibration-motors-with-pwm

CHAPTER 6

APPENDICES

6.1 COST ANALYSIS6.1.1 MECHANICAL PART COSTNo. of ElementMATERIAL COST(BDT)

1Acrylic sheet600

2Cutting Cost1400

3Stainless steel Rod150

4Small pulley120

5Wood frame1200

6Miscellaneous 200

Total 3670

6.1.2 ELECTRICAL PARTS COSTNo. of Element MATERIALAMOUNT COST(BDT)

1DC motors of 7kg torque2

900

2DC motor of 3kg torque1350

3Microcontrollers(AT mega 32) 2500

4 L298 IC2

300

5L293D IC190

6Heat sink

210

8Bread Board

2250

10Vero board120

11LCD display1350

12Crystal250

13Switch1430

147805 IC115

157812 IC120

16Wires25 feet150

17Capacitor810

18Diode3060

Total3105

Total Cost=6775 (BDT)

6.2 Programming C code of the machine has given below:

Code for Microcontroller-1:

#include

#include

#include"lcd.h"

#include

#include

#include

#define pi 3.14592654

void Drawing_line(void);

void Drawing_circle(void);

void Drawing_ellipse(void);

void Drawing_quadrilateral(void);

int input_number(unsigned int);

void input_point(unsigned int *p);

void input_length(unsigned int *L);

void init_timer1(void);

unsigned int power_of(unsigned int B, unsigned int E);

unsigned int digits_of_number(int);

unsigned int reset=0,n=0,digits[6]={0,0,0,0,0,0};

float ocr_factor;

int last_value_of_x=0;

char line[16],line1[16];

void main(void)

{

DDRD=0xFF;

unsigned int d;

DDRA=0x00;

if(n==0)

{LCDInit();

n=1;

}

LCDSendCmd(0x01);

LCDGotoXY(1,1);

sprintf(line,"line-1,Quadrilat-2");

LCDString(line);

LCDGotoXY(1,2);

sprintf(line,"Circal-3,ellipse-4");

LCDString(line);

while(1)

{

d=((~(PINA))&0xF);

if(d>0)

{

d=((~(PINA))&0xF)-1;

if(reset==0)

{

if(d==1)

{

_delay_ms(300);

Drawing_line();

}

if(d==2)

{

_delay_ms(300);

Drawing_quadrilateral();

}

else if(d==3)

{

_delay_ms(300);

Drawing_circle();

}

else if(d==4)

{

_delay_ms(300);

Drawing_ellipse();

}

}

else if(d==12)

{

_delay_ms(300);

reset=0;

main();

}

}

}

}

void Drawing_quadrilateral(void)

{

unsigned int length,width,i=0,c;

float t1,t2;

sprintf(line,"Length=?");

input_length(&length);

sprintf(line,"Width=?");

input_length(&width);

LCDSendCmd(0x01);

LCDGotoXY(1,1);

sprintf(line,"Length=%d",length);

LCDString(line);

LCDGotoXY(1,2);

sprintf(line,"Width=%d",width);

LCDString(line);

_delay_ms(145);

while(i.5)

{c=c+1;}

if(i==0)

{

PORTD|=(1