Вы находитесь на странице: 1из 5

World Academy of Science, Engineering and Technology 81 2011

Design and Simulation of Microcontroller Based Automatic Tool Changing System in CNC Machine
La Pyae Lynn, Theingi and Win Khaing Moe
After getting command for a particular tool, the magazine moves in the shortest route to bring the tool to a position where it is accessible to a mechanical handling device. At the end of use, the tool is returned to its slotted position in the magazine before calling the next tool. Automatic tool changers (ATC) have two main characteristics. And they are differentiated: by tool-to-tool time and the numbers of tools they can manage [6] [7]. The drum type tool magazine is used in this tool changing system in CNC machine. AbstractThis research focuses on the automatic tool changing system in CNC machines. Most CNC parts are controlled by hydropneumatic or electronics, but this research represents with electronic system only. In this research, two DC motors are used to control the spindle. The four limit switches are used to start/stop operation of the two DC motors. A unipolar stepping motor is used to rotate the desired angle when the operator calls the required tool to operate. And the keypad is used as the user input. PIC 16F877A microcontroller is used to interface the user input through the driver circuits. And it also drives the two DC motors and the stepper motor to operate correctly. This research mainly concentrates on control logic program and simulation software for automatic tool changing system. By using Proteus 7.7 simulation software, the required angle of stepper motor control and directions of DC motors control are simulated. KeywordsCNC, microcontroller, stepper motor, DC motor,
logic program

(a)

(b)

Fig. 1 (a) Chain type magazine (b) Drum type magazine [6]

I. INTRODUCTION

numerical control is the process of manufacturing machined parts using a computerized controller to command motors which drive each machine axis. In order to achieve high precision machining, many efforts have been made to develop more accurate computerized numerical control (CNC) systems. CNC systems are commonly used in industrial and commercial applications for its compact size, high power-to-weight ratio, reliability, and low maintenance. CNC System includes a PC, motion board, servo motor drive and motors, spindle drive and motor, automatic tool-changer and general I/O card. A tool magazine is an indexable storage used on a machining center to store tools not in use. The tool magazines are available as rotary drum and chain types as shown in Fig.1.
OMPUTER

II. SYSTEM DESCRIPTIONS The overall system of ATC consists of microcontroller, stepper motor for tool magazine, DC motors for spindle and the driver circuit for the motors.

Fig. 2 Block Diagram of the System

La Pyae Lynn is studying at the Department of Mechatronic Engineering, Mandalay Technological University, Myanmar (email:mglapyae81@gmail.com). Dr.Theingi is with West Yangon Technological University, Myanmar (email: theingi.sa@gmail.com). U Win Khaing Moe is with the Department of Electronic Engineering, Yangon Technological University, Myanmar.

A. Microcontroller In this research, PIC 16F877A microcontroller is used to control the motors and interface between the user input and the driver circuit. There are some requirements for proposed system design. The first fact of microcontroller is to provide inexpensive, programmable logic control and interfacing to external devices. The second option is that there are about 32 I/O pins are required for interfacing various input and output devices. PIC 16F877A is used in this research because it is compatible all these requirements.Stepper Motor

330

World Academy of Science, Engineering and Technology 81 2011

B. Stepper Motor A stepper motor is an electromechanical device which converts electrical pulses into discrete mechanical movements. The shaft or spindle of a stepper motor rotates indiscrete step increments when electrical command pulses are applied to it in the proper sequence. The motors rotation has several direct relationships to these applied input pulses [4]. The stepper used in this research has 200 steps per revolution. The relationship between steps per revolution and step angle is given by the following formula;

Motor driving circuit is shown in Fig.3. In this research, the DC motor with H-bridge is used to advance the cage to the next position. The motor provides for clockwise (CW) direction and counter clockwise (CCW) direction. To rotate the DC motor, pin 33 and 34 are used from PIC16F877A. When pin 33 is high and pin 34 is low, Q1and Q4 is energized and motor rotate clockwise direction. When pin 34 is high and pin 33 is low, Q2and Q3 are energized and motor rotate counter clockwise direction. In DC motor, clockwise direction is for Up-state and counter clockwise is for Down-state. E. Stepper Motor Driver Circuit The five-wire, five-phase unipolar stepper motor can easily be controlled from a microcontroller with one MOSFET per winding. The output lines from the PIC16F877A are buffered using a 4050 non-inverting buffer chip. Each buffered signal line is connected to a MOSFET. The IRFZ44N MOSFET is actually an NPN Darlington; in the schematic, it is shown as a standard NPN. As for Darlington connection, two stages of transistors are connected inside in series with one transistor driving the other. A control signal on the base is amplified and then drives the second MOSFET. The resulting circuit can not only switch large currents, but it can do so with a very small controlling current. The diagram of stepper motor driving section is showed in Fig.4. It uses four pins at RB3, RB2, RB1 and RB0 on the PIC to drive the motor. These four pins are connected to transistors Q1, Q2, Q3 and Q4 respectively. Using these pins, the proper transistors are turned ON and OFF to achieve clockwise (CW) or counter clockwise (CCW) rotation. A reverse shunting diode is connected between the emitter and the collector to produce the transistor from reverse voltages
4050 RB3 PIC16F877A RB2 Microcontroller RB1 4050 RB0 4050 4050 Q1 D1 L1 L2 D2 Q3 D3 Stepper Motor L4 L3 Q2

Step angle

360 Number of steps per revolution


Step angle =

(1)
360 200 steps

Step angle = 1.8 It is found that the step angle is 1.8 degree in a step. In this research, the number of tools in the tool magazine is 25 tools. It is necessary to rotate 14.4 degree for one position of 25 tools. So, it needs to rotate 80 steps for one position of tools. For example, if the operator needs to operate the tool number 5, the stepper motor has to rotate 72 degree.
C. DC Motor The DC motor has two basic parts: the rotating part that is called the armature and the stationary part that includes coils of wire called the field coils. The stationary part is also called the stator. The armature is made of coils of wire wrapped around the core, and the core has an extended shaft that rotates on bearings. The ends of each coil of wire on the armature are terminated at one end of the armature. The termination points are called the commutator, and this is where the brushes make electrical contact to bring electrical current from the stationary part to the rotating part of the machine. The coils that are mounted inside the stator are called field coils and they may be connected in series or parallel with each other to create changes of torque in the motor [4]. D. H-Bridge Driver Circuit

10k

IRFZ44N 10k

IRFZ44N 10k +12V

IRFZ44N 10k Q4

D4 IRFZ44N

Fig. 4 Diagram of Stepper Motor Driving Section

Fig. 3 H-Bridge Motor Driving Circuit

III. SYSTEM OPERATION This research is designed to control the tool changing system of the CNC machine such as DMC 105 V machine. It is a milling machine. Two DC motors and one stepper motor are used in this research work. DC motors are used to control the direction of the spindle for X and Z-axis. Stepper motor is used to control the desired rotation of the tool magazine. A PIC microcontroller is also used to drive the three motors. Motors convert current into torque which produces motion. Motors torque properly to move the load at the required speed and acceleration must determine for each motion.

331

World Academy of Science, Engineering and Technology 81 2011

When the operation is started, the spindle moves backwards to the marked position and then moves downward to the tool magazine. And then tool magazine rotates in order to pick up the tool for the spindle. After catching the desired tool from the tool magazine, the spindle moves upward and moves forward to the operating area.
Limit switch

This process will also go on until the limit switch four reaches. After switching limit switch four, the stepper motor

Limit switch 2 and 3

Limit switch 4

Fig. 5 Tool Changing Process

Fig. 6 Tool Magazine and Spindle of DMC 105 V

A. Flow Chat of DC Motor Control The functional flow chart of the system is illustrated in Fig.7. According to the flowchart, the port initialization was stated for the input and output declaration. Afterwards, the sequence will follow step by step according the user instruction. The controller stands by the tool changing instruction. The two DC motors were assembled for moving the spindle of the system. The moving sequences of the two DC motors are limited with four limit switches. The breaking points of X axis DC motor are control with limit switch one and two. The end points of Y axis DC motor are stretched with limit switch three and four. First of all, when the program starts to operate, PIC microcontroller initializes which pins are assigned as the input and output ports. And then program waits the tool change command from the keypad. When the operator types the desired tool number from the keypad, the DC motor X rotates to reach the limit switch two. The process will go on till the reach of the limit switch two. After switching the limit switch two, the DC motor Y is rotated to reach the limit switch three.

Fig. 7 Flowchart of Two DC Motor

rotate with predefined angle to reach the desired tool number. Then the DC motor Y operates again to the limit switch three. This process will also go on until the limit switch three reaches. After that the DC motor X also reoperate to the limit switch one. After switching on the limit switch one, the program waits to change the tool from the user. B. Flowchart of Stepper Motor Control The stepper motor operation starts when the Y-axis DC motor stops its operation. When the Y-axis DC motor stops, the limit switch 4 switch on. After switching limit switch 4 on, the stepper motor starts to operate to the input tool number.

332

World Academy of Science, Engineering and Technology 81 2011

After waiting a second, it will rotate back to the home position. And it will wait to operate to another input tool number. If another tool number is entered from the keypad, it rotates to the last position for tool release. After releasing the used tool to the magazine, the motor rotates to the latest input tool number position. After waiting a second to pick up the tool, it rotates to the home position. And then the stepper motor waits another tool to operate from the user

C. Circuit Operation of the System This control circuit consists of two driver units. They are Hbirdge DC motor driver and stepper motor driver. H-bridge DC motor driver is used to drive the spindle to get required displacement. In H-bridge DC motor driver, there are six transistors to drive the DC motor forward and reverse. In stepper motor driver circuit, there are four IRFZ44N MOSFETs. Keypad circuit and limit switch circuit are constructed to provide the signal to implement the operation of the microcontroller. Port C and port B are assigned as input pins and port A and port D are assigned as output pins of microcontroller. The two H-bridge driver circuits are connected to port A and the stepper motor driver circuit is connected to port D. Keypad input circuit is connected to port C and the four limit switches are connected to port B.

Fig. 9 Overall Circuit Diagram

IV. TEST AND RESULT The simulation of the system is operated by the Proteus 7.7 software. Since this software consists of many separate programs plus a large number of additional files such as libraries and models, it is the fact that the user decided to use this software. As already mention, limit switches are used to check the end position of the spindle. Keypad is used to give the microcontroller to pick up the desired tool. The operation of the system is supervised by the microcontroller. The two DC motors are used to move the spindle to the tool magazine. Stepper motror is manipulated by the operator the tool magazine to get required tool.
Fig. 8 Flowchart of Stepper Motor

333

World Academy of Science, Engineering and Technology 81 2011

In this simulation, the user must press one or two number keys from the keypad. When * key is pressed, the stepper motor will rotate according to the predefined data of microcontroller. One of H bridge DC motor will rotate at the same time. When the user press the SW2, the running DC motor will stop and the another DC motor will rotate. Other limit switches are used for the directions and start/stop simulations of the two DC motors.

REFERENCES
[1] [2] [3] [4] [5] [6] [7] [8] [9] C.T.Bower: The book of the Lathe, AM.I.Prod.E, London, 1957. Herbert Addison: The Pump Users Handbook, Mac Graw-Hill Co.,1958. WillianWolansky and Akers: Modern Hydraulics, A Bell & Howell Information Co, London, 1970. Wernick. Ett, 1978. Electric Motor Hand Book, MC GrawHillBookCompany (UK) limited Theodore Franklin: Cam Type Turret Lath Machine, LioShing Company. 1984, http:// www.turret.com.tw Bumin.F.F.: Conversion of a Conventional General Purpose Lathe to a CNC Lathe, M.S.C Thesis, M.F.T.U, 1985. David Gibbs: An Introduction to CNC Machining, Second Edition, English Language Book Society, Cassel Publisher Ltd, (1987). Genjamin R. Mohan: Hydraulic & Pneumatic Symbols, 1999, http://www.Hyd_Pnue_symbols.html.o Jom Dancan, 1997, Success in Electronics, second edition, John MurrayPublishers Ltd

Fig. 10 Simulation Result of DC Motor Rotation

Fig. 11 Simulation Result of Stepper Motor Rotation

V. CONCLUSIONS In this research paper, position control system for tool changing application is considered electrically. This paper has presented the logic program and interfacing design for tool changing system. It also includes microcontroller based control system. The simulation and operation of control system can support in one corner of fully functional hardware construction. This control system needs many considerations of motor specifications and torques for further research works. This research only intends to approach the algorithm of tool changing system of CNC machine. ACKNOWLEDGEMENT This research paper couldnt have been accomplished without help and guidance from the people at MTU. Especially, it is worth to express the deepest gratitude to Dr. Theingi, Pro Rector, WYTU for her valuable suggestions and guidance.

334

Вам также может понравиться