Sei sulla pagina 1di 20

Automated Wire Wrapper

By

Helya Azari Ben Catlin

ECE 345, SENIOR DESIGN PROJECT Summer 2004

TA: Mo Zhou

02 August 2004

Project No. 1

ABSTRACT The Abstract is a short (150 words or less) summary of the paper. Start the text of the Abstract here. The Title Page, Abstract and the Table of Contents are considered preliminary pages, as opposed to the rest of the text. The preliminary pages are numbered in small roman numerals and numbering starts with the abstract. The title page is page i but the page number does not appear on the page. The abstract is page ii and the Table of Contents is page iii.

ii

TABLE OF CONTENTS

1.

INTRODUCTION.................................................................................................................... 1 1.1 Purpose............................................................................................................................... 1 1.2 Functions.............................................................................................................................1 1.3 Design Block Diagram....................................................................................................... 1 1.4 Subprojects......................................................................................................................... 2 DESIGN PROCEDURE...........................................................................................................3 2.1 Main Motor.........................................................................................................................3 2.2 Guide Motor........................................................................................................................3 2.3 Wire Sensor........................................................................................................................ 3 2.4 Limit Switch....................................................................................................................... 3 2.5 Microcontroller................................................................................................................... 3 2.6 LCD Panel.......................................................................................................................... 4 2.7 Keypad................................................................................................................................ 4 2.8 Encoder............................................................................................................................... 4

2.

3.

DESIGN DETAILS.................................................................................................................. 5 3.1 Main Motor.........................................................................................................................5 3.2 Guide Motor........................................................................................................................5 3.3 Wire Sensor........................................................................................................................ 6 3.4 Limit Switch....................................................................................................................... 6 3.5 Microcontroller................................................................................................................... 6 3.6 LCD Panel.......................................................................................................................... 7 3.7 Keypad................................................................................................................................ 7 3.8 Encoder............................................................................................................................... 8 3.9 Final Schematic...9

4.

DESIGN VERIFICATION.....................................................................................................10 4.1 Main Motor....................................................................................................................... 10 4.2 Guide Motor......................................................................................................................11 COST (Parts and Labor)......................................................................................................... 13 CONCLUSIONS.................................................................................................................... 14 APPENDIX A: Programming.................................................................................................15

5. 6.

iii

iv

1. INTRODUCTION Being student employees of the ECE workshop for over three years, we have been privileged to operate the HEART of Everitt Laboratory. We call the ECE workshop the HEART because it is the life support that all the labs, students, and faculty depend on. Without the shop, Everitt could not run as smoothly as it does. Just like a heart pumps blood to the entire body, the ECE workshop supplies parts to the entire Everitt building. The ECE shop is equipped to provide individual needs, such as parts requested by a student or faculty member, as well as massive needs, anywhere from stocking our advanced labs with wire kits to the hardwiring of the benches used in the labs. Having such a huge responsibility, the shop tries to perform as efficiently and economically as possible. As student employees over the past three years we have been able to use our engineering skills acquired at UIUC to make the shop run efficiently and economically in various ways. Our last contribution before we leave is to create an automated wire wrapper. We believe an automated wire wrapper can benefit the ECE shop by decreasing the cost of wire and increasing the productivity of wire cut. 1.1 Purpose The primary purpose of the automated wire wrapper is to wrap wire from a small spindle onto a larger spindle. It should be able to perform such a task at a reasonable speed and without any human interaction once command is given to activate. 1.2 Functions The automated wire wrapper will be able to handle various size spindles, adjust to the different gauge sizes of wire, keep track of amount of wire spun onto a spindle, stop once the spindle has run out of wire for reloading, and stop after a certain amount that is requested by the user.

1.3 Design Block Diagram

Keypad

Main Motor

PIC Microcontroller

LCD Display

Guide Motor

1.4 Subprojects The design of the project was split up into three parts: it has a mechanical aspect dealing with the body of the frame and gears, a hardware aspect dealing with the wiring of components, and a software aspect dealing with communication of components and commands.

2. DESIGN PROCEDURE The design procedure lists each component in our design. It discusses what devices we used to accomplish our desired functions on our automated wire wrapper. 2.1 Main Motor Design The main motor had to be powerful enough to rotate the spindle for several hours. We decided to use a 12V DC Dayton motor that can drive at 3.5 Amps. The main motor had to run at full speed once activated and stop immediately when commanded by the microcontroller. We decided to use a single NMOS transistor to switch the motor ON or OFF. Depending on what the gate of the NMOS received from the Microcontroller (5V or 0V) it would pull down +12V through its drain to the motor or remain in cut-off and output 0V to the motor. 2.2 Guide Motor Design The guide motor had to be able to change directions immediately and be able to run for several hours. We decided to use a 12V DC PITTMAN. Its a small motor but can handle a load current up to 14.5 Amps, which is more than powerful enough to drive the guide left and right on the frame. To control the direction of the motor, we decided to us an H-bridge design. The H-bridge design takes in a high (5V) or low (0V) from the Microcontroller, and biases or cuts-off certain MOSFETs to send the 12V to the Motors positive-to-negative terminal to rotate the motor clockwise or negative-to-positive terminal to rotate the motor counter-clockwise. The H-bridge is a perfect circuit design for the guide motor because it intakes a +5V and sends +12V to the motor, driving it at full capacity. 2.3 Wire Sensor Design We had to find a sensor that detects the presence of the wire. We decided to use an H21A1 optic coupler for such a task. The H21A1 optic coupler has a slot in the middle. If the slot is covered, it sends a +5V output to the microcontroller. If nothing is blocking the slot, it sends a 0V output to the microcontroller. 2.4 Limit Switch Design We needed a device that lets the microcontroller know that the wire guide has reached one end of the frame and needs to change direction of the guide motor. We decided to use two limit switches on both ends of the frame. The limit switches should be normally open until the switch is pressed. At that point it should close and send a +5V output into the microcontroller, informing it to change the direction of the guide motor.

2.5 Microcontroller Design Our choice of control devices is the PIC 16F877 microcontroller. We chose this microcontroller because it has five available general purpose I/O ports and it can be programmed in the circuit. The PIC gives the standard 5 Volt outputs and takes 5 volt inputs. We are also used L.E.T. PIC Basic Pro to write our code for the PIC because it has libraries to talk to the LCD, and KeyPad. An alternative would have been to use the Motorolla HC12, but this seemed too powerful for our project as well as more 3

complex to us. Also the cost was somewhat cheaper for the PIC. 2.6 LCD Panel Design We used the Shelly LCD display in our project as the visual part of the user interface for our project. This LCD uses a simple 4 bit (half byte) data bus and a 2 bit Read/Write/Enable bus to control when information is displayed. The display is 2 lines and 32 characters per line. This was the LCD given to us by the electronics shop, so we decided it was best to use this. 2.7 Keypad Design The original Keypad desired for use in this project was a simple set of row and column lines with switches that would connect the row line to the column line. This is the standard way that most keypads operate, and the library in the software for the PIC should have worked for it. But due to a problem in the library, we decided to switch to standard button switches (momentary contact switches) and created a five button layout that had two buttons to move the cursor right and left, two buttons to increase and decrease the number selected, and a button to enter the information and start the process.

2.8 Encoder Design The encoder we planned to use was taken from a mouse because of the easy availability of the encoder wheel and the flexibility taking the individual parts gave us. This encoder consisted of one IR LED and a two collector coupled BJT transistors in the receiver package. The base of the BJTs is activated by the IR LED and the output pins were the emitters on the transistors. This encoder will be scrapped in the final implementation for a simpler mechanical encoder, but that will be discussed in further detail in future considerations.

3. DESIGN DETAILS This chapter gives detail descriptions of how each component was created from the beginning. (Diagrams are included for clearer understanding). 3.1 Main Motor The main motor was controlled through one MTP50N06 NMOS. The NMOS was primarily used as a switch to shut ON or OFF the main motor. The NMOS has three connections: gate, drain, and source. The gate determines whether to bias the NMOS transistor ON or OFF depending on the input voltage received from the microcontroller. The drain is connected to the negative terminal of the motor. The positive terminal of the motor is connected to +12V power supply. The source is grounded. Once the microcontroller sends a +5V to the gate. The transistor is biased and the circuit is completed. The +12V is pulled down through the motor all the way to ground. Diagram is shown below for better visual understanding.

3.2 Guide Motor The guide motor is controlled with an H-Bridge. An H-Bridge is composed of 2 MTP50N06 NMOS and 2 MTP8P10 PMOS. The H-Bridge intakes +5V from the microcontroller and drives the motors with +12V. A diagram of the H-Bridge is shown below:

When inputs A and B receive +5V from the microcontroller and inputs D and C receive 0V from the microcontroller, then A cuts-off the PMOS, B biases the NMOS, C cuts-off the NMOS, and D biases the PMOS. This results in +12V being pulled down through PMOS A to the motor all the way down to NMOS C, causing the motor to rotate clockwise. When inputs C and D receive +5V from the microcontroller and inputs A and B receive 0V from the microcontroller, then D cuts-off the PMOS, C biases the NMOS, B cuts-off the NMOS, and A biases the PMOS. This results in +12V being pulled down through PMOS D to the motor all the way down to NMOS B, causing the motor to rotate counterclockwise. 3.3 Wire Sensor The H21A1 optic coupler was used to detect the presence of wire. The H21A1 optic coupler has a slot in the middle. If the slot is covered, it sends a +5V output to the microcontroller. If nothing is blocking the slot, it sends a 0V output to the microcontroller. Diagram is shown: 5V GND GND 5V
R
R

300

10k

A +5V is connected to terminal 1. The 300 ohm resistor is connected to terminal 2 to limit the current through the diode. The 10k ohms resistor is placed in between terminal 3 and +5V. The 10k ohm resistor is required to create a voltage drop so that 0V is outputted once the wire is removed and the circuit is completed. Terminal four is connected to ground directly.

3.4 Limit Switch The limit switches are wired so that they are normally open until the switch is pressed. When the switch is open, +5V is outputted to the microcontroller. When the switch is pressed, it closes the circuit, causing a voltage drop across the 1k ohm resistor, outputting 0V into the microcontroller. Circuit diagram is shown below:

5V

R1 1k

GND

3.5 Microcontroller Initially programming the PIC was a problem because the Parallel port moved the data slightly faster than the programming circuit was designed to handle, so it was necessary to add a 1 F capacitor from 6

pin1 on the PIC to ground. This solved the problem by adding a slight delay on that data pin during programming. Apart from the LCD and Keypad handling which will be discussed seperatly, the PIC programming included interfacing the motors and the sensors to act together. Specifically I put the motor outputs on the port C pins 1-3, where port C pin 0 was reserved for an LED I had placed there to make sure the PIC was running the code properly. The sensors I placed on port B because the internal pull up resistors made it simpler to use this port over port C. Pins 0-2 were used for the optical sensor and the two limit switches. I made an attempt to install the buttons on this port as well, but that will be discussed more in the Keypad section. The major problem in all of the motors was with the H-bridge used to control the guide motor. For some reason there seemed to be too high of a current draw initially when starting the motor, and this would cause the output from the PIC to feedback and the PIC would reset. To fix this we placed an LM340-12 voltage regulator across the 12 Volt supply, which was able to regulate the start-up current draw from the supply and keep it from feeding back onto the PIC. The main motor driver worked fine with the 5 Volt output from the PIC, and the NMOS transistor handled switching the 12 Volts to the motor on and off perfectly with the input into the gate from the PIC. 3.6 LCD Panel The PIC was programmed to handle the LCD output on port D, which is one of the three ports suggested by the compliers user guide. The other two options were port B and port C. I chose port B initially, but had difficulty getting the LCD to work, and in a troubleshooting effort I moved to port D and it worked fine on the first try. On port D pins 2 and 3 are used for the Enable and RS lines respectively and the last four pins (4-7) are data pins sending half bytes of data to the LCD. The remaining connections on the LCD were power and grounds. 3.7 Keypad / Buttons The keypad is a set of simple contact switches that connect a row line to a column line. To use this I tried the library built into the compiler, but when that failed I attempted to send a high signal out on one of the row pins and to read the column pins to see if anything had been pressed. Then if nothing was pressed on that row, then I set the next row pin high, and repeated this process until all the rows had been checked. Because of a problem with how the compiler sets the initial registers pin B.3 would constantly give an incorrect output, or it would not settle to what was being inputted on it. This caused problems that would make it so the Keypad would not work, and led us to believe that this is what kept the LCD from working on that port as well. Since port B had to be used for the keypad because of the compiler we decided to move to a different idea. The second idea was to use five buttons, left, right, up, down, and enter. This would allow us to move the cursor, to increment or decrement the numbers displayed, and to finalize the entered data and start the motors. This also did not work because it took the remaining pins on port B, and whenever a button was pressed on pin 3 it would cause the entire PIC to reset. Also time did not permit me to do sufficient testing on this implementation since it was a last effort to make a working machine interface before the demonstration of our project. Because neither of these interface devices were working for our demonstration I am not including them on the final schematic in the diagram section. The plan is to try to implement the buttons in the final product delivered to the shop for actual use. 7

3.8 Encoder This was the last component worked on and tested. This unfortunately was left with very little time to get it working. Our idea was to take apart a mouse encoder, use the wheel in the mouse as our actual encoder wheel and to make a separate housing for that encoder. The encoder was an IR LED and two collector coupled BJT transistors. The base of the transistor was activated by the IR LED, and the emitter was the output. On our first tests on a proto-board the encoder was giving 5 volt output pulses, so we set out to create a housing for to spin the encoder wheel and to hold the optics still. To accomplish this we took apart a potentiometer, and glued the encoder wheel to the shaft of the potentiometer, and glued the optics to the casing. So as the wire turned the shaft, the encoder wheel would turn, but the housing would stay stationary. This did not work because it was incredibly difficult to get the encoder wheel aligned with the shaft so that a consistent covering and uncovering of the IR optics would produce the desired pulses. Further testing after the demonstration showed that the alignment of the transmitter with the receiver was more important that initial tests had shown. A mechanical encoder is going to be used in the final implementation delivered to the electronic shop because of its simplicity and durability, but this will be covered in more detail in Future Works section in the conclusion. 3.9 Final Schematic

412 ,

,o!t8 Regu!ator +*340+A912


1 2 3

*&P50-0/

*&P50-0/

3uide *otor
*

*ain *otor
*

*&P50-0/

*&P1P10

*&P1P10

3-D

:1

:2

45 ,
1 2 3 4 5 / . 1 2 10 11 12 13 14 15 1/ 1. 11 12 20

14

P)C1/01.. 40 *C+R R . 32 RA0 R / 31 RA1 R 5 3. RA2 R 4 3/ RA3 R 3 35 RA4%&'C() R 2 34 RA5 R 1 33 RE0 R 0%)-& 32 RE1 ,DD 31 RE2 ,SS 30 ,dd RD. 22 ,ss RD/ 21 'SC1 RD5 2. 'SC2 RD4 2/ RC0 RC. 25 RC1 RC/ 24 RC2 RC5 23 RC3 RC4 22 RD0 RD3 21 RD1 RD2

1 ,ss3-D 2 ,dd45 3 ,!contrast 4 RS 5 R%W / Ena5!e . D0 1 D1 2 D2 10 D3 11 D4 12 D5 13 D/ 14 D. 15 Anode+ED 1/

Cat6ode+ED

'sci!!ator

Wire Detector

300

"21A1 1k 1k 10 (

3-D ECE 345 Summer 2004 Senior Design Project Automated Wire Wrapper en Cat!in "e!#a A$ari

R8 +imit S;itc6 +8 +imit S;itc6

+CD D)SP+A7

4. DESIGN VERIFICATION The design verification is important to ensure that the automated wire wrapper performs as desired. Different test were conducted on the primary components. Endurance testing was required on the motors. 4.1 Main Motor For the main motor we found that an endurance test was necessary. We decided to run the main motor for three hours and record its current. To measure its current we placed a 1 ohm resistor in between the +12V power supply and the positive terminal of the motor. We recorded the voltage drop across the resistor using an oscilloscope. Then we found the current by dividing the voltage over the 1 ohm resistor: V/R = I Results are recorded in chart below and displayed on the graph. Time (minutes) 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 Total Voltage (V) 1.525 1.512 1.578 1.603 1.563 1.667 1.742 1.702 1.756 1.811 1.833 1.714 1.755 1.729 1.677 1.758 1.720 1.735 Average Resistor (ohms) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 I = Current I(A) 1.525 1.512 1.578 1.603 1.563 1.667 1.742 1.702 1.756 1.811 1.833 1.714 1.755 1.729 1.677 1.758 1.720 1.735 1.688

10

Main Motor
182 181 18. 18/ 185 184 1 3 5 . 2 11 13 15 1. Time (minutes)

Current I (A)

Series1

4.2 Guide Motor

For the guide motor we found that an endurance test was necessary. We decided to run the main motor for three hours and record its current. To measure its current we placed a 1 ohm resistor in between the +12V power supply and the positive terminal of the motor. We recorded the voltage drop across the resistor using an oscilloscope. Then we found the current by dividing the voltage over the 1 ohm resistor: V/R = I Results are recorded in chart below and displayed on the graph. Time (minutes) 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 Total Voltage (mV) 352 377 380 355 388 406 400 396 352 349 320 300 330 333 346 395 407 394 Average Resistor (ohms) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 I= Current I(mA) 352 377 380 355 388 406 400 396 352 349 320 300 330 333 346 395 407 394
365.56

11

Guide Motor
450 400 Current I (mA) 350 300 250 1 3 5 . 2 11 13 15 1. Time (minutes)

12

5. COST Parts Total quantity of parts and costs of each part are listed below in chart: Part # Desc For Price Microcontroller (PIC16F877) GM9434G807 Pittman P16PRO PIC Programmer GH5026-ND Keypad SSM11625 Shelly-LCD panel H21A1 Slotted Optic Coupler MTP8P10 PMOS MTP50N06 NMOS 1N4749A Zener Diode (24V) 144742A Zener Diode (12V) 1N36 Diode 100 Ohm Resistor 10K Ohm Resistor 32pF Capacitor 4MHz Oscillator Crystal 1L475 Dayton Total Cost 8-bit PIC DC Motor ALL Motors $5.70 $30.00 $14.95 $14.94 $4.79 $2.37 $11.00 $1.28 $0.15 $0.15 $0.15 $0.15 $0.76 $0.31 $2.94 $100.00

Qty 1 1 1 1 1 2 2 3 1 4 5 1 1 1 1 1

Total $5.70 $30.00 $14.95 $14.94 $4.79 $4.74 $22.00 $3.84 $0.15 $0.60 $0.75 $0.15 $0.76 $0.31 $2.94 $100.00 $206.62

DC Motor

Motors

Labor Salary: $25/hr Workers: 2 Hours: 40hrs Total Labor Cost = ($25/hour) x 2 x 2.5 x 100 = $12,500.00 Grand Total = $12,500.00 + $206.62 = $12,706.62

13

6. Conclusion

The final stages of our project as demonstrated failed to keep track of the wire spun and to stop at a given length of wire spun. This is due to the failure to complete a working interface to enter a length, and the failure to mount the optics in a precise manner so that a consistent output could be read from it to keep track of the length of wire. Currently the project does succeed in wrapping wire evenly onto a spindle and shuts down when the wire runs out. This is the most basic and most important function to the project and it is currently usable in the electronic shop as is. To isolate the problem the port B we are going to look at the assembly code that the compiler provides to see if the registers are being correctly set to work pin 3 as a normal input or output. This is currently the only problem that we could not work out a solution to, so it needs further investigation before the PIC is used to control the user input. The optical encoder will be replaced by a mechanical encoder which is much simpler to use, and more robust. The future of this project has two possible ideas. One is to just complete the programming for the PIC, fix the user input device, and use a mechanical encoder to work the encoder inputs. The second is to use a set of switches to operate the motors, and the PIC just for the keeping track of the length of wire and the user interfaces. Both options will be further explored in the next few weeks.

14

Appendix A. Programming Code This is the programming used in the demonstration for our project. Its main function is to take in input from the limit switches and the optical encoder and to output a motor direction, or stop the motors.
'Senior Design Project Device 16F877 Include LCD 'pin assignments Symbol EN=D.2 Symbol RS=D.3 'variables Dim temp Dim dela Dim ! Define PortD "######## 'De$ine Port% "&&&&&&&& Define PortC "######## Define Port' "&&&&&&&& Init LCD(PortD OutC )"#######&* Goto +ain Co$$, PortD=# High EN Clrwdt Low EN PortD="&&###### High EN Clrwdt Low EN Del yu! )&2* High RS "eturn ' Place t-e $irst ./bits on Port' ' Strobe t-e EN line 0ig- / Lo1 ' Place t-e ne!t ./bits on Port' &&###### ' Strobe t-e EN line 0ig- / Lo1 ' Pa3se $or .#3s 1it- .m04 5SC ' 'ac6 into c-aracter mode ' E!it t-e s3bro3tine

Pa3se, For !=# to 7 Del ym! )Dela * ne#t ! !=# "eturn C-ec68ire,

15

temp = In$ort% If temp 9 "#######& = & then "eturn OutC )"#######&* Cur!or &(& &rint :53t o$ 8ire;: "eturn +ain, CLS Go!ub Co$$ Cur!or &(& &rint :Start: Dela =3# GoSub Pa3se GoSub C-ec68ire temp = In$ort% Cur!or &(2 If temp 9 "######&# = 2 then OutC )"####&#&#* If temp 9 "######&#<=2 then goto >1o Cur!or &(& &rint :Le$t :

Loop,

>1o,

GoSub C-ec61ire temp = In$ort% If temp 9 "#####&## = . then OutC )"#####&&#* If temp 9 "#####&##<=. then Goto >-ree Cur!or &(& &rint :Rig-t: >-ree, Go!ub C-ec61ire temp = In$ort% If temp 9 "#####&&# = 2 then Goto ?3it Dela =&@ Go!ub Pa3se Goto Loop ?3it, Cur!or &(& OutC )"#######&* &rint :Stop : Goto ?3it 'nd

16

Potrebbero piacerti anche