Você está na página 1de 214

CNC Machine Design Report

Project 24
Submitted By: Team: F09-24-CNCMACHD

CNC Machine Design Report

Prepared for: Saluki Engineering Company Team Members:


James Williams (PM) EE/CompE Shawn Gossett EE Eric Blankenship EE/CompE Glenn E Spiller II CompE Pat Brokaw ME Brian Hagene ME

CNC Machine Design Report

Acknowledgements Saluki Engineering Companys Team 24 would like to thank these individuals for their input and support in proposing and designing the project. Dr. Frances Harackiewicz Dr. William Osborne Mrs. Kay Purcell Dr. Alan Weston Dr. Haibo Wang- Faculty Technical Advisor Mr. Mark Hopkins- Technician/ Field Engineer for Allegro Microdevices Saluki Engineering Companys Team 24 would also to thank these individuals and their respective companies for their donations to accomplish the construction of the project. Mr. Howard Everton- President of Norva Plastics Barb Saathoff- Representative from Dytronix

CNC Machine Design Report

1. Table of Contents
2. Introduction ........................................................................................................................................ 13 2.1 2.2 Main Block Description ............................................................................................................... 13 Options Considered and Chosen Option..................................................................................... 14 Mechanical Subsystem........................................................................................................ 14 Main Controller Subsystem................................................................................................. 15

2.2.1 2.2.2 2.3 2.4 2.5 3.

Expected and Achieved Performance Data ................................................................................ 15 Limitations................................................................................................................................... 15 Summarization of Fault Analysis ................................................................................................. 16

Mechanical Subsystem........................................................................................................................ 17 3.1 Deflections .................................................................................................................................. 17 X-axis ................................................................................................................................... 17 Z-axis ................................................................................................................................... 18 Y-axis ................................................................................................................................... 19

3.1.1 3.1.2 3.1.3 3.2

Mechanical Drive System ............................................................................................................ 19 Ballscrew Lead Specification ............................................................................................... 19 Ballscrew Linear Force and Torque ..................................................................................... 19 Thrust Force ........................................................................................................................ 20

3.2.1 3.2.2 3.2.3 3.3 3.4

Table Top Support Calculations .................................................................................................. 20 Tool Heads .................................................................................................................................. 21 Spindle Mount..................................................................................................................... 21 Solder Paste Dispenser........................................................................................................ 21

3.4.1 3.4.2 3.5

Machine Electronics .................................................................................................................... 22 Cable Carrier ....................................................................................................................... 23 Electrical Component Housing ............................................................................................ 23 Pendant Case ...................................................................................................................... 23

3.5.1 3.5.2 3.5.3 3.6

Equipment Lists ........................................................................................................................... 23 Design Tools ........................................................................................................................ 23 Machining and Assembly Tools ........................................................................................... 23

3.6.1 3.6.2 3.7

Components and Specifications .................................................................................................. 24

CNC Machine Design Report

3.7.1 3.8

Material Specifications........................................................................................................ 24

Components ................................................................................................................................ 24 Z-axis ................................................................................................................................... 24 X-axis ................................................................................................................................... 26 Base ..................................................................................................................................... 27 Y-axis ................................................................................................................................... 28 Tool Heads........................................................................................................................... 29 Machine Electronics ............................................................................................................ 31 Additional Components ...................................................................................................... 31

3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.9

Data Sources ............................................................................................................................... 32 Websites.............................................................................................................................. 32

3.9.1 3.10

Fault analysis ............................................................................................................................... 32 Fastener and Component Failures ...................................................................................... 32 Excessive Wear.................................................................................................................... 32

3.10.1 3.10.2 3.11 3.12 4.

Health & Safety, Environmental, Life Cycle, and Societal Issues ................................................ 33 Engineering Drawings ................................................................................................................. 33

Electrical .............................................................................................................................................. 34 4.1 Motor Driver Board ..................................................................................................................... 34 Scope ................................................................................................................................... 34 Block Diagram ..................................................................................................................... 34 Technical Description .......................................................................................................... 36

4.1.1 4.1.2 4.1.3

4.1.4 .................................................................................................................................................... 41 4.1.5 4.1.6 4.1.7 4.1.8 Health and Safety ................................................................................................................ 44 Equipment Required ........................................................................................................... 45 Schedule Data for Driver Board .......................................................................................... 45 Test, Measurement and Fault Analysis ............................................................................... 45

4.1.9 .................................................................................................................................................... 46 4.1.10 4.2 Section Summary ................................................................................................................ 49

Main Controller Schematic ......................................................................................................... 50 Communication Controller.................................................................................................. 50

4.2.1

CNC Machine Design Report

4.2.2 4.2.3 4.2.4 4.3

CPLD Connections ............................................................................................................... 58 Timing for the CPLD ............................................................................................................ 59 Power supply ....................................................................................................................... 59

Pendant Subsystem..................................................................................................................... 61 Introduction ........................................................................................................................ 61 Hardware Subset ................................................................................................................. 61 Schematic Design ................................................................................................................ 61 PCB and Physical Layout...................................................................................................... 62 Physical Display after Button Press ..................................................................................... 65

4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 5.

Firmware ............................................................................................................................................. 66 5.1 Communication Controller: ........................................................................................................ 66 Listening State: .................................................................................................................... 67 Preamble State: ................................................................................................................... 67 Receiving State: ................................................................................................................... 67 Group ID .............................................................................................................................. 68 Post-amble State: ................................................................................................................ 70

5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.2

Motion Controller Micro-Processor Code................................................................................... 71 Events .................................................................................................................................. 71 Initialization......................................................................................................................... 71 Parameter Table.................................................................................................................. 72 Global Table ........................................................................................................................ 73 Commands .......................................................................................................................... 74 Motion Controllers data flow.............................................................................................. 76 Interrupts ............................................................................................................................ 78 Files in the Motion Controller Program .............................................................................. 79 Bresenham Algorithms........................................................................................................ 81

5.2.1 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 5.3

Firmware Subset ......................................................................................................................... 83 Interrupts ............................................................................................................................ 83 Driver Subset ....................................................................................................................... 84 Display Driver ...................................................................................................................... 87

5.3.1 5.3.2 5.3.3

CNC Machine Design Report

5.3.4 5.3.5 5.3.6 5.3.7 5.3.8 5.3.9 5.3.10 5.3.11 5.3.12 5.3.13 5.3.14 6.

Analog Driver ...................................................................................................................... 90 Serial Driver ......................................................................................................................... 91 Main Subset ........................................................................................................................ 92 Function Sub-block.............................................................................................................. 94 Jog Sub-block....................................................................................................................... 95 Cancel Sub-block ................................................................................................................. 96 Accept Sub-block ................................................................................................................. 97 Directory Block .................................................................................................................... 98 Graphics ............................................................................................................................ 100 Screens .............................................................................................................................. 101 Relation To Other Sub-Systems ........................................................................................ 109

Conclusions and Recommendations ................................................................................................. 110 6.1 6.2 Conclusions ............................................................................................................................... 110 Recommendations .................................................................................................................... 110

7.

Cost/Manufacturability ..................................................................................................................... 111 Materials ............................................................................................................................................... 112 7.1 7.2 Mechanical Cost ........................................................................................................................ 113 Electrical Cost ............................................................................................................................ 120

8.

APPENDIX A ....................................................................................................................................... 125 8.1 VGA Data Sheet ......................................................................................................................... 125 MoveTo() ........................................................................................................................... 126 EraseScreen ....................................................................................................................... 126 SetBackground() ................................................................................................................ 126 DrawLine() ......................................................................................................................... 126 SetFontSize() ..................................................................................................................... 127 DrawBox().......................................................................................................................... 127 OpaqueTransparent()........................................................................................................ 127 PlaceText()......................................................................................................................... 127 WriteString() ..................................................................................................................... 127 DisplayImage() .................................................................................................................. 128

8.1.1 8.1.2 8.1.3 8.1.4 8.1.5 8.1.6 8.1.7 8.1.8 8.1.9 8.1.10

CNC Machine Design Report

8.1.11 8.1.12 8.1.13 8.1.14 8.1.15 8.1.16 8.2 9.

PaintArea() ........................................................................................................................ 128 DrawCircle() ...................................................................................................................... 128 SetColumn() ...................................................................................................................... 128 SetRow() ............................................................................................................................ 129 SetRowColumn() ............................................................................................................... 129 PlaceCharUnFor() .............................................................................................................. 129

3.1 Screens ................................................................................................................................ 129

APPENDIX B ....................................................................................................................................... 130 9.1 9.2 9.3 9.4 X-axis ......................................................................................................................................... 130 Y-axis ......................................................................................................................................... 131 Calculated Moments and Equivalent Force Couples on X Rails ................................................ 131 Trade off Study: 3 rods vs 4 rods, Rod Spacing ......................................................................... 133 3 Rod Configuration .......................................................................................................... 133 4 Rod Configuration .......................................................................................................... 135

9.4.1 9.4.2 9.5

Table Top Support Calculations ................................................................................................ 136 Table Support Calculations ............................................................................................... 136

9.5.1 9.6

Ballscrew Calculations............................................................................................................... 137 Ballscrew Calculations ....................................................................................................... 137

9.6.1 9.7

Cable Carrier ............................................................................................................................. 138 Cable Carrier Selection ...................................................................................................... 138

9.7.1 9.8

Solder Paste Dispenser ............................................................................................................. 138 Equations .......................................................................................................................... 138 Solution: General Engineering Equation ........................................................................... 139 Flow Locations................................................................................................................... 140 Solution: Force Approximation ......................................................................................... 140

9.8.1 9.8.2 9.8.3 9.8.4 9.9

Design Notebook: Pat Brokaw .................................................................................................. 140 Table of Contents .............................................................................................................. 140

9.9.1 9.10

Cost Data and Schedule Data .................................................................................................... 143 Prototype Cost .................................................................................................................. 143

9.10.1 9.11

Manufacturing Costs and Schedule .......................................................................................... 150

CNC Machine Design Report

9.11.1 9.11.2 9.11.3 9.11.4

Equipment Costs ............................................................................................................... 150 Material Costs ................................................................................................................... 153 Fasteners ........................................................................................................................... 160 Component Data Sheets ................................................................................................... 163

10. APPENDIX C ....................................................................................................................................... 166 10.1 Pendent Code Datasheet .......................................................................................................... 166 Graphics Header File: ........................................................................................................ 166 Graphics Source File: ......................................................................................................... 168 Screens Header File:.......................................................................................................... 172 Screens C Source file: ........................................................................................................ 174 Support Source File: .......................................................................................................... 183

10.1.1 10.1.2 10.1.3 10.1.4 10.1.5

11. APPENDIX C ....................................................................................................................................... 184 11.1.1 11.1.2 11.1.3 11.1.4 Test Data ........................................................................................................................... 184 Calculations Section .......................................................................................................... 191 List of Figures .................................................................................................................... 203 Simulations........................................................................................................................ 206

CNC Machine Design Report

CNC Machine Design Report

Saluki Engineering Company Senior Engineering Design College of Engineering Mailcode 6603 Carbondale IL 62901-6603 618-453-7837, -7031, -7025, -7642

Transmittal Letter 27 April 2010 Subject: CNC Machine Design Client: Engineering Innovations, Inc. Project Number: F09-24-CNCMACHD The CNC Machine that was requested by Engineering Innovations, Inc. has been designed, tested, and built into a prototype by Team 24 of the Saluki Engineering Company. The prototype can successfully perform different functions of manufacturing through one of three different communication links that can interpret multiple file types. Attached, you will find the design report to aid in understanding the creation of the machine. Also attached in a separate packet, there is a users manual to help anyone understand how to assemble, connect, and correctly operate the machine, and there is a technicians manual to provide information to a trained specialist to find and correct any problems that may occur during operation of the machine. We request that you be very careful while operating the machine and completely read the users manual before starting any job. We would like to thank you for having interest in working with Saluki Engineering Company, and if there are any further questions feel free to contact the project manager, James Williams, at 618-937-8521. Sincerely, James Williams- Project Manager Shawn Gossett- Secretary

Executive Summary
10

CNC Machine Design Report

The CNC Machine is a system that can be used not only by manufacturers but also by small scale hobbyists. It has been designed with these features.

Microcontroller system to send and receive information Driver system to run machine at desired specifications Hand pendant system to access information and manipulate machine Mechanical system to support weight of gantry while in motion or idle plus the weight of the attached tool heads, handle deflection, and prevent thermal expansion This machine has these advantages over similar products.

Three forms of communication either through serial port, Ethernet, or USB jump drive Controllable through a specially designed hand pendant Multiple tool heads for different applications including milling, paste dispensing, and air brushing Accepts multiple types of files Able to move at high speeds Longer working life compared to other relative machines Costs much less than competitors Easy to assemble, operate, and maintain This document contains a report with all relevant material concerning the design of the entire machine. The report will be broken down into these sections

Overall description of system Sub-system design Cost Estimate


11

CNC Machine Design Report

Implementation Schedule Conclusion with discussion of design Complete time for implementation of the machine will be approximately 13 weeks, and it would have a total cost of $1814.

12

CNC Machine Design Report

2. Introduction
2.1 Main Block Description The CNC machine is a system that is able to accept numerical control inputs to machine a part specified by the exact positioning of the inputs. The machine is able to accept commands either through a directly connected personal computer or a flash drive that is activated through the pendant subsystem. The personal computer is allowed three direct forms of communication to the main controller subsystem either through Ethernet, USB, or serial link. The main controller subsystem is able to interpret and communicate the limits of any job, and it can directly control movement of the attachable tool heads. With direct connection to the main controller subsystem, the pendant subsystem is able to accept jobs uploaded through a flash drive, access information incoming through one of the three communication ports that are active, and can change specified rates of speed and the direction of movement of the machine. The framework of the system is set up by the mechanical subsystem which will allow for movement in the x, y, z axes and specify spatial limitations of any acceptable job. The main controller, pendant, and mechanical subsystems are able to interact through power provided by the motor driver subsystem. The motor driver subsystem will contain a power supply that can accept input power through an electrical outlet plug-in, provide movement independently to the x, y, z axes, and can add an extra board to power the acceleration axis. The overall block diagram of the machine is pictured below.

13

CNC Machine Design Report

Ethernet

Motor Power Supply Table Motor 1 Motor 2 Motor 3 Motor 4 Tool head Limits

Personal Computer

USB Serial

Flash Drive

Main Controller Board

Motor Driver Board

Pendant

A Axis Driver Board

Figure 1: Overall Block Diagram

2.2 Options Considered and Chosen Option


2.2.1 Mechanical Subsystem

In consideration of the mechanical subsystem, there were two different aspects of the design that had to be considered before implementation of the design. These two aspects are listed below.

14

CNC Machine Design Report

Materials of the structure Railing of the table The materials of the structure options were between aluminum and high density polyethylene. The chosen option for the materials was the high density polyethylene because of the decrease in total weight of the entire system, less cost, and the dampening of vibrations caused by mechanical movement. The railing of the table options were between versa railing and rod railing. The chosen option for the railing was the rod railing because it had a high decrease in costs compared to its counter-part.
2.2.2 Main Controller Subsystem

In consideration of the main controller subsystem, there is one aspect that was considered before implementation of the design that is listed below. Microprocessor The microprocessor of the controller was between the PIC 24 and the Atmel. The chosen option for the microprocessor was the PIC 24 because of its less cost, its availability of development tools, its easier level of programming for the instruction set, and its greater reliability. 2.3 Expected and Achieved Performance Data The two main performance data statistics are for the machines acceleration rate and velocity rate. The expected performance of both rates was anticipated to be 4 inches per second. After designing and testing, the achieved rates were within a small deviation for both rates expected values. 2.4 Limitations The machine is limited by only two factors. These factors are types of materials that can be cut and the total weight of the tool head. The cutting
15

CNC Machine Design Report

material is only allowed to light metals, wood, and circuit boards. The tool head weight can not exceed 5 pounds.

2.5 Summarization of Fault Analysis As of this date, the faults detected in the motor driver subsystem do not affect overall system performance, and no other faults can be detected in the system without further testing.

16

CNC Machine Design Report

3. Mechanical Subsystem
The mechanical subsystem includes the CNC machine and all of its components. This consists of the machine frame, the gantry for each axis, the work table, and the interchangeable tool heads. This subsystem produces a machine that has three dimensions of reliable and precision motion and allows milling, silk screening, and paste dispensing to be done to a part that has been fixed to the work table. Each axis has been supported by precision guide rails and driven linearly by ballscrews. The ballscrews provide axis motion by transferring torque from the three separate stepper motors. These motors are powered by the Power Drive Electronics subsystem and controlled by the Main Controller subsystem.

3.1 Deflections
The most significant purpose of the mechanical design was to provide three gantries that would allow precision to be maintained in the tool head position. In order to obtain this, a maximum allowable deflection of 0.001 inch was set for each guide rail. Each axis was designed to support its weight and withstand the force incurred during milling while maintaining this deflection tolerance. 3.1.1 X-axis

3.1.1.1 Calculated Moments and Equivalent Force Couples on X Rails This iterative design process began with the determination of the deflection in the x-axis. The x-axis provides motion across the width of the table and must support both the weight of the vertical axis(z-axis) and withstand the cutting force. Because the x-axis crosses the table, it required the use of unsupported precision rail and was susceptible to the largest deflection. In order to find the deflection of the x-axis rails, a tentative design for the z-axis was done and the weight of each component, including a 10lb tool head, was multiplied by the distance from its center of gravity to the center of the x-axis ballscrew. These were summed in appendix Table 1.4-1 to find a moment due to the weight of the z-axis of approximately 100 lbs.in. Then, the maximum cutting force experienced by the tool head when extended fully to the table was set at 5.5 lbs and multiplied by the vertical distance. This calculation, shown in Table 1.4-2, produced a 75 lbs.in moment. With the calculated moments, the resultant forces experienced by each rail was then determined. Since the ballscrew is centered between the rails, the resultants produce force couples in the horizontal and vertical directions that are equivalent to the moments of the cutting force and the z-axis weight, respectively. Each resultant was found by dividing the moments by the spacing of the horizontal and vertical spacing of the rails as shown in Table 1.5-1 and Table 1.5-3. Table 1.5-1 and Table 1.5-3 also show that the effect of increasing the spacing between the rails was a decrease in the resultant force experienced by each rail. The final spacing was set at 4 in as a compromise between reduced forces and a compact x-axis design.

17

CNC Machine Design Report

3.1.1.2 Trade off Study: 3 rods vs 4 rods The force resultant is reduced further with the use of three and four rails. Tables 1.5-2 and 1.5-4 show the rod orientation with three and four rail designs, respectively. From Table 1.5-1 showing the configuration for three rails, the moment due to weight is balanced by a vertical force couple where each force is F1 and the moment due to the cutting force is neutralized by a horizontal force couple with each component as F2. Rod 1 experiences all of the vertical force, F1, while rods 2 and 3 only hold half of this force component because both are aligned. The horizontal force component is split between rods 1 and 2 while rod 3 experiences the entire force. After determining the horizontal and vertical forces on each rod, a resultant was found for each and is shown in Table 1.5-1. The top rear rail experienced a 26.70 lb force, while the top front and bottom rails were loaded with 15.63 lb and 22.53 lb forces respectively. These resultants are presented more clearly in Table 1.5-2 in the cell corresponding to the orientation of the rod. In addition, a free body diagram sketch can be referenced on page 31 of Pat Brokaws design notebook. When four rods are used, both components of the force couple are divided between two rods. This reduces the resultant force on each rod even further to 15.63 lbs each. A comparison was done between the configuration for three rods and four rods was done in order to determine if this additional reduction in force justified adding a fourth rod. This first required a comparison of the minimum rod diameter allowable for a three and four rod design. 3.1.1.3 Rod Diameter Selection The rod diameter required to support a given weight was found using the deflection equation given in Figure 1.1-1 (Budynas). This equation, applied twice, best represents the x-axis deflection problem because the rod has fixed supports with two point forces applied at the bushing locations. Table 1.2-1 shows this calculation with the modulus of elasticity set at 29x106 psi, the maximum deflection set at 0.001 in, the length of the rail at 30 in, and the forces separated by the center to center distance of the bushings of 1.3125 in. The force that results in a 0.001 in deflection was found for rod diameters of 0.75 in to 1.25 in. It was determined that the 1 in rod only supported 19.4 lbs and the next available rod size of 30mm, or 1.18 in, supported 37.8 lbs at a deflection of 0.001 in. With these numbers, it was found that with three rods a one inch rod was insufficient to support the load and the 30mm rod diameter was required. However, if four rods were used the 15.63 lb force on each rail could be supported by the 1 in diameter rod. Then, the final comparison involved cost. The costs include the expense of the rails, the bushings, and the additional machining required for the additional rod. It was determined from this analyze that a 3 rod configuration would be less expensive and ultimately the most desirable design. 3.1.2 Z-axis In the process of evaluating the deflections in the x-axis, it was apparent that the horizontal distance between the tool heads center of gravity and the x-axis ballscrew was a significant factor in the calculated moment. It was determined that reducing this distance would greatly reduce the moment

18

CNC Machine Design Report

due to weight. For this reason, the versa rails were selected as the linear guides for the vertical axis. The height of rail system from the bottom of the rail to the top of the bearing block was 1.18 in and the total including the standoffs was 1.6024 in. A cross-sectioned sketch of this axis can be found on page 36 of Pat Brokaws design notebook. This reduced the moment and because the versa rails are capable of dynamic loads of 2449 lbs, all deflection concerns in the z-axis were eliminated. 3.1.3 Y-axis The deflections in the y-axis guide rails were also an area of concern. The rails are mounted beneath the work table and the y-axis provides motion along the length of the table. The force that it must support is solely due to the weight of the z-axis and x-axis gantries. This weight is near 100lbs and must be supported on a 38 in long rail. Table 1.3-1 shows the force required to deflect a rod of this length 0.001 in and compares the forces for rod diameters from 0.75 in to 1.25 in. From the calculations in Table 1.3-1, it was determined that this tolerance could not be held by a linear rail alone and a supported guide rail system must be used for this application.

3.2 Mechanical Drive System


3.2.1 Ballscrew Lead Specification Once the linear guides for each axis were designed to hold the desired deflection tolerance, the mechanical drive system was examined. The mechanical drive utilizes ballscrews to convert the torque from the drive motors into linear motion. Ballscrews use circulating ball bearings within the nut which act to eliminate frictional losses and reduce wear in comparison to other linear motion alternatives, namely ACME threaded power screws. A precision of 0.001 in was desired in the linear motion of the tool head and a ballscrew with a lead of .200 in/rev was selected. As explained in the Power Drive Electronics subsection, microstepping is used to turn the ballscrew in increments small enough to achieve this precision. 3.2.2 Ballscrew Linear Force and Torque Next, the forces transmitted linearly through the ballscrew were calculated in order to validate the diameter selected and determine a method for mounting the ballscrew. Table 3.1-1 shows the specifications of the ballscrew and some of the operating conditions considered. Two conditions were considered when the machine was accelerating and when operating at a constant velocity. The force exerted on the ballscrew is equivalent to the acceleration force and the force of friction that must be overcome when moving along the gantry. When accelerating, the static coefficient of friction was used and the force of acceleration is added to the frictional force. When moving at a constant velocity, only the frictional force is present and the kinetic coefficient of friction was used. Since the y-axis carries the greatest weight, it was used to determine the maximum forces on the ballscrews. As shown in Table 3.1-1, the static friction force was 25 lbs and the force of acceleration was 3.88 lbs. This converts to a torque of 16.3 oz.in. When moving at a constant velocity, the ballscrew must overcome a kinetic friction force of 18.75lbs by providing a torque of 10.6 oz.in. An acceleration of 15

19

CNC Machine Design Report

in/s2 was set for machine operation and the time to accelerate to various velocities was determined. This was used in a separate equation provided by Roton, the ballscrew manufacturer, and it was confirmed that the force remained constant at 3.89 lbs if the acceleration is kept at 15 in/s2. 3.2.3 Thrust Force The linear force carried by the ballscrew is the thrust force that must be carried by the bearings and the gantry sides. The ballscrew was supported by a roller bearing on one end and was fixed on the other using a thrust bearing block assembly shown in Figure 3.3-1. A preliminary sketch of this assembly is a shown on page 39 of Pat Brokaws design notebook and final engineering drawing of the thrust bearing block is present as drawing number B-13. One thrust bearing was placed between the shaft step and the thrust bearing block. Then another thrust bearing was pressed into the other side of the thrust bearing block and a nut was tightened on the shaft threads to remove all free play in the bearings. This effectively removed all linear play in the ballscrew when the thrust bearing block is mounted to the side of the gantry. In addition, seals were placed on either end of the bearing block and a greases zerk was threaded into the side to allow for routine lubricating of the thrust bearings.

Figure 3.2-1

With the ballscrew fixed with the thrust bearing block, all linear forces are then transferred to the gantry sides. Each gantry side was fixed solidly, and it was determined that each axis would be able to handle this thrust force. For example, each x-axis rod is mounted with a 3/8 in bolt threaded into the end and the uprights are constructed of in high density polyethylene quite capable of withstanding this thrust force. Additional finite element analysis for each gantry end is certainly desirable to confirm this observation. However, the expertise was not available among the teams mechanical engineers and unfortunately time did not allow for the skills to be obtained and applied for this project. In future considerations, this will certainly be an area of focus.

3.3 Table Top Support Calculations


The design of the gantry guide rails and the ballscrew drive system provide precise motion of the tool head. Additional calculations were then done to ensure that when a part is placed on the table it is held accurately in position and that no deflections are experienced in the work table. The table top is constructed of 0.5 in high density polyethylene provided by Norva Plastics. This offers ease of

20

CNC Machine Design Report

construction, superb appearance, and acts to dampen vibrations. However, the maximum allowable weight of a part placed on the table without deflection is minimal. In order to allow milling to be done to larger stock and to maintain tolerances when tooling inflicts downward forces, such as in drilling applications, additional supports were needed under the table. It was determined that three rectangular, steel supports would be distributed evenly beneath the table. The calculation that justified this decision is shown in Table 2.1-1 and was done using the deflection formula shown in Figure 1.1-1, which was used previously for the guide rail deflections. However, in this case the second moment of area was changed appropriately for a rectangular beam. It was determined that a rectangular rail with dimensions, 0.375 in by 1.00 in, provided an additional 6.1 lbs of support per rail if the part weight is approximated as two point forces separated by 1.3125 inches. This allows for a piece of metal stock in excess of 18 lbs to be placed in the center of the table without a deflection greater than 0.001 in.

3.4 Tool Heads


With a precision machine and a well supported table designed, attention was turned to the functionality of the machine. This includes the tool heads available for attachment to the z-axis. The machine is intended to be multifunctional with applications ranging from milling, solder paste dispensing, and silk screening. For this project, a spindle mount was designed and prototyped. In addition, a solder paste dispensing tool attachment was designed for future prototyping and testing. 3.4.1 Spindle Mount The weight of a 10lb spindle was accounted for in the design of the machine, allowing for significant millwork to be done by this CNC. However, for the prototype a low cost, light duty spindle was fitted to the z-axis. The components of this spindle mount are presented in the following drawings: B-33, B-34, B-35. 3.4.2 Solder Paste Dispenser Considerable design was done to create a method of dispensing solder paste from a syringe using a small stepper motor, a reciprocating screw, and a plunger. These components are presented in drawing numbers B-36, B-37, B-38, B-39, B-40, B-41, and B-42, and the assembly is shown in Figure 5.2-1. It was determined that the paste flowrate was related to the motor speed using Equation 5.3.1, which would be used in the control algorithm for the paste dispenser. Also, the required torque was found to be dependent on the fluid pressure as shown by equation 5.3.2.

21

CNC Machine Design Report

Figure 3.4-1

(5.3.1) (5.3.2) An attempt was made to model the paste flow as a newtonian fluid using the general engineering equation, shown in Equation 5.3.3, with head losses along each length of the syringe, at each diameter contraction, and at the needle exit. These calculations are shown in appendix Table 5.2-1 with the conditions at each point in the syringe shown in Table 5.3-1. Also, hand calculations and a sketch of the paste syringe with the locations numbered are shown on page 48 of Pat Brokaws design notebook. However, due to the minimal needle size and the low flowrate it appeared that some modifications must be made to this equation. A simplified attempt was made using only the dynamic pressure of the fluid and the head loss along the length of the needle, as shown in Equation 5.3.4. Still, the resulting pressure appeared to exceed what was determined to be a reasonable by those familiar with the use of a paste syringe. In a final attempt to spec the motor, forces applied to syringe plunger were approximated and converted to the required torque in Table 5.4-1. From this, it was determined that a small stepper motor would be sufficient to power the reciprocating screw and plunger and further analysis would require prototyping and testing. (5.3.3) (5.3.4)

3.5 Machine Electronics


Additional design considerations to accommodate the electronics required for the operation of the CNC machine. This includes the wiring to the motors, the housing for the main controller and driver boards, and the case for the pendant to be use by the operator to make machine inputs.

22

CNC Machine Design Report

3.5.1

Cable Carrier Cable carriers were used to organize the wiring to the motors, spindle, and limit switches and allow them to move with the machine throughout its travel. Appendix Table 4.1-1 provides a list of the wires to be held in the wire carrier for each axis. The diameters of each wire were measured and cable carriers of appropriate dimension were ordered from the McMaster Carr website. 3.5.2 Electrical Component Housing A protective case was required to house the main controller board, the motor driver board, a capacitor, a relay, and a transformer. Polycarbonate was selected for the case material to provide protection while allowing the electronics to be attractively displayed. In this case, the main controller board was placed on the bottom while the driver board was elevated directly above. A divider was then placed inside the case to separate these boards from the capacitor, relay, and transformer. The purpose of this divider was to protect the boards in the event of a catastrophic capacitor failure. Additional accommodations were made to allow for connections to the motors and the spindle, as well as VGA, DB, Ethernet, USB, DC power, and AC power inputs/outputs. The drawing of this housing has been presented in the assembly drawing BB-5. 3.5.3 Pendant Case The pendant will allow the machine operator to make positional and feed rate adjustments as well as perform other input tasks as described in the pendant subsystem. A case was designed to house the two separate boards containing functional and directional buttons and the OLED screen. The drawing for this case has been labeled B-43. An attempt was made to machine this complex design from high density polyethylene. However, it was determined that some dimensions needed to be changed to improve the strength of the casing if this material was to be used. Further considerations were made to utilize polycarbonate for this construction of this case to provide greater strength and allow the internal boards to be displayed. For prototyping purposes, the pendant boards will be mounted to single piece of polycarbonate and further machining will be done to finish this component.

3.6 Equipment Lists


3.6.1 Design Tools AutoCad Inventor Microsoft Excel Machining and Assembly Tools Mill Lathe Grinding Lathe Horizontal and Vertical Bandsaws Drill Press Chop Saw

3.6.2

23

CNC Machine Design Report

Cordless Drill Combination Wrenches Allen Wrenches Screw drivers, both Phillips and Flat head Various endmills from 1/8-5/8 Fly cutter and various milling tool heads Boring head Calipers Micrometers Telescoping gauges Depth gauges Tap handle Taps: #4-40, #6-32, #8-32, #10-24, 1/4-20, 3/8-16, 3/8-24, 1/8-27 NPT Die: 5/16-18 Drill bits: #43, #36, #32, #29, #27, #25, #24, #18, #9, #7, F, H, Q, W, X, 5/16, ,

3.7 Components and Specifications


3.7.1 Material Specifications
Material E (106psi) Sy (ksi) (g/cm3) E/ Sy/ Hardness Steel A36 29 36 7.85 3.69 4.6 Aluminum 6061-T6 10 37 2.71 3.69 13.7 HDPE 0.12 4.3 0.96 0.13 4.5 D60-70 Polycarbonate 0.32 9 1.2 0.27 7.5 M70-82

3.8 Components
3.8.1 Z-axis The z-axis allows vertical motion of the tool head. The total travel of the vertical axis on this CNC machine is 8.24 in. An assembly of the z-axis is shown Figure 8.2-1 and in the drawing BB-1. The following components are included:

24

CNC Machine Design Report

Figure 3.8-1

Z-axis Ballscrew: A 5/8 in ballscrew was used and shaft steps were machined to allow for thrust and ball bearing supports. The dimensions of the ballscrew are shown in drawing B-1 and the specifications, per Roton, are included in the Section 9 of the appendix. Z-axis Thrust Bearing Block: The design of this component required minimizing its height in order to reduce the overall height of the z-axis. This part drawing is B-2. Z-axis Ballnut Flange: This part has internal threads for the ballnut and threaded holes for mounting to the z-mount as shown in part drawing B-3. Z-top: A recessed section allows for the z-axis motor, and the ball bearing supporting the ballscrew was pressed into the z-top. Part dimensions are shown in drawing B-4. Z-bottom: The bottom of z-axis allows for the mounting of the thrust bearing block and clearance of the end of the ballscrew. Refer to drawing B-5 for dimensions. Z-sides: These parts provide additional strength to the z-top and z-bottom which must withstand the thrust force of the ballscrew. These parts are shown in drawing B-6. Z-Back: The z-back acts as the base component in the z-axis. The z-top, z-bottom, z-sides, and the versa rails all mount to this component. The z-back was also used to mount the zaxis to the x-traveling block. This part was designed with grooves for aligning the versa rails and an inset in the top to position the z-top. The dimensions of this component are shown in drawing B-7. Z-mount: This part connects the tool head, the versa blocks, and the ballscrew. Drawing B-8 shows the dimensions of this part. Standoffs: These were included to account for height difference between the versa blocks and the clearance required for the ballscrew and its supporting bearings. Clearance holes 25

CNC Machine Design Report

were machined for the versa block bolts and the threaded holes are used to mount the tool head. These part is shown is shown in drawing B-9. Versa rail: These precision rails were used to guide the vertical travel of the tool head and were selected over other alternatives in order to reduce the height of the z-axis. The dimensions are shown in drawing B-10 and the specifications, from Anaheim Automation, are given in Section 9 of the appendix. Versa block: These travel along the versa rail and use ball bearings to support a maximum dynamic load of 2449 lbs. The specifications from Anaheim Automation are provided in Section 9 of the appendix and the part drawing is B-11. 3.8.2 X-axis The x-axis provides tool head motion across the work table with a maximum travel of 24.15 in. The assembled x-axis, shown in Figure 8.2-2 and in drawing BB-2, includes the following components:

Figure 3.8-2

X-axis Ballscrew: A 5/8 in ballscrew as used to provide linear motion along the x-axis and the dimensions of this part are given in drawing B-12. X-axis Thrust Bearing Block: The part holds the thrust bearings required to carry the linear force of the ballscrew. Dimensions are shown in drawing B-13. X-axis Ballnut flange: This part connects the ballnut to the the x-traveling block and transmits the motion of the ballscrew. This part is shown in drawing B-14. X-Rods: These rails guide the precise linear motion of the x-axis while supporting the weight of the z-axis and withstanding the force due to the cutting head. Dimensions are found in drawing B-15 and Lintech Motion specifications are included in Section 9 of the appendix.

26

CNC Machine Design Report

X-Traveling Block: This part holds the ball bushings that slide along the x-rods. These bushings have been pressed into the bored holes for an interference fit that will hold throughout the operating temperature range. The x-traveling block also provides mounting holes for the z-axis and all dimensions are shown in drawing B-16. X-Bushings: The bushings allow the x-traveling to travel along the x-rods and carry the load through ball bearings. The specifications of these bearings from Lintech Motion are provided in Section 9 of the appendix. X-Top: This part mounts across the top of the x-axis and provides some additional strength as well as providing for the mounting of the x-axis cable carrier. The part dimensions are shown in drawing B-17. X-Back: This part covers the back of the x-rails, providing some strength but primarily protecting the rails from debris. Drawing B-18 shows the dimensions of this component. 3.8.3 Base This assembly provides the solid foundation for the CNC machine as well as support for the y-axis. The assembly, shown in Figure 8.2-3 and in drawing BB-3, includes the following components:

Figure 3.8-3

Table Bottom: The table bottom is the base of the machine and has two 36 in, aluminum extruded rectangular tubes mounted beneath it that provide a solid stand for the machine. The bottom also has channels for the precise placement of the y-axis linear guide rails. This part is shown in drawing B-19. Table Ends: The table has two end components to which the y-axis ballscrew and the y-axis drive motor mount. One end, the Table End-motor shown in drawing B-20, supports the

27

CNC Machine Design Report

ballscrew through a ball bearing and has a recess for the motor mount. The other, Table End shown in drawing B-21, provides mounting holes for the z-axis thrust bearing block. Table Sides: The table sides add strength to the table ends which experience the thrust force of the ball screw while also protecting against debris from accumulating under the work table. The dimensions of these parts are shown in drawing B-22. Work Table: The work table, shown in drawing B-23, mounts across the table ends and provides 1160.25 in2 of area on which to mount the part to be machined. In order to support weight of the part, support rails were mounted beneath the work table to remove the deflections. 3.8.4 Y-axis The y-axis provides 31 in of travel along the length of the work table. This assembly is shown in Figure 8.2.4 and drawing BB-4. The following components comprise the y-axis:

Figure 3.8-4

Y-axis Ballscrew: Linear motion is provided by a 5/8 in ballscrew and is dimensioned in drawing B-24. Y-axis Thrust Bearing Block: The thrust bearings that carry the linear force of the ballscrew have been pressed into the thrust bearing block. This part is identical to the x-axis thrust

28

CNC Machine Design Report

bearing block, and the dimensions of this block as well as the bearing bores are shown in drawing B-13. Y-axis Ballnut Flange: This part connects to the y-cross component and transmits motion from the ballscrew to the y-axis. It has been dimensioned in drawing B-25. Y-Rails: Supported guide rails were selected for the y-axis due to the weight that had to be supported and the length over which this load had to be supported. Dimensions of these rails are shown in drawing B-26 and the specifications from Lintech Motion have been included in Section 9 of the appendix. Y-axis Bushing Blocks: Assembled bushing blocks were ordered from Lintech Motion for the y-axis. These use ball bearings to carry the load and to provide precise motion. These have been dimensioned in drawing B-27 and the specifications have been included in Section 9 of the appendix. Y-Lifts: These parts mount to the y-axis bushing blocks and contain mounting holes for the vertical gantry sides. These were designed to offset the y-rails further under the table, protecting them from debris which could damage the rail surface or the bushings. The y-lifts also position the vertical gantry sides such that the center of gravity is centered on the bushing blocks to prevent uneven wear. The dimensions of these parts are shown in drawing B-28. Y-Cross: The y-cross spans the width of the y-axis and connects the y-lifts and y-axis bushing blocks which travel along each rail. The ballscrew flange connects to the center of the y-cross, transmitting motion of the ballnut to the y gantry. The dimensions of this part are shown in drawing B-29. Y-axis Vertical Gantry Sides: The vertical gantry sides mount to the y-lifts at the bottom and act as the ends of the x-axis at the top. The x-rods, x-axis ballscrew, x-back, and x-top all mount between the vertical gantry sides at the top. One vertical gantry side, shown in drawing B-30, has a mount for the x-axis drive motor and supports the ballscrew using a ball bearing. While the other, shown in drawing B-31, allows for mounting of the x-axis thrust bearing block. Y-Gantry Insert: Inserts were made for the gantry to insure correct positioning of the x-rods over time. A continued load can lead to creep in the HDPE gantry sides. In order to prevent future misalignment, aluminum inserts, shown in drawing B-32, were machined with x-rod positioning holes made to match those in the gantry sides. 3.8.5 Tool Heads The exchangeable tool heads allow for a multifunctional CNC. The tool heads that have been designed for this machine include a spindle and a solder paste dispenser. 3.8.5.1 Spindle The spindle will allow the CNC to mill and engrave. The parts included in this tool head include:

29

CNC Machine Design Report

Spindle Plate: The spindle plate has holes for mounting to the z-axis as well as holes for mounting the spindle. Dimensions of this plate are shown in drawing B-33. Spindle Holder: The holder has been bored to the outer diameter of the spindle and clearance holes have been machined for mounting to the spindle plate. The dimensions of this part are shown in drawing B-34. Spindle: The spindle used for this prototype has been dimensioned in drawing B-35. 3.8.5.2 Solder Paste Dispenser The solder paste dispenser will dispense solder paste onto a printed circuit board using a syringe and the plunger system shown in Figure 8.2-5. The individual components included in this tool head include:

Figure 3.8-5

Plate: This plate mounts to the z-axis while containing holes for the dispenser motor and the syringe to mount. Also a groove to guide the plunger was designed into the plate. This is shown in drawing B-36. Motor Mount: This mounts the driving motor to the plate and is shown in drawing B-37. Syringe Mount: This holds the syringe in position and mounts it to the plate. It is shown in drawing B-38. Syringe: The solder paste is sold in and dispensed from a standard size syringe from Amtech. Screw: A reciprocating screw will extend the plunger into the syringe. This screw is shown in drawing B-39 and will provide a 3 in stroke. Paste Dispenser: This part has internal threads that will allow it to extend as the screw is rotated and will be guided linearly by the groove in the plate. This part has been dimensioned in drawing B-40. Plunger: The plunger screws into the end of the paste dispenser and will contact the plunger inside of the syringe. This part, which is shown in drawing number B-41, was designed to be interchangeable in the event that a different sized syringe was used.

30

CNC Machine Design Report

Coupler: The couple, shown in drawing B-42, will connect the screw to the motor shaft. 3.8.6 Machine Electronics Some mechanical components were necessary to account for the machine electronics. These items include: Pendant Case: The pendant allows the operator to make inputs to the machine. A case was designed to house the circuit boards and screen for this component. The dimensions of the pendant case are shown in drawing B-43. Electrical Component Housing: A case was designed to house and protect the main controller board, the motor driver board, a capacitor, a relay, and a transformer. Drawing BB-5 shows the assembly of the component housing and Table are showing in the drawing BB-5. Cable Carriers: Cable carriers were ordered from McMaster Carr to hold the wiring to the motors, limit switches, and the spindle. Information about the sizes and lengths of these cable carriers are given in appendix Table 4.1-1. 3.8.7 Additional Components Some additional components that were either necessary for the assembly of the machine or common for each of the three axes include: Ball Bearings: Ball bearings were used to support one end of the ballscrews. Specifications for these bearing are given in Section 9 of the appendix. Thrust Bearings: Thrust bearings were used in the thrust bearing block assembles to account for the linear force of the ballscrew and to remove linear play in the ballscrew position. The specifications for these bearing are given in Section 9 of the appendix. Bearing Seals: Seals were used to seal the thrust bearing blocks to allow them to be filled with grease in order to lubricate the bearings. Specifications for these seal are given in Section 9 of the appendix. Seal Retainer: The seals that fit the ballscrew shaft diameter had an outside diameter that was smaller than that of the thrust bearings. Seal retainers were machined with an outside diameter of 0.875 in and an inside diameter of 0.625 in as shown in drawing B-44. The seals were pressed into the seal retainers which were then pressed into the thrust bearing blocks. Pulleys: Timing belt pulleys were used on both the ballscrew shafts and the motor shafts to transfer the torque. Specifications for these pulleys are provided in Section 9 of the appendix. Belts: Timing belts were used to transfer torque from the motors to the ballscrew. The lengths and specifications for these belts are given in Section 9 of the appendix. Motors: Stepper motors were used to power the ballscrews. A 166 oz.in motor was used for the z-axis and a 276 oz.in motor was used for both the x-axis and z-axis. Additional specifications are given in Section 9 of the appendix. Fasteners, Set Screws, and Washers, Board Standoffs, and Grease Zerks: A complete list of sizes and totals can be found in the appendix Table 7.2-1 and 7.2-3. 31

CNC Machine Design Report

3.9 Data Sources


3.9.1 Websites Roton, http://www.roton.com Lintech, http://www.lintechmotion.com Anaheim Automation, http://www.anaheimautomation.com VXB, http://www.vxb.com MCMaster Carr, http://www.mcmaster.com Online Metals, http://www.onlinemetals.com Norva Plastics, http://www.norvaplastics.com MSC Direct, http://www.mscdirect.com Fastenal, http://www.fastenal.com Machine Shop Discount Supply, http://www.msdiscount.com Grainger, http://www.grainger.com Amazon, http://www.amazon.com Newegg, http://www.newegg.com

3.10 Fault analysis


Fault analysis of this CNC machine concludes that failure will occur if the machine ceases to operate, due to a failed fastener or component, or if the machine begins to operate out of tolerance due to excessive wear. 3.10.1 Fastener and Component Failures The ballscrew must transfer motion through the ballnut flange to each axis. The most likely fastener failure will occur in the bolts that hold the ballnut flanges to the y-axis and the z-axis. Possible component failure could occur in the ballnut flanges or to the gantry components that directly experience the thrust force of the ballscrew. These gantry components include the table ends and the top and bottom of the z-axis. These components may not fail completely. However, fatigue may eventually allow excessive deflections that will cause the machine to operate out of tolerance. Design modifications could be made to increase fastener or component size in order minimize the risk of failure. In addition, reinforcement could be added to the gantry components to reduce the effect of fatigue. Despite adding complexity to the design, the cost of these modifications would not be significant as slightly larger aluminum stock or additional reinforcing components only reflect a minimal increase in expense. 3.10.2 Excessive Wear Excessive wear on crucial components will cause the machine to lose tolerances and the usefulness of the CNC machine will become limited to low precision work. If wear is extreme, the usefulness of the machine will be completely lost or the machine may become inoperable.

32

CNC Machine Design Report

Key components are found in the drive and the guidance systems. The drive system consists of the ballscrew, the ballnut, and the supporting bearings. If wear is experienced by the bearings, movement of the ballscrew will be allowed. If the ball bearings inside of the ballnut are worn, the ballscrew will be unable to accurately transmit linear motion. Most likely the ballnut will experience wear first, but soon after wear on the ballscrew itself will occur. The linear guide system consists of the guide rails and the ball bushings for each axis. Wear may be experienced by the ball bearings inside each bushing or to the shafts themselves. If any of these components wear excessively, the machine will be unable to position the tool head with the desired precision. Design modifications cannot provide a solution to these modes of failure. All of the drive and guide system components have been selected for use within their stated specifications. Therefore, only proper and routine lubrication can prevent this wear and extend the life of the machine. The bushings and bearings are to be greased and the shafts are to be oiled as per the Users Manual. If these actions are taken, the risk of failure due to excessive wear will be minimal.

3.11 Health & Safety, Environmental, Life Cycle, and Societal Issues
When operating the CNC machine, the ballscrews can emit significant noise. Continual exposure to this environment can lead to hearing loss. Proper ear protection should be worn. Other components that can cause injury include the tool heads, belts, and ballscrews. Contact with these rotating components must be avoided. Waste products from machine include lubrication grease and metal shavings from machining. These by-products should be disposed of properly. If a component on the machine requires replacement, whether the part is machined from HDPE, aluminum, or steel, these components should also be disposed of in a manner that is not harmful the environment or other individuals.

3.12 Engineering Drawings


All engineering drawings have been included in Section 10 of the appendix, with the exception of the components that require reference to manufacturer data sheets. These are included in Section 9 of the appendix.

33

CNC Machine Design Report

4. Electrical
4.1 Motor Driver Board
4.1.1 Scope

The following section provides a detailed technical description of the function of the Motor Driver. Most component values were derived from the specifications of Data Sheets. Test, measurement, and fault analysis is included and provides detailed accounts of all tests performed with measurement and fault analysis of each circuit. Health and safety pertaining to the Motor Driver is also including in this section. Equipment list, test data and simulations are also in Appendix C. See Users Manual for complete list of specifications.
4.1.2 Block Diagram

The Motor Driver provides a Low Voltage Power Supply which generates four voltages levels 5, +12, -12, and 24 Vdc. The 5Vdc Supply provides the power to the Optical Isolation and Microstepping Sequencer. Step, Direction, Enable, Reset, MS1, and MS2 are all Optical Isolated inputs from the Main Controller. The Step input signal steps the motor. The Direction input changes the direction of the motor. The MS1 and MS2 inputs set the micro-stepping mode which is either full, half, or 1/16 step mode. The Voltage Reference (Vref) determines the maximum current through the motors and there are 3 independent Voltage References for each axis. The Motor Power Supply provides the power to the motors. The Micro-stepping Sequencer controls the Mosfet H-Bridge which drives the motors. The Motor Driver Board provides three fuse blown LED Indicators and a 5V indicator which is lit during normal operation. The Driver Board Ready, Vbb Ready, and Fault signal are outputs to the Main Controller and provide status information of the Motor Driver Board.

34

CNC Machine Design Report

Block Diagram
Motor Driver Board
24 Vdc +-12 Vdc +5 Vdc

To Controller

Low Voltage Power Supply

Vref X,Y,Z axis

Step

Micro stepping Sequencer

A+ AB+ B-

Direction

MOSFET H-Bridge

Enable

Optical Isolation

PFD1, PFD2, SR (jumper selectable

Reset

Connections to Bipolar Stepper Motors X,Y,Z axis


Vm+

MS1, MS2
Vm-

Logic Inputs From Controller

Motor Power Supply

Driver Board Ready 12 V Fuse Blown -12 V Fuse Blown 24 V Fuse Blown 5V GOOD Vbb Ready Driver Board Fault Output Signals

To Controller

LED Indicators

System Monitoring and Fault Identification


35

CNC Machine Design Report

4.1.3

Technical Description

4.1.3.1 Input Optical Isolation

The drive board provides high speed optical couplers for each STEP and DIRECTION input signal and provides low speed optical isolation for ENABLE, RESET, MS1, and MS2 input signals. Each input signal comes from the controller. Optical Isolation is required to isolate the driver board from the controller to avoid damaging it from high frequency noise and voltage spikes occurring on the driver board. This is the main interface between the Motor Drive Board and the Main Controller Board.
4.1.3.1.1 High speed optical couplers

The high speed optical couplers (U8, U9, U14, U15, U20 and U21) are required because of the high frequency at which the motors will be stepped. The response of the Optical coupler is crucial to the performance of the system. R24, R25, R44, R45, R56 and R57 are input resistors each of the couplers and provide 2.3 mA to drive them into saturation when the 3.3 V input signal from the microcontroller is sent. Resistor values were based on specifications is in the data sheet and equations derived in Appendix C. See Micro-stepping Sequencer Schematic C-1 See Data Sheet for SFH6720T High Speed Opto-Coupler in Appendix C for a complete functional description and specifications.
4.1.3.1.2 Optical Isolators

The Low speed Optical Isolator (U10) provides the same isolation function as the High Speed optical couplers but do not require an excellent frequency response. These signals will only enable or disable certain functions and are considered constant. R16, R17, R18, and R19 are the input resistors of each input to the Optical Isolator and provide 2.2 mA to drive them into saturation when a 3.3 V input signal from the microcontroller is sent. The output resistors R20, R21, R22, and R23 are pull-down resistors. The isolators are designed to function as inverters to prevent the A3986 from being enabled at power up. This prevents any unwanted movement of the CNC during this time. Resistor values were based on specifications is in the data sheet and equations derived in Appendix C. See Micro-stepping Sequencer Schematic C-1
36

CNC Machine Design Report

See Data Sheet for SFH6720T High Speed Opto-Coupler in Appendix C for a complete functional description and specifications.
4.1.3.2 Low Voltage Power Supply

The low voltage Power Supply provides four voltage levels, +5, +-12 and +24 Vdc. The +5 volts is used to power all the circuitry on the board expect the operational amplifiers, which uses +-12 volts. The +24 volts is used to operate two solid state relays.
4.1.3.2.1 Input Power Conditioning

Consists of Terminal Block 1 (TB1), step down transformer (XR1), full bridge rectifier (BR2), and filter capacitors (C17, C18, C19, and C20). TB1 provides AC main connections and can be configured for 120/240 VAC. See Users Manual for 120/240 VAC terminal block configurations. The Transformer provides the required step down voltage to the Full Bridge Rectifier (BR2). The Rectifier and filter Capacitors provide the DC input voltage to the regulators (VREG2, VREG4, and VREG3). See Low Voltage Power Supply on Schematic C-2. See Data Sheet for MB110S-TPMSCT-ND Bridge Rectifier in Appendix C for a complete functional description and specifications
4.1.3.2.2 +-12Vdc Supply

The +-12 Vdc (VREG2, VREG4) is the regulated input to the +5Vdc regulator and provides the supply voltage for the Voltage Reference Circuitry. The output voltage of VREG2 and VREG4 are fixed by resistors (R12, R13 and R29, R30 respectively) .These supplies are designed to provide increased ripple rejection by connecting a capacitor to the adjustment pin (pin-1) of VREG2 and VREG4. These bypass capacitors (C10 and C14) prevent ripple from being amplified as voltage on the output is increased. The supply also has input and output short circuit protection. The diodes prevent current from entering the regulator. When the input of the regulator is shorted the output capacitor (C6 and C8) would normally discharge into the output of the regulator. This will not haven because discharge current will be shunted to the input side of the regulator by diodes (D5 and D1) respectfully. To prevent the bypass capacitors from also discharging into the regulator, diodes (D2 and D6) are used provide a low resistance path back to the output side of the regulator. Resistor values were based on specifications is in the data sheet and equations derived in Appendix C. See Low Voltage Power Supply on Schematic C-2.

37

CNC Machine Design Report

See Data Sheet for LM317 and LM377 3-Terminal Adjustable Regulator in Appendix C for a complete functional description and specifications.

4.1.3.2.3 Slow Turn on Circuit

Each supply also has a slow turn on Circuit. The +12 Vdc slow turn on circuit consists of Pchannel mosfet (U32), capacitor (C75), resistor (R63) and diode (D8). The voltage at the gate and source of U32 slowly rise until the capacitor is fully charged to 12 volts at which time the gate voltages becomes more positive then source voltage an U32 gets turned off; effectively removed from the system. The -12 Vdc supply has the same slow turn on circuit as the +12Vdc supply and consists of Nchannel mosfet (U33), R64, C76, and D9. See Low Voltage Power Supply on Schematic C-2.

4.1.3.2.4 5Vdc Supply

The 5Vdc supply (VREG1) powers the optical couplers, optical isolators, jumper selectable functions, the A3986 Micro-stepping sequencer, and the Vbb Protection Circuit. The 5Vdc supply has been designed to deliver up to 185 mA at 20 degrees Celsius. It provides temperature protection shut down at temperatures greater than 150 degrees Celsius. C16 and C9 provide stability to VREG1. Selection of input voltage was based on equations from the data sheet and Matlab graphs in Appendix C. C16 and C19 were selected from specifications from the data sheet in Appendix C. The 5 volt supply has also been designed with short circuit protection (D7). The turn on time for the 5Vdc supply is approximately 15 seconds, which is set by the slow turn on circuit for the +12 Vdc supply. The 5Vdc supply has an indicator light which illuminates when 5V is present. See Low Voltage Power Supply on Schematic C-2. See Data Sheet for TDA3664 Very Low Dropout Voltage Regulator in Appendix C for a complete functional description and specifications.

38

CNC Machine Design Report

4.1.3.2.5 24 Vdc Supply

The 24 Vdc supply (VREG3) is used to power the chassis mounted solid state relay which turns on AC power to the motor driver board and the motor power supply. Another relay is used to apply AC power to the spindle head. Note: The main controller operators these relays. See Low Voltage Power Supply on Schematic C-2. See Data Sheet for LM317 3-Terminal Adjustable Regulator in Appendix C for a complete functional description and specifications.

4.1.3.3 Motor Power Supply

The motor supply provides the power to drive the motors on the CNC. The motor supply can provide an unregulated output of 40 Vdc at full load. The supply consists of a toroidal transformer, filter capacitors, and a bridge rectifier (BR1). The Transformer and filter capacitors are chassis mounted. C74, C72, C87, C86 are located on the Motor Driver Board and provide filtering of high frequency noise and reduce transient voltage spikes during normal operation. Transient voltage suppressor (TVS1) is used to prevent transient voltage spikes over 55 V. Voltage spikes in excess of 55 Volts may destroy the A3986 therefore a transient voltage suppressor has been installed to prevent this from occurring. See Motor Power Supply Simulation Data in Appendix C. A toroidal Transformer was used in the design of the motor power supply for several reasons. First, the size of the toroid is about half the size of standard power transformers. Since the transformer will fit into a smaller space; this allows the enclosure to be smaller, which reduces the material cost of the system. Second, the toroid produces very little transformer humming so noise pollution produced from the system will be reduced. Also, toroid transformers produce nearly no stray magnetic fields which reduce electromagnetic interference on other circuit components in the electrical cabinet. See Motor Power Supply on Schematic C-3

4.1.3.4 Micro-stepping Sequencer with External H-Bridge

The A3986 is the heart of the driver board. It is micro-stepping driver with a minimum number of control inputs. It is capable of operating 2-phase bipolar stepper motors in full, half, quarter and sixteenth step modes. The current in motor is controlled by a fixed off-time pulse width
39

CNC Machine Design Report

modulation control circuit. The current in the motor at each step is set by the value of an external current sense resistor, a reference voltage, and the output of the DAC controlled by the translator. The A3986 provides all the necessary circuits to ensure that the gate to source voltage of both high side and low side mosfets are above 10 V, and that there is no cross conduction in the motor windings. (1) The use of pulse width modulation provides the cost-effective solution for designing high efficiency motor driver. By utilizing PWM, the size of the motor supply is greatly reduced because the current required from the supply will be a fraction of that in the motor windings. Also, there no need to design a complex controller because motor stepping is controlled by two inputs. (Step and Direction) See Data Sheet for A3986 Dual Full-Bridge MOSFET Driver with Micro-stepping Translator in Appendix C for a complete functional description and specifications.

4.1.3.4.1 Axis Control

The following describes the X-axis control. The A3986 (U1) provides all the circuitry to control a 2-phase bipolar stepper motor using two external N-channel H-bridges. U2 and U3 makeup the A-phase bridge while U6 and U7 makeup the B-phase bridge. The maximum current through each phase of the motor is controlled by current sense resistors R9 and R11 respectively. Capacitors C2, 3, 4, 5 provide the increased gate voltage needed to turn on the high side Nchannel mosfets. Capacitors C1, C31 and C32 provide stability during transient conditions which exist when the motors are stepping. R1 through R8 are external gate resistors to the mosfets and control the rate of change of the voltage and current in the motor terminals. R10 is the oscillator timing resistor. Capacitor values were selected from specifications in the A3986 data sheet. R10s component values were based off equations from the A3986 data sheet. Note: Y and Z-axis control is identical to the X-axis control. See Micro-stepping Sequencer Schematic C-1 See Data Sheet for A3986 Dual Full-Bridge MOSFET Driver with Micro-stepping Translator in Appendix C for component value selections or formulas.

40

CNC Machine Design Report

4.1.4 4.1.4.1.1 H-bridge

The selection of the external H-bridge was crucial to the over performance of the system. IRF7341PbF dual HEXFET power mosfets were used because of the low resistance from source to drain when turned on (Rdson) and power dissipation of 0 watts. The maximum power dissipated by the mosfets will only be .235 watts when using 4.7 amp motors. This also limits heating of surrounding components increasing performance. The by limiting the current to a maximum of 4.7 amps no heat sink will be required and the full capabilities of the mosfets will be utilized increasing system performance. Also, utilizing dual surface mount mosfets the space required to house them is greatly reduced compared to other systems on the market. See Micro-stepping Sequencer Schematic C-1 See Data Sheet for IRF7341PbF HEXFET Power MOSFET in Appendix C for a complete functional description and specifications.

4.1.4.1.2 Current Sense Resistors

The feedback resistors were also choosing to reduce power dissipation and heating affects on other system components. By selecting .043 ohm resistors surface mount packages could be utilized, reducing the need for large high watt resistors. A maximum power dissipation of .202 watts is required compared to 2.35 watts when choosing a .5 ohm resistor. Although selecting .043 ohm will reduce heat and component size the trace resistance becomes an issue and will adversely affect the accuracy of the current feedback loop. By choosing this option the PCB layout of the current sense resistors became critical to the performance of the system and the solution is fully discussed in the PCB layout section. See Micro-stepping Sequencer Schematic C-1

4.1.4.2 Voltage Reference Circuits

There are 3 independent voltage reference circuits that set the maximum and minimum current through each motor. It consists of a voltage divider and an operational amplifier which provides a stable reference between .688 and 1.6168 Vdc, which corresponds to a current adjustment of 2 to 4.7 A. The maximum current limit is set to protect the H-bridge mosfets from being destroyed by improper adjustment.

41

CNC Machine Design Report

4.1.4.2.1 X-Axis voltage Reference Circuit

The voltage divider comprises of resistors (R31, R32), variable resistors (VR1, VR3), and C37. R31 and R32 set the maximum and minimum voltages, respectively. VR1 and VR3 provide the fine and coarse voltage adjustment respectively. C37 stabilizes the input to the operational amplifier. Decoupling capacitors C38 through C40 provide additional high frequency noise reduction. The amplifier U23 is design for unity gain feedback. The output of the amplifier has a test point for easy adjustment of the voltage reference. Note: The Y and Z-axis voltage reference circuits are identical to the X-axis. Resistor values were based from equations derived in Appendix C. See Voltage Reference Schematic C-4 See Data Sheet for OP27G Operational Amplifier in Appendix C for a complete functional description and specifications.

4.1.4.3 System Monitoring

The motor driver provides four on board indicators and three outputs that provide information to the controller on the status of the driver board.

4.1.4.3.1 Fuse Blown Indicators

Three fuse blown indicators will light up if there is a fuse blown on the +-12 Vdc, and 24 Vdc regulators. This provides the user and maintenance personal a way to quickly diagnose there is fuse blown to bring the system back up quickly, effectively reducing down time. The +12 Vdc fuse blown indicator consists of P-channel mosfet (U30), resistor (R59), diode (D10), and light emitting diode (LED2). The -12 Vdc fuse blown indicator consists of Nchannel mosfet (U30), R61, D12 and LED1. The 24Vdc fuse blown indicator consists of Pchannel mosfet (U31), R60, R62, D11, and LED3. Resistor values were selected from equations derived in Appendix C. Simulations for all fuse blown indicators were performed using Multisim and worked as designed. See Appendix C for Simulation. See Low Voltage Power Supply on Schematic C-2.

42

CNC Machine Design Report

4.1.4.3.1.1

5 Vdc Indicator

The driver also provides an indicator light that lets the user know that +5Volts dc is present and that the driver board is functional. The indicator consists of R74 and LED4. See Low Voltage Power Supply on Schematic C-2.
4.1.4.3.1.2 Vbb Protection Circuit

The Vbb Protection Circuit provides protection in the event of an over current condition. The circuit is designed to trip when an over current condition (>65 mA) occurs. The circuit was implemented to take advantage of the under voltage protection inherent to the A3986 chip. By cutting off Vbb to the chips they would automatically disable themselves preventing any damage from occurring to the A3986 chips. The circuit comprises of U38, U39, and R85, 73, 80 and C88. When an over current condition exists the voltage drop across R80 is greater than 65 mV the gate voltage on the NPN mosfet (U38) will drop to 0V turning off U38 until the over current condition is removed. The decoupling capacitor C88 provides stability during transient conditions. R80s component value was selected from equations in the LT1910 data sheet. See Data Sheet for LT1910 Protected High Side MOSFET Driver in Appendix C for a complete functional description and specifications. See Low Voltage Power Supply on Schematic C-2.

4.1.4.4 Driver Outputs to Controller

These circuits are designed to be used with any miscellaneous inputs to the controller board that uses an optical isolator. They provide the current to drive an optical isolator in either the linear or saturation region to allow the controller to monitor the voltage on the output of the isolator. All component values for the Driver Outputs were selected from equations derived in Appendix C.
4.1.4.4.1 Driver Ready Signal

The Driver Ready Signal is designed to let the controller know when the driver board circuitry is powered up and ready to use. When the driver boards +12 Vdc is completely charged it provides a nominal 533 uA to drive the input of an optical isolator in the linear region. The circuit comprises of resistor (R72) and jack (J10).

43

CNC Machine Design Report

See Low Voltage Power Supply Schematic C-2.

4.1.4.4.2 Vbb Ready Signal

The Vbb Ready Signal is designed to let the controller know that the motor voltage is full charged and ready to drive the motor. When the motor voltage is fully charged it provides a nominal 533uA to drive the optical isolator in the linear region. The circuit comprises of R69, R70, R71 and J9. See Motor Power Supply Schematic C-3
4.1.4.4.3 Fault Signal

The Fault Signal is design to let the controller know that there is a fault in system. The circuit comprises of AND gate (U40), R81, and J11. When a fault is detected the output of U40 will go low (0V) and cutoff the optical isolator. See Motor Power Supply Schematic C-3

4.1.4.5 PCB Layout

The PCB Layout was crucial in the implementation of the Motor Driver.

4.1.5

Health and Safety

Noise Pollution from the motors may cause a loss of hearing if exposed to for long periods of time. Anyone who will be operating the equipment and is in close proximately to the motors should wear hearing protection. Supply Voltages of 45 Volts are present on the driver board. Use caution when performing adjustments when power is applied. Never perform adjustments without the presence of a person that can perform CPR. Also, when power is turned off voltages above 45 volts may still exist. Allow time for filter capacitors to discharge or use a shorting probe to short the voltage to ground. Installed on this equipment is a LED indicator across the filter capacitor mounted to the chassis. This indicator lets maintenance personnel know there is voltage still present of the capacitor. Components used in production of the driver board may or may not contain hazardous material. Disposal of all electronic material should be in accordance with the guidelines set by the EPA.

44

CNC Machine Design Report

For information regarding the disposal, handling and recycling of electronic equipment go to http://www.epa.gov/osw/conserve/materials/ecycling/index.htm

4.1.6

Equipment Required

4.1.6.1 Test Equipment

1. 34401 Agilent multimeter or equivalent standards. 2. Tektronix O-scope 3. DC power supply from 0-30V 4. 33120 Agilent Function Generator or equivalent standard.
4.1.6.2 Soldering Equipment

4.1.7

Schedule Data for Driver Board

Time for Procurement: 1 week from the time of purpose Time for Installation: Reflow Oven:
4.1.8 Test, Measurement and Fault Analysis

4.1.8.1 Input Optical Isolation

All optical couplers and isolators are within specified tolerances. See test data for optical couplers and isolators in Appendix C
4.1.8.2 Low Voltage Power Supply

See test data for the Low Voltage Power Supply in Appendix C
4.1.8.2.1 +-12Vdc Supply

During testing of the Driver board it was found that the 125mA fast blow fuse for the 12Vdc supply was being blown because of the inrush current from the circuitry it drives. Procurement of 125 mA slow blow fuses was not possible in the package required; therefore a slow turn on circuit was designed to eliminate this issue. The +-12 Vdc supplies are within specified tolerances.

45

CNC Machine Design Report

4.1.8.2.2 Slow turn on Circuit

After implementing the slow turn on feature no fuses are being blown. The time it takes the two supplies to reach +-12 volts is on average of 20 seconds. Since, the +12 V slow turn-on circuit provides the longest delay time it was used as a feedback signal to the controller called the driver board ready signal. During Testing of the slow turn on circuit it was found that the +12 Vdc delay is 25 seconds and the -12 Vdc delay is 15 seconds. This delay offset could be changed by reducing the value of R12 or C75. Since, the inrush current problem has been resolved no changes to system will be made or needed.
4.1.8.2.3 5Vdc Supply

The turn on time for the +5Vdc supply is approximately 16 seconds, which is set by the slow turn on circuit for the +12 Vdc supply. 4.1.8.2.4 24 Vdc Supply When conducting the 24Vdc voltage ripple test the measurement was found out tolerance. This is because the input ripple to VREG4 is higher than the tolerance limits on the regulator and cannot filter the ripple out. This may have been caused by using old filter capacitors from the previous circuit board and have been degraded from overheating during unsoldering the components. The solution to this problem would be to replace the filter capacitors C17 and C18 and retest the ripple voltage. If this does not work then C17 and C18 would be increased to reduce the input ripple voltage. Since the 24 Vdc supply is only used to actuate relays, the ripple on it is of no consequence to the system, and therefore no replacement or resizing of the capacitors are needed. The voltage measurement test was within tolerance limits.
4.1.9 4.1.9.1.1.1 Motor Power Supply

All other measurements are within specified tolerances. See test data for the Motor Power Supply in Appendix C
4.1.9.2 Micro-stepping Sequencer with External H-Bridge

During testing it was found that two PCB traces where connected to the wrong side of the HBridge. This caused a catastrophic failure of the A3986 and destroyed most if not all the mosfets for the H bridge. Also the 5Vdc line was shorted to ground caused by the failure of one A3986.

46

CNC Machine Design Report

Once the problem was found a corrected a functional test of the driver board was performed and was successful. Procurement of new A3986 chips was not possible until after March 25 2010 from any supplier. Mark Hopkins a representative from allegro micro that was helping resolve the issues with the A3986 suggested contacting Dytronics and get free samples. Procurement of the new chips was possible and the situation was resolved. The PCB Layout was changed to correct the issue and new PCBs were ordered. Mark Hopkins from allegro micro recommended installing 100nF capacitor across the source and drain of the each mosfet of the H-bridge. The capacitors were not installed on the first PCB revision 1.0.0. This recommendation was considered and implemented on the new PCB boards. During testing the performance of the motors was horrible and heating of the mosfets occurred due of the reactance of the capacitors. They were then removed from the PCB and response of the motors was excellent and no heating occurred to the mosfets as designed. The Schematic and PCB Layout were updated and no capacitors form source to drain will be shown.
4.1.9.3 Voltage Reference

All measurements are within specified tolerances. See test data for the Voltage Reference in Appendix C
4.1.9.3.1 Fuse Blown and 5Vdc Indicators 4.1.9.3.1.1 Fuse Blown Indicators

During Testing of the 24 Vdc fuse blown circuit it was discovered that the wrong PNP mosfet (U31) was used in the circuit. The drain to source voltage is over the rated voltage of the mosfet being used and will be shorted out applying a constant current at all times to the LED until the mosfet breaks down. This failure is of no consequence to the system. The PCB Layout has been updated with the correct part for future procurement of new PCBs. The 24 Vdc fuse blown indicator may be used as an input power indicator light by bypassing U31 if desired. The +-12Vdc fuse blown indicators work as designed. See test data for the Fuse Blown Indicators in Appendix C
4.1.9.3.1.2 5Vdc Indicators

The 5 Vdc Indicator works as designed.


4.1.9.4 Driver Outputs to Controller

All driver output measurements are within specified tolerances. See test data for the Driver Outputs in Appendix C

47

CNC Machine Design Report

4.1.9.5 Vbb Protection Circuit

During Testing the Protection Circuit the timing capacitor would not recharge above approximately 2 V after power on or a fault condition. This should never have unless an over current condition exists. This condition never existed after startup and the voltage timer circuit should have charged to 3.5 V. U39 was assumed good but was replaced by another chip and the same symptoms occurred. The timing capacitor was then removed from the circuit and fixed the problem. The voltage on the timer pin charged to 3.5 V during normal operation and 2 V when a vault condition existed. The Vbb Protection circuit was fully functional and tested at that time. After installing the board in the Electronic Cabinet another system test was performed. During testing all system functions were normal expect the gate pin on the LT1910 chip was 0 V. The only way that pin would be 0 volts is if the fault pin was low or the timer was below 3.3 V. Neither of these condition existed and therefore chip must have failed. This chip may have failed due to overheating during soldering and re-soldering. The chips functionality is degraded and part of the circuit has been bypassed. Procurement of new LT1910 chips and more testing will have to been done to find a solution to this problem. There is no adverse affects caused by this failure to the system. Although the Vbb protection circuit is degraded and will not open the Vbb line during an over current condition the circuit will still determine if a fault condition exits. Therefore when the fault is detected the microcontroller will be informed and can disable the motors and solid state relay preventing any further damage that would otherwise occur.
4.1.9.6 Full System Fault Analysis 4.1.9.6.1 Overvoltage

After completing a full system test of the driver board the motor filter capacitor was shorted to the 5 Vdc line (Vdd test pin) and multiple components on the board were destroyed. This was a catastrophic fault that simulated a very high overvoltage situation which will never happen during normal operation. Several components on the board were destroyed including all three A3986 chips (U1, U4, and U16) and the LT1910 chip (U38). The Vdd pin on each A3986 chip and the IN pin on the LT1910 chip was shorted to ground. This short circuit condition on the 5 Vdc line caused the +12Vdc fuse to blow and the +12Vdc fuse blown indicator to light as designed. No other component failures occurred on the board. There is no way to protect every component from an overvoltage situation like this. Since the three A3986 chips were destroyed clamping the input on the Vdd pin so that the voltages will not

48

CNC Machine Design Report

excide 5 V may reduce the changes of it being destroyed by an overvoltage condition. More testing and research would have to been done which may greatly out way the cost of just replacing the three chips.

4.1.9.6.2 Short Circuit of the 5Vdc and +-12Vdc Supplies

A short condition on the 5Vdc, +-12 Vdc line was simulated by shorting each supply to ground. No component failures occurred. The fuses blew and each indicator lights lit as designed.
4.1.9.6.3 Motor Voltage Supply Failure

The entire enclosure that houses the all components for the electronic system is made from poly carbonate and is virtually indestructible. The motor supply components are also isolated from the motor driver and main controller board by a thick piece of poly-carbonate. If the filter capacitor were to explode it would be contained inside the motor supply housing and no other components should be affected. If a short circuit condition exists on the motor voltage supply line the fuse will be blown reducing the changes of this catastrophic failure.

4.1.9.7 Fault Summary

The design failures of the of the +24 Vdc fuse blown indicator have been corrected. The degraded performance of the Vbb Protection Circuit will not be corrected until further procurement of the LT1910 chips and more testing occurs. There are no design failures or faults in the system that will degrade the system performance of the Motor Driver. There is no way to protect against ever possible failure that may occur during normal operation. All possible ways to protect the Motor Driver that were thought of have been implemented

4.1.10 Section Summary

The Motor Driver is designed to drive 3-independent motors which control the movement of the each axis of the CNC. The driver is designed to be a low cost, high performance product. The A3986 Dual Full-Bridge MOSFET Driver provided the means to design and implement a low cost motor driver that is cable of driving motors from 2 to 4.7 amps.

49

CNC Machine Design Report

4.2 Main Controller Schematic


The main controller is designed to take the information for the CPU or any other external device to run the driver board for the CNC. There are 3 micro-controller chips that were used in this design: the pic24FJ256GB110 (Communication controller), pic24HJ256GP610 (Motion Controller), and the ENC624J600 (Ethernet Controller). The communication controller gets information from different sources: the Ethernet Controller, USB to go, RS232 (Serial port), and the USB to PC. The Motion Controller then receives information from the communication controller and turns it into data that can be understood by the Driver Board. In the Motion controller it has one external UART connection that is hooked up to the Hand Pendent. The Motion Controller also has a handshake to the Communication controller to flag it that it is ready for more data. The Main Controller also has a Memory bank system that is controller by an FPGA. This FPGA takes the information coming from the trajectory and places it into either bank A or Bank B. Bank A and B (IS61LV25616AL) are 256k x 16 high speed asynchronous CMOS static ram with 3.3v supply. In Figure 1.1 shows the system diagram of how the CNC Main Controller is connected.
VGA Pendant

Ether COM USB X Y Z

Serial

Handshake

Main Controller

USB to go

Trajectory Memory

CPLD

BANK A

BANK B

Figure 1.1 Main Controller Component connection flow


4.2.1 Communication Controller

The Communication controller is the main source for information coming to the CNC. This microchip sorts out good and bad packets into the CNC and determines where information goes. This controller is interrupt driven meaning it
50

CNC Machine Design Report

waits for information to come to a port and when that port is flagged the interrupt goes high and all other ports are shut off. On the sheet 3 of the schematic sheet will show the Communication Controller and the RS232 chip, USB to PC, USB to go, and the VGA Connector. Also on the sheet 4 of the schematic sheets show the Ethernet Controller and how it is interconnected. Note: See schematic D- 3 Main Controller, Communications Processor for more details.
4.2.1.1 RS232

The serial pin is connected to a MAX3232CDBR chip that is connected to the RB8 and the RB9 pins on the communication controller. The MAX3232CDBR chip operates with 3 volt to 5.5 volt VCC supply. This chip is a Multi-Channel RS232 Line Driver/Receiver. This device operates with two line drivers and two line receivers. These input pins are TIN1, TIN2, RIN1, and RIN2. The TIN1 and TIN2 have external outputs going to the Communication controller. The TOUT1 and TOUT2 are then looped over to the RIN1 and RIN2 pins. The ROUT1 pin goes to RX1 pin which is port RB8 of the communication controller and the ROUT2 ping goes to the CTS1 pin which is RB9 port on the communication controller. The RS232 will bring information from a serial port that is either connected to the computer or any other external device that has properly working CNC design software. Note: See schematic D - 1 Main Controller, Main Processor for more details.

4.2.1.2 Ethernet microchip

This microchip will allow us to have access using an Ethernet port. This microchip is an already programmed to be able to bring in Ethernet packets and transfer them through the data ports. On This chip there are 7 Data Ports 15 Address ports that will deal with the data. The Data comes in from the Ethernet circuit jack (RJ 45) and transfers the information to an internal pin that will act as a docking station for information coming to the Ethernet and information coming
51

CNC Machine Design Report

out of the Ethernet microcontroller. The Ethernet also has a pin that will select the chip to be used. This pin is what will cause the interrupt to be flagged. Note: See schematic D - 4 Main Controller, Ethernet Processor for more detail
4.2.1.3 USB to GO

The USB to go is implemented into the communication chip. The USB port is connected to pines RG2 and RG3. The input is on RG2 and the output pin is on RG3. This chip will control the information that is disconnected from the PC. This Hand pendent will also receive information from this port to show the files that are on the USB. Note: See schematic D - 1 Main Controller, Main Processor for more details.

4.2.1.4 USB to PC

The USB to PC port is connected by a USB port to a FT245RL chip. This chip is connected to the D- and the D+ from the USBDM and the USBDP. The D0- D7 output ports and the RXF, and TXE are connected to the Communications A Bus. The RD and WR pins are connected to the CPDL connections USB_WR and USB_RD. The Communications A Bus also connects to USB_CS on the CPLD Note: See schematic D- 6 Main Controller, PC USB Interface for more details.

4.2.1.5 Serial Port

The serial port is only controlled by 2 pins the RF 13 and RF 12. The input from the serial port will be the RF12 pin and the Output to the serial port will be RF13. This is the main connection to the communication controller. Note: See schematic D- 3 Main Controller, Communications Processor for more details.

52

CNC Machine Design Report

4.2.1.6 VGA pin The VGA connector is connected by a set of 5 pins. The first pin is the VDD that gives the VGA port power. The second pin is the VGA receive pin. This pin goes to the Communication controller as the third pin which is the VGA transmit pin goes to the VGA to display the screen. The fourth pin is the ground pin and the 5th pin is an extra input pin. Note: See schematic D - 3 Main Controller, Communications Processor for more details.

4.2.1.7 Communication Data Flow

The information that comes from the 4 input ports are all passed over the Data lines on the Communication controller. RE0 to RE7 are the home for the D0D7 I/O connectors. The address of the data is transferred by PMA0 PMA15 pins. The address pins are identified as ADDR_0 ADDR_15. There are also 2 SPI ports. One Port is the Handshake for the Motion Controller and the other port is direct access to the Motion controller for the special functions (See Motion Controller code SPI 2). The SPI1 pins RD8, RA15, RA14 is the direct connection to the Motion Controller and the SPI2 pins RD12, RD3, RD2 are the handshake that will be coming from the Motion Controller. This chip also has miscellaneous pins that do other functions. These pins are:
CS_A (Chips select for the address) RD7 ALE_A () RD6 RD (Read) RD5 WR (Write)RD4 Bank_Switch( Switches memory banks)RD 13 Bank_Lock (Locks the memory Banks)RC14 Ethernet Interrupt Request RD0 USB Flag RF8 USB Transmit Enable RF2 USB Chip Select RF3

53

CNC Machine Design Report

Ethernet Chip Select RA1 USB Sensor RB3(Shows if the USB is functioning properly) RB3 MDIX RE8

On the schematic there are other capacitors and resistors that have been placed on the board. These components were placed due to the chips data sheet specified how to interconnect them. Note: See schematic D - 3 Main Controller, Communication Processor for more details.

4.2.1.8 Motion Controller

The Motion Controller controls the information that comes from the Communication Controller. The Pic24HJ256GP610 is a 100 count chip that has 9 external terminal blocks that will control the miscellaneous I/O pins and Limit selections. These terminal blocks are identified on the schematic as TB9 TB1. TB9, TB8, and TB2 are all miscellaneous output pins as TB7-TB4 are miscellaneous inputs. TB 9, 8, 7, 6, 5, 4 are all connected to the Motion controller by OptoIsolators. TB2 is a high power output pin which is connected by an Opto-Coupler. TB 3 and 1 are passed to the circuit having to do with the Limit switches. The other pins running on the motion controller all deal with other aspects of the CNC. On the motion controller there are 2 SPI ports one being Master and one being Slave. There is one UART port that connects the Hand pendent to the Main Controller. Note: See schematic D - 1 Main Controller, Main Processor for more details.

4.2.1.9 Terminal Block connections

Note: See schematic D - 1 Main Controller, Main Processor for more details on all terminal block connections.

54

CNC Machine Design Report

4.2.1.9.1 Terminal Block 1 These connections are used for the limits switches. Pins 1-6 connect the left and right limits for X and Y and the top and bottom of the Z. These connections are also connected to 3 and gates that connect to other and gates that connect to another and gate that goes to the limit interrupt pin on the Motion Controller. 4.2.1.9.2 Terminal Block 2* These connections are used for miscellaneous output pins 0-3. Pins 1-6 on the terminal block connect to an Opto-Coupler that then connects to the output ports on the motion controller. 4.2.1.9.3Terminal Block 3 These connections are used for the back and forth limits. Pins 1-2 connect these limits as pin 3 connects to ground and VDD. Pins 1-2 also connect to an AND gate that connects to another and gate that is connected to the pins from terminal block 1 that connect to the limit interrupts.

4.2.1.9.4 Terminal Block 4* These connections are used for miscellaneous input pins 0-1 that will connect certain functions from the motor driver board to the motion controller. Pins 1-4 are connected to these input pins by an opto-isolator.
4.2.1.9.5 Terminal Block 5*

These connections are used for miscellaneous input pins 2-3 that will connect certain functions from the motor driver board to the motion controller. Pins 1-4 from the terminal block are connected to these input pins by an optoisolator. 4.2.1.9.6 Terminal Block 6* These connections are used for miscellaneous input pins 4-5 that will connect certain functions from the motor driver board to the motion controller.
55

CNC Machine Design Report

Pins 1-4 on the terminal block are connected to these input pins by an optoisolator. 4.2.1.9.7 Terminal Block 7* These connections are used for miscellaneous input pins 6-7 that will connect certain functions from the motor driver board to the motion controller. Pins 1-4 on the terminal block are connected to these input pins by an optoisolator. 4.2.1.9.8 Terminal Block 8** These connections are used for miscellaneous output pins 6-7 that will connect certain functions from the motion controller to the motor driver board. Pins 1-4 on the terminal block are connected to these input pins by an optoisolator. 4.2.1.9.9 Terminal Block 9** These connections are used for miscellaneous output pins 4-5 that will connect certain functions from the motion controller to the motor driver board. Pins 1-4 on the terminal block are connected to these input pins by an optoisolator.
*Consult the Motor Driver board section for more information of these miscellaneous input pins **Consult the Motion Controller code section for more information of these miscellaneous output pins

4.2.1.10 Pendent Serial Connection

The hand pendent is connected to the motion controller by a serial interface. These serial interface connections is then connected to a MAX3232CDBR chip as discussed in section 1.1. The T1IN connection on the MAX3232 is the pendents transmit port as R1OUT is the pendents receive port. The pendent reset pin is connected to the CTS pin on the serial interface. When this bit is set low it is forced to
56

CNC Machine Design Report

ground. When this pin is set high the pendents connection will reset. Also the DTR pin on the serial interface will be connected to the pendent connected pin on the motion controller. When the pendent losses connection this will be set low and it will shut off. For other connection information please consult the schematic.
Note: See schematic D-1 Main Controller, Main Processor for more details.
4.2.1.11 Motion Controller pin connections

The motion controller has numerous connections to external connectors. RA0-RA7 connects the limit pins from TB1 and TB3. The limit interrupt connector from TB1 and TB3 is connected to INT2 pin. The pendents connection pins on the motion controller are pins RA9, RF3, RF2, and RF1. The miscellaneous input pins are all connected on the RB8 RB14 pins and the miscellaneous output pins are connected on the RD0-RD7 pins. These pins connect all the terminal blocks to the motion controller. The serial ports (SPI1 and SPI2), which control the handshake and the direct connection from the communication controller, are all connected by the motion controllers specified SPI ports. The CPLD connections D7_B D0_B are connected to the RD15-RD8 ports. There are other miscellaneous connections from other parts of the CNC connection. These connections are:
DATA_AVIL ( Interrupt that flags the communication controller that information is ready)-INT1 E-STOP( Emergency stop interrupt) INT3 Z-DIR( Z direction)-RB0 Z-STEP(Z Step) -RB1 Y-DIR(Y Direction) RB2 Y-STEP(Y Step) - RB3 X-DIR(X Direction) - RB4 X-STEP( X Step) -RB5 OENABLE(Output Enable) -RG15 ORESET(Resets the Allegros)-RG14 OM1 (Output signal 1 for microstepping)-RG13 OM2(Output signal 2 for microstepping)-RG12 CS_B(Chip Select B Bus CPLD)-RE3 ALE_B(Address Latch Enable B Bus CPLD)-RE2 RD_B(Read Enable B Bus CPLD)-RE1 WR_B( Write Enable B Bus CPLD)RE0

57

CNC Machine Design Report

Note: See schematic D - 1 Main Controller, Main Processor for more details.
4.2.2 CPLD Connections

The CPLDs main function is to take data from the communications controller and add it to a memory bank while simultaneously taking data from the other memory bank and moving it to the motion controller. The CPLD has Bus A and Bus B that. Bus A coming and going from the communication controller and Bus B coming and going to the main controller. Pins TDI, TMS, TCK, TDO, Vccint, and Vccio are programmable ports for the CPLD. This will be used for firmware update to the CPLD. Pins CS_A, ALE_A, RD, WR, CS_B, ALE_B, RD_B, and WR_B are all input pins that will handle the Chip Select (CS) the Address Latch Enable (ALE) the Read (RD) and the Write (WR). The other pins are the D0-D7 and D0_B, D7_B. These pins are I/O pins that bring data from the Bus A. For Bus B the control connections from the CPLD to the Memory Bank A and B are as followed: Memory Bank A
CS_M1 CE(Chip Enable) OE_M1 OE(Output Enable) UB_M1 UB(Upper bits) LB_M1 - LB(Lower Bits) WR_M1 WR(Write Enable)

Memory Bank B
CS_M2 CS(Chip Enable) OE_M2 OE(Output Enable) UB_M2 UB(Upper Bit) LB_M2 LB(Lower Bit) WR_M2 WR(Write)

The data pins in the CPLD and bank A are I/O pins. Data pins D0_M1 - D15_M1 all connect to bank A on pins I/O0 I/O15. For bank B the data pins D0-M2 D15_M2 are connected to the I/O0 I/O15 pins on bank B. The address pins on the CPLD A0_M1 A15_M1 connect to A0 A15 on bank A and A0_M2 A15_M2 is connecter to A0 A15 on bank B. Note: See schematic D - 2 Main Controller, Main Processor for more details.
58

CNC Machine Design Report

4.2.3

Timing for the CPLD

The CPLD timing is very important for the Main Controller board. The timing calculations are determined by take . Taking this function gives the calculation used to determine the timing needed for the CPLD. When chip select goes low the Read and Write can be toggled if it is high it will not be implemented. Figure 1.2 shows the timing diagram for the FPGA. These parameters have to be followed to have proper data catching on the FPGA.
25 ns CS 25 ns 25 ns

ALE RD WR BANK_SWITCH DATA INVALID DATA INVALID

T0

T1

T2

T3

Figure 1.2 Timing Diagram


4.2.4 Power supply

The power supply for the main controller is a 7 volt DC power source. This power source goes through 2 Voltage regulators VREG1 and VREG2. VREG1 is connected to 3 fuses and 3 LEDs. These fuses and LEDs show will give verification to the
59

CNC Machine Design Report

owner of the board that there is a fault in the system. If LED 2 is on the Main controller (MAIN_3V3) has a blown fuse. This procedure is the same for LED3, LED5 and LED4. The Main controller the Ethernet and the USB all take 3.3 volts. Note: See schematic D - 5 Main Controller, Power Supply for more details.

60

CNC Machine Design Report

4.3 Pendant Subsystem


4.3.1 Introduction

The pendant subsystem is the subsystem that works between the inner subsystems and outside users. It is composed of the hardware and firmware subsets. The hardware subset is based upon the schematic layout and inner processes that occur when a user presses a button on the pendant. It also shows the complete layout that is seen by the user. The firmware subset is broken up into the driver block and the main block. The driver block is chosen either between interrupt or non-interrupt based implementation. After an implementation is chosen, the state diagram for movement of commands from key presses is created to illustrate and build coding for transfer of information on different screens. The main block will show how each message is dispatched through the system and how graphics functions are created to build the functions for the screens which the user will use to navigate the machine and gather information through the microcontroller sub system.
4.3.2 Hardware Subset

This subset will contain brief descriptions for the architecture of the schematic, PCB layout, and physical reactions to the microcontroller when buttons are pressed.
4.3.3 Schematic Design

In order to allow the user access to the outside parameters of the CNC and control movement of the machine, a hand pendant must be designed in order to give this function accessibility. In order to see the main board view and top board view of the pendant, turn to the given schematics of E1 and E2 in the appendix of the report. The benefit of this particularly designed hand pendant is to allow the user the ability to access certain internal functions of a job through buttons, change speed through an exterior feed pot, and visual display of certain items through an LCD screen which will all receive this information with communication with the main controller board.
61

CNC Machine Design Report

The configuration shows how the pendant will receive information through its cable link from the PIC 24 microcontroller. The DB9 and Max32 chips will work together to receive and transmit information received through the microcontroller board. The inputs RBO and RB1 will act as the high and low connections signals. They will send this information to the pendant microcontroller through inputs RB2 and RB3. Later, the information will be relayed from the outputs RB5 through RB8 and RB10 to a group of four buttons which the user is able to access the information from. The voltage regulator will receive a 5 volt input and produce a regulated 3.3 volts for the microcontroller to use. The clock chip will provide an oscillation for the microcontroller to allow a steady, constant flow of information. The MCPIDE chip will attach to the microcontroller through its MCLR pin to reset the operations of the microcontroller. The AN0 pin of the microcontroller will attach to the potentiometer to allow feed/speed rate changes of the machine through the pendants exterior feed pot. Output RB11 will attach to an LED which when lit will show the pendant microcontroller is operating and ready to receive information. Outputs RB12 through RB14 of the pendant microcontroller will be connected to the LCD screen for the screens ability to received information, send information, or reset if needed. Output RB10 of the pendant microcontroller will also move to the top board schematic to give connection to the other four buttons of the pendant. Each button is connected to the microcontroller with a resistor to prevent any button to short out another button. Capacitors are used between inputs and outputs of certain chips to shunt high frequency noise and to prevent switching problems from occurring within the chips. Other capacitors between VDD and ground are used to prevent energy losses when switching occurs and prevent ripple in voltage outputs [1].

4.3.4 PCB and Physical Layout

Based upon the design of the previously discussed schematic, the PCB layout must be constructed to fit within the structure parameters of the pendant

62

CNC Machine Design Report

box and prevent electrical problems from occurring. In order to see the PCB layout of the pendant, turn to the given diagram provided in the report appendix. In order for the pendant board to fit inside the pendant box, the size of the pendant board must be designed in order to meet these specifications. The size of the pendant will be based upon the size of an adult human hand to fit the pendant while the user is able to press buttons with their other hand while still holding the pendant. The top four set of buttons which will control the function, cancel, enter, and axis switch tasks will be set up to fit below the LCD screen and feed pot dial inside the upper section of the box. Therefore, the upper section must have a larger width to contain the set of switches that are spaced apart on a horizontal line. To meet this criterion, the upper section will have a width of 5 inches and a length of around 2.5 inches. The lower section will contain the directional buttons to allow movement of the machine on different axes depending upon the designation given by the axis switch button. They will be spaced in square containment area with the all the buttons separated from each other an equal distance pointing in the direction of movement that each button will provide on the table top. To meet this criterion, the lower section will be set up to have a width 3 inches and a length of 3.5 inches. The figure below will illustrate how the pendant will look once completed.

63

CNC Machine Design Report

Feed Pot Dial

LED Screen
Function Cancel Enter Axis Switch

Up Y/Z Axis

Left X Axis

Right X Axis

Down Y/Z Axis

Figure 6: Pendant Structure

The PCB Layout of the pendant is built with the bottom layer containing all the chips, link cable connector, and the LCD screen and the top layer containing the switches. The red layer corresponds as the bottom copper layer and the green layer corresponds as the top layer. The bottom layer shows many of the chips bound into the same small area. This is due to the length of traces that must be kept at certain length and direction to prevent internal electrical issues. The traces must move at a 45 degree angle to prevent current losses from occurring

64

CNC Machine Design Report

when moving from pin to pin. The longer the traces cause a greater possibility that internal inductance will grow into a large range and affect output current. Also, shorter traces will provide another method of noise reduction and prevent resistance drops along traces to read the optimum outputs.
4.3.5 Physical Display after Button Press

After any button is pressed, the pendant and microcontroller begin sending and receiving messages between each other. The pendant has either the choice of requesting information from the microcontroller through any of its communication pathways and direct it to a particular screen created in the firmware. Otherwise, the pendant can use its LCD screen to present current information from the table top and navigate the tool head to any part on the table top. A block diagram of the button press is displayed below.
Button Press

Which Process

Display

Request Info

Figure 7: Button Press Process

65

CNC Machine Design Report

5. Firmware
5.1 Communication Controller:

The communication controllers task is to receive our information from four different ports: serial, Ethernet, USB to go, and USB to PC. We also had one output port (VGA) that would receive visual information as to where the CNC was positioned and, what state it was in. . The information that goes through the Controller board is called a Packet. The packet contains the Preamble, the packet size, the Datagram(s), and the Post-amble.

|------Preamble-----|------Packet Size------|-------Datagram------|------Postamble-----| 15 bytes 512034 bytes 3+N bytes 15 bytes

S0 Listening State
S0

S1 Preamble State S2 Receiving State

S3

S3 Post-amble State
S1

S2

Our code design was made into 4 main states: listening, preamble, receiving, and post-amble. The listening state waits for an interrupt to flag that information is being received. The preamble state determines if the information

66

CNC Machine Design Report

being received from the PC is credible information that will be used for the CNC. The third phase, receiving state, will determine the destination of the information packet. The fourth and final stage which is the post-amble state will validate the informations credibility from the PC. The Post and Preamble states are interconnected with each other. This way the information is checked twice to make sure it is correct.
5.1.1 Listening State:

The listening state sits and waits for information to be given to CNC from the PC. This state is driven by interrupts on the communication controller. Each input port when it receives information tells the communication controller that there is data ready to be transmitted. Once the communication controller is told that is has data ready it triggers an interrupt flag for that port and all other ports are shut off till the packet is finished being processed. Once it has finished processing, the interrupts are all reset and more data can be accepted.

5.1.2

Preamble State:

The Preambles main duty is to search for the appropriate sequence to show the information is valid. The Preamble sequence comes directly before the receive state and looks for a 15 byte sequence with three phases with each phase having 5 bytes. The first phase of the preamble searches for the Hex value FF(0xFF), The next phase is looks for 00(0x00) and the final phase searches for AA. Figure 1 shows the preamble sequence in the order it will be read. FF FF FF FF FF 00 00 00 00 00 AA AA AA AA AA 4.1.1 Preamble sequence
5.1.3 Receiving State:

The Receiving state transfers our Datagram through our Controller board. The Data gram consists of 3+N bytes. The first byte in the Datagram is the Command Id which is then followed by the Datagram size witch is 2 bytes long.

67

CNC Machine Design Report

The Nth bytes are the Data. In figure 4.2 shows the structure of the Data Gram that will be passed to the Motion Controller. CMD SIZE 4.1.2 Data Gram The Controllers states consists of 7 internal states: Command ID, Com Controller, Main Controller, Trajectory Memory, Process Com Command, Transfer Via SPI1, Store Into Memory, Post-amble (Phase 4). The Command State determines what path the data will go. There are three main paths: Communication Controller, Main Controller, and the Trajectory Memory. To determine what path to take it uses the command ID. Figure 4.1.4 shows the state diagram for the communication controller. Command ID The Command ID has 129 groups. Groups 0-20 is designated for the Communication Controller, 21-40 are for the Main Controller, and 41-128 is designated for the Trajectory Memory. Figure 4.1.3 shows the group ID table for the Data Packet.
Destinations Com Controller Main Controller Trajectory Memory ID Group 0 - 20 21 - 40 41 - 128

DATA

Figure 4.1.3
5.1.4 Group ID

If the group ID is between 0-20 the next state that it goes to is the Communication Controller. At this state if the byte counter is less than the Datagram size then it will loop until it is equal. Once this state is satisfied it then passes the datagram to the fourth state which is the Process Communication

68

CNC Machine Design Report

Command. Once it reaches this state if the byte count is not equal to the actual size of the data then it will be go back to the Command ID state and restart. If this state is satisfied then it will go to the Post-amble state. If the group ID is in the range of 21-40 the next state that it goes to is the Main Controller. Once it reaches this state, it will pass to the state that will transfer the information via the Serial Port Interface 1 (SPI1). Once the data reaches this state the next state is the Post-amble. The only requirement needed for the data to pass to this state is that the byte count has to equal the data size. If the group ID is between 41-128 the next state that is goes to is the Trajectory Memory. This state is designed for all types of data that deal with the plotting data of the CNC. This state is the only state that stores information in the memory. The reason for it being added to the memory is so two data transmissions can happen at the same time. At this state if the data count is less than the data size it loops till this requirement is satisfied. Once the count is equal to data size it moves the data to the Memory. In this state there are two options. The first option is if the Data Count is less then the Data Size is goes directly to the Command ID state. This is in place to show there might have been some Data loss and it needs to resend the information. If the byte count is equal to the byte size then it goes to the post-amble state.

69

CNC Machine Design Report

Invalid Packet Count < Packet Size S0 CMID <MAX ID CMDID <21 Count < Size

CMDID <41 Count < Size S3 S1 S2 Transfer Complete S6 Transfer Complete S5 Count = Size Count = Size S7 Count = Size Exit Notify Main Controller ready data S4

S0 = Command ID S1 = Com Controller S2 = Main Controller S3 =Trajectory Memory S4 = Process Com Command S5 = Transfer Via SPI1 S6 = Store Into Memory S7 Post-amble

Figure 4.1.4
5.1.5 Post-amble State:

The Post-amble state is the same as the preamble state. The only difference is the sequences. For the Post-amble the sequences are 55x5, 00x5, and FFx5. The Post-amble must be true before the communication controller will pass on the data to the Main Controller. If not satisfied then the data is thrown out and the computer has to resubmit the packet. Figure 4.1.5 shows of the preamble in the last phase of the communication controller. 55 55 55 55 55 00 00 00 00 00 FF FF FF FF FF Figure 4.1.5

70

CNC Machine Design Report

5.2 Motion Controller Micro-Processor Code

The motion micro-processor is the controller that powers the driver board. The purpose of this controller is to control the X, Y, Z axis, the acceleration, and velocity. The code for this controller is designed to use the Bresenham Line, and Circle algorithm to move the CNC to its desired position.
5.2.1 Events

There are 5 main events that will be done with the main controller: Data Available, E Stop, Limit Interrupt, UART interrupt, SPI interrupt. The data available interrupt will let the main controller know that data is ready to be interpreted to code to run the driver board. The E Stop interrupt event will stop the CNC machine for safety reasons under OSHA guidelines. The limit interrupt will stop the machine at its limits. These limits will be either the static end points of the CNC base or the soft limits which can be assigned by the user. The UART interrupt will be used for the pendent. 5.2.2
Initialization

The first step was to initialize the Motion controller. The CNC required initialization of three timers: two 32-bit and a 16bit timer. The timers are used for the acceleration and velocity (32-bit) and the 16 bit timer is an extra timer if needed. The CNC also required initialization of two SPI ports. One port is the Master port and the other one is the Slave. The slave port is where the information will come in on from the Communication controller. The Master port is the handshake from the Motion controller to the Communication controller. This handshake is used so the Communication controller will know when to send more data and that the Motion controller received the data. Also a UART pin is initialized to bring in information from the hand pendent that will do small jobs on the CNC without the PCs help. There were seven miscellaneous pins on the Motion controller that can be programmed to do other jobs or use other forms of cutting (milling, solder paste dispenser). These pins are initialized to take in an analog signal and change it to digital, which is called Analog to digital conversion.

71

CNC Machine Design Report

The last thing that we had to initialize on the Motion Controller was the ports. Ports A D had to be initialized to act as an input or an output.
5.2.3 Parameter Table

There are three types of Parameters that need to be implemented into the code to allow total functionality of the CNC: soft limit, work off set, and home position. All these Parameters are 16 bytes long. The soft limit parameter is used to set limits inside of the CNC. The soft limits are usually within the parameters of the home position. Figure 4.2.1 shows an example of a soft limit compared to the full size of a CNC base. The next parameter is the work off set. This parameter deals with placing the distance from a position other than the center. The work offset could be used when the drawing job needs to be offset to a different position other than the global zero. Figure 4.2.2 shows an example of the work offset of the base of a CNC machine. The last parameter that is needed is the Home Position. This position can specified at start and this position can be called when there is a tool change or the CNC is coming out of a job. This position can be set by the user. Figure 4.2.3 shows an example of where this position could be on a CNC.
Drawing Position

SOFT LIMITS

W or k

O ffs e

Home Position

Center (Global Zero)

Figure -4.2.1

Figure 4.2.2

Figure 4.2. 3

72

CNC Machine Design Report

In the parameter table there are 3 movement speeds: Jog rate, Rapid Rate, Feed Rate. There are also 2 modes the micro-stepping mode and the move mode. The Jog rate is used when there is a cutting job being done. When the CNC is cutting it uses the jog rate. This normally has the Z axis in a set position unless it is doing a 3D drawing. The Rapid Rate is used when there is no cutting job but the CNC needs to move from one position to the other. The feed rate is the speed of the spindle head. When the spindle head needs to gain more speed for a certain task the feed rate, which is set by the user, will be adjusted accordingly. The two modes in the Parameter table deal with the movement of the motors or the movement of the CNC. The micro-stepping mode will determine how much power will be powered to the stepper motors controlled by the driver board. The move mode will determine where the CNC spindle head will move to.

5.2.4

Global Table

The global table is what will hold the global variables for the CNC. This table includes: feed override, current position, and the command velocity. The feed override variable will be used to change the feed rate (Section 4.2.3) of the CNC. This variable will be used for the E-Stop function and any other function that needs to stop the feed rate of the CNC or change the rate while a job is in progress. The current position variable will be widely used in the CNC code. This variable will be used to calculate the Bresenham circle and line algorithms (Section 4.2.9), setting up the home position, machine position and the current position which is known as the TPosition in our code. The command velocity is a variable that will set the velocity of the stepper motors. This variable also will be used in calculating the acceleration table of the CNC. This table and variable will be calculated by hand and set up into a table array.

73

CNC Machine Design Report

5.2.5

Commands

The Main Controller codes main purpose is to tell the driver board what commands is needed to job at hand. These commands that will control the driver board are implemented on the motion controller. These commands are:
GoHome SetHome SetWorkOffset SetFeed SetAccel SetMCode SetSoftLimits StartJob EndJob SetJog Traverse o Linear o Rapid

There are other feature commands that will be implemented at a later time but time constraints did not allow for them to be added. These commands are: Circle Ellipse These will make it easier for the CNC to make more precise arches. The line algorithm will do a circle, but the time will be quicker once the Bresenham circle algorithm is implemented. 5.2.5.1 GoHome The GoHome command takes the current home position variable and places it in the MachinePosition variable. This function will be called when the user wants to place the CNC in the current home position for either tool changes or when a job ends

74

CNC Machine Design Report

5.2.5.2 SetHome

SetHome command takes the current position that the CNC is at or the position that given by the user. Setting the home position will be used at the beginning of the job. This position will also be used if the CNC is using the Traverse command when it is put in the absolute mode.

5.2.5.3 SetWorkOffset

SetWorkOffset sets the work offset that I mention before in the CNC. There are two different offsets for the X, Y, Z, and A positions in the CNC. This code gives you the ability to select which offset you want to use.
5.2.5.4 SetFeed

This function sets the feed rate for the CNC. As mentioned before the feed rate sets how fast the CNC moves.
5.2.5.5 SetAccel

The SetAccel rate sets the acceleration of the CNC for the stepper motors. The acceleration of the CNC will be calculated dynamically in a table array and it will be used to determine the velocity of the CNC. The acceleration will be set within an Array variable AccelRate[1000].
5.2.5.6 SetMCodes

The SetMCodes command will be used to set the miscellaneous ports to do different functions. Port M4 is the spindle head port. When the user prompts the controller board that it wants the spindle head on, this port is then given the value of 1 and it is turned on. The other ports 5-7 are used for miscellaneous ports and ports 0-3 are used as high voltage ports.

75

CNC Machine Design Report

5.2.5.7 SetSoftLimits

SetSoftLimits function sets the parameters of the X, Y, and Z limits of the CNC. These limits are use full for having some type of project that doesnt need the CNCs max range. Setting these limits will let the user create a project without offsetting there routing design on the computer.
5.2.5.8 StartJob

This commands main function is to start the spindle head or any other device needed for the CNC before any other command is called.
5.2.5.9 2EndJob

This commands main function is to stop the spindle head of any other device needed for the CNC at the end of the job.
5.2.5.10 SetJog

This command will set the Jog rate for the CNC Machine. This variable will be set by the user and can be changed at any time during a job.
5.2.5.11 Traverse

The Traverse command is the main command in the motion controller. This commands main function it to implement a line on the CNC. There were two types of Traverse modes: Linear and Rapid. Linear traverse is when the CNC is in a routing job. This mode has a very slow acceleration rate so it can cut the material that the job is calling for. The Rapid traverse mode is for moving the spindle head to a particular position that it will continue the schematic again. The acceleration of these two modes will be called from the acceleration table.
5.2.6 Motion Controllers data flow

The motion controllers data flows very similar to the communication controller. The motion controller brings in a Data Gram packet. In this Data Gram there are 3 parts: The command ID, the data size, and the data itself. Figure 4.2.4 shows the structure of a typical Data Gram packet. The command ID packet is the ID that will call the set of commands that is mentioned in section 4.2.5. Each

76

CNC Machine Design Report

command is given an ID. Figure 2.2.5 shows a list of all the command IDs in used in the code.
Command ID Data Size DATA

Figure 4.2.4 The next part of the data gram is the data size. The data size gives us the appropriate size of the data packet. This number will be used to as a stopping point for the counter inside the motion controller. Once the data size equals the counter of the job the CNC believes the job is over and it then starts searching for more information that has came from the message query. Figure 4.2.6 shows the flow of the data gram from the message query. The information is on a FIFO (First In First Out) procedure. This allows for no skipping of data information. This is the main reason that the functions that call for positions or any other safety function comes from the SPI port.

Commands SPI: GoHome SetHome SetWorkOffset1 SetWorkOffset2 SetFeed SetAccel SetMCode SetSoftLimit1 SetSoftLimit2 Memory: StartJob EndJob SetJog Linear Traverse Rapid Traverse

ID

1 2 3 4 5 6 7 8 9 1 2 3 4 5

Figure 4.2.5

77

CNC Machine Design Report

SPI Port

Message Query 1 2 3 _ _ _ MOTION CONTROLLER

Figure 4.2.6
5.2.6.1 Message Query

The Message query holds the information to be given to the Motion Controller. The only information that will be placed on the message query will be any type of trajectory data. The message query code takes the message from the Communication controller and dispatches it to the message query. Here is where the data is placed into a FIFO design where once one message is done the next message in line came directly before that message.
5.2.7 Interrupts

The Motion Controllers specific ports are interrupt driven. The interrupts are in a range of 7-0, 7 being the top priority interrupt and 0 being the lowest. If the CNCs interrupt not set the interrupt is automatically set as a 4. The interrupts for the CNC are as followed:
Velocity Timer : 7 Acceleration Timer: 6 Limit Switch: 7 E-Stop: 6 SPI Port 1: 4 SPI Port 2 : 4

78

CNC Machine Design Report

UART : 5 Analog to Digital : 3 5.2.8 Files in the Motion Controller Program

C Files: UART Timer2 Timer3 Timer4 SPI1 SPI2 Messages MaiInitialization Main Limits Handle EStop Dispatch DataAvail AnalogToDigital
5.2.8.1 UART

H Files: UART Timer2 Timer3 Timer4 SPI1 SPI2 Messages MaiInitialization Main Limits Handle EStop Dispatch DataAvail AnalogToDigital

The UART file has the initialization functions for the UART and also has the enable function that will enable the UART. The sequence to enable the UART is to enable the UART1 pin. Next you need to enable the transmitting bit. Next you need to Enable the transmit interrupt and then the receive interrupt. 5.2.8.2 Timer 4 This file is used to initialize the Timer 4. This Timer is used if another timer is needed for the CNC. This timer can be used at a later time depending on the firmware updates.

79

CNC Machine Design Report

5.2.8.3 Timer 3 Timer 3 is the acceleration timer. This timer is used to determine the acceleration that will be used for the CNC. It also will determine when the acceleration of the CNC will plain out to its max speed.
5.2.8.4 Timer 2

Timer 2 is the velocity timer. This timer calculates the time of max velocity. This timer as Timer 3 also will determine the max velocity.
5.2.8.5 SPI1

SPI 1 is the slave port. This port will transmit the handshake to the Communication Controller. This port will be enabled by flagging the enable the RF13 port.
5.2.8.6 SPI2

SPI 2 is the master port. This port will receive the information from the Communication Controller. This port can be enabled by flagging the enable bit for port RF12. 5.2.8.7 Messages The Message file specifies the structure of the data messages that get transmitted to the Motion Controller. The message structure has a Message ID, the LPARAM (Parameter 1), and the WPARAM (Parameter 2). It would then increment the message to place the message into a message packet. Then it will dispatch the message to the message query.

80

CNC Machine Design Report

5.2.8.8 MainIntialization

The Main Initialization file has all the commands and all the parameters inside them. It has every position and movement rate, as well as all the Command pointers for the Handle file.
5.2.8.9 Main

The main files only function is to take the message and place it into the message query by using the functions GetMessage() and AddToQue().
5.2.8.10 Limits

This file sets all the limits on the Motion Controller Ports.
5.2.8.11 Handle

The Handle file gives each command its ID. These IDs then go to a case file and are selected by the command ID from the message.
5.2.8.12 EStop

The EStop file is the Emergency stop command. This is command is called on the SPI port. Once this command is called it is immediately executed.
5.2.8.13 Dispatch

This file dispatches the functions HandleSPIRecieve() and also the Handle_Data_Avail(). These functions will be called depending on which command is in the appropriate function from the Handle file.
5.2.8.14 DataAvail

This file controls the external interrupt that tells the motion controller that the communication controller has information ready to be processed.
5.2.8.15 AnalogToDigital

The Analog To Digital file initializes the miscellaneous ports on the CNC. This file will hold the functions of the M codes that are used for different abilities that can be called for the CNC
5.2.9 Bresenham Algorithms

The Bresenham Algorithm is made up of two different types. The line and c circle Algorithm are made up in the linear and rapid traverse functions. The
81

CNC Machine Design Report

Bresenham line algorithm uses X and Y to step to the final position of X and Y. Since our cutting will be 1/16 of an inch this algorithm will work perfectly. There will be no visible cuts in the material that looks like we stepped from one axis to the other. Figure 4.2.7 shows the Bresenham line algorithm diagram that was used to calculate the line and Figure 4.2.8 shows the equation that was used to step to each position.
(X,Y)

X) CurrentPosition = X + MachineOffset + CurrentPosition Y) CurrentPosition = Y + MachineOffset +CurrentPosition


Y

The current positions for each Axis is its own variable postion. X = CurrentPosition.X Y = CurrentPosition.Y

Figure 4.2.7

Figure 4.2.8

82

CNC Machine Design Report

5.3 Firmware Subset

When a physical button is pressed, there must be a way for the pendant to correctly receive information from the microcontroller sub-system. In order to receive a request from the pendant, an interrupt system must be set up to give priority for driver processes. After priority is set, it must be sent through the driver sub-block to generate the events relevant to the message. Afterwards, the message moves to the main sub-block to move messages to the queue and dispatch to the appropriate handler. Finally, generalized functions must be created in the firmware to write graphics to the LED to create the different screens.

5.3.1

Interrupts

In order for the internal queue of the memory to operate with the ability to have certain functions have priority over other functions, the message queue system must be set up where the drivers are interrupt based. Each driver is given a specific priority based upon which operation must be worked into and out of the message queue first. The interrupt system will give first priority to scan key driver, second priority to the analog driver, and equal priority between the display and serial drivers which will all link into the message queue. The block diagram below shows how the interrupt system will be based.

83

CNC Machine Design Report

Serial Drivers

Display Driver

Scan Key Driver/ Timer

Analog Driver

Message Queue Hardware Abstraction Layer

Figure 8: Interrupt Block Diagram

5.3.2

Driver Subset

As stated above, the drivers are separated into priority passing their information into the queue based upon which driver sent the information. Each driver will be broken down into more generalized descriptions starting with highest priority.
5.3.2.1 Key Scan Driver

In order to accept a key scan press, a finite state machine must be created to accept button presses as starting states which must be validated and released before any information can move from the drivers. The state machine is set up below with legend below.

84

CNC Machine Design Report

State So

State S1

State S3

State S2

Legend S0=Ks_Detect Button Press S1=Ks_Verify Press S2=Ks_Detect Release S3=Ks_Verify_Release

Figure 9: State Machine for Key Press Interrupt

Within the microcontroller of the pendant, there are two timers that may activate after a key is pressed depending upon the current state. One timer is used for detection of the initial key press and scanning row and columns of the keypad that will last approximately 1 millisecond. The second timer is activated is used for the debounce of the keypad or verifying the key press which will last for approximately 30 milliseconds. When going through debouncing, if they key press is correct, the message will continue and move to the main application from

85

CNC Machine Design Report

whatever driver released it, but if they key press was in error, the state machine will return to the detection state. Starting from state 0, when a key is pressed, the state machine will move to state 1 where the first timer will activate. The machine moves will check for correctness of the key press in state 1 and if confirmed will move to state 2, but if not confirmed, it will turn off the second timer if it is running and go back to state 0. After validation, the machine will move to state 2 where the first timer will deactivate and the second timer will activate which will move the machine to state 3. Once the key is released, the second timer is deactivated and the first timer will reactivate and send the machine back to state 0 to respond to another key press. The key scan driver will return to state 0 in all cases where either an error was made or process was completed. As an entire process starting from initialization, the block diagram of the key scan is presented below.

86

CNC Machine Design Report

Initialization

Timer Interrupt

Yes

Set Row High/ Set Flag Toggle

No

Toggle=0

Read Key Press

Next Row High

Debounce Toggle=1

Read Key press Return

Place in Message Queue

Yes

Previous= Current

No

Clear Toggle

Figure 10: Key Scan Driver

5.3.3

Display Driver

This driver is built for the purpose of creating display functions that can be repeatedly used for the different screens. This is done by creating functions with the LCD screens internal datasheet. With the use of hex and C code, the function library can be created to hold all the functions that can be used. To build this driver, there is a choice between creating it as an interrupt or non-interrupt based system. Although the non-interrupt system is simpler to code and implement, it causes performance problems with the driver sub-system and contains no loop transition for transmission which can lead to stalled applications. Pictured below is the display driver if it were in non-interrupt form.

87

CNC Machine Design Report

Transmit Queue

Get Byte/ Set Busy Flag

Send

No Acknowledge

Yes

Yes Tx Empty

Complete/ Clear busy flag

No

Figure 11: Display Driver Non-Interrupt

In this setup of the display driver, the routine checks to see if data is inside the transmit queue. If data is waiting, the busy flag is set to prevent any other operation from occurring or other information from being released. The machine must acknowledge the byte being sent before it can move, and it checks to see if the transmit queue is empty. If it is not empty, the routine continues again. If it is empty, the busy flag is reset to allow other operations to occur. Pictured below is the setup for the interrupt version of the display driver.

88

CNC Machine Design Report

Data into Transmit Queue

Build Command Structure

Yes

Busy No

Enable Tx Interrupt

TX Interrupt Flag Get Byte from transmit queue Yes Last character No

Service Routine

Initial First Byte Transfer Service Routine

Disable Tx interrupt flag/ Clear busy

Return

Return

Figure 12: Display Driver Interrupt

In this setup, the data is moved into the transmit queue. A built command structure must be created to move the information out of the queue and into the message loop. If the driver is busy, no data can be moved until the busy flag is released. After data is completely filled into the transmit queue, the interrupt process begins and sets the interrupt flag on. The first character is moved quickly to the message loop, and the routine checks for another character and moves it to the message loop until the queue is empty which disables the interrupt process and clears the busy flag again. Afterwards, the routine will return to its original status.
89

CNC Machine Design Report

5.3.4

Analog Driver

This driver is a connection to the feed pot discussed in the hardware subset. Any change in the feed pot dial will be stored as an analog value which must be sent through the driver to the message loop to be converted into digital information and be used by machine to change the speed/feeds of the machine while in motion. The block diagram for the analog driver is pictured below.
Initialize Analog Drive

Get Value

Current Value=Previous Value No Put in Message Queue

Yes

Return

Figure 13: Analog Driver Diagram

The diagram shows that after initialization it will check the value the feed pot is currently displaying and comparing it to the value it last checked it as. If the previous value is not the same as the current value, the value will be placed into the message queue to be sent to the microcontroller to change the speed/feed rate. If the values are the same, the routine will return to initialization.

90

CNC Machine Design Report

5.3.5

Serial Driver

This driver is the main connection between the serial port that runs directly to the microcontroller sub-system and the pendant sub-system. This driver has access to the Tx transmit queue and Rx receive queue. When information is received through the transfer queue from the microcontroller sub-system, it is processed byte by byte until it is completely moved in the message loop. Also, if information needs to be stored from the receive queue, it must move each byte of the message until it has been completely processed. The block diagram for the serial driver is displayed below.
Main Initialize

Tx Queue/ Tx ISR

Read Queue/ Rx ISR

Get byte from Tx buffer No Check Tx queue empty Yes Disable Interrupt/ Clear Busy Yes

Store received byte No Return End of transmission Return

Send Message/ Clear Acknowledge

Return

Return

Figure 14: Serial Driver

As shown in the diagram depending upon which queue branch was taken, each byte of information is stored or read, and if more information is detected, the loop will repeat. Otherwise, the busy signal is cleared to allow other operations to occur and will return to main.

91

CNC Machine Design Report

5.3.6

Main Subset

The subset contains all blocks for correct dispatching of the message after exiting the message queue.
5.3.6.1 Message Loop

After exiting the message queue, the command information is sent to the message loop where it will either be dispatched or go back into the message loop after being dispatched. Each dispatched message has to be delegated to the appropriate handling method. The four main types of dispatched messages are either serial events, display transmission finished, analog value changed, and key pressed. Serial events can either be transmission completed or a request to receive data. The message transmission path is shown in the figure below.
From Message Que

Message Loop

Dispatch Message

AL Application Layer

Figure 15: Main Subset

The message loop is either set to 0 or 1 input. Based upon interrupt priority, the message loop will grab the message from the message queue that has the highest priority. Afterwards, it will call the dispatch message command. It will then return to the message loop. The message will be set to 0 if there is a
92

CNC Machine Design Report

message or be a 1 if there is no message in the loop. Finally, it will decrement the message counter. The message loop block diagram is pictured below.
Get from queue

Decrement Counter

Return

Figure 16: Message Loop

5.3.6.2 Dispatch Message

The dispatch message block is set up by a menu index that determines the current state of the machine. After any of the buttons are pressed, a different set of operations are performed to send the correct information and determine the action wanted by the user. After information has moved through this block and graphics commands are written to make screen displays, it can be shown any multiple screens for reading or altering. The main block with major sub-blocks for the dispatch block are shown below.
Handle Key Press Menu

Function

Jog

Cancel

Accept

Figure 17: Dispatch Menu Main Block

93

CNC Machine Design Report

The menu for the key press can either be set at 0 through 4. Index 0 stands for the machine in no motion in idle state. Index 1 stands for the machine moving into function set of sub-screens. Index 2 stands for the machine in motion in jog state. Index 3 stands for the machine opening a file from an outside jump drive. Index 4 stands for the machine being locked and unable to accept any new commands.
5.3.7 Function Sub-block

This sub-block allows the user to enter the main set of function screens that will be discussed in greater detail later. Pictured below is the block diagram for the function sub-block.

94

CNC Machine Design Report

Function

Display Function Menu

Key Index=0

Return

Figure 18: Function Sub-Block

5.3.8

Jog Sub-block

In this sub-block, the index is checked to see its immediate placement to allow a different command to be utilized depending on the state. If index is 0, the routine will return to the main loop. If index is 1, next function menu will be displayed. If index is 2, a jog command can be sent. If index is 3, the directory to the jump drive will be displayed. If index is 4, the display is locked and no operation can changed until it returns to the main loop. Finally, if the index is outside the range, it has entered an unknown state and must immediately return to the main loop. The block diagram for the jog sub-block is displayed below.

95

CNC Machine Design Report

Jog

Yes No

Key=0

Return

Yes No

Key=1

Display Next Menu

Return

Yes

No

Key=2

Send Jog Command

Return

Yes No

Key=3

Display Directory

Return

Yes No

Key=4

Display Unknown State

Return

Yes

Display Locked

Figure 19: Jog Sub-Block

5.3.9

Cancel Sub-block

In this sub-block, after the key index is set to 0, the current coordinate set will be displayed if on the main screen or it will return you to the main screen if in a lower screen. The block diagram for the cancel sub-block is displayed below.

96

CNC Machine Design Report

Cancel

Set Key=0

Display Coordinate

Return
Figure 20: Cancel Sub-Block

5.3.10 Accept Sub-block

In this sub-block, after function sub-block is initiated, it provides movement to the lower set of screens and executes files loaded from the jump file which will return to the default screen. Pictured below is the block diagram for the accept sub-block.

97

CNC Machine Design Report

Accept

Go To Selected Screen

Execute File

Return To Default Screen

Main Screen
Figure 21: Accept Sub-Block

5.3.11 Directory Block

This block is a sub-block under the jog block. After it has been selected through the flowchart, it opens up the directory to the outside thumb drive. After opening the drive, it gives access to the folders within the directory and the files within each folder. Pictured below is the block diagram for the directory block.

98

CNC Machine Design Report

Thumb Drive Initialize

Button Press

Yes Accept No Left No Right No File Yes Load File/ Run Job Change Directory Update Display Exit

No Up

Yes Get Request Next File Yes Down Get Previous File Refresh Display Exit Refresh Display Exit

No

No Function Go to Main Sub Screen Yes No Go To Main

99

CNC Machine Design Report

Figure 22: Directory Block Diagram

5.3.12 Graphics

In order for the function blocks to communicate directly to the screens and display the corresponding information, firmware graphic functions must be written to give the writer access to information from the microcontroller subsystem and correctly move it to the pendant screens. Listed below is a table with the created functions and a brief description for each one [2]. Name MoveTo() Description Moves x and y pixels on LCD screen to new position Draws a line on a screen in a specified position Draws a box on a screen in a specified position Returns a character from a specified position Draws a circle on a screen in a particular position Draws a triangle on a screen in a particular position Moves a character to specified x and y array positions

DrawLine()

DrawBox()

DrawChar()

DrawCircle()

DrawTriangle()

RowColumnPos()

100

CNC Machine Design Report

SetOpaqueTransparent() Used in conjunction with DrawBox() command to set background to opaque or transparent SetBackgroundColor() Set background color to a set of written, predefined colors for the LCD Sets pen size for the drawing Draws a semi-circle on a screen in a particular position Writes a string of characters starting at placement stated by RowColumnPos() command Clears screen of all previous images and information Draws an uploaded icon to a particular position on the screen
Table 1: Graphics Functions

SetPenSize()

DrawSemiCircle()

WriteString()

ClearScreen()

DrawIcon()

5.3.13 Screens

This section will describe each screen displayed on the LCD of the pendant with its related use and how it receives information from different sources [2].
5.3.13.1 Main Screen

This is the default screen for the LCD. After startup, the pendant will display the current x, y, and z coordinates of the pendant with the current acceleration directly below sent through the microcontroller sub-system. On the top right, there will be an odometer displaying changes made to the speed through the feed pot potentiometer. At the bottom left, there are five circles that are either red or green to tell the user when the limit of a switch is on or off based upon
101

CNC Machine Design Report

preferences given by microcontroller sub-system. Finally, the bottom left will display a text box that will read run, jog, or idle depending upon the current state of the machine.

X: Y:
-50 50

Z: A:

JOG

Figure 23: Main Screen

5.3.13.2 Main Sub-Screen

This is the first screen that will appear once the function key is pressed allowing the user to move into the lower sub-screens.
Subscreens - Offsets - Parameters

- Soft Limits

Figure 24: Main Sub-Screen

5.3.13.3 Offsets Screen Menu

This sub-screen will be broken up into four different screens that the user can access and alter.

102

CNC Machine Design Report

Offsets - Home Position - Park Position

-Work Offset 1 -Work Offset 2

Figure 25: Offsets Screen Menu

5.3.13.4 Home Position/ Park Position/ Work Offset 1/ Work Offset 2 Screens

These screens will all display different information depending upon what the user previously set up each screens values as or what the job the machine is performing may set them as. These screens will have a title at the top displaying the current screen. On the left side, there will be a title to show the set values for the x, y, and z positions and the acceleration rate. On the right side, there will be a title to show the current values for the x, y, and z positions and the acceleration rate that are currently being processed on the machine while in motion. At the bottom, there are accept and cancel boxes that can be used with their corresponding buttons to accept the set position as the current position or cancel and return to main screen.

103

CNC Machine Design Report

Title
Set Position X: Y: Z: A: Current Pos

Accept

Cancel

Figure 26: Offset Screen

5.3.13.5 Parameters Screen Menu

This sub-screen will give the user access to the machine parameters, TCP/IP configuration, and communications port screens.

Parameters - Machine Parameters - TCPIP Configuration

- Com Port

Figure 27: Parameters Screen Menu

104

CNC Machine Design Report

5.3.13.6 Machine Parameters Screen

This screen will display all the parameters that the machine is limited to working at. These parameters are specified through the outside connections requirements, jump drive requirements, or the default rates the machine can move it based upon the drive sub-systems limitations for stepping.

Machine Parameters
Max Speed: Acceleration: Rapid Max: Rapid Min: Deceleration: Jog Speed: Max Jog Speed: Max Feed: Min Feed: Jog Increment:

Figure 28: Machine Parameters Screen

5.3.13.7 TCP/IP Configuration Screen

This screen will only show information when the machine is operating through its Ethernet connection. These variables will show the addressing from different protocol layers that are hardwired into the connection bus depending upon where the outside connection is being made. The information is relayed from the microcontroller sub-system.

105

CNC Machine Design Report

TCP/IP Configuration
Ip Address xxx.xxx.xxx.xxx Subnet Mask xxx.xxx.xxx.xxx Default Gateway xxx.xxx.xxx.xxx

Primary DNS xxx.xxx.xxx.xxx Secondary DNS xxx.xxx.xxx.xxx

Figure 29: TCP/IP Configuration Screen

5.3.13.8 Communications Port Screen

This screen will only display information when the machine is operating under the serial connection. These variables displayed will show the rate at which the bytes are being moved into the machine, the bytes that distinguish the end of the transmission, the bytes representing how the flow of information is being controlled, the bit to show if the information has a certain type of parity, the bits to show the on character and off character if the flow control is moving in this pattern. All this information is sent to the pendant through the microcontroller sub-system.

106

CNC Machine Design Report

Com Port Communications


Baud Rate

Stop Bits: Flow Control: Parity:

Xon Char: Xoff Char:

Figure 30: Communications Port Screen

5.3.13.9 Soft Limits Screen Menu

This sub-screen will allow the user to move to the upper and lower soft limits screens.
Soft Limits -Upper Limits -Lower Limits

Figure 31: Soft Limits Screen Menu

107

CNC Machine Design Report

5.3.13.10

Upper Soft Limits/ Lower Soft Limits Screen

These screens have the same setup as the offsets screens. The title is centered showing which limits are being displayed. The left side displays the set values for the x, y, and z positions and the acceleration rate, and the right side displays the current values for the x, y, and z positions and the acceleration rate. The bottom shows the accept and cancel boxes to change the set values to current values or go back to the main screen. This information is provided by the job the machine is performing or can be specified by machine limitations given by driver and microcontroller sub-system constraints.

Upper Limits/Lower Limits


Set Position X: Y: Z: A: Current Pos

Accept

Cancel

Figure 32: Upper Soft Limits/Lower Soft Limits Screen

5.3.13.11

Thumb Drive Screen

This screen will display the entire directory for the uploaded jump drive file. The top of the screen displays the name of the jump drive. Below, the directory
108

CNC Machine Design Report

names with an icon are shown for all folders. If a folder is chosen, the directory names with an icon are shown for all files.
Root:

Folder Name

File Name

Figure 33: Thumb Drive Screen

5.3.14 Relation To Other Sub-Systems

Mechanical Sub-System: Connection to outside structure through a serial port connector; able to control movement of mechanical gantry through set of buttons that can be switched to control either y or z axes and x axis simultaneously Microcontroller Sub-System: Receives information that can be displayed by screens and can send information back to system to change current information to set information on the table. Driver Sub-System: Receives power for operation from this system

109

CNC Machine Design Report

6. Conclusions and Recommendations


6.1 Conclusions

The CNC machine is a system that accepts numerical input and performs machining on a part or product based upon the provided tool heads function. It has an estimated life expectancy of at least 15 years. It has negative impact on the environment through either noise pollution and may cause adverse affects on an individuals health if the electrical components contain any poisonous elements. It can be manufactured quickly if all schematics, firmware, and software are provided and cost being of small concern. This system can replace many products that perform only one particular function and can only accept certain types of input files. Its cost is lower than many similar machines currently on the market, and it is adaptable to be useful for both manufacturers and hobbyists. The machine is broken down into these four subsystems. Mechanical Motor Driver Main Controller Pendant 6.2 Recommendations This system is able to add more features, improve current features, and develop new facets. Some possible improvements and additional testing to the current system are listed below. Combine ENC and PIC24F processors by using newly invented PIC32 processor Add more interface screens to pendant Expand miscellaneous input/output space from main controller to motor driver

110

CNC Machine Design Report

Implement Bresenham circle algorithm and ellipse function into FPGA for the main controller subsystem Design independent power supply for each subsystem Provide additional axes for movement Reduction in size of motor driver PCB board Use more miscellaneous outputs on motor driver board to control voltage reference circuitry to set maximum current through motors Provide protection circuit in series of motor drivers bridges to maintain micro-stepping sequencing Create extra tool head attachments Perform FEA finite element and stress analysis testing on gantry components Calculate bearing deterioration, bushing wearing, and ball screw wearing

7. Cost/Manufacturability In order to make this product marketable, a range of costs must be found that can show the machine can reproduced at a lower cost compared to the amount given by the original prototype. After creating a working prototype, prices have been calculated for the major costs for the system. They are displayed in the table with a price given at a large quantity that is given to the buyer after a certain time has passed.
Part Motor Driver PCB Board Pendant PCB Board Main Controller PCB Board Plastics Parts Pendant Parts Driver Parts Main Controller Cost $25 $13 $13 384 each 50 each 120 each 100 each Quantity 5 10 10 50 50 50 50 Waiting Time 4 weeks 4 weeks 4 weeks N/A N/A N/A N/A 111

$ $ $ $

CNC Machine Design Report

Cabinet Assembly Electrical Reflow Total

$40 $ 25 each $770


Table 2: Manufacturability Costs

1 N/A 3 N/A

List of Equipment and Materials with Prices


Equipment Soldering Iron Reflow Iron Mill Table Saw Location Borrowed from James Williams Borrowed from James Williams Loaned from University Loaned from Norva Plastics

Materials
1 BAV16W-FDICT-ND Diode 9 CC0805 0.1uF Capacitor 3 CC0805 1uF Capacitor 3 CC0805 4.7uF Capacitor 1 CTX736CT-ND Chip 1 DB9/RS232 Chip 1 HEADST10 Dual Row Header 3 Single Row Headers 1 MAX3232CDBR_SOIC chip 1 MCP1825T-3302E Voltage Regulator 10 Mounting Holes 1 PIC24HJ32GP302/SOIC28 Microcontroller .18 .05 .04 .08 7.35 .50 .10 .05 2.45 1.04 Free 4.82

Price (each in $)

112

CNC Machine Design Report

1 RC0805 1M Resistor 2RC0805 47K Resistor 5 RC0805 1K Resistor 1 RC0805 4.7K Resistor 2 RC0805 100K Resistor 1 RC0805 240 Resistor 1 RC0805 470 Resistor 1 RC1210 100 Resistor 1 SMD_LED0805 LED 8 SW415-ND Switches 1 VRT24W Variable Resistor PCB Board 1 OLED Display Frame

.07 .07 .07 .07 .07 .07 .07 .26 .40 .60 1.55 33.00 79.00 Free

The boards will come completely assembled after purchase, but time required to machine and align complete system will take 1 day. The electrical control box will take .5 days to complete, and system testing will take 1 to 2 days to complete.
7.1 Mechanical Cost

113

CNC Machine Design Report

Component Common Parts (X, Y, & Z) Ballscrews Ballnuts Thrust bearing blocks Ballnut flanges Thrust Bearings Grease Zerks: 1/827 PTF Ball Bearings Bearing seals Seal retainer Belts Pulleys Motors Motors Wiring Cable Carriers Cable Carrier (X & Y)

Part #

Quantity

Cost

Total Cost

Source

Date Priced

108" 3 3 $ $

$10.09/ft 23.55 11.75

$ $ $

90.81 70.65 11.75

Roton Roton Stock from Online Metals, machined in house Stock from Online Metals, machined in house VXB McMaster Carr

1/24/2010 1/24/2010

3.38

3.38

6 3

$14.95/2 $2.90/10

$ $

44.85 2.90

3 6 3 3 6 X&Y Z 20ft 2 1 3

$ $

5.55 2.31 $1.25/3

$ $ $ $ $ $ $ $

16.65 13.86 1.25 10.47 19.02 78.00 29.00 39.00

McMaster Carr MSC Direct Stock from ME shop, machined in house McMaster Carr MSC Direct Anaheim Automation Anaheim Automation Anaheim Automation

3/29/2010

$ $ $ $ $

3.49 3.17 39.00 29.00 13.00

3/23/2010

41.19

82.38

McMaster Carr

3/29/2010

114

CNC Machine Design Report

Mounti ng Brackets (X&Y) Cable Carrier (Z) Mounti ng Brackets (Z) Z axis z-top z-side z-bottom z-back z-mount

8.58

17.16

McMaster Carr

3/29/2010

1 1

$ $

10.66 6.96

$ $

10.66 6.96

McMaster Carr McMaster Carr

3/29/2010 3/29/2010

1 2 1 1 1 $

Quoted Quoted Quoted Quoted 18.23 $ 3.04

standoff

9.85

9.85

versa rail versa guide block Spindle Plate Spindle spindle holder X axis x-traveling block xback

2 2 1

$ $ $

40.30 33.80 10.94

$ $ $

80.60 67.60 10.94

Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Stock from Online Metals, machined in house Stock from McMaster Carr, machined in house Anaheim Automation Anaheim Automation Stock from McMaster Carr, machined in house James Williams Machined by Norva Platics

3/29/2010

1/27/2010 1/27/2010 3/29/2010

1 1

22.00 Quoted

22.00

105.00

105.00

Quoted

Stock from Norva Platics, machined in house Machined by Norva Platics

115

CNC Machine Design Report

xtop x-rods x-bushings Table Table sides Table Bottom Table end Motor Table End Table Top Table supports Table stand rails Y axis sides side w/o motor y-cross

1 3 6 $

Quoted 39.35 $39.95/4 $ $ 118.05 59.93

Machined by Norva Platics Lintech VXB

2 1 1 1 1 3 2 $ $

Quoted Quoted Quoted Quoted Quoted 8.69 10.62 $ $ 26.07 21.24

Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Stock from Online Metals Stock from Online Metals 4/7/2010 4/7/2010

1 1 1 $

Quoted Quoted 18.23 $ 15.19

Machined by Norva Platics Machined by Norva Platics Stock from Online Metals, machined in house VXB VXB

y support rail y-axis bushing block y-lifts

1 2

$ $

179.00 39.95

$ $

179.00 79.90

1/28/2010 1/28/2010

57.33

57.33

Stock from Online Metals, machined in house

Machine Electronics

116

CNC Machine Design Report

Electronics Case Top Bottom Sides Front Back Divider Pendant Case Case Back Plate Fasteners M5x20 M6x25 mm 440x0.25 632x0.25 832x0.375 832x0.5 8-32x1 1024x0.75 1024x1 24 17 2 12 68 12 148 $7.94/100 $16.15/100 $ $ 0.95 23.90 McMaster Carr Fastenal 4/2/2010 8 8 $5.34/25 $7.91/25 $ $ 1.71 2.53 McMaster Carr McMaster Carr 4/7/2010 4/7/2010 1 1 Quoted Quoted Machined by Norva Platics Machined by Norva Platics 1 1 2 1 1 1 Quoted Quoted Quoted Quoted Quoted Quoted Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics

117

CNC Machine Design Report

1/420x1 3/816x1.5 3/824x1 832x0.25 (self tapping ) 5/1616 Nut board standoffs 6-32x0.3125 6-32x0.3125 4-40x0.25 set screws 8-32x0.25 8-32x0.3125 Washers Split Lock washers #10 1/4 3/8 M5 M6

77 10 4 4 $

$9.45/50 9.79 $8.27/25

$ $ $

14.55 9.79 1.32

McMaster Carr Lowes McMaster Carr 4/7/2010

7 10 4

3 1

32 56 16 8 8

$2.13/100 $5.64/100 $4.00/25

$ $ $

0.68 3.16 2.56

McMaster Carr McMaster Carr Lowes

118

CNC Machine Design Report

Ext. Tooth Lock washers #10 Flat washers 3/8 .438x.203 x.032 .500x.265 x.032 Fastener Totals Paste Dispenser motor mount plate

110

$2.54/100

2.79

Fastenal

4/16/2010

8 24 36 Unlisted $ 30.00 $ 30.00

1 1

Quoted $25.34/3 $ 8.45

plunger syringe paste dispenser coupler screw Quote: Plastics and Machining

1 1 1 1 1 30

Quoted User Selected Quoted Quoted Quoted Quoted

Machined by Norva Platics Stock from Online Metals, machined in house Machined by Norva Platics Amtech Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics

$900 Norva Plastics

Cost

$ 2,406.89

Mechanical Subsystem

Table 3: Mechanical Costs

119

CNC Machine Design Report

7.2 Electrical Cost


Part Number Y236653 193316 1940272 25604 1712616 16652 494039 495162 495082 230050 230041 186992 175214 1953604 1953591 77586 139222 166546 133542 230958 921651 2076252 2076682 526504 526563 IRF7341PBFCT-ND 768-1011-1-ND 751-1366-1 160-1365-5-ND PIC24FJ256GB110-I/PF-ND ENC624J600-I/PT-ND PIC24HJ256GP610-I/PF-ND PIC24HJ32GP302-I/SO-ND 296-13094-1-ND 620-1166-1-ND GBJ2001-FDI-ND 507-1442-ND 706-1035-ND Part Description Quantity Unit Price Total Cost Toroidal Transformer 250VA, 30V+30V 1 53.48 $ 53.48 CAP ELECTROLYTIC 220uF 50V 10 0.0125 $ 0.13 POWER SUPPLY 12V @4.16A 1 26.95 $ 26.95 HOOD, D-SUB METALIZED, 25 PIN 1 0.445 $ 0.45 PANEL MOUNT FUSEHOLDER 1 3.475 $ 3.48 AC RECEPTACLE, MALE, 15A@250v 1 0.545 $ 0.55 CONN,CPC AMPH 4 0.46875 $ 1.88 CONN,CPC AMPH 4 0.28125 $ 1.13 CONN,CPC AMPH 4 0.34875 $ 1.40 CONN, MOLEX 1 0.225 $ 0.23 CONN,MOLEX 1 0.195 $ 0.20 SOLID-STATE RELAY 1 15.95 $ 15.95 SOLID-STATE RELAY 1 6.95 $ 6.95 PLUG,DC,PWR,FEM 2.1 TO 2.5 1 1.49 $ 1.49 PLUG,DC,PWR,FEM 2.5 TO 2.1 1 1.49 $ 1.49 STAND-OFF 5 0.029 $ 0.15 STAND-OFF 5 0.045 $ 0.23 STAND-OFF 2 0.1875 $ 0.38 STAND-OFF 25 0.0078 $ 0.20 USB 2.0 TYPE B CONNECTOR 1 0.475 $ 0.48 USB TYPE A CONNECTOR 5 0.19 $ 0.95 TACTITLE SWITCH SURFACE MOUNT 10 0.0125 $ 0.13 DB9 FEMALE SHORT CONNECTOR 2 0.1625 $ 0.33 TYPE III SNAP-IN CRIMP SOCKET 12 0.01875 $ 0.23 TYPE III SNAP-IN CRIMP PLUG 12 0.01875 $ 0.23 HEXFET 4.7A@25C,55V VDSS, 0.050 Ron 15 0.046 $ 0.69 IC USB TO PARALLEL FIFO 28 SSOP FTDI 2 1.125 $ 2.25 HIGH SPEED OPTO-COUPLER 15 0.070833 $ 1.06 OPTO-ISOLATOR 8 0.06375 $ 0.51 USB HOST MICRO CONTROLLER 1 4.43 $ 4.43 ETHERNET 10/100 CONTROLLER 1 2.47 $ 2.47 PIC24 MICRO CONTROLLER 1 4.76 $ 4.76 PIC24 MICRO CONTROLLER 1 2.41 $ 2.41 RS-232 TRANSCIEVER 3 0.25 $ 0.75 IC DRIVER MICROSTEPPING 38-TSSOP 3 1.656667 $ 4.97 BRIDGE RECTIFIER, 100VRB 20A 1 1.76 $ 1.76 CONN, MAGJACK 10/100B-TX 1 1.56 $ 1.56 IC SRAM 4MBIT 10NS 44-TSOP 2 1.715 $ 3.43 120

CNC Machine Design Report

576-1137-ND MCP1826S-3302E/DB-ND MFU08051.25CT-ND 568-3309-1-ND 122-1376-ND P10.0CCT-ND P100AACT-ND P100ACT-ND P100KACT-ND RMCF1/1010KJRCT-ND P12KACT-ND RHM180ARCT-ND RHM270ACT-ND P2.0KACT-ND P4.7KACT-ND P470ACT-ND 541-47KACT-ND P49.9CCT-ND P49.9KCCT-ND P1.0MACT-ND P12.7KCCT-ND T93YA-100-ND T93YA-2.0K-ND P12.4KCCT-ND 490-1683-1-ND 490-1746-1-ND PCC270CGCT-ND 490-1638-1-ND 399-1136-1-ND 445-3463-1-ND 445-5206-1-ND 511-1443-1-ND 490-1729-1-ND 709-1172-1-ND 535-9640-1-ND XC1526CT-ND CTX736CT-ND L62701CT-ND SC237-ND 296-5108-1-ND

LDO REGULATOR 5.0V 1.25A 4 LDO REGULATOR 3.3V SOT223-3 7 FUSE 1.25A FAST BLOW 5 VOLTAGE REG 5V 100MA SOT-223 1 IC CPLD 3.2K 144MCELL 100-TQFP 1 10.0 OHM 1/8W 1% 0805 5 100 OHM 1/2W 5% 1210 5 100 OHM 1/8W 5% 0805 5 100K 1/8W 5% 0805 5 10K 1/8W 5% 0805 50 12K 1/8W 5% 0805 25 180 1/8W 5% 0805 5 270 1/8W 5% 0805 10 2.0K 1/8W 5% 0805 5 4.7K 1/8W 5% 0805 5 470 1/8W 5% 0805 5 47K 1/8W 5% 0805 10 49.9 1/8W 1% 0805 5 49.9K 1/8W 1% 0805 10 1M 1/8W 5% 0805 5 12.7K 1/8W 1% 0805 5 100 OHM POT, 21 TURN 3 2.0K OHM POT , 21 TURN 3 12.4K 1/8W 1% 0805 5 0.1uF 16V CERAMIC CAP 0805 250 10uF 6.3V CERAMIC CAP 0805 10 27pF 50V CERAMIC 0805 5 6.8nF 50V 5% CERAMIC 0805 5 1nF 50V CERAMIC 0805 10 1.0uF 50V 0805 CERAMIC 5 1.0uF 100V 0805 5 4.7uF 6.3V TANT 0805 5 0.33uF 25V CERAMIC 0805 15 22pF 50V CERAMIC 0805 5 CRYSTAL 25.000MHZ 18pF 1 CRYSTAL 8.000 MHZ 20pF 1 OSC CLOCK 10.000 MHZ 1 LED RED 5 CONN, POWERJACK MINI R/A PCMT 2.5MM 1 QUAD 2-INPUT AND GATE 14-SOIC 2

0.27875 0.082857 0.0407 0.855 6.5 0.0091 0.0378 0.0077 0.0077 0.000088 0.000828 0.0034 0.004 0.0077 0.0077 0.0077 0.00385 0.0091 0.00455 0.0077 0.0091 0.283333 0.283333 0.0091 5.55E-05 0.0082 0.0151 0.0283 0.0036 0.0099 0.066 0.066 0.007267 0.0044 0.64 0.585 3.675 0.0267 0.72 0.125

$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $

1.12 0.58 0.20 0.86 6.50 0.05 0.19 0.04 0.04 0.00 0.02 0.02 0.04 0.04 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.85 0.85 0.05 0.01 0.08 0.08 0.14 0.04 0.05 0.33 0.33 0.11 0.02 0.64 0.59 3.68 0.13 0.72 0.25

121

CNC Machine Design Report

160-1423-1-ND 277-1273-ND 277-1274-ND A98335-ND A98337-ND LM1084IS-5.0-ND 160-1427-1-ND 609-3464-ND 609-3469-ND 609-3248-ND 609-3256-ND 3M9450-ND MHC10E-ND 576-1137-ND 399-4630-1-ND 495-2269-1-ND BAV16W-FDICT-ND 399-1161-1-ND PCC2452CT-ND F1450CT-ND LM337IMPCT-ND 296-12602-1-ND MB110S-TPMSCT-ND MT2119-ND P1.15KCCT-ND 541-0.0ACT-ND RHM20.0KCRCT-ND RMCF1/1010KJRCT-ND RHM1.00KCRCT-ND RR12P4.32KDCT-ND P240DACT-ND RHM2.05KCRCT-ND PRL1632.043FCT-ND S9172-ND 609-3464-ND A98359-ND 495-1565-1-ND 399-1168-1-ND 445-5102-1-ND 490-3895-1-ND

LED GREEN TERM BLOCK 2.54MM 2POS TERM BLOCK 2.54MM 3POS TERM BLOCK 2.54MM 4POS TERM BLOCK 2.54MM 6POS POSITIVE VOLTAGE REG 5V 5A LED SUPER RED 0805 LIST 0.100 LIST 0.100 LIST 0.100 LIST 0.100 HEADER 5 POS HEADER 10 POS LDO REG 1.25A 5.0V TO263 4.7uF 25V TANT 1.0uF 25V TANT DIODE SWITCH 75V SOD123 15nF 50V CERAMIC 0805 0.1uF 50V CERAMIC 0805 FUSE 0.125 125V FAST BLOW 1206 NEGATIVE VOLTAGE REGULATOR ADJUSTABLE POSITIVE REGULATOR LM317 DIODE BRIDGE 1A 100V TRANSFORMER DUAL 14VAC 0.40A 1.15K 1/8W 1% 0805 0.0 OHM 1/8W 5% 0805 20.0K 1/8W 1% 0805 10K 1/8W 5% 0805 1.00K 1/8W 1% 0805 4.32K 1/10W 0.5% 0805 240 1/8W 0.1% 0805 2.05K 1/8W 1% 0805 0.043 OHM 1W 1% 1206 HEADER 20POS LIST 0.100 TERM BLOCK 5.08 2POS 10uF 25V TANT 0.1uF 25V CERAMIC 0805 15nF 25V CERAMIC 0603 1uF 25V CERAMIC 0603

5 1 1 14 5 1 5 5 5 5 3 5 5 3 7 20 35 10 5 10 5 5 5 1 15 25 15 10 10 5 5 25 12 5 10 3 3 25 15 5

0.0105 0.545 0.825 0.041786 0.1755 1.665 0.0126 0.02 0.048 0.06 0.071667 0.0204 0.188 0.371667 0.034286 0.003375 0.008543 0.0023 0.0103 0.0371 0.42 0.176 0.112 4.125 0.003033 0.000828 0.001267 0.00105 0.0019 0.0148 0.0204 0.000536 0.038417 0.037 0.01 0.141667 0.115 0.0009 0.0013 0.0068

$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $

0.05 0.55 0.83 0.59 0.88 1.67 0.06 0.10 0.24 0.30 0.22 0.10 0.94 1.12 0.24 0.07 0.30 0.02 0.05 0.37 2.10 0.88 0.56 4.13 0.05 0.02 0.02 0.01 0.02 0.07 0.10 0.01 0.46 0.19 0.10 0.43 0.35 0.02 0.02 0.03

122

CNC Machine Design Report

587-2400-1-ND 445-1314-1-ND 490-1731-1-ND 497-1314-1-ND 160-1422-1-ND DMP2160UWDICT-ND 2N7002W-FDICT-ND OP27GSZ-ND RMCF1/100RCT-ND P4.99KCCT-ND RR12P4.02KDCT-ND P3.0MACT-ND P46.4KCCT-ND P26.1KCCT-ND P2.00KCCT-ND P1.00KCCT-ND P1.0DDKR-ND MCT0603-10K-MDCT-ND 311-3.57MCRCT-ND P1.50KCCT-ND RHM22.1KCCT-ND LT1910IS8#PBF-ND 455-1903-ND 455-2050-1-ND 296-13097-1-ND 296-13261-1-ND 40-2-5-ND C2103L-100-ND Uoled160g1 863-74FST3257DR2G 31M9297 IRF7341PBF Shipping ADVANCED CIRCUITS ADVANCED CIRCUITS ADVANCED CIRCUITS ADVANCED CIRCUITS AMAZON MOUSER

1.0uF 50V CERAMIC 0603 0.1uF 50V CERAMIC 0603 1.0uF 25V CERAMIC 0805 IC GATE AND DUAL 2-INPUT SOT23-8 LED RED 0805 MOSFET P-CH 20V 1.5A SOT-323 MOSFET N-CH 60V 115mA SOT 323 IC OPAMP GP 8MHZ PREC 8SOIC 0.0 OHM 1/8W 0805 4.99K 1/8W 1% 0805 4.02K 1/10W 0.5% 0805 3M 1/8W 5% 0805 46.6K 1/8W 1% 0805 26.1K 1/8W 1% 0805 2.00K 1/8W 1% 0805 1.00K 1/8W 1% 0805 1.0 OHM 1/8W 1% 0805 10K 0.15W 0.5% 0603 3.57M 1/8W 1% 0805 1.50K 1/8W 1% 0805 22.1K 1/8W 1% 0805 IC MOSFET DRIVER HI-SIDE 8-SOIC CONN HOUSING 2POS 2.5MM CONN CONTACT XA 26-22AWG TIN IC DRVR/RCVR MULTCH RS232 16SSOP IC DUAL INVERTER GATE SOT-23-6 SOLDER-WICK LEAD-FREE 5' 0.06" HOOK-UP WIRE BLUE STRANDED 18AWG Serial OLED Graphics Display QUAD 2:1 MULT 22000uF 63V ELECTROLYTIC CAPACITOR HEXFET 55V 4.7A

5 30 5 1 5 15 2 3 50 5 5 5 5 5 5 10 5 5 5 5 5 1 15 25 5 1 1 1 1 1 3 25

0.0165 0.000917 0.0081 0.29 0.0105 0.022 0.155 0.458333 0.000088 0.0091 0.0148 0.0077 0.0091 0.0091 0.0091 0.00455 0.091 0.0178 0.0074 0.0091 0.0041 2.25 0.001967 0.00048 0.49 0.33 4.08 24 79 0.39 3.863333 0.00922

$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $

0.08 0.03 0.04 0.29 0.05 0.33 0.31 1.37 0.00 0.05 0.07 0.04 0.05 0.05 0.05 0.05 0.46 0.09 0.04 0.05 0.02 2.25 0.03 0.01 2.45 0.33 4.08 24.00 79.00 0.39 11.59 0.23

$ $ $ $ $ $

25.28 25.35 25.28 25.35 8.62 7.68

123

CNC Machine Design Report

DIGIKEY DIGIKEY DIGIKEY DIGIKEY DIGIKEY JAMECO JAMECO JAMECO MOTION DRIVER BOARD MOTION DRIVER BOARD MODIFIED MAIN CONTROLLER BOARD PENDENT CONTROLLER BOARD Poster Board Poster Paper Total Cost
Table 4: Electrical and Miscellaneous Costs

$ $ $ $ $ $ $ $ 1 1 1 1 44.246 56.97 33 33 $ $ $ $ $ $ $ $

8.37 11.60 17.10 13.28 7.81 20.50 6.90 6.90 44.25 56.97 33.00 33.00 8.00 26.00 53.48 779.76

8. Implementation Schedule
If one wanted to recreate the CNC Machine prototype built during this project a detailed implementation schedule should be followed. If the build were to be undertaken starting June 1, 2010, within the first week retrieve all the items found in table 3-1: prototype item/cost breakdown. Start the actual build the following week, January 7, 2010. The construction is relatively simple and can be easily completed in a week with a small team. Once all parts are gathered the build can be done within a 4 hour period with a three man team. Having three sets of arms helps greatly in the complete assembly/adjustment process. One guy can hold a part, with another stabilizing the other side of the CNC, while the other person connects parts or makes an adjustment. The prototype should be fully functional within hours of completion.

Step # 1 2 3 4 5

Step Description Place parts on boards Table Assembly Gantry Assembly Tapping and Drilling Electric Box Assembly

Hours 4 20 15 13 8

124

CNC Machine Design Report

6 7

Assemble Systems Testing Total Hours

4 5 69

9. APPENDIX A
9.1 VGA Data Sheet

The VGA port code is designed just like the pendent LCD Screen. The commands code is placed in a buffer to be called. The buffer the VGA uses is the VGABuffer[255] and a VGACount. This buffer will hold the command ID and the sequence it needs to perform the function. The VGA chip has a pixel range from 0639 on the X axis and 0-479 on the Y axis. It also has a range of 0-79 columns and 0-39 rows. The code pixel placement is split up into 8bits, the MSB (Most Significant Bit) and the LSB (Least Significant Bit).These bits will determine the X and Y on the VGA screen. The VGA has 16 functions that were used to implement the actions of the CNC. These functions are:
MoveTo() EraseScreen() SetBackground() DrawLine() SetFontSize() DrawBox() OpaqueTransparent() PlaceText() WriteString() DisplayImage() PaintArea() DrawCircle() SetColumn() SetRow() SetRowColumn() PlaceCharUnFor()

125

CNC Machine Design Report

A select number of theses functions are staticly implemented in the VGA chip. These functions will use the VGABuffer[ ] and the VGACount to get total functionality. Each line of implementation will go into its own array slot. The Command ID will go in the VGABuffer[0] slot and the other lines of code will follow behind in order as the data sheet requires.

9.1.1

MoveTo()

The MoveTo command takes the X and Y axis specified by the developer and places the next point to the specified pixel point. The code takes the MSB and the LSB of the Y and X axis and it gives the desired location.

9.1.2

EraseScreen

The EraseScreen function is a internal command on the VGA chip. This function uses the VGABuffer. The command value for this function is 45hex. This function will erase the screen and another function can be called to the VGA.
9.1.3 SetBackground()

This function will set the background color for the VGA screen. The command value for the background is 42Hex. The next position atVGABuffer[1] is the color of the background. The count of this function is then placed at 2.
9.1.4 DrawLine()

This function will draw a line on the screen from the current pixel position to the next position. The functions command ID is 4Hex. In the array positions 1-4 the current positions of the CNC are placed here and for the positions 5-8 the next positions are placed here all in pixel positions. At VGABuffer[9] the color of the line is placed here. The count of this function is 10. Also at the end of these functions the CurrentPosition is placed as the next X and Y positions.

126

CNC Machine Design Report

9.1.5

SetFontSize()

This function sets the font size. The command ID of this functions is 46Hex. In the VGABuffer[1] the Font size is added. The VGACount is equal to 2

9.1.6

DrawBox()

In this functions it doesnt use the buffer or the counter. This functions draws a box that will be used for the X,Y,Z,A, limit switches, and the state box. This function is created by taking the current position and moving one position at a time till it loops back. So the sequence that it takes is Current X and Current Y, Current X to Y, X to Y, X to Current Y, and then back to Current X and Current Y.
9.1.7 OpaqueTransparent()

This function will be implamented when the firmware for the VGA allows the user to open up documents from the USB to go on the VGA. This function can make the text be Opaque or Transparent depending on the position the selector is on. The Command ID for this is 4FHex. The next position in the buffer is the mode that is wanted. If it is 01 it will be Opaque and if it is 01 it will be transparent. The Counter for this will be 2.
9.1.8 PlaceText()

This function will place a text on the screen at the Row and Column position desired by the screen developer. The command ID for this function is 54Hex. The next position is where the character that is being written is placed. The next 2 positions is where you place the Column first and the Row second. The final position in this array VGABuffer[4] is going to be the font color. The Counter of this function will be 5.
9.1.9 WriteString()

This function writes a string on the VGA. The command ID for this function is 73Hex. The next position of the array will be how it will be aligned on the VGA. The next 2 positions will be first The Column and then the Row. The next position
127

CNC Machine Design Report

will be the font color and then the characters that are being written on the screen will be in the next position. The final position which is VGABuffer[6] is the terminate command. This ends the string when strings are finished being wrote. The counter on this function is 7.

9.1.10 DisplayImage()

This function will place an image on the screen. This function will be implemented when the user functionality is working. This functions command ID is 49Hex. The next 4 positions will be the X and Y pixel positions. The next 4 positions after that is first the width(MSB, LSB) and the height(MSB, LSB). The final position will be the File that is going to be passed to the VGA. The count of this will be 10.
9.1.11 PaintArea()

This functions main task is to paint the area of a specific place. The command ID of this function is 70Hex. The next 8 positions are the current X and current Y positions and then the new X and Y positions all in pixel format. The Final array position is the Color of the area.
9.1.12 DrawCircle()

This function takes the radius and the current position of the CNC and makes a circle from that point. The command ID for this function is 43Hex. The next 4 positions on the array are the current positions of X and Y. The next position will be the radius. The radius in this function is measured in pixels. The last position on the array is the graphic color. The buffer count in this function is 7
9.1.13 SetColumn()

This functions main task is to set the current column position to a new column that has been specified by the developer.

128

CNC Machine Design Report

9.1.14 SetRow()

This functions main task is to set the current row position to a new position that is specified by the developer.

9.1.15 SetRowColumn()

This functions main task is to set the current column and row at the same time. This function allows it to be easier and quicker to set the row and column without having to call 2 separate functions.
9.1.16 PlaceCharUnFor()

This function places a char in an unformatted state. Instead of it being placed in a row and column it is placed by the X and Y pixel position. The command ID for this function is 74Hex. The next array position is the Character that is being entered. The next 4 positions are the X and Y positions. The next 2 array positions are the width and height. If these positions equal 01hex then the sizes are normal, if they are 02hex then the sizes have doubled. If the hex number increases to another number the VGA takes that number and multiplies it with the normal character size. (Ex 10Hex = 3*normal)
9.2 3.1 Screens

There is only one screen that is implemented in this first version of the CNC. This screen is the Main routing screen. This screen has the X,Y,Z,A, limit switches, and the current state. Figure 3.1 shows what the VGAs current screen will look like.
X: Y: Z: A:

129

CNC Machine Design Report

Figure 3.1 The X, Y, Z, and A positions are made using write string and the boxes are used using the Draw Box function. Inside of these boxes is the WriteToString function that was implemented into the hand pendent. This will change the integer value for X, Y, Z, and A into a string of characters. The box with the 5 circles in them is the limit switches. These will turn red or green depending if it is on or off. The final 2 boxes on the right side are the current state and the offset display. The top box will show the offset of the CNC and the bottom box will tell if the machine is in Jog, Idle, or Rapid state. The bottom opening will be a dialog box that will show which commands were being called to the CNC.

10. APPENDIX B
10.1 X-axis
Table 10-1

E y(deflection) x a1 b1 a2 b2 L Forces Separation

29000000 -0.001 15 13.6875 16.3125 16.3125 13.6875 30 1.3125

Diam 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.18 1.20 1.25

I 0.0155 0.0201 0.0256 0.0322 0.0400 0.0491 0.0597 0.0719 0.0859 0.0955 0.1018 0.1198

F1 -0.00031 -0.00024 -0.00019 -0.00015 -0.00012 -0.00010 -0.00008 -0.00007 -0.00006 -0.00005 -0.00005 -0.00004

F2 -0.000020 -0.000016 -0.000012 -0.000010 -0.000008 -0.000006 -0.000005 -0.000004 -0.000004 -0.000003 -0.000003 -0.000003

Force (per bearing) F(per rod) 3.1 6.1 4.0 7.9 5.1 10.1 6.4 12.7 7.9 15.8 9.7 19.4 11.8 23.6 14.2 28.4 17.0 33.9 18.9 37.8 20.1 40.2 23.7 47.4

130

CNC Machine Design Report

10.2 Y-axis
Table 10-2

E y(deflection) x a1 b1 a2 b2 L Forces Separation

29000000 -0.001 19 17.6875 20.3125 20.3125 17.6875 38 1.3125

Diam 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25

I F1 0.0155 -0.00063 0.0201 -0.00048 0.0256 -0.00038 0.0322 -0.00030 0.0400 -0.00024 0.0491 -0.00020 0.0597 -0.00016 0.0719 -0.00014 0.0859 -0.00011 0.1018 -0.00010 0.1198 -0.00008

F2 -0.000033 -0.000025 -0.000020 -0.000016 -0.000013 -0.000010 -0.000009 -0.000007 -0.000006 -0.000005 -0.000004

Force (per bearing) F (per rod) 1.5 3.0 2.0 3.9 2.5 5.0 3.1 6.3 3.9 7.8 4.8 9.6 5.8 11.7 7.0 14.0 8.4 16.8 9.9 19.9 11.7 23.4

It was determined that a supported rail was needed.

10.3 Calculated Moments and Equivalent Force Couples on X Rails


Table 10-3

Part zback zbottom zsides zversa mount rails ztravel block Tool Head z top front

quantity 1 1 2 3 1 1 1

Horizontal Position from Spacing Weight/ Center of between Reaction Force Moment (lb- Volume Ballscrew the rails (in) (lb) in) (in3) 3.3627 4 1.068 3.590 31.403 4.5502 0.125 0.570 3.687 4.5502 0.871 7.926 12.808 3.7052 1.941 21.572 2.327 5.6127 7.1877 4.5502 0.598 10.000 0.125 SUM 3.359 71.877 0.570 98.641 17.602 3.687

Density (lb/in3) 0.034 0.034 0.034 0.278 0.034 0.034

Force in y on top Material rails HDPE 24.566 HDPE HDPE 21.954 Steel HDPE HDPE

zmotor & ztop rear ztop middle counterweight

1 1

-0.357 2.393 -3.482

1.771 0.106 3.000

-0.632 0.254 -10.446

7.969 3.125

0.034 0.034

HDPE HDPE

131

CNC Machine Design Report

Table 10-4

Total vertical gantry distance 17.009

Vertical Distance: Spacing Tool head top rail- between the cutting tool head rails force 15.584 4.00 5.5 3.75 4.00 4.25 4.50 4.75 7.00

Moment of tool head 74.711 75.398 74.711 74.023 73.336 72.648 66.461

Force in x 18.678 20.106 18.678 17.417 16.297 15.294 9.494

Force in x per rail 9.339 10.053 9.339 8.709 8.148 7.647 4.747

Table 10-5

Rail front top front bottom back top if 4 rails

Forces per rail no counterbalance w/ counterbalance 13.070 11.652 20.796 19.935 20.534 16.775 13.070 11.652

132

CNC Machine Design Report

10.4 Trade off Study: 3 rods vs 4 rods, Rod Spacing


10.4.1 3 Rod Configuration
Table 10-6

Moment due to Weight Separation of 1&2 (x) F1 Moment due to Cutting Separation of 2&3 (y) F2

Trial 1 100 3.464 28.87 75 2.009 37.33

Trial 2 100 4 25 75 2.5 30

Trial 3 100 5 20 75 3 25

Trial 4 100 4 25 75 4 18.75

Rod 1 F1 F2/2 Resultant 1 Rod 2 F1/2 F2/2 Resultant 2

28.87 18.67 34.38

25.00 15.00 29.15

20.00 12.50 23.58

25.00 9.38 26.70

14.43 18.67 23.60

12.50 15.00 19.53

10.00 12.50 16.01

12.50 9.38 15.63

Rod 3 F1/2 F2 Resultant 3

14.43 37.33 40.03

12.50 30.00 32.50

10.00 25.00 26.93

12.50 18.75 22.53

133

CNC Machine Design Report

Table 10-7

x 2 3 rod orientation 1 y

x 23.60 y 40.03 Resultants, Trial 1 34.38 29.15

x 19.53 y 32.50 Resultants, Trial 2 23.58

x 16.01 y 26.93 Resultants, Trial 3 26.70

x 15.63 y 22.53 Resultants, Trial 4

134

CNC Machine Design Report

10.4.2 4 Rod Configuration


Table 10-8

Moment due to Weight Separation of 1&2,3&4 (x) F1 Moment due to Cutting Separation of 2&3, 1&4 (y) F2

Trial 1 100 3.464 28.87 75 2.009 37.33

Trial 2 100 4 25 75 2.5 30

Trial 3 100 5 20 75 3 25

Trial 4 100 4 25 75 4 18.8

Rod 1 F1/2 F2/2 Resultant 1 Rod 2 F1/2 F2/2 Resultant 2 Rod 3 F1/2 F2/2 Resultant 3 Rod 4 F1/2 F2/2 Resultant 4

14.43 18.67 23.60

12.50 15.00 19.53

10.00 12.50 16.01

12.50 9.38 15.63

14.43 18.67 23.60

12.50 15.00 19.53

10.00 12.50 16.01

12.50 9.38 15.63

14.43 18.67 23.60

12.50 15.00 19.53

10.00 12.50 16.01

12.50 9.38 15.63

14.43 18.67 23.60

12.50 15.00 19.53

10.00 12.50 16.01

12.50 9.38 15.63

135

CNC Machine Design Report

Table 10-9

x 1 2 4 3 rod orientation x 23.60 23.60 y 23.60 23.60 Resultants, Trial 1 y

x 19.53 19.53 y 19.53 19.53 Resultants, Trial 2

x 16.01 16.01 y 16.01 16.01 Resultants, Trial 3

x 15.63 15.63 y 15.63 15.63 Resultants, Trial 4

10.5 Table Top Support Calculations


10.5.1 Table Support Calculations
Table 10-10

E y(deflection) x a1 b1 a2 b2 L Forces Separation

29000000 -0.001 19 17.6875 20.3125 20.3125 17.6875 38 1.3125

Base 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.375 0.375 0.375 0.375 0.375 0.375 0.375 0.500 0.500 0.500 0.500 0.500 0.500 0.500

Height 0.500 0.625 0.750 0.875 1.000 1.125 1.250 0.500 0.625 0.750 0.875 1.000 1.125 1.250 0.500 0.625 0.750 0.875 1.000 1.125 1.250

2 Point Forces 0.3 0.5 0.9 1.4 2.0 2.9 4.0 0.4 0.7 1.3 2.0 3.1 4.3 6.0 0.5 1.0 1.7 2.7 4.1 5.8 8.0

F(per rail) 0.5 1.0 1.7 2.7 4.1 5.8 8.0 0.8 1.5 2.6 4.1 6.1 8.7 11.9 1.0 2.0 3.4 5.5 8.1 11.6 15.9

136

CNC Machine Design Report

10.6 Ballscrew Calculations


10.6.1 Ballscrew Calculations
Table 10-11

lead (in/rev) major diameter minor diameter pitch diameter rpm velocity (in/min) velocity (in/s) 2 acceleration (in/s ) lead angle Y-axis weight mass Force to Accelerate (lb) change in linear speed(ft/min) time to accelerate Acc Force to torque (oz.in)

0.2 0.625 0.48 0.5525 1200 240 4 15 0.115

6 15

8 15

10 15

12 15

14 15

100 0.259 3.89 20 0.27 2.199 3.89 30 0.40 2.199 3.89 40 0.53 2.199 3.89 50 0.67 2.199 3.89 60 0.80 2.199 3.89 70 0.93 2.199

Torque-Forward Drive (in.lb) torque-Forward drive (oz.in) Acceleration Torque WK2=(1/8)WD2

3.54 56.59

only applicable if the weight is being lifted.

12.5

Acceleration Static friction force Coefficient of friciton Mass*Acc Force (lb) Torque (oz.in) Constant velocity Kinetic friction force Coefficient of friciton Mass*Acc Force (lb) Torque (oz.in)

25 0.25 3.88 28.9 16.3

18.75 0.1875 0 18.75 10.6

137

CNC Machine Design Report

10.7 Cable Carrier


10.7.1 Cable Carrier Selection
Table 10-12

Cable carriers Axis Z # 3 Wires Wire spindle paste dispensor limit, paste air brush sum OD 0.23 0.22 0.13 0.58 Interior A&B Height, A Width, B 0.41 0.63 Travel 8.24 Available Height 1.8524 Loop Length Total (desired, min) in ft 2.91 9.63 0.8 5.51 Cost 17.6

spindle paste dispensor limit, paste air brush z-motor limit, z sum

0.23 0.22 0.13 0.22 0.13 0.93

0.41

1.18

24.15

3.775

5.93 17.59 5.51 Cost

1.5

42.2

spindle paste dispensor limit, paste air brush z-motor limit, z x-motor limit, x sum Costs per foot 10.66 11.43 13.73

0.23 0.22 0.13 0.22 0.13 0.22 0.13 1.15

0.41

1.18

31

7.85 21.01 5.51 Cost

1.8

49.8

Cost Total 109.57

Width 0.63 0.79 1.18

Brackets 6.96 7.89 8.58

10.8 Solder Paste Dispenser


10.8.1 Equations (5.1.1)

138

CNC Machine Design Report

(5.1.2) (5.1.3) (5.1.4) 10.8.2 Solution: General Engineering Equation


Table 10-13

139

CNC Machine Design Report

10.8.3 Flow Locations


Table 10-14

Point 1 h1 L1 v1 d1 A1 Re1 L1/d1 f1 hf1 K1-2 d1/d2 h1-2 3 2.5 0.0004 0.618 0.3000 1.3E-05 4.04 5 4.3E-09 0.49 7.537 1.0E-10 2.9996 2.4996 L2 v2 d2 A2 Re2 L2/d2 f2 hf2 K2-3 d2/d1 h2-3

Point 2 0.25 0.023 0.082 0.0053 9.48742E-05 3.05 5 1.1E-05 0.49 9.111 3.4E-07 h3 L3 v3 d3 A3 Re3 L3/d3 f3 hf3 K3-O d2/d1 h3-O

Point 3 0 0.5 1.918 0.009 6.36E-05 8.6E-04 55.56 5 1.323 1 0.005


Select Dispensing Needle 27, 0.009

10.8.4 Solution: Force Approximation


Table 10-15

Approximated Force 6.05 5 10 15 20

Torque [oz.in] 3.208 2.7 5.3 8.0 10.6

10.9 Design Notebook: Pat Brokaw


10.9.1 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Table of Contents Reference websites Deflection calculation solved for deflection 1st team meeting notes Mechanical literature review sections 2nd team meeting notes 3rd team meeting notes Deflections: solved for force Team meeting notes Management meeting notes Team meeting notes Literature review notes: Drive mechanism 140

CNC Machine Design Report

12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51.

Literature review notes continued with references used Team meeting notes Team meeting notes Mechanical subsystem proposal notes Team meeting notes Initial mechanical specifications Initial electrical specifications Microcontroller block diagram Team meeting notes Discussion notes: z-axis Team meeting notes List of forces and List of mechanical parts Table end sketches, Calculations for table top support Sketches: table bottom, y-cross, y-lift mounts Notes on screw sizes Dimensions for y-lifts, table top spacing, y-axis ballnut flange Dimensions x-axis top and bottom Blank Blank Moments and Forces on each x-axis rod Deflection equation used to calculate rod deflections Acceleration and force on x-axis, paste dispenser sketch Paste dispenser sketches, paste dispenser motor dimensions, volume dispensed calculation Z-axis sketch for small versa rails (unused), Volumetric thermal expansion calculation Z-axis dimensions Z-back dimensions, z-bottom dimensions Z-top dimensions Thrust bearing block dimensions, acceleration force(Roton equation) Pendant case dimension Pendant case sketch (unfinished) Pendant case sketch with dimensions for board mounts Z-mount dimensions Dimensions: tool head mount plate, z-axis mounting Cable carrier dimensions Spindle mounting block Equations for ballscrew calculations Paste dispenser pressure calculations Paste dispenser angular velocity and torque calculations Transformer test voltages Rectifier Heat Sink 141

CNC Machine Design Report

52. Lecture notes for design report, April 6,

142

CNC Machine Design Report

10.10 Cost Data and Schedule Data


10.10.1
Table 10-16

Prototype Cost

Component Z axis z ballscrew Ballnut thrust bearing block z ball nut flange z ztop zside zbottom zback zmount standoff versa rail versa guide block Spindle Plate Spindle spindle holder X axis thrust bearing block x-traveling block xback

Part #

Quantity Cost

Total Cost

Source

Date

24" 1 1 1 1 2 1 1 1 2 2 2 1 1 1 $ $ $ $ $ $ $ $

$10.09/ft

20.18 Roton 23.55 Roton 11.75 Stock from Online Metals, machined in house Stock from Online Metals, 3.38 machined in house Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics 18.23 Stock from Online Metals, machined in house Stock from McMaster Carr, 9.85 machined in house

1/24/2010 1/24/2010

23.55 $ 11.75 $ 3.38 Donated Donated Donated Donated 18.23 $ 9.85 $ $

3/29/2010 1/27/2010 1/27/2010 3/29/2010

40.30 $ 33.80 $ 10.94 $ On hand Donated

80.60 Anaheim Automation 67.60 Anaheim Automation 10.94 Stock from McMaster Carr, machined in house James Williams Stock from Norva Platics, machined in house

1 1 1 $

Common stock listed previously 105.00 $ Donated

Stock from Online Metals, machined in house Stock from Norva Platics, 105.00 machined in house Machined by Norva Platics

143

CNC Machine Design Report

144

CNC Machine Design Report

xballscrew Ballnut xrods xtop ball nut flange x Bushings Table Table sides Table Bottom Table end -Motor Table End Table Top Table supports Table stand rails Y axis sides side w/o motor Ball flange y y-cross y support rail yballscrew

36" 1 3 1 $ $

$10.09/ft

30.27 Roton 23.55 Roton 118.05 Lintech Machined by Norva Platics Stock from Online Metals, machined in house

1/24/2010 1/24/2010

23.55 $ 39.35 $ Donated

Common stock listed previously 6 $39.95/4 $

79.90 VXB

2 1 1 1 1 3 2 $ $

Donated Donated Donated Donated Donated 8.69 $ 10.62 $

Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics 26.07 Stock from Online Metals 21.24 Stock from Online Metals 4/7/2010 4/7/2010

1 1 1 1 1 48" $

Donate Donate Common stock listed previously Common stock listed previously 179.00 $ $10.09/ft $

Machined by Norva Platics Machined by Norva Platics Stock from Online Metals, machined in house Stock from Online Metals, machined in house 1/28/2010 1/24/2010

179.00 VXB 40.36 Roton

145

CNC Machine Design Report

Ballnut y-axis bushing block y-lifts Common Parts (X, Y, & Z) Thrust Bearings Ball Bearings Bearing seals Seal retainer Belts Pulleys Motors Motors Wiring Machine Electronics Cable Carriers Cable Carrier (X & Y) Mounting Brackets (X&Y) Cable Carrier (Z) Mounting Brackets (Z) Electronics Case Top X&Y Z 20 ft

1 2 2

$ $ $

23.55 $ 39.95 $ 57.33 $

23.55 Roton 79.90 VXB 57.33 Stock from Online Metals, machined in house

1/24/2010 1/28/2010

6 3 6 3 3 6 2 1 3 $ $ $ $ $ $ $

$14.95/2

44.85 VXB 16.65 McMaster Carr 13.86 MSC Direct Stock from ME shop, machined in house 10.47 McMaster Carr 19.02 MSC Direct 78.00 Anaheim Automation 29.00 Anaheim Automation 39.00 Anaheim Automation 3/23/2010 3/29/2010

5.55 $ 2.31 $ Donated 3.49 $ 3.17 $ 39.00 $ 29.00 $ 13.00 $

2 2 1 1

$ $ $ $

41.19 $ 8.58 $ 10.66 $ 6.96 $

82.38 McMaster Carr 17.16 McMaster Carr 10.66 McMaster Carr 6.96 McMaster Carr

3/29/2010 3/29/2010 3/29/2010 3/29/2010

Donated

Machined by Norva Platics

146

CNC Machine Design Report

Bottom Sides Front Back Divider Pendant Case Case Back Plate Fasteners M5x20 M6x25mm 4-40x0.25 6-32x0.25 8-32x0.375 8-32x0.5 8-32x1 10-24x0.75 10-24x1 1/4-20x1 3/8-16x1.5 3/8-24x1

1 2 1 1 1

Donated Donated Donated Donated Donated

Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics

1 1

8 8 24 17 2 12 68 12 148 77 10 4 $

$5.34/25 $7.91/25 On Hand On Hand

$ $

5.34 McMaster Carr 7.91 McMaster Carr James Williams James Williams Lowes Lowes Lowes

4/7/2010 4/7/2010

$7.94/100 $16.15/100 $9.45/50

$ $ $

7.94 McMaster Carr 32.30 Fastenal 18.90 McMaster Carr 9.79 Lowes 4/7/2010 4/2/2010

9.79 $ $8.27/25 $

8.27 McMaster Carr

147

CNC Machine Design Report

8-32x0.25 (self tapping) 5/16-16 Nut

4 3 Donated

Lowes ME Shop

board standoffs 6-32x0.3125 6-32x0.3125 4-40x0.25 set screws 8-32x0.25 8-32x0.3125 grease zerk 1/8-27 PTF Tools, etc. 1/8" carbide tipped drill bit #12-5/16 extractor 15/16-16 tap 3/8-16 tap Layout fluid Unused Aluminum Washers Split Lock washers #10 1/4 32 56 $2.13/100 $5.64/100 $ $ 2.13 McMaster Carr 5.64 McMaster Carr 3 $2.90/10 $ 2.90 McMaster Carr 3 1 Donated Donated ME Shop ME Shop 7 10 4 On Hand On Hand On Hand James Williams James Williams James Williams

1 1 1 1 1 1

$ $ $ $ $ $

10.53 $ 2.39 $ 61.17 $ 16.02 $ 6.21 $ 5.07 $

10.53 McMaster Carr 2.39 McMaster Carr 61.17 McMaster Carr 16.02 McMaster Carr 6.21 MSC Direct 5.07 Stock from Online Metals, machined in house

148

CNC Machine Design Report

3/8 M5 M6 Ext. Tooth Lock washers #10 Flat washers 3/8 .438x.203x.032 .500x.265x.032 Paste Dispenser motor mount plate plunger syringe paste dispenser coupler screw Shipping Totals Norva Plastics Online Metals Anaheim Automation Lintech

16 8 8

$4.00/25

4.00

Lowes Lowes Lowes

110

$2.54/100

5.08 Fastenal

4/16/2010

8 24 36

Lowes

1 1 1 1 1 1 1 $

Donated 25.34 $ Donated On hand Donated Donated Donated 25.34

ME Shop Stock from Online Metals, machined in house ME Shop James Williams, Amtech ME Shop ME Shop ME Shop

$ $ $ $

11.84 $ 36.87 $ $ $

11.84 36.87 -

149

CNC Machine Design Report

VXB Roton MSC McMaster

$ $

6.75 $ 21.02 $ 10.98 $ 14.50 $ Cost

13.50 21.02 21.96 14.50

$ $

$ 1,754.93 Mechanical Subsystem

10.11 Manufacturing Costs and Schedule


10.11.1 Equipment Costs

150

CNC Machine Design Report

Table 10-17
Equipment Cost Source Date Link

Design Tools

AutoCad Inventor

$ 1,463.29 Amazon

4/25/2010 http://www.amazon.com

Microsoft Office: Excel Machining and Assembly Tools Mill

409.95 Newegg

4/25/2010 http://www.newegg.com

$ 5,995.00

Penn Tool Company Penn Tool Company

4/25/2010 http://www.penntoolco.com

Lathe & Grinding Lathe

$ 3,495.00

4/25/2010 http://www.penntoolco.com

Horizontal Bandsaw

$ 1,149.00 Grainger

4/25/2010 http://www.grainger.com

Vertical Bandsaw

$ 2,075.00 Grainger

4/25/2010 http://www.grainger.com

Drill Press

639.00 Grainger

4/25/2010 http://www.grainger.com

Chop Saw

279.17 Fastenal

4/25/2010 http://www.fastenal.com

Cordless Drill

185.28 Fastenal

4/25/2010 http://www.fastenal.com

Combination Wrenches

50.54 Fastenal

4/25/2010 http://www.fastenal.com

Allen Wrenches Screw drivers, both Phillips and Flat head

13.29 Fastenal

4/25/2010 http://www.fastenal.com

51.24 Fastenal

4/25/2010 http://www.fastenal.com

151

CNC Machine Design Report

Various endmills from 1/8-5/8 $

50.00 Fastenal

4/25/2010 http://www.fastenal.com

Fly cutter and various milling tool heads

5.70

Machine Shop Discount Supply Machine Shop Discount Supply

4/25/2010 http://www.msdiscount.com

Boring head

421.30

4/25/2010 http://www.msdiscount.com

Calipers

53.27 Fastenal

4/25/2010 http://www.fastenal.com

Micrometers

0"-1"

16.40 Fastenal

4/25/2010 http://www.fastenal.com

1"-2"

23.93 Fastenal

4/25/2010 http://www.fastenal.com

Telescoping gauges

250.99 Fastenal

4/25/2010 http://www.fastenal.com

Depth gauges

145.55 McMaster Carr

4/25/2010 http://www.mcmaster.com

Tap and Die Set

106.98 Fastenal

4/25/2010 http://www.fastenal.com

Tap handles Taps: #4-40, #6-32, #8-32, #10-24, 1/4-20, 3/8-16, 3/8-24, 1/8-27NPT; Die: 5/16-18 Drill bits:#43, #36, #32, #29, #27, #25, #24, #18, #9, #7, F, H, Q, W, X, 5/16, #1-#60 Drill Set $ 89.99 Fastenal 4/25/2010 http://www.fastenal.com

A-Z Drill Set

119.99 Fastenal

4/25/2010 http://www.fastenal.com

Total Equipment Cost

17,090

152

CNC Machine Design Report

10.11.2
Table 10-18

Material Costs

153

CNC Machine Design Report

Component Common Parts (X, Y, & Z) Ballscrews Ballnuts Thrust bearing blocks Ballnut flanges Thrust Bearings Grease Zerks: 1/827 PTF Ball Bearings Bearing seals Seal retainer Belts Pulleys Motors Motors Wiring Cable Carriers Cable Carrier (X & Y) Mounting Brackets (X&Y) Cable Carrier (Z)

Part # Quantity

Cost

Total Cost

Source

Date Priced

108" 3 3 3 6 3 3 6 3 3 6 X&Y Z 20 ft 2 1 3 $ $ $ $ $ $ $ $ $ $

$10.09/ft

90.81 Roton 70.65 Roton 11.75 Stock from Online Metals, machined in house Stock from Online Metals, 3.38 machined in house

1/24/2010 1/24/2010

23.55 $ 11.75 $ 3.38 $ $14.95/2 $2.90/10 $ $

44.85 VXB 2.90 McMaster Carr 16.65 McMaster Carr 13.86 MSC Direct 1.25 Stock from ME shop, machined in house 3/29/2010

5.55 $ 2.31 $ $1.25/3 $

3.49 $ 3.17 $ 39.00 $ 29.00 $ 13.00 $

10.47 McMaster Carr 19.02 MSC Direct 78.00 Anaheim Automation 29.00 Anaheim Automation 39.00 Anaheim Automation 3/23/2010

2 2 1

$ $ $

41.19 $ 8.58 $ 10.66 $

82.38 McMaster Carr 17.16 McMaster Carr 10.66 McMaster Carr

3/29/2010 3/29/2010 3/29/2010

154

CNC Machine Design Report

Mounting Brackets (Z) Z axis z-top z-side z-bottom z-back z-mount standoff versa rail versa guide block Spindle Plate Spindle spindle holder X axis x-traveling block xback xtop x-rods x-bushings Table Table sides Table Bottom

6.96 $

6.96 McMaster Carr

3/29/2010

1 2 1 1 1 2 2 2 1 1 1 $ $ $ $ $ $

Quoted Quoted Quoted Quoted 18.23 $ 9.85 $ 40.30 $ 33.80 $ 10.94 $ 22.00 $ Quoted 3.04

Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Stock from Online Metals, machined in house Stock from McMaster Carr, 9.85 machined in house 80.60 Anaheim Automation 67.60 Anaheim Automation 10.94 Stock from McMaster Carr, machined in house

3/29/2010 1/27/2010 1/27/2010 3/29/2010

22.00 James Williams Machined by Norva Platics

1 1 1 3 6

105.00 $ Quoted Quoted

105.00

Stock from Norva Platics, machined in house Machined by Norva Platics Machined by Norva Platics

39.35 $ $39.95/4 $

118.05 Lintech 59.93 VXB

2 1

Quoted Quoted

Machined by Norva Platics Machined by Norva Platics

155

CNC Machine Design Report

Table end -Motor Table End Table Top Table supports Table stand rails Y axis sides side w/o motor y-cross y support rail y-axis bushing block y-lifts Machine Electronics Electronics Case Top Bottom Sides Front Back Divider Pendant Case Case

1 1 1 3 2 $ $

Quoted Quoted Quoted 8.69 $ 10.62 $

Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics 26.07 Stock from Online Metals 21.24 Stock from Online Metals 4/7/2010 4/7/2010

1 1 1 1 2 2 $ $ $ $

Quoted Quoted 18.23 $ 179.00 $ 39.95 $ 57.33 $ 15.19

Machined by Norva Platics Machined by Norva Platics Stock from Online Metals, machined in house 1/28/2010 1/28/2010

179.00 VXB 79.90 VXB 57.33 Stock from Online Metals, machined in house

1 1 2 1 1 1

Quoted Quoted Quoted Quoted Quoted Quoted

Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics

Quoted

Machined by Norva Platics

156

CNC Machine Design Report

Back Plate Fasteners M5x20 M6x25mm 4-40x0.25 6-32x0.25 8-32x0.375 8-32x0.5 8-32x1 10-24x0.75 10-24x1 1/4-20x1 3/8-16x1.5 3/8-24x1 8-32x0.25 (self tapping) 5/16-16 Nut

Quoted

Machined by Norva Platics

8 8 24 17 2 12 68 12 148 77 10 4 4 3 $

$5.34/25 $7.91/25

$ $

1.71 McMaster Carr 2.53 McMaster Carr

4/7/2010 4/7/2010

$7.94/100 $16.15/100 $9.45/50

$ $ $

0.95 McMaster Carr 23.90 Fastenal 14.55 McMaster Carr 9.79 Lowes 4/7/2010 4/2/2010

9.79 $ $8.27/25 $

1.32 McMaster Carr

board standoffs 6-32x0.3125 6-32x0.3125 4-40x0.25 set screws 8-32x0.25 8-32x0.3125 3 1 7 10 4

157

CNC Machine Design Report

Washers Split Lock washers #10 1/4 3/8 M5 M6 Ext. Tooth Lock washers #10 Flat washers 3/8 .438x.203x.032 .500x.265x.032 Fastener Totals Paste Dispenser motor mount plate plunger syringe paste dispenser coupler screw Quote: Plastics and Machining 1 1 1 1 1 1 1 30 Quoted $25.34/3 Quoted User Selected Quoted Quoted Quoted Quoted Cost $ 8.45 Machined by Norva Platics Stock from Online Metals, machined in house Machined by Norva Platics Amtech Machined by Norva Platics Machined by Norva Platics Machined by Norva Platics $900 Norva Plastics $ 2,406.89 Mechanical Subsystem 8 24 36 Unlisted $ 30.00 $ 30.00 110 $2.54/100 $ 2.79 Fastenal 4/16/2010 32 56 16 8 8 $2.13/100 $5.64/100 $4.00/25 $ $ $ 0.68 McMaster Carr 3.16 McMaster Carr 2.56 Lowes

158

CNC Machine Design Report

10.11.2.1 Recommended Vendors Vendors recommended by the CNC machine design team include: Roton, http://www.roton.com o Ballscrews and Ballnuts Lintech, http://www.lintechmotion.com o X axis linear guide rods Anaheim Automation, http://www.anaheimautomation.com o Y-axis versa rails and blocks. VXB, http://www.vxb.com o Thrust bearings, x-rod bushings, y-axis supported rail and bushing blocks C M Master Carr, http://www.mcmaster.com o Ball bearings, belts, Online Metals, http://www.onlinemetals.com o Metal stock Norva Plastics, http://www.norvaplastics.com o Plastics and machining of plastic components MSC Direct, http://www.mscdirect.com o Pulleys, bearing seals Fastenal, http://www.fastenal.com o Fasteners

159

CNC Machine Design Report

10.11.3
Table 10-19

Fasteners

160

CNC Machine Design Report

Part Bolts table top table ends table sides y-rails y-sides, uprights

Location/comment Fastener Size 10-24x1 1/4-20x1 10-24x1 10-24x1 10-24x1 10-24x1 1/4-20x1 3/8-16x1.5 M6x25mm 1/4-20x1 10-24x1 10-24x1 8-32x1 8-32x1 8-32x1 3/8-16x1.5 10-24x1 M5x20mm 3/8-24x1 3/8-16x3 1/4-20x1 1/4-20x1 10-24x0.75

Quantity 18 21 22 26 16 28 24 6 8 12 8 20 16 4 4 4 10 8 4 2 12 8 12 7 5 8 24 12 2 16 4 2 2 7 10 4 7 10 4 3 1 3

Washers Split Lock ET Lock 18 22 26 16 24 6 8 12 8 20

Flat

table supports bottom ends connects lifts x-rods Holds aluminum bearing blocks connects y-cross end

24 6

y-lifts

x-back x-top z-sides z-top z-bottom X-Z mounts z-axis versa rails versa block z-mount spindle mount thrust bearing block ballnut flange motor mounting

4 20 8 4 2 12 8 12

2 12 24

Electronics housing driver board mount divider top bottom sides relay motor connectors db-25 outputs AC-input Fuse driver standoffs controller standoffs vga standoffs board standoffs driver main controller vga set screws ballnuts z-axis thrust bblock grease zerk bearing blocks

8-32x1 8-32x1 8-32x1 8-32x1 8-32x0.5 8-32x0.375 4-40x0.25 4-40x0.25 8-32x0.25 (self-tapping) 8-32x0.25 (self-tapping) 6-32x0.25 6-32x0.25 4-40x0.25 6-32x0.3125 6-32x0.3125 4-40x0.25 8-32x0.25 8-32x0.3125 1/8-27 PTF

161

CNC Machine Design Report

Table 10-20

Totals Fasteners

M5x20 M6x25mm 4-40x0.25 6-32x0.25 8-32x0.375 8-32x0.5 8-32x1 10-24x0.75 10-24x1 1/4-20x1 3/8-16x1.5 3/8-24x1 3/8-16x3 8-32x0.25 (self-tapping)

8 8 24 17 2 12 68 12 148 77 10 4 2 4 396 32 56 16 8 8 110 8 24 36

Split Lock washers

#10 1/4 3/8 M5 M6 #10 3/8 .438x.203x.032 .500x.265x.032

Ext. Tooth Lock washers Flat washers

162

CNC Machine Design Report

10.11.4 Component Data Sheets Ballscrews Versa rails Versa blocks X-rods X-rod bushings Y-Supported Rail Y-Bushing Blocks Ball Bearings Thrust Bearings Bearing Seals Motors Pulleys Belts
Spacing Axis Z X Y Pulley Diameter 1.890 1.890 1.890 Max 5.08 8.00 4.50 Min 4.08 7.03 3.50 Middle 4.58 7.52 4.00 Max 16.09 21.94 14.94 Belt Length Min 14.10 19.99 12.94 Middle 15.10 20.97 13.94 Order Price Source

Total

163

CNC Machine Design Report

10.11.4.1 10.11.4.2 10.11.4.3 10.11.4.4 10.11.4.5 10.11.4.6 10.11.4.7 10.11.4.8 10.11.4.9 10.11.4.10 10.11.4.11

Engineering Drawings Z-axis X-axis Base Y-axis Tool Heads Spindle Paste Dispenser Machine Electronics Pendant Case Electronic Component Housing

164

CNC Machine Design Report

Electronic Component Housing Assembly, BB-5 Part Name Part Number 1 Top 2 Bottom 3 Front 4 Back 5 Left Side 6 Right Side 7 Partition 8 Driver Board Panel

165

CNC Machine Design Report

11. APPENDIX C
11.1 Pendent Code Datasheet
11.1.1 Graphics Header File:

All graphics within the Graphics.c file uses an LCDBuffer[ ] array that has a size of 255. Also it has a LCDCount that counts the number of positions used within the LCDBuffer. Inside the main structure there three sets of internal structures: CurrentPos (Current Position) PositionArray (Position in Rows and Columns) Properties (Color, Font, etc) In Current Position we have two declarations X and Y. These declared variables have a data type int which will be used for pixel position on the LCD Screen. The range of the Y position will be 72 pixels and the X position will be 120 Pixels. The Position Array structure has two declarations Row and Column. Also declared as int data types, will be used in positioning with Rows and Columns. Unlike the current position we have a range of 9 Rows and 15 Columns. In the Properties structure we have the six declared variables that have a data type of int: Color FontSize BackColor (background color) CurrentScreen Pen (Pen size) The Color variable is used to set the color for any of the draw functions. BackColor is used to set the background color inside the Graphics.c file. All Colors
166

CNC Machine Design Report

are defined outside of the structure inside the Graphics.h file. These colors are white, black, red, green, blue, yellow, teal, fuchsia, purple, gray, and orange. These colors are called by using theses specified names: clWhite = White clBlack = Black clRed = Red clGreen = Green clBlue = Blue clYellow = Yellow clTeal = Teal clFuchsia = Fuchsia clPurple = Purple clGray = Gray clOrange = Orange FontSize is used to specify the character font sizes. There are 3 different font sizes that can be used but it changes the Row and Column sizes. FONT_SIZE_5X7 FONT_SIZE_8X8 FONT_SIZE_8X12 For the 5X7 the Rows will be 15 and the Columns will be 20, for the 8X8 the Rows will be 15 and the Columns will be 15, and finally for the 8X12 which we will use for our pendent we will have 9 Rows and 15 Columns. The current screen variable will be useful to set up a command that will set what screen that we need to be on at a specific time. The pen variable is used to set the pen size of the draw functions. When the pen is set to be solid it will have a circle that is filled in. If the pen is set to be wire it will just outline the shape and it wont be filled in. We have two defined pen sizes that can be used in our program: SOLID
167

CNC Machine Design Report

WIRE Some more defined variables that will be used in our program are: OPAQUE TRANSPARENT These are used to allow when we are choosing a window or command we can make it OPAQUE so it looks like we are playing out selector over that selection and it would become TRANSPARENT if we were not selected over the file box.

11.1.2 Graphics Source File:

In our Graphics.c file we have every function that will be shown on the pendent LCD screen. Here are the list of commands in this file: MoveTo() WriteString() DrawLine() DrawBox() DrawChar() DrawCircle() DrawTriangle() RowColumnPos() SetOpaqueTransparent() SetBackgroundColor() SetPenSize() DrawSemiCircle() ClearImage()
11.1.2.1 DrawIcon()

168

CNC Machine Design Report

The first command is the MoveTo function. The MoveTo function takes the x and y pixels and moves them to the next position. It then saves the position that you move to as the current position. EX: MoveTo(16,8); 16 pixels in the X direction and 8 in the Y direction The WriteString command is used to write a string of chars. It takes the string that you write and puts it into an array and prints it onto the screen. EX: WriteString(Hello World); - Prints Hello World on the LCD Screen The DrawLine command as it specifies draws a line from the starting position to a specified position. EX: DrawLine(56, 20); Draws a line from the current position to the pixel position X = 56 and Y=20.
(X1,Y1)

(X2,Y2)

The DrawBox command draws a box using the current position as one corner and then the users gives a position on the opposite corner. EX:DrawBox(56,20); - In this figure X1 and Y1 are the current positions and X2 = 56, Y2 = 20.
(X1,Y1)

(X2,Y2)

169

CNC Machine Design Report

The DrawChar command returns a char but returns it one at a time in. It takes the current row and column that you are in prints the char. EX:DrawChar(A); - Writes a char A to the current position array and prints it on the LCD Screen.

Draw Circle takes the Radius and the current positions and makes a complete loop to create a circle. The radius of this command is in pixels EX: DrawCircle(16); - Draws a Circle with a radius of 16 pixels

(Radius)

DrawTriangle takes 2 positions on the screen and the current pixel positions and plots out a Triangle on the screen. EX: DrawTriangle(36,12,45,18); - X1 and Y1 are the current positions and X2,Y2,X3,Y3 are all calculated. In this example 36=X2, 12=Y2, 45=X3, 18=Y3.
(X1,Y1)

(X2,Y2)

(X3,Y3)

170

CNC Machine Design Report

RowColumnPos is similar to MoveTo but this command uses array positions and not pixel positions. This command is used for any type of character format. EX: RowColumnPos(4,5) This sets the current position at Row 4 and Column 5

SetOpaqueTransparent is used or the DrawBox command. This command will be used to implement a file or window selected. It will be Opaque when selected and Transparent when de-selected. EX: SetOpaqueTransparent(OPAQUE)- this command will set the Box in the function to be Opaque.
Opaque Example

Transparent

Example

SetBackgroundColor will set the background color to any of the Colors that were defined on the Graphics.h file. EX: SetBackgroundColor(clBlue);- sets background color to Blue SetPenSize sets the pen size of the drawing. This is used to either fill or not fill a graphic EX:SetPenSize(SOLID or WIRE); - sets a graphic to be filled or not filled

171

CNC Machine Design Report

Wire

Solid

DrawSemiCircle creates a SemiCircle on the LCD Screen. This command was created to draw a Semi-Circle for the Jog Screen. You need to give the radius of the semi-circle to have it drawn. Ex: DrawSemiCircle(12); - Draws a Semi-Circle with the radius of 12 pixels
(Radius)

ClearScreen clears the screen of any currently displayed information. This command is used to clear the screen when the jump file screen is being uploaded from the main sub screen. DrawIcon is used after an icon is uploaded into the processor after initialization to illustrate either a folder or file for the jump file screen to display the drives directory Ex: DrawIcon(Folder); -Draws the folder icon before the folder name

**
11.1.3 Screens Header File:

This header file is used for all external declared variables for the Screens.c source code. There are 5 external variable that are declared: X, Y, Z, A, Buffer[6]. The X Variable is used for the X axis on the CNC, the Y is used for the Y axis of the CNC, the Z is used for the Z axis of the CNC, and the A is used for the acceleration of the CNC itself. The Buffer[6] array will be used to transfer a int to a string .
172

CNC Machine Design Report

Structures: These are structures built within the screen header file to be used as a new type such as integer, string, or character for the purpose of collecting particular information from the microcontroller and sending it to the pendant. TPosition Structure built with the ability to hold the information from all four axes (X, Y, Z, A). It gives the user the ability to access any axis dimension after it stops on the table. TIP Structure gives the user the ability to access addressing information incoming from the Ethernet connection and break down into smaller amounts of information. TMachineParameters Structure gives the user the ability to collect information based upon the users particular job it is currently running such as jog rates, feed rates, speed rates, and acceleration/deceleration. TTCPIPConfiguration Structures uses the TIP structure discussed above to set up the incoming information received through Ethernet into the form xxx.xxx.xxx.xxx where the TIP structure breaks it down into four pieces of information to be displayed in the correct form.

173

CNC Machine Design Report

11.1.4 Screens C Source file:

This souce file is the Main source file that will talk to the Pendent.C code. This file will have the main drawing files and functionality files. The commands in this file are: DrawMainScreen() DrawMainSubScreen() DrawOffsetSubScreen() DrawParametersSubScreen() DrawSoftLimitsSubScreen() DrawOffsetScreen() DrawMachineParameters () DrawSoftLimits() DrawTCPIPConfiguration() DrawComPort() DrawFileScreen() DrawFileScreen() The DrawMainScreen command will draw our main pendent screen. At the top left of the screen will display the X, Y, and Z coordinates on the CNC and the Acceleration speed which is denoted as A on the screen. At the bottom left of the screen is a 5 limit switch section that is set using circles. When a circle is red that limit is turned off and when it is green it is turned on. At the top right there will be a Jog switch dial that can be changed by the user, and at the bottom right of the screen is the display screen that will tell if the CNC is Running(RUN), Jogging(JOG), or Idle(IDLE).

174

CNC Machine Design Report

X: Y:
-50 50

Z: A:

JOG

The DrawMainSubScreen command is the transition screen from the main screen to all the lower sub-screens. The title will state Subscreens followed below by a drawn line and the five different sets of sub-screens which are offsets, parameters, soft limits, and thumb drive.

Subscreens - Offsets - Parameters

- Soft Limits - Thumb Drive

175

CNC Machine Design Report

The DrawOffsetsSubScreen command can be chosen from the main subscreens menu. It gives the user the ability to choose between the offsets between the different offsets of home position, park position, work offset 1, and work offset 2 with the title of Offsets.
Offsets - Home Position - Park Position

-Work Offset 1 -Work Offset 2

The DrawParametersSubScreen command is chosen from the main sub-screen menu list. Once chosen, it will give the user access to the machine parameters screen, TCPIP configuration screen, and the com port screen.
Parameters - Machine Parameters - TCPIP Configuration

- Com Port

176

CNC Machine Design Report

The DrawSoftLimitsSubScreen command can also be chosen from the main subscreen menu. This screen allows the user to choose between the upper of lower soft limits with the title of Soft Limits.

Soft Limits -Upper Limits -Lower Limits

The DrawOffsetScreen command will draw one of four offset chosen by the user. All screens have the same design except the title will change depending upon which offset screen is chosen which could be home position, park position, work offset 1, or work offset 2. The left side of the screen is titled by the words Set Position which are the positions that the machine is currently using for the offset which was chosen. Underneath the title, the four axes are shown with the corresponding positions next to them. On the right side of the screen, there is a title that says Current Pos which allows the user to change the offset on the set position to the current position on which the machine has just stopped on. Underneath the title, there is the variables that correspond to
177

CNC Machine Design Report

each axes position on the machine. Below the left side axes, there is an accept button to allow the user to switch the set to the current positions, and below the right side axes, there is a cancel to stop the action just taken by the user.

Title
Set Position X: Y: Z: A: Current Pos

Accept

Cancel

The DrawMachineParameters command will draw the machine parameters based upon the values the job allows the machine to work at. The screen will carry the title Parameter Screen 1. Below the title, every machine parameter will be displayed with its corresponding value next to it.

178

CNC Machine Design Report

Machine Parameters
Max Speed: Acceleration: Rapid Max: Rapid Min: Deceleration: Jog Speed: Max Jog Speed: Max Feed: Min Feed: Jog Increment:

The DrawSoftLimits command will draw either the upper or lower limits of the machines current job depending upon which the user chooses. The screens title will state which limits the user wants to use. On the left side of the screen, the secondary title will be Set Position, and on the right side of the screen, the secondary title will be Current Pos. Below the left title, there will be labels for each axis dimension followed by its set value. Below the right title, there will just be the values corresponding to the machines current position on the table. Below the left values, there will be an accept button to change the set position to the current position, and below the right values, there will be a cancel button to stop the action just taken.

179

CNC Machine Design Report

Upper Limits/Lower Limits


Set Position X: Y: Z: A: Current Pos

Accept

Cancel

The DrawTCPIPConfiguration command will draw and display the information coming into the machine from the Ethernet connection when used. It will display the title TCP/IP Configuration. It will have a labels under it stating the title of the information being uploaded from the outside connection with each labels information below it displayed in the form xxx.xxx.xxx.xxx.

180

CNC Machine Design Report

TCP/IP Configuration
Ip Address xxx.xxx.xxx.xxx Subnet Mask xxx.xxx.xxx.xxx Default Gateway xxx.xxx.xxx.xxx

Primary DNS xxx.xxx.xxx.xxx Secondary DNS xxx.xxx.xxx.xxx

The DrawComPort command will draw and display information incoming to the machine from its serial ports. At the top, it will display the title Com Port and underneath say Communications. Below the title will be the first label for baud rate and its information right underneath the title. The next title will be for the stop bits, and after the title, there will either be the words one stop bit, one and a half stop bits, or two stop bits depending upon what information the pendant receives. Below this title, there will be a title for the ports flow control followed by either the words none, hardware, or Xon/Xoff depending upon what form of information flow the machine receives. The next title will show parity within the incoming information. It can detect if the information has no parity, odd parity, or even parity. The final two titles will be display information if the flow control is using the Xon/Xoff format. The first title will be for Xon character and the second title will be for the Xoff character.

181

CNC Machine Design Report

Com Port Communications


Baud Rate

Stop Bits: Flow Control: Parity:

Xon Char: Xoff Char:

The DrawFileScreen command will display the file directories from the uploaded jump drive. It will have the root title of the jump drive at the top of the screen. Below the title, there will be the folder icon followed by its name. Below this, there will be the file icon followed by a list of each file name displayed after and continuing below. If the page isnt big enough to fit all files, the remaining files can be found below the file screen by using the up and down buttons.

182

CNC Machine Design Report

Root:

Folder Name

File Name

11.1.5 Support Source File:

This file is used to support the functions inside the CNC. These functions are public to all source files. IntToString() The IntToString command will change a Integer to a String. This command is being used to change the position for the X, Y, Z, and A into a string to be printed on the LCD Screen. This command is what uses the Buffer[6] array from the Screens.h. The function of this command takes each integer that is given from the CNC and divides it first by 1000 until it cant be divided anymore and it is incremented into an integer character. It does this process all the way down to 1. For example, if we had 21.02 as the number it divides first by 1000. It can divide it 2 times so it increments the character to 2 and places it in the first array block. It then divides it by 100 and the number can be divided only once so it increments the 2nd array block to 1. The third block becomes a . so it splits the numbers into its appropriate value. The next number is 0 so the dividing by 10 is skipped so it places a 0 in the fourth array block. Finally the last number is 2 so it is divided by 1.

183

CNC Machine Design Report

The character array block is incremented to 2 so the string then becomes 21.02.
Integer 2 1 . 0 2 String 2 1 . 0 2

**Image taken from Windows XP Database

12. APPENDIX C
12.1.1 Test Data 12.1.1.1 Low Voltage Power Supply 12.1.1.1.1 Voltage Measurement 12.1.1.1.1.1 Input Voltage Measurement

Test 24 Vdc Input +12 Vdc Input -12 Vdc Input

Nominal (VDC) 40 20 -20

Actual (VDC) 41.90 19.96 -22.00

Tolerance (VDC) <50 <25 >-25

12.1.1.1.1.2 Output Voltage Measurement

Test 24 Vdc +12 Vdc -12 Vdc 5 Vdc

Nominal (VDC) 24 12 -12 5

Actual (VDC) 24.00 11.96 -11.99 5.03

Tolerance (VDC) 5% (22.8 to 25.2) 5% (11.4 to 12.6 5% (-12.6 to -11.4) 5% (4.75 to 5.25)

12.1.1.1.2 Voltage Ripple Measurement 12.1.1.1.2.1 Input Ripple Measurement

Test 24 Vdc Input

Nominal -

Actual (V pk-pk) 2.5

Tolerance (V pk-pk) <= 1


184

CNC Machine Design Report

+12 Vdc Input -12 Vdc Input

.75 .80

<= 1 <= 1

12.1.1.1.2.2 Output Ripple Measurement

Test 24 Vdc +12 Vdc -12 Vdc 5 Vdc

Nominal -

Actual (mV pk-pk) 2V 150 150 110

Tolerance (mV pk-pk) < 600 < 300 < 300 < 150

12.1.1.1.3 Slow Turn On

Test +12Vdc -12Vdc 5Vdc

Nominal (Seconds) 15 15 15

Actual (Seconds) 25 15 16

Tolerance N/A N/A N/A

12.1.1.2 Optical Isolation Measurements

12.1.1.2.1 Response Time Measurements 12.1.1.2.1.1 Optical Isolator Response Time

Test ENABLE (J1-13) GND (J1-14)

Frequency(kHz) 1

Rise Time Nominal -

Fall Time Nominal -

Actual(us) Rise | Fall 80|60 | |

Tolerance (us) < 100 < 100 < 100


185

CNC Machine Design Report

RESET (J1-15 ) GND (J1-16) MS1 (J1-17 ) GND (J1-18) MS2 (J1-19 ) GND (J1-20)

80|60 | | 80|60 | | 80|60 |

< 100 <100 <100 < 100 <100 <100 < 100 <100

186

CNC Machine Design Report

12.1.1.2.1.2 Optical Couplers Response Time

Test X-DIR(J1-3 ) GND (J1-4)

Frequency(kHz) 1 10 100 1MHz 1 10 100 1MHz 1 10 100 1MHz 1 10 100 1MHz 1 10 100 1MHz 1 10 100 1MHz

X-STEP (J1-1) GND (J1-2)

Y-DIR (J1-7 ) GND (J1-8)

Y-STEP(J1-5 ) GND (J1-6)

Z-DIR (J1-11) GND (J1-12)

Z-STEP (J1-9 ) GND (J1-10)

Rise Time (ns) Nominal -

Fall Time (ns) Nominal -

Actual (ns) Rise | Fall 23|5 33|5 28|10 30|10 23|5 33|5 28|10 30|10 23|5 33|5 28|10 30|10 23|5 33|5 28|10 30|10 23|5 33|5 28|10 30|10 23|5 33|5 28|10 03|10

Tolerance (ns) < 100 < 100 < 100 < 100 <100 <100 < 100 <100 <100 < 100 <100 <100 < 100 < 100 < 100 < 100 <100 <100 < 100 <100 <100 < 100 <100 <100

187

CNC Machine Design Report

12.1.1.2.2 Frequency Response Measurements 12.1.1.2.2.1 Optical Isolator Frequency Response

Test Pins ENABLE (J113) GND (J1-14) RESET (J1-15 ) GND (J1-16) MS1 (J1-17 ) GND (J1-18) MS2 (J1-19 ) GND (J1-20)

Frequency(kHz) 1

High(VDC) Nominal 5

Low(VDC) Nominal 0

Actual(VDC) High | Low 5|.010 | | 5|.010 | | 5|.010 | | 5|.010 | |

Tolerance (VDC) High | Low >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3

188

CNC Machine Design Report

12.1.1.2.2.2 Optical Coupler Frequency Response

Test Pin

Frequency(kHz)

High(VDC) Nominal 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

Low(VDC) Nominal 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Actual High | Low 3.80|-.30 3.80|-.30 3.75|-.25 3.63|-.25 3.80|-.30 3.80|-.30 3.75|-.25 3.63|-.25 3.80|-.30 3.80|-.30 3.75|-.25 3.63|-.25 3.80|-.30 3.80|-.30 3.75|-.25 3.63|-.25 3.80|-.30 3.80|-.30 3.75|-.25 3.63|-.25 3.80|-.30 3.80|-.30 3.75|-.25 3.63|-.25

X-DIR(J1-3 ) GND (J1-4)

X-STEP (J1-1) GND (J1-2)

Y-DIR (J1-7 ) GND (J1-8)

Y-STEP(J1-5 ) GND (J1-6)

Z-DIR (J1-11) GND (J1-12)

Z-STEP (J1-9 ) GND (J1-10)

1 10 100 1MHz 1 10 100 1MHz 1 10 100 1MHz 1 10 100 1MHz 1 10 100 1MHz 1 10 100 1MHz

Tolerance (VDC) High | Low >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3 >= 0.7 | <= 0.3

189

CNC Machine Design Report

12.1.1.3 Motor Power Supply 12.1.1.3.1 Voltage Measurement 12.1.1.3.1.1 Output Voltage Measurement

Test Vm (No Load) Vm(Full Load) Vm (Transient Voltage Spikes)

Nominal (VDC) 45 40 -

Actual (VDC) 45.9 40.0 52

Tolerance (VDC) 12 < Vbb < 48 12 < Vbb < 48 < 55

12.1.1.3.1.2 Voltage Ripple Measurement

Test Vm (No load)

Nominal -

Actual(V) .250

Tolerance (V pk-pk) <= 1

12.1.1.4 Voltage Reference 12.1.1.4.1 Voltage Measurement

Test X-Vref Y-Vref Z-Vef

Nominal (VDC) Adjustable .6880 to 1.6168

Actual (VDC) .6970 to 1.6210 .6975 to 1.6180 .6960 to 1.6205

Tolerance (VDC) .6192 to 1.7785

12.1.1.5 Driver Outputs to Controller

Test Driver Board Ready Vbb Good Signal Fault Signal

Nominal (IDC) Steady State 533uA 533uA No Fault | Fault 2.2mA | 0

Actual (IDC) Steady State 540uA 552uA 2.2mA/0

Tolerance (IDC) Steady State (525 to 652) uA N/A

12.1.1.6 Fuse Blown Indicators

Test Fuse Blown Indicators +12 Vdc -12Vdc 24Vdc

Nominal PASS PASS PASS

Actual PASS PASS FAIL


190

CNC Machine Design Report

12.1.2 Calculations Section 12.1.2.1 Voltage Regulator (5 Vdc supply)

Calculations and Graphs for determination of input supply using Matlab are shown below. The determination of the VREG1 was determined by the supply requirements. Supply Current Requirement of VREG1 1. 2. 3. 4. Driver = 10mA*3 Chips Opo-Coupler=5mA*6 Chips Opo-Isolator=4mA Vbb Protection=1mA

Total Current = 65mA _________________________________________________________________________


% Volatage Regulator 5Vdc % Determination of the the input supply to the 5Vdc Regulator Rthja=100 Vp=6:1:22; Vreg=5 Tamb=20; Ireg=(150-Tamb)./(Rthja.*(Vp-Vreg)); figure(1) plot(Vp,1000*Ireg) title('Maximum Output Current at Different Input Voltages to VREG1'); xlabel('Input Voltage To VREG1 (V)'); ylabel('Ouput Current (mA)');

191

CNC Machine Design Report

% Volatage Regulator 5Vdc % Maximum output of Regulator Rthja=100 Vp=12 Vreg=5 Tamb=0:1:175; Ireg=(150-Tamb)./(Rthja*(Vp-Vreg)); figure(2) plot(Tamb,1000*Ireg) title('Maximum Output Current of VREG1 with Volatge Input set at 12V'); xlabel('Temperature (Celsius)');

192

CNC Machine Design Report

ylabel('Ouput Current axis([0 175 0 250]);

(mA)');

193

CNC Machine Design Report

12.1.2.2 Voltage Regulators (+-12, 24 Vdc Supplies)

V out

R (I I )*R ref 1 ref adj 2 R V V V * 1 I *R out ref ref R adj 2 2 R 1 V 1 ref R 2 V out V ref R 1

(1)

V out

adj

*R

( 2)

( 2)

V ref I adj

(3)

Let R 1 For Vout For Vout For Vout

240 , Vref 12Vdc 12Vdc 24Vdc

1.25V, I adj R2 R2 R2 2.05k 2.05k 4.32k

50uA

194

CNC Machine Design Report

12.1.2.3 Voltage Reference Circuit

Calculates the value of and for a given supply voltage and minimum voltage .

, sense resistor

RD

VD

RC VMIIN x VD x

(1) 1

RM

RD

RC

(2)

Where x

I*RD

VD

VMAX

VD

I trip (m ax) * 8R S

Calculates the value of VSET when values of

and

are selected.

195

CNC Machine Design Report

Let R R R

R T

D R

Rf R C

R m C R Rf (ohm/turn) * X Rf Rf (ohm/turn) * X Rc Rc

V SET

I (R T C V D R T

(3)

where I

V SET V SET

V V D D T R R R (ohm/turn) * X Rf Rf Rf V D ((ohm/turn ) *X R ) Rc Rc m R (ohm/turn) * X Rf Rf V (X SET Rf 1,X Rc ) V (X SET Rf 0,X Rc )

(4)

(5)

*See Voltage Reference Circuit

Calculations for Voltage Reference Circuit for Rd and Rm using Matlab. 12.1.2.3.1

Vd=12; %supply voltage Itmax=4.7; % Maximum Trip Current Rs=.0430 ; % Sense Resistor plus trace resistance Rc=2*10^3; % Coarse Adj resitsor display(' When Vmin=.688') Vmin=.688; x=Vd-(Itmax.*(Rs*8)); Rd= Rc./(((Vd-Vmin)./x)-1)
196

CNC Machine Design Report

Rm= (Rd.*(((Vd)./x)-1))-Rc Itmin=Vmin./(Rs*8) Vmax=Itmax.*(Rs*8) Itmax=Vmax./(Rs*8)

When Vmin=.688 Rd = 2.2358e+004 Rm = 1.4815e+003 Itmin = 2 Vmax = 1.6168 Itmax = 4.7000

12.1.2.4 Optical Isolator

Ic

Vcc Vout Rc Vin Vf If

(1)

Rd

(2)

Let Vin 3.3V, Vf Rd 1.150 k Let Vcc Rc 5V , Vout 10 k

1V, If

2mA

0V , Ic

.5mA

197

CNC Machine Design Report

12.1.2.5 Optical Coupler

Rd
Let

Vin Vf If
Vin 3.3V, Rd 1 k

(1)
Vf 1V, If 2.3mA

12.1.2.6 Vbb Protection Circuit

V Rs I

trip

(1)

trip

Vtrip

65mV , I trip Rs R80 1

65mA

12.1.2.7 Input Filter Capacitor

load 2 * f *V ripple

(1)

12.1.2.7.1 Low Voltage Power Supply

Let I

100mA, load C 416uF F

120Hz,

ripple

1V

198

CNC Machine Design Report

12.1.2.7.2 Motor Voltage Power Supply

Let

8.4 A, load C 35mF F

120Hz,

ripple

1V

12.1.2.8 Fuse Blown Indicator

VUREG VLED I I 2R

(1)

(2)

12.1.2.8.1 +-12Vdc Fuse Indicator

Let VMOSFETS R R59

0, VUREG R61 4.0k 1/ 8 W

22V, V LED

1.6V, I

5mA

P 100mW

per resistor

12.1.2.8.2 24Vdc Fuse Indicator

Let VMOSFETS

0, VUREG

44V, VLED

1.6V, I

4.5mA

R 9.40k R R60 R62 2 P 95mW 1/ 8 W

4 .7 k

per resistor

12.1.2.9 Driver Outputs Tests were conducted to determine a more accurate value of data required. The test setup is shown in figure ___.

199

CNC Machine Design Report

Ic

Vcc

Vout Rc Vf If

(1)

Rd

Vin

( 2)

Vin was adjusted until a value of approximately 1 Volt was seen on the output (Vout).

Rc 10k Rd 1.15k
Data used to calculate the Driver Output signals: Board Ready Signal and Vbb Ready Signal.

VIN

1.66V, VOUT If 533uA

1.060V, Vf

1.047V

I SET

Ic 394uA Note : Output Current on Optical Isolator must provide 394uA. Power Supply to optical isolators on Controller Board is 3.3V Rc 5.685k Note : Tolerancelimits For I SET are 533uA to 652uA

12.1.2.9.1 Driver Board Ready Signal

R72

12 Vf I SET

R72

20.5k

R72 wasset to 20k


12.1.2.10 12.1.2.11

I SET

547uA

200

CNC Machine Design Report

12.1.2.12 12.1.2.12.1 Vbb Ready Signal

Let Vx 15V, Vbb Vbb Vx R69 Vx R70

40V, Vf

1.047V, ISET

533uA, I R69

534uA, I R71 1uA

Vx Vf R71 Vbb R 69

(1)

Vf R 71

ISET

Vx Vf R71

1 R 69

1 1 R 70 R 71 R 71

Vf (2)

R 69 R 71 R 70

Vbb Vx I R 69 Vx Vf I R 71 Vx I R 70

46.816k 26.178k

15M

201

CNC Machine Design Report

Componets set : R69 I SET 534.6uA I R 69 I R 70 R 70 538.8uA 4.2uA 3.5714M

46.4k, R71 26.1k

Componets set : R70

3.57M

Final Circuit Component values and circuit conditons : R69 46.4k, R71 26.1k6R70 Vbb R 69 1 R 69 Vf R 71 1 R 70 542uA 3.57M

(1)

Vx

1 R 70 I SET

Vx

15.0975V

12.1.2.12.2

Fault Signal

(2)

R81

5 1.047 2mA

1.9765k

2k

202

CNC Machine Design Report

12.1.3 List of Figures

Vd

Rd

Rf Vref Vset Rc Vref = Vset

Rm

12.1.3.1

Figure 34 Voltage Reference Simplified Circuit Diagram

203

CNC Machine Design Report

Vcc

Rd Vin Vf

Ic

Rc

If

Vout

12.1.3.2

Figure 35 Optical Isolator Circuit Diagram

204

CNC Machine Design Report

Vin LM317, LM377

Vout Iref

Vref Iadj

R1

R2

12.1.3.3

Figure 36 Voltage Regulator Simplified Circuit Diagram

205

CNC Machine Design Report

12.1.4 Simulations

Figure 37 Motor Voltage Simulation

206

CNC Machine Design Report

Figure 38 Simulation # 1: Motor Voltage Ripple at Normal Load (3.3 A)

207

CNC Machine Design Report

Figure 39 Simulation # 2: Motor Voltage Ripple at Full Load (8 A)

208

CNC Machine Design Report

Figure 40 Fuse Blown Test for 12Vdc and -12Vdc

209

CNC Machine Design Report

Figure 41 Fuse Blown Test for 24Vdc

210

CNC Machine Design Report

Figure 42 Low Voltage Power Supply Transient Analysis

211

CNC Machine Design Report

Figure 43 Low Voltage Power Supply Input Filter Capacitors Voltage Ripple

212

CNC Machine Design Report

Figure 44 Low Voltage Power Supply Ripple Rejection: +5Vdc (yellow), 12Vdc (green), -12Vdc (blue)

213

CNC Machine Design Report

13. References [1] dsPic30F3013 Data Sheet http://ww1.microchip.com/downloads/en/DeviceDoc/70139C.pdf [2] Goldelox-SGC Command Set: Software Interface Specification http://www.4dsystems.com.au/downloads/Semiconductors/GOLDELOXSGC/Docs/GOLDELOX-SGC-COMMANDS-SIS-rev2.pdf

214

Você também pode gostar