Laser PCB Milling Machine - Department of Electrical Engineering
Transcription
Laser PCB Milling Machine - Department of Electrical Engineering
Laser PCB Milling Machine Group 18 Nathan Bodnar David Dowdle Ryan Maticka Spring 2010 May 3, 2010 Table of Contents: SECTION 1: Executive Summary ...................................................................................... 1 SECTION 2: Motivation ..................................................................................................... 2 SECTION 3: Technical Objectives and Goals.................................................................... 3 SECTION 4: Specifications and Requirements .................................................................. 4 SECTION 5: Research and Investigations .......................................................................... 7 5.1 – Burn Test ............................................................................................................................. 7 5.2 – Laser Safety ......................................................................................................................... 9 5.3 – Air Scrubbing ..................................................................................................................... 11 5.4 – Similar products ................................................................................................................ 12 SECTION 6: Laser System ............................................................................................... 13 6.1 – Types of Lasers .................................................................................................................. 13 6.1.1 – Previous Design ............................................................................................................. 14 6.1.2 – Current Design ............................................................................................................... 21 6.2 – Prototype/Test .................................................................................................................. 21 6.3 – Build .................................................................................................................................. 23 6.4 – Evaluation plan ................................................................................................................. 23 SECTION 7: Laser Power Supply Unit ............................................................................ 25 7.1 – Previous Design................................................................................................................. 25 7.1.1 – Rectification ................................................................................................................... 25 7.1.2 – DC to DC Converter ........................................................................................................ 26 7.1.3 – Switching ........................................................................................................................ 26 7.1.4 – LC filter ........................................................................................................................... 28 7.1.5 – Controller ....................................................................................................................... 30 7.2 – Current Design .................................................................................................................. 31 7.2.1 – DC to DC Converter ........................................................................................................ 31 7.2.2 – Switching ........................................................................................................................ 32 7.2.3 – Controller ....................................................................................................................... 33 7.3 – Prototype/Test .................................................................................................................. 33 7.4 – Build .................................................................................................................................. 34 7.5 – Evaluation Plan ................................................................................................................. 34 SECTION 8: TEC Power Supply Unit ............................................................................. 35 8.1 – Design ............................................................................................................................... 35 i 8.1.1 – Rectification and DC to DC Conversion .......................................................................... 35 8.1.2 – Cooling Control .............................................................................................................. 35 8.2 – Prototype/Test .................................................................................................................. 36 8.3 – Build .................................................................................................................................. 36 8.4 – Evaluation Plan ................................................................................................................. 37 SECTION 9: Q Switch...................................................................................................... 38 9.1 – Types of Q Switches .......................................................................................................... 38 9.2 – Previous Design................................................................................................................. 40 9.2.1 – Q Switch High Voltage Power Supply ............................................................................ 41 9.2.2 – Q switch Fast FETs ......................................................................................................... 47 9.3 – Current Design .................................................................................................................. 49 9.4 – Prototype/Test .................................................................................................................. 49 9.5 – Build .................................................................................................................................. 51 9.6 – Evaluation Plan ................................................................................................................. 51 SECTION 10: Motors and Motor Controller Unit ............................................................ 52 10.1 – Design ............................................................................................................................. 52 10.2 – Prototyping and Testing ................................................................................................. 56 10.3 – Building ........................................................................................................................... 56 10.4 – Evaluation Plan ............................................................................................................... 56 SECTION 11: XY Table ................................................................................................... 58 11.1 – Design ............................................................................................................................. 58 11.2 – Prototype/Test ................................................................................................................ 60 11.3 – Evaluation Plan ............................................................................................................... 61 SECTION 12: Microcontroller ......................................................................................... 62 12.1 – Design ............................................................................................................................. 62 12.2 – Prototype/Test ................................................................................................................ 66 12.3 – Build ................................................................................................................................ 68 SECTION 13: Software .................................................................................................... 69 13.1 – Design ............................................................................................................................. 69 13.2 – Prototype/Test ................................................................................................................ 91 13.3 – Evaluation Plan ............................................................................................................... 93 SECTION 14: Security ..................................................................................................... 95 SECTION 15: Personnel ................................................................................................... 98 15.1 – Nathan Bodnar ................................................................................................................ 98 ii 15.2 – David Dowdle .................................................................................................................. 98 15.3 – Ryan Maticka .................................................................................................................. 98 SECTION 16: Bibliography ............................................................................................. 99 SECTION 17: Facilities and Consultants ....................................................................... 102 SECTION 19: Budget and Financing ............................................................................. 103 SECTION 20: Milestone................................................................................................. 104 SECTION 21: Project Summary ..................................................................................... 105 APPENDIX A: Copyright Notices ................................................................................. 108 A.1 – jPicUsb License ............................................................................................................... 108 A.2 – gerb2tiff License ............................................................................................................. 108 A.3 – ImageMagick License ...................................................................................................... 114 APPENDIX B: Example DRL File................................................................................. 116 APPENDIX C: Password Generation Code ................................................................... 117 APPENDIX D: jPicUsb Documentation ........................................................................ 118 iii SECTION 1: Executive Summary This goal of this project was to replace the current milling machine used by senior design students. The main reasons that motivated us for replacing the current milling machine are the cost factor for the replacement of the milling bits and its safety. These cost factors, along with the amount of user errors need to be improved. Therefore, this project utilizes a new design using a high powered Nd:YAG laser. The laser light is used to mill the printed circuit boards allowing for tool-less machining. This reduced the cost load of maintaining a rapid printed circuit board prototyping machine. This process will also avoid some of the safety issues involved with the old milling machine, which included having fiberglass debris flying everywhere and the openness of the rotary blades cutting the copper clad boards. This project consists of building the high powered Q Switched second harmonic Nd:YAG laser and the control units to power it. The project also includes the designing and building of a XY table to move the laser light to the target copper substrate. The designs for this venture also incorporate safety throughout the electronics. This will prevent the users from causing damage to the machine and to protect the user. The software is engineered to allow the user to engrave away the copper using either a Gerber file or a bitmap Portable Network Graphics (PNG) file. This will allow the senior design student to have the opportunity to utilize any design software that they choose and be able to mill their circuit board. This is something that the current milling machine cannot do. The framing of the machine incorporates a safety viewing window that will allow the senior design student to view their work as the laser mills the board out. The cost of the parts for this project has been funded by the group. Attempts were made to try to acquire donations for the parts required to build this machine. The budget for this adventure was around three to eight thousand dollars. The budget was estimated from what the parts would cost if they were bought new from the manufacture. The team worked to acquire the materials through used and surpluses stores and through the online provider of eBay. These materials greatly reduced the cost of this project. 1 SECTION 2: Motivation The motivation for this laser PCB etcher is the constant down time of the TTech Quick Circuit 5000 PCB milling machine in the senior design lab. As two of our group are ARC members, and are tasked with keeping the machine repaired and running, we have found this to be an increasingly difficult task. In just the last year we have had to replace the lead screw, and are currently in the process of replacing the main spindle motor. These problems resulted from two areas: ignorance and fatigue. The lead screw only needed to be replaced because someone thought it would be a good idea to oil it. As the very large stickers warn, lead screws are not meant to be oiled. If the plastic shavings that were everywhere was not an indication that something was wrong, the horrible screeching noise would have. This case of ignorance on the part of a senior design student caused several months of down time as we needed to first search for the part, find funding for the part, and have that part replaced. The spindle motor has simply worn out because of fatigue. These things happen, but this particular part is very expensive and has been particularly difficult to find funding for. Our project intends to take care of both of these problems. It will be left with the amateur radio club when we are finished to be used by future senior design students. Ignorance has been solved through security and training. The current milling machine is in a locked room, inside another locked room, but this was not enough to keep it from being damaged. Our project will take this further in that our project is completely contained and monitored. There is no interaction with the machine without first having enrolled in senior design, and being certified by an ARC member. The certification will only come at the end of an intensive training session that we will develop as part of the project. At this time the user is granted a username and password that will determine their level of access to the machine. We are taking a hierarchical approach to security in this regard. No one will have access to a part of the machine that they do not need access to, and have not been trained in the proper use and maintenance of. For the standard senior design student this will equate to being able to open the main lid, and nothing else. The compartments storing the lasers, most of the optics and all of the electronics is sealed. Fatigue is solved through less moving parts. In fact, the only moving part of our project is the XY table to do the etching. The XY table, unlike the current system, is driven by stepper motors attached to a belt system. The motors were purchased from an online retailer for a reasonable price. In this project, the main thing that can break is the laser parts. Spare parts were purchased that will be required to keep our project in operation for many years. 2 SECTION 3: Technical Objectives and Goals Our goals for this project were that the finished machine is safe, reliable, and timely. This was accomplished through the extensive use of sensors for everything from an overheated diode to a user trying to force the machine open at the wrong time. Mediation schemes are in place for as many scenarios that we can think of. When higher level reasoning is required, the information is passed off to the computer based software portion of our project and the decision relayed. This is only used for the less immediate concerns, however. All of the lower level decisions are computed on chip in the project itself. Any part that goes out of specification or if a sensor requires immediate attention, the entire project will enter a programmed shutdown that will attempt to reduce the negative effects on the hardware. This is the default case if an unexpected error is reached. We attempted to meet the goal of reliability through the use of high quality components and through the reduction of moving parts. The use of a laser will further meet the goals of reliability and timeliness. By the very nature of our design, we do not have any need to change bits. This allows us to reach our reliability goal in that very few people will be able to access the laser portion of the project. As with any system, the less people that have access to it the less likely someone is going to try and tamper with it. In the current setup, everyone has access to the bits and often load them wrong, or chose the wrong one for the current job. While it is true that our project did take a little over double the amount of time as the current machine to remove all the copper from a standard sized board, we have the advantage of not requiring a user’s constant input. It will be entirely possible for a user to start the etch process in the morning, go to all of his or her classes and come back at a later time to find one entire side of their board finished. All they will need to do is flip the board over at the appropriate time. The function of this project is to replace the current milling machine used by senior design students. This is accomplished through the use of a focused high powered green laser. Furthermore, our project can not only be able to etch the copper off of the printed circuit boards, but can also cut the fiber glass substrate of the boards. This avoids the safety issues of using a shear or rotary saw to cut prototypes out of the master board and allow holes for through hole components to be made during the main etch process. 3 SECTION 4: Specifications and Requirements The specifications outlined below were defined in large part to satisfy the desires of our sponsor. The milling machine has features appropriate for use in an undergraduate setting for senior design students. The software of this project is quite significant. It is able to handle communicating with microcontrollers, large input files, and running on a wide variety of hardware. It is also be responsible for providing users and technicians with an interface to work with or on the machine. • Software o XY Table Allow positioning of board Import images Import Gerber Store previous boards Remember previous board cuts Checks safety measures o GUI for Laser Standard Users (Senior Design Students) • Allows the milling of FR-4 boards only • Allow only two boards to be milled • Cannot add boards • Must follow all safety measures • Cannot add any user Advanced Users (non-Senior Design Users) • Users may have privileges from some but not all of advanced users settings • Can be created from Administrators or Experienced Users • Cannot add any users Experienced Users (Arc Trainers) • Allow the addition of boards • Allow the modification of unique sized boards • Allow control of laser power • Allow the selection of different PCB materials • Must follow all safety measures • Can add Standard and Advanced Users • Can remove any Standard or Advanced User • Can change user access to all but Administrator and Experienced Administrator (Laser Experienced Service Technicians) • All safety measures can be over written 4 • • Can create all users Can remove a user or change access level The XY table is the only main moving part of this project. This table is responsible for moving the mirrors and lenses around, collectively called the milling head, and is able to reach the entire board. • XY Table o Belt driven o Stepper motors with encoders for positions o Capable of a maximum board size of 12 in by 12 in The laser is the heart of this project. Copper is removed from the printed circuit boards through the power of this laser and the supporting structures alone. Therefore, a laser is used that is powerful, relatively cheap, and easy to find to allow for backups to be reasonably attainable. • Laser o 5 W @ 532 nm o 15 W @ 1064 nm o Q-switched o Solid State Diode 808 nm, 40 W o Nd:YAG o KTP (KD*P) • Optics o Allow beam waste to be 1 mil o Allow Rz to be 0.25 in o Directing mirrors to be 532 nm HR 45º, 1064 nm HR 45º o Automatic focusing o Automatic board positioning and aligning o Automatic removal checker o Pixel burning @ 1 kHz o 1 to 2 mm pixel size • Laser Power Supply o Input: 120 V AC, 60 Hz o Output: 730 V DC o Current controlled o Monitoring current o Monitoring laser output • Q-switch Power Supply o Pockel Cell 2.5 kV DC -2.5 kV DC Pulsed with microcontroller • Stepper Motor Power Supply o 12 V DC 5 o H-bridge configuration • Power Management Circuit o Turn on specific devices o Controlled by microcontroller o Emergency power shutdown 6 SECTION 5: Research and Investigations 5.1 – Burn Test Estimating the amount of power required to generate the plasma required to vaporize the copper substrate of a printed circuit board will help in designing the laser for this project. An equation was created to estimate the amount of energy to vaporize the copper substrate. This was created by calculating the volume of the copper target. The next step would be to multiply this value with the density. This value was then multiplied by the molar mass and the heat of vaporization constant for copper. This value was then used to estimate the total energy required to vaporize the copper. This value was then multiplied with the absorption spectrum and the graph below shows the amount of energy to vaporize the copper substrate depending on the wavelength (Figure 5.1). Energy to Vaporize Copper 35 30 Power (mJ) 25 20 15 10 5 0 1048 848 648 448 248 W avelength (nm) Figure 5.1: Graph of energy required to vaporize copper for given wavelength A testing laser was used to verify the graph. The laser used was a second harmonic Nd:YAG laser. The laser was flash tube based with a pulse duration of around 10 ns. The pulse energy ranged from 0.7 mJ to around 2 mJ. The laser was the YG580 series Active Q switched Nd:YAG laser from Quantel. The pulse rate was 10 pulses per second. The target that was used was a printed circuit board that was mounted in a stage to allow minimal movement. This would allow multiple shots to hit the same location. The focusing lens that was used was a convex lens with a focal point of around 100 millimeters. The laser diameter from leaving the laser cavity was about one centimeter in diameter. The target was placed at the focal point and 7 the laser the laser pulses were counted until the laser light exited through the copper target. The number of pulses that were required to vaporize the copper target was about 40 pulses for the 0.7 millijoules and around 30 for the two millijoules. The following photo is the profile of the pulses of the laser hitting the copper target. The profile goes form a single pulse at the right of the image to five pulses, then to ten pulses and continuing this iteration to up to 25 pulses (Figure 5.2). Figure 5.2: Burn testing with second harmonics of Nd:YAG Looking at a close view of one of the shots, it seems that the laser pulse generated copper whiskers. The width of one of the widest whisker measured to be around one micron. The comparison of this size to the size of the hole is around 25 times its thickest width. This would be apparent that these whiskers should not be a problem for the milling process of the printed circuit boards. The following image is the crater that was generated from having the laser pulse hitting the printed circuit board (Figure 5.3). It can also be seen that for one of the firings that there was a misalignment and another pulse was shot below the original spot. Figure 5.3: Close up view of the burn test 8 5.2 – Laser Safety The laser system that this project will employ is a class four laser. When the laser is enclosed in a sealed environment that has interlocks and other preventive measures, the laser class will drop to a class one. When the laser is being serviced the laser will change its class back to a four. This is what is characterized by the Federal Laser Product Performance Standard and the ANSI Z136.1. There are numerous signs that will need to be placed along the project. The first sign will indicate that the project is a Class one laser. This is a yellow and black caution sign. The following image will show the layout of this sign (Figure 5.4). ! CAUTION LASER RADIATION DO NOT STARE INTO BEAM Enclosed Nd:YAG, 532nm, 10mJ, 40ns CLASS 1 LASER Figure 5.4: Laser Safety Label for exterior case of project The next sign that is placed is in the material processing area. This will indicate that a class 2A laser is in progress. This is because when aligning up the printed circuit board a low powered 730 nanometer diode laser is present. This will help in indicating the header position. The following image will show the sign that is placed in the material processing area (Figure 5.5). ! CAUTION LASER RADIATION DO NOT STARE INTO BEAM LASER DIODE, 730nm, 100mW CLASS 2 LASER Figure 5.5: Laser Safety Label for Material Processing area The next signs that will need to be placed in the project are in the high powered laser section. Within this section the laser class is a class four. This section will 9 need to have a sign that indicates the laser wavelength output and the power output. There will also need to be a laser sign for the output of the oscillator. The following images are the signs for this section of the laser (Figure 5.6, 5.7). ! DANGER LASER RADIATION WEAR PROTECTIVE EYEWEAR Nd:YAG, 532nm, 10mJ, 40ns LASER DIODE, 808nm, 80W CLASS 4 LASER Figure 5.6: Laser Safety Label for High Power Laser Figure 5.7: Label at exit of High Powered Laser There will have to be safety precautions that will need to be followed as given by the ANSI Z136.1. These safety precautions are necessary to allow the high powered laser to be run as a class one. The following procedures are to run the system as a class one laser. There has to be a protective housing, interlocks on the protective housing, a service access panel, and equipment labels. To run the laser as a class four, the following control measures must be followed. A protective housing, interlocks, service access panel, key control, removable interlock connector, beam stop or attenuator, Activation warning system, laser controlled area, equipment labels, and laser area warning signs. One of the precautions in working with the high powered laser is to wear laser safety glasses. The rating that the glasses that need to be worn are the following ratings that were generated from the ANSI Z136.1 Standard. The OD rating is five OD for 532 nanometers, five OD for 1064 nanometers and greater than four optical densities for 808 nanometers. 10 Since there is high voltage for the Q switch there will have to be warning signs for the high voltage terminal of the Q switch and the power supply that drives the Q switch. The warning sign is as followed (Figure 5.8). DANGER HIGH VOLTAGE Figure 5.8: Warning Sign for the High Voltages need for the Q switch 5.3 – Air Scrubbing Since the process in generating vaporized copper plasma creates particulates that can be considered as a hazard to the health of the user, the vapors from this process must be processed in a manor that will protect the user. There are two types of scrubbing schemes used to purify the pollutants from the system. The fist type of system is illustrated below; this is a wet scrubber (Figure 5.9). Figure 5.9: Wet scrubbing of polluted air (Permission granted Wikipedia.com) 11 This process works by injecting the contaminated air with small water droplets. The droplets generate a static charge and pull debris out of the air. The biggest problem with this type of system is that the partials that can be collected range for 20 microns down to two microns [1]. This process will also generate a lot of waste water and give off a great deal of moisture. This process would work great for systems were the output of the system exits to the outside of the building. For this project this process would not work. The next option would be to use dry scrubbers. The main compound for collecting the pollutants generated through this system would be active carbon. The only downside of using active carbon is that the larger particles will clog the scrubber and reduce the efficiency. The best method would be to include a pre-filter that would collect the larger debris. For the initial design of this project there is no filtration during this stage. During the second revision then this system may be employed. 5.4 – Similar products While researching this topic there were some manufactures that currently use lasers to mill printed circuit boards. The leading manufacture for this is LPKF [2]. There system uses a 1064 nanometer laser to etch the boards. The system that they use also using gravimeters to move the laser light to the target on the copper clad board. Another alternative to etching the copper substrate from the board is to coat the boards with an opaque polymer and using a CO2 laser to remove the polymer. The newly prepared boards are then chemically etched. This process is something that this group currently employs in creating circuit boards. Another method of creating the printed circuit boards is to use mechanical methods to remove the copper substrate. This is the method that is currently employed for the senior design students. In previous senior design groups a similar project was created [3]. There project consisted of taking a one watt 808 nanometer laser diode and attaching it to an XY table. When etching occurred the XY table would move the laser and its optics to the location and the laser would turn on. This project compared to the previous project is that the pulse energy is much greater. The power of the laser diode that is being used for this projects laser system compared to that of the previous system is about 80 times greater. This will allow this laser system to be able to mill away the copper substrate. 12 SECTION 6: Laser System 6.1 – Types of Lasers The two common lasers that are used in industry for material processing are the CO2 laser and the Nd:YAG laser. The CO2 laser works by exciting a mixture of gas that contains CO2 with a high voltage or with microwaves. The output of the CO2 laser is around ten microns. For copper this wavelength is over 98 percent reflective. Using a CO2 laser would require very high power design to allow the two percent that is absorbed to vaporize the copper target. The Nd:YAG laser is created by exciting a neodymium doped rod of the crystal yttrium aluminum garnet. The main output frequency that this laser generates is 1064 nanometers. This too, is highly reflective for copper with a reflectivity of 96 percent. The big advantage to the Nd:YAG lasers is that there are nonlinear optics that can generate harmonics of the fundamental wavelength of this laser. For the second harmonic of 532 nanometers, the reflectivity of copper drops down to 45 percent. This will allow 55 percent of the laser pulse to be absorbed and will allow the laser to run at much lower powers than if just the fundamental wavelength would be used. The conversion to generate the second harmonic is not perfect and the best efficiency in generating the harmonic is 45 percent of the fundamental wavelength. If the third harmonic of the fundamental would be used the reflectivity drops down to 35 percent. The only problem with generating this third harmonic is that the conversion efficiency drops to at best 30 percent of the fundamental wavelength. For third harmonic generation, the process requires multiple nonlinear optics to generate it. The reason for multiple optics is that the first optic generates the second harmonic and the second nonlinear optic takes the second harmonic and the fundamental and generates the third harmonic. This process becomes even less efficient because it is almost imposable to generate in that laser cavity. So to first generate the fundamental the laser cavity will need to be pumped over 90 percent higher than if the third harmonic would be built in the laser cavity, this is because the standard output coupler is 90 percent reflective. Since the second harmonic can be created in the cavity, it is therefore more efficient to generate the second harmonic in the cavity at a higher power than to user the third harmonic. Nd:YAG lasers can also generate even higher order harmonics, but these conversions waist a numerous amount of the fundamental wavelength energy and are not used for material processing. A new development is being implemented in generating high powered fiber lasers. This design consist of fiber that is doped with some rare earth metals that when excited by a pump laser and placed in a cavity they can generate high powered lasers. The most common fiber doped laser is the Ti:Sapphire. This laser has an output wavelength of around 790 nanometers. The biggest problem with Ti:Sapphire laser systems is that the fiber is hydroscopic and over a short time will need to be replaced regularly. Another type of fiber laser schemes is to use thulium doped fiber. This fiber system generates a wavelength of around two 13 microns. The biggest drawback to this fiber system is that the cost of the fiber being used costs around a thousand dollars per foot. The second drawback is that the laser is in the infrared wavelength that cannot be detectable using standard IR viewers or standard IR fluorescents cards. There is a new type of laser system that is called thin disk laser system. The leading developer in this laser system technology is Trumpf. Thin disk laser system works by generating the doping material to be a 100 micron thick disk. On one side of the disk is a very precise temperature controller. If used, this would generate a higher conversion efficiency. The reason for this higher conversion efficiency is that it reduces the thermal lensing and controls the crystal’s temperature to the ideal range for the conversion of the pump light to the laser’s output light. The doping material that is used for this system is Yb:YAG. This crystal structure generates a wavelength of 1060 nanometers. This is very close the Nd:YAG laser wavelength and this would allow many of the same optics to be used. This would also include the second harmonic crystals. The biggest downside of this system is that because this is a new process, the cost of the thin crystal is very high and the means of accurately controlling the temperature of the disk would be costly as well. The last alternative in laser system design would be to use the laser diode as the fundamental laser and generating the second harmonic wavelength by using another second harmonic generation crystal. The downside of using this schema is that the energy output will reproduce the same as if the laser was running in continues wave mode. Comparing this design in continues wave configuration, the conversion efficiency is very high compared to Nd:YAG. The difference comes when the system is pulsed. Unlike Nd:YAG, this system cannot be Q switched. This will prevent the crystal from dumping all of its energy at once. So to compare the laser output energy, if 80 watts of laser diodes would be used the output energy is around 3.2 microjoules. Comparing this to a Nd:YAG laser the output would be about a thousand time greater. 6.1.1 – Previous Design The laser design used for this project will consist of a second harmonic Nd:YAG Q-switched laser. The second harmonic generation is generated in the cavity. The following layout will show the design of the laser system (Figure 6.1). 14 HR:1064 HT:808 Nd:YAG HR:1064 HT:808 Diode Diode Polarizer HT:1064 HR:532 Q-switch ¼ Wave HR:1064 KTP HR:1064 HR:532 Figure 6.1: Layout of Laser system To generate the fundamental wavelength, a Nd:YAG rod is end pumped with one to two 808 nanometer laser diodes. The diodes chosen for this project are fiber coupled diodes. The output of each diode is rated for 40 watts of laser light output. The manufacture of the diodes is Coherent. The reason that these diodes were used was because they are commonly available on eBay. If the diodes were bought from the manufacture, they would have cost over ten thousand dollars each. Also the advantage of using fiber coupled diodes is that the optics required to generate a round beam is much easer than if a non fibered coupled diode is used. The reason is that in order to generate the high power output the diode must be multiple diodes stacked on top of one another. The shape of the output of the stacked diodes reproduces exactly how the diodes were stacked. This would require many optical elements to fix the shape of the beam and the addition of each optic would degrade the power output. The design is to first use only one diode, and if the power output is too low then a second diode is added to increase the pump power. When the two diodes are setup, it is important to prevent the diodes form having the pump laser light from one diode enter the other diode. So when the system is setup, the focal point of the diodes is off center of the crystal rod. This will prevent a large amount of the pumping light that exits the crystal from hitting the other diode. The Nd:YAG rod that is used for this laser was collected from a old range finder that was used on a M1 tank. The rod was bought also from eBay. An alternative crystal that could have been used for this system is the Nd:YVO4. This crystal has the great advantage to have an acceptance pump wavelength that is much wider than Nd:YAG. The disadvantage to this crystal is the pricing for just a small crystal us about four times the cost for a larger Nd:YAG rod. Another disadvantage to this crystal is that the crystal is polarization dependent. The common practice for using Nd:YVO4 is to use it as a low power oscillator and to 15 then use a Nd:YAG rod for an amplifier. This would increase the complexity of this projects design, therefore it is better to stick with using one Nd:YAG than the Nd:YVO4 crystal. The doping proportion of the neodymium is unknown, but comparing it to other rods, it looks to be around 0.7 percent. This is the standard doping used for diode pumping. The Nd:YAG rod will also need to be cooled when it is being pumped this is because the conversion efficiency from the pumping laser light to the laser’s fundamental light is around 45 percent. The crystal is mounted in an aluminum block that will water cooled. As a safety precaution the aluminum heat sink’s temperature will also be monitored. This aluminum heat sink will need to also be about a quarter of an inch longer than the Nd:YAG rod. The reason for the increase in length is that the crystal will start to generate thermal lensing at the ends of the rod. If the heat sink was not longer than the rod the crystal will destroy itself by fracturing at the ends. To generate the second harmonic wavelength a nonlinear crystal is used. There are about four different crystals that are used for this generation. The easiest nonlinear crystal to grow is the Potassium Dideuterium Phosphate (KDP). This crystal is the cheapest second harmonic generation crystal. The downside of using this type of crystal is that it is hydroscopic and the conversion efficiency in generating the second harmonic is temperature dependent. The lasers that use this type of crystal normally need to be continually purged with desiccated nitrogen, or the crystal is placed in a small box that has anti-reflective windows and filled with expensive index matching fluid. The crystal would also need to have a peltier on it to regulate the temperature. If the humidity of the crystal is not low the crystal will start to fog over and the crystal could easily be destroyed by putting minimal pressure on it. This pressure would be the pressure of just mounting the crystal in a heat sink. The crystal also has the issue of aging. When the KDP crystal ages, it darkens and reduces the power output [4]. Another second harmonic generation crystal is the Lithium Triborate (LBO). It does not have the setback of KDP when it comes to being hydroscopic. The LBO crystal also has a conversion efficiency of about three times greater than KDP [5]. The Beta Barium Borate (BBO) second harmonic crystal also is not hydroscopic and has a conversion efficiency of about double that of LBO and six time that of the KDP [6]. BBO crystals also do not need to be temperature controlled like the LBO and KDP because it has a temperate bandwidth of 55 degrees centigrade. Lastly the commonly used second harmonic crystal used today for the green laser pointers is the Potassium Titanyl Phosphate (KTP). The reason that this crystal is used is that it has a conversion efficiency of 15 times greater than the KDP [7]. It also is not hydroscopic and has a large working temperature range from 25 degrees centigrade to 80 degrees centigrade. The biggest problem with KTP crystals is that the cost of generating large crystals is much greater than KDP. So the general rule is that if a long crystal is needed than a KDP crystal is used, otherwise the more efficient KTP crystal is used. There was a more 16 recently development method in generating Anti-gray Tracking KTP crystals. These crystals have about double the damage threshold than the standard KTP crystal [8]. Without the anti-gray tracking the aging of the crystal over time generates gray tracks within the crystal, the new crystals are engineered to reduce this problem and therefore increase the lifetime of the crystal. For this project a KTP with the anti-gray tracking crystal is used. The crystal dimensions are three and a half millimeters by six millimeters. The crystal was also acquired from eBay. The KTP crystal was also coated with anti-reflective coatings for 1064 and 532 nanometers. To prevent overheating of the crystal it is placed in an aluminum heat sink. The heat sink will also be water cooled. The temperature of the heat sink will also be monitored. If the crystal is misaligned the temperature of the crystal will increase, measuring the temperature of the heat sink will help diagnose that there is a misalignment. This will also save the laser cavity because if the crystal heats up past a hundred degrees Fahrenheit the crystal will fracture. To protect the diodes from the 1064 nanometer laser light the cavity is folded. The folding mirrors are coated to reflect the YAG fundamental light and to be transparent to the laser diodes wavelength. So what happens is that 99.8 percent of the fundamental light is reflected and the 0.2 percent hits the diode. The amount of light that hits the diode is a much less than 160 mircojoules. This amount of energy would not be enough to damage the diode. The design of the cavity is to allow the second harmonic to be generated in the cavity. The cavity is folded to allow the pump diodes to be placed for end pumping the Nd:YAG rod. For the second harmonic generation crystal, it is placed as close to the second focal point in the cavity. The efficiency of the cavity is dependent to how much the majority of the YAG rod is in the cavity. To prevent the cavity from continuing to expand and preventing the second harmonic crystal from being completely in the beam, a lens was placed in the cavity. The lens is placed in a location that generates an image of the center of the YAG rod. At the focal point of the lens a highly reflective mirror is placed. The mirror will need to be designed for high power laser light for the fundamental wavelength of Nd:YAG and the second harmonic. The reason is that the cavity is converging to a very small spot size on the mirror. The mirror’s coating will need to be rated for a power of greater than 120 joules per centimeter. The section that is in between the lens and the mirror is the location for the second harmonic crystal. This will allow the second harmonic crystal to be fully exposed without letting the edges of the crystal be exposed. The output coupler for this laser is a special coated mirror that allows the fundamental Nd:YAG laser light to pass through and reflect the second harmonic light. The second harmonic laser light that exits the cavity will need to be collimated. This is done with adding a convex lens on the output sections of the laser cavity. The lens reduces the beam from diverging. This will help in maintaining the same spot size when the 17 laser is engraving. Since the output power of the laser pulse is very, high the lens will need to be coated with an antireflective coating. The focal point of the lens that is used for collimating the output of the laser will have to be determined after the laser is built. The measurements of the divergence will determine the lens that is used. To generate pulsing of the laser a Q switch is implemented. The additional parts required to generate pulsing of the laser are the polarized beam splitter and a quarter wave plate. The pulse generation works by first having the Q switch change the polarity of the laser light by a quarter-wave. Then when the laser light passes through the quarter wave plate it rotates by another quarter wave. The light is then bounced back from the cavity mirror and passes back through the quarter wave plate and the Q switch then changes the polarity back to the original polarity and passes right through the beam splitter. When the Q switch is turned off and when the laser light is passed through the system the polarity is horizontal and when it goes through the beam splitter it is sent out of the cavity. This prevents the laser from oscillating and the laser is turned off. The two methods of preventing the polarization from passing are to use a cubic beam splitter or to use a polarizing filter. The reason that a cubic beam splitter was chosen was that polarizing filters absorb the entire laser light that is not the correct polarization. Since the design of this laser is for high power, this would burn and destroy the polarizing filter very quickly. Using a cubic beam splitter diverts the horizontally polarized light out of the cavity and allows the vertically polarized laser light to pass through. Once the light exits from the beam splitter it can be collected in a water-cooled beam dump. This will prevent damaging the polarizing optic. The polarizing beam cube that was chosen was designed for Nd:YAG fundamental wavelength. The manufacture of the polarizing beam splitter is CVI Lasers. The beam splitter was also bought on eBay at a heavily reduced price compared to buying it directly form the manufacture. The quarter wave plate that is used for the project is a Spectra Physics multi order wave plate with the center frequency of 1064 nanometers. This quarter wave plate was chosen because it was also available from eBay and the company is very reliable. The down side of using a multi order wave plate is that the acceptance wavelength is around one percent. If a zero order plate was used the acceptance bandwidth is around two percent. The cost of a zero order wave plate is about double the cost of a single wave plate, therefore a multi order wave plate was bought. The cavity mirror that is going to be used for the laser is a highly reflective concave mirror. The focus point of the mirror is 500 millimeters. The lens that is used for relaying the center image of the Nd:YAG rod will have a focal point of 800 millimeters. These values were chosen because a model was created using a computer simulator named LASCAD. This software is designed to take in the crystal parameters and the different lenses and will generate the cavity stability. The software will also estimate the output power of the laser cavity. Using the 18 Nd:YAG rod that was specified in the above test, a simulation of the entire cavity was designed. The following figure is the design of the cavity (Figure 6.2). Figure 6.2: Cavity deigned in LASCAD This cavity design was also simulated to be pumped with two end pumping lasers with a total pump power of 80 watts. The software design was not created for frequency doubled cavities, but it does follow the same rules for stability. The 11 elements in the software represent the objects of the cavity. The first element starting at zero is the highly reflective mirror. The second and third elements are the interfaces of the KTP crystal. The fourth element is the mirror that would separate the second harmonic from the fundamental wavelength. The fifth and sixth section is the Nd:YAG crystal. The seventh section is the beam splitter and the eighth element is the quarter wave plate. The ninth and tenth elements are the interfaces for the Q switch. The last element is the concave mirror. In simulating the laser cavity, the concave mirror was chosen to be the output coupler. The data collected from the simulations shows that this laser cavity will oscillate and that the output power is mostly exponential by the dependence of the input pumping power. This can be illustrated in the graph of the input pump power to the output lasing power (Figure 6.3). This data can be used to estimate the laser power for the second harmonic generation. Figure 6.3: Power output Vs Input estimations using LASCAD 19 The software will also simulate the ability to pulse the laser with a Q switch. The design criteria that were inputted were that the laser would be pulsed for 41 nanoseconds and that the laser pulsing would have a duty cycle at one kilohertz. The data collected showed that the output power for this laser cavity would generate pulses of over nine millijoules. If the efficiency of converting the pulse form the fundamental frequency to the second harmonic is 45 percent then the output power of the second harmonic pulse should be around four millijoules. This power output is about six times higher than the minimum amount of energy required in generating the plasma to vaporize the copper off the circuit boards. As previous experiments showed that the laser power output of the software is concretively lower than the experimental outputs. This indicated that this laser design will generate a laser system that should be able to generate the plasma needed to vaporize the copper substrate. The control elements that are required to run the laser correctly need to be synced together in order to allow the proper operation of the laser. When some of the elements fail the entire system must act accordingly in order not to damage the laser system. The following is a flow chart that illustrates how these different elements interact with one another (Figure 6.4). Main Computer USB USB USB USB AC Power AC Power Thermal Electric Cooler Laser Power Supply Laser Power Supply Thermal Electric Cooler Cooling Lines Wire Thermistor Wire Thermistor Cooling Flow Cooling Flow Laser Diode #1 Laser Diode #1 Wire Cooling Lines Cooling Lines Figure 6.4: Flowchart of Laser system 20 Wire Cooling Lines 6.1.2 – Current Design Unfortunately we were incapable of using the design outlined in the previous section. This is due to the fact that the laser 808 nm laser diode that we purchased from eBay was out of the listed specifications for it. The diode was running at 800 nm instead of the 808 nm that it was supposed to run at. As the Nd:YAG crystal that is part of our cavity design has an acceptance region of 0.6 nm, we would have only been capable of making this design work by actually heating the diode to a level that is dangerously out of the diodes safe operating range. The current design of our laser is a flash tube based system. The main drawback of using this type of laser system instead of a diode system is that they are at best 2% efficient, have a low duty cycle, and have a shorter mean time to failure than a diode system. The flash tube system that we will be using will have a maximum duty cycle of 100 pulses per second, with a more realistic goal of 10 pulses per second. These pulses consist of containing four nanosecond pulse durations. The advantage of using a flash tube laser system is that we will have a higher output power from the oscillator. This will allow us to take fewer shots to achieve a burn through, but is mainly because we need the higher power because we are doing the frequency doubling outside of the cavity and our conversion efficiency is now much lower. The theoretical power output of the current design will be 15 J per pulse. This will be obtained because we will have 100 mJ of 1064 nm light per pulse out of the flash tube cavity. This is our main laser, which will be referenced as the laser oscillator from now on. We will then use two amplifiers that are both flash tube based amplifiers. The amplifier’s régime will consist of a single pass amplifier meaning that the light will enter one port and exit from a different one by only making a single pass through the excited gain median. The light will then enter a focusing lens and near the focal point the laser light will enter a KTP crystal. At the focal point will be a highly reflective mirror that will reflect the beam back through the KTP for a second pass. After having the light pass through the nonlinear KTP crystal creating a double pass, the laser light is now converted into 532 nm green light which is the final light that we will be using for the mill operation. The light will hit a mirror that is highly reflective for 532 nm and transmissive for 1064 nm to separate the 532 nm light out of the laser amplifier system. The 1064 nm light will stay in the laser section and the 532 nm light will be transmitted to the XY stage. 6.2 – Prototype/Test The first task in prototyping and testing this design is to first test the diodes. The diodes are designed to give out a wide range of wavelengths from 804 nanometers to 810 nanometers. The center frequency is determined by the temperature of the die. The first test would be to determine what temperatures 21 are required to generate an output wavelength of 808 nanometers. The reason that this is important is because the efficiency for Nd:YAG conversion to the fundamental wavelength is best preformed with a pump wavelength of 808 nanometers. The test will also be used to determine what power outputs are generated for the current that is used by the diode. This data is helpful when building the laser power supply. Another measurement that was preformed is the calculation of the diodes laser power output to its internal power meter. This was used to determine if the diode is working correctly. Once the laser diodes are fully tested, the next step is to build a simple laser cavity that would consist of the laser diode, the highly reflective concave mirror and a 99 percent output coupler. The next step would be to add in the imaging lens. Once the lens is placed back in, the cavity length will have to be changed to regenerate a stable cavity. Once the cavity is stable, the next element that would be added would be the mirror that is reflective for the second harmonic and transparent for the fundamental wavelength. The laser mirrors will then be tweaked to generate the highest power output. The next object that would be added would be the KTP crystal. The crystal rotation and position was adjusted until the highest output power was generated through the output of the reflective mirror for the second harmonic. The next step is to change out the 99 percent output coupler with a highly reflective mirror for the fundamental and second harmonic of Nd:YAG. The next element that would be placed in the cavity would be the beam splitter. Since the KTP crystal is polarity dependent, both the cubic beam splitter and the second harmonic generation crystal’s rotation will have to be adjusted until the highest output could be achieved. The next element that was added is the Q switch. The Q switch will need to be adjusted until the output power was the maximum. The last element that would be added would be the quarter wave plate. This was adjusted so that the cavity will not lase. The next step would be to test the Q switch to see if generates a pulse laser pulse. The power was measured and all components were adjusted to improve the output power of the laser. The next step would be to calibrate the power output compared to the input pump power. The next step would be to see if the power output can reach the minimum required energy to generate the plasma that vaporizes the copper substrate. If the power output is below the required energy output then the second diode will have to be added to the setup. This will consist of first removing the Q switch, the quarter wave plate and the cubic beam splitter. The next step would be to add another highly reflective mirror for the fundamental Nd:YAG and transparent to the pump diode’s wavelength. Then the cavity was tweaked to produce the maximum energy with just one of the diodes. Once this is done the next step was to turn on both diodes at half power and adjust the cavity until maximum power is achieved in the output. Now that the maximum is found the next step will consist of placing back in the cubic beam splitter. After tweaking the beam splitter, the next step was to add the Q switch. As before, the next element that was added is 22 the quarter wave plate. The final step was to adjust all the elements to generate the maximum output power. After the adjustments, the laser system needs to be calibrated to understand what characteristics of diode power were needed to vaporize the printed circuit board material. The final test was to measure the divergence of the output beam. This data will help in choosing the correct focal point in the output lens to collimate the beam. Characteristic such as the mode and the M2 will also need to be measured to determine what the spot size was when the beam is being focused on the copper substrate. This data will also be used to determine what type of focusing lens was used. The next testing that will need to be done is to redo the burn testing that was done with the quantaray laser. 6.3 – Build Once the burn tests were finished, the next step was to look at the layout of the prototype laser and redesign a new bread board that was the final placement of the elements. When the design of the bread board was designed, the next step was to prepare the stock aluminum by first flattening it and then drilling the holes to mount the elements. The next step was to attach the elements on the new bread board. Each element was placed on the bread board in the same order as when they were prototyped. The next step was to adjust the elements until the power outputs match the outputs that the prototype gave. When this process is finished the next step was to cover the laser. This will prevent dust form entering the cavity and degrading the power output. The exit portal for the laser is an antireflective coated window. This will allow the entire laser to be sealed. For diagnostic and safety purposes temperature sensors and humidity sensors were added to the laser cavity. For the laser cavity mirror a photo diode will be placed in its location. This is used to measure the output of the laser cavity without using a high powered power meter. This can be used to detect faults and warn the computer that a fault has occurred and to shut down the system. The same could be said for the humidity sensors and the temperature sensors. The diodes are also equipped with photo detectors and with the calibrated data from the testing section this data could be used with the software to determine when a diode is going bad. 6.4 – Evaluation plan The first step in evaluating the laser section of this project is to first test a simple cavity. The next step was to add additional elements to the laser cavity. This process allows the ability to diagnose problems before adding additional complexity. Once all the elements are added to the laser cavity. The next step was to test it to see if the power output is within specification. If the power is below specifications, then a second laser diode was added to the cavity. The next step was to determine the divergence of the laser beam and the modes. The 23 beam will then be corrected to generate a near collimated divergence. The next step was to place the laser on a bread board that would be dedicated to this laser design. Lastly, the laser was sealed up and the laser beam was ready to be routed to the XY table. 24 SECTION 7: Laser Power Supply Unit 7.1 – Previous Design The previous power supply for the diode laser system requires a DC output with low voltage and high current. The power supply was to have an input of 120 V AC at 60 Hz from the AC mains and deliver an output of 0 to 5 V DC at 60 A to the laser diode. The method used to power the laser diode had to be reliable, precise, and have heat dissipation comparable to similar power supplies. The laser diode needed a constant source of power that had a precise value, which requires the power output of the conversion to have a small voltage and current ripple. If the change in input power is too large, it will not allow the laser diode to function and may damage the laser diode. The output voltage ripple must be less than 1 mV. It was current controlled, and it had current and temperature monitoring. The laser power supply was designed and simulated using LTspice. It was used because it is commonly used in engineering courses and uses equations that closely simulate actual circuit operation. 7.1.1 – Rectification The AC mains was converted to a DC voltage before entering the converter. The first part of the rectifying stage filters out high frequency AC noise using a lowpass filter. A metal oxide varistor (MOV) has a high resistance at low voltages and a low resistance at high voltages, and it is used to protect the power supply circuit from power surges. After this, a 60 Hz transformer provides electrical isolation from the AC mains. The output of the transformer enters a rectifier bridge with a filtering capacitor on the output to change the single phase AC to a DC waveform. This DC waveform enters the DC to DC converter, which gives a regulated DC output that can be changed in magnitude and corrected by a control circuit if it differs from the desired output. There are different options to consider when creating the DC to DC conversion circuit. The following schematic is the rectifier used for converting AC to DC (Figure 7.1). Figure 7.1: The filtering and rectification stage. 25 7.1.2 – DC to DC Converter A linear regulator is one option to convert the DC voltage. It can deliver a lower output voltage compared to the input, but it is not efficient enough. The regulating component is an adjustable voltage divider network that maintains a constant output voltage. The divided voltage that is not used as the desired voltage value is dissipated as heat. This can make the efficiency drop to as low as 40% [9]. They are more inefficient as the voltage drop from input to output increases, and they dissipate heat power equal to the product of the output current and the voltage drop [9]. A better option is the switched-mode DC to DC converter or switched-mode power supply. Instead of constantly dissipating unused power as heat, it uses power semiconductor devices to allow the input power to provide power at certain times, charging the power storing inductor and capacitor. The duty cycle, D, is the ratio of on-time of the semiconductor to the switching period. Changing the duty cycle allows for this converter to use the minimum input power necessary to achieve the desired output power. Today, switching devices have very high switching speeds and very high power handling capabilities, which allows switched-mode power supplies to operate with an efficiency greater than 90% with low cost and relatively small size and weight [9]. Another reason the switched-mode converter was used is because its complexity allows for the most control of the output voltage and current, compared to a linear regulator. It can be adjusted by changing the duty cycle of the PWM on the microcontroller. Changing the output power is more difficult on a linear regulator because in many cases of linear regulators more difficult hardware adjustments must be made. The two switched-mode converter configurations that can be used in the design to decrease the voltage and increase the current are the buck, which can only have a voltage gain less than one, and the buck-boost, which can have a voltage gain less than, equal to, or greater than one. A gain below one is the only requirement for the laser power supply, so it was used instead of the buck-boost. 7.1.3 – Switching There are several options for the semiconductor to be used for switching. The desired characteristics of the semiconductor are high forward current carrying capability and fast switching. The BJT, IGBT, and the power MOSFET are the best options for achieving these requirements. The BJT has a high power rating with high current carrying capabilities in the on state, but if it becomes too hot, it is prone to malfunction 26 from second breakdown [9]. Also, it requires more power to drive than the MOSFET, which gives the MOSFET an advantage. The IGBT is made of a BJT and a MOSFET so it has a high current, but its turn-off time is larger than a BJT, and can only operate up to 20 kHz in medium power applications, such as this power supply [9]. The laser power supply cannot be operated at this low of a frequency, because a much higher frequency must be used to obtain a voltage ripple smaller than 1 mV. The power MOSFET has the highest switching speeds compared to the other two, reaching more than 1 MHz, and a power rating of up to around 600 V with a current rating of 40 A [9]. This power and current rating is sufficient for the power supply, and the high switching speeds are good, so the MOSFET was used. In Figure 7.2 the diode that blocks when the MOSFET is on is also an important part of the efficiency and successfully switching operation of the power supply. The diode dissipates power as heat equal to its forward voltage drop multiplied by the current through it. This heat requires the converter to be cooled to prevent heat from damaging the circuit, and the diode current increases exponentially with the voltage across it [9]. Figure 7.2: (a) A buck converter with a switch and diode (b) A buck converter with two switches for synchronous switching. A low power design uses a diode to block power from reaching the ground node of the circuit. The high power being delivered to the output puts a high stress on the diode. Diodes are not usually used for high power applications such as this. This is a major disadvantage of this circuit, because the diode can be prone to breakdown, and a power diode must be used to successfully block the high power being delivered to the output. The switched-mode power supply was made more efficient by replacing the diode with a MOSFET, as seen in Figure 7.2.b. This is more efficient than using any type of diode. This method is called synchronous switching [10]. To replace the diode, M2 will turn off when M1 is on, and then M2 will turn on only for a short time when M1 is off, which will drain ground the negative voltage on the inductor. It is important that the two MOSFETs are not on at the same time, because some of the output power from M1 will drain to ground, and the desired amount of power will not reach the output of the converter. 27 The three MOSFETs put in parallel in place of M1 in Figure 7.2 provide the 60 A of current needed for the output of the converter. Initial designs had current output lower than 60 A, so adjustments had to be made to the circuit. The requirements of a low voltage and high current output can be achieved by using more than one switching MOSFET in parallel instead of a single switching MOSFET. This will increase the output current while having little effect on the output voltage. Because the majority of the heat dissipation in the converter is proportional to the conduction time of the MOSFETs, having more MOSFETs allows the heat to be more spread out on the heatsink, compared to using a smaller number of switches. 7.1.4 – LC filter The LC filter at the output of the buck converter serves to reduce the output voltage and current ripple. If the inductor is too large, it will require too much time to get to the desired steady state value. A larger inductor can decrease the voltage ripple by keeping the converter in continuous conduction mode (CCM), but because synchronous switching is used, the converter was operating in discontinuous conduction mode (DCM). Therefore, inductor was small to save space, have a lower resistance, and provide the desired inductor current in a reasonable time. Increasing the output filtering capacitor was a method used to lower the voltage ripple. The capacitor was derived from ΔVC 1− D = Vo 8LCf 2 where ∆VC is the voltage ripple, Vo is the output voltage, D is the duty cycle created with PWM for the three MOSFETs in parallel, L is the inductor value, and f is the switching frequency of the three MOSFETs in parallel, as can be seen below in Figure 7.3. 28 Figure 7.3: Basic buck converter schematic using parallel MOSFETS. The output voltage ripple must be smaller than 1 mV, which was achieved by adjusting the output filtering capacitor of the converter or changing the switching frequency of the switching MOSFETs. The ripple size decreases as the capacitor increases. The ripple can also be decreased when the switching frequency increases, but this also lowers the power delivered through the switching MOSFET due to the switching limitations of the MOSFET. The buck converter was simulated and the output values for voltage and current are given in the following figure (Figure 7.4). Figure 7.4: Buck converter simulation measuring output voltage and current. 29 In this converter, a relatively moderate switching frequency is used, and a relatively large capacitor is used to achieve the desired output voltage ripple. The ripple measures approximately 0.7 mV, as seen in Figure 7.5 below. Figure 7.5: Buck converter simulation measuring output voltage ripple. 7.1.5 – Controller The first design used a microcontroller to control the output. A difference amplifier would measure the output current and provide a voltage that corresponded to the current. This voltage would be the signal sent to the microcontroller to adjust the duty cycle of switching MOSFETs. This design was not used because it would be simpler if one less microcontroller were used, and if a controlling chip is used, it could provide more features and the power supply can more separate from the rest of the systems. The design was then changed to use the LT1339 to control the buck converter. It is a buck/boost controller for high power converters. Its capability of giving the converter a high efficiency is a major reason for using it. It also has anti-shootthrough circuitry for converters dealing with high power. The LT1339 controls the drivers of the two sets of power MOSFETs, which are BJTs that are powered by a 12 V source. The high currents involved generate substantial heat, and the high efficiency from the controller and the use of synchronous switching allows the heat dissipation to be at levels comparable to power supplies that have similar power conversions. The average current limit function is used to control the output current. An op-amp circuit controlled by a digital potentiometer sets the average current limit. The use of a digital potentiometer allows the laser to operate at different energy levels for testing or troubleshooting and be easily controlled using software. The output voltage is programmed with a resistor feedback network. When the input voltage goes above 30 V, the four MOSFETs in parallel exhibit phantom turn-on. This is solved by adding a negative 3 V offset 30 to the gate driver for these MOSFETs. If the input voltage unexpectedly drops, it can cause the system to become locked in an undervoltage state. A shutdown function is used to shut down the system when this occurs. The complete buck converter with control circuit is depicted in Figure 7.5. Figure 7.5: Buck converter with controller and current controlling circuit. 7.2 – Current Design The previous laser design used laser diodes and required a converter to deliver power with low voltage and high current. The current laser design uses flash tubes and requires high voltage and a low current. This was achieved using a boost converter. The rectification for the current converter design is the same as the previous design. The flash tube system is not susceptible to moderate voltage and current ripple in the output, so the output voltage and current ripple do not need to be lowered much compared to the output for the laser diode design. 7.2.1 – DC to DC Converter The best option for the DC to DC conversion is the switched-mode DC to DC converter to supply the laser flash tube system with 730 V. The boost converter 31 was used to output a voltage gain larger than one. A double boost converter configuration was used to generate a faster current response to the output and to help spread out the heat dissipated by using more switches. A current transformer is used to lower the current through the main IGBTs. The boost converter is depicted in Figure 7.6. Figure 7.6: Buck converter with controller and current controlling circuit. 7.2.2 – Switching The BJT, IGBT, and the power MOSFET are the possible switching devices considered. The BJT is designed for high current, but the current used in this converter will be handled fine with the other two switches, and BJT requires a higher driving power than the other two devices. The power MOSFET has the highest switching speeds compared to the other two, reaching more than 1 MHz, and a power rating of up to around 600 V with a current rating of 40 A [9]. The boost converter requires a higher voltage than 600 V and does not require switching over approximately 100 kHz, so the MOSFET was not a good choice for the switching device. The IGBT is made of a BJT and a MOSFET so it can handle high current and can be controlled easily because a voltage is used to control the gate instead of current, but its turn-off time is larger than a BJT, and can only operate up to 20 kHz in medium power applications, such as this power supply [9]. The 32 disadvantage of the IGBT’s turn-off time is small compared to the disadvantages of the other two devices, and the converter will be operating at 17 kHz, so the maximum frequency limit of the IGBT is not a problem. Also, the IGBT is capable of high voltage blocking, which is needed for the high voltages in the boost converter. Compared to the MOSFET, the IGBT is generally more robust at maximum operating loads and are more efficient at high temperatures [25]. The IGBT is the best option for the boost converter. 7.2.3 – Controller For the current design, the regulating pulse width modulator, UC3526, was used to control the boost converter. Its operating temperature range is 0° C to 70° C, allowing for proper function when the power supply is running at full power, which generates substantial heat. The related controllers from Unitrode did not have a high enough operating temperature range for this converter. Both of the IGBTs for the boost converter are controlled using this controller with added op-amps circuits. The soft-start feature protects transistors and diodes from high currents when the converter is turned on. If the input voltage unexpectedly drops below a certain voltage, it can cause the system to become locked in an undervoltage state. If this occurs, the output is disabled until the system comes out of the undervoltage state and can operate normally. Current limiting is controlled digitally, allowing the user to control the boost converter output via software. 7.3 – Prototype/Test The parts were acquired via online distributors. All of the testing of the laser power supply was done in the UCF senior design lab. The control circuit and other circuits that do not have high voltages or high currents were constructed on a breadboard. They were constructed using the parts and wire that was acquired. The parts of the power supply using high voltages or high currents were soldered onto a printed circuit board (PCB), because a breadboard would have been damaged by the high currents, or high voltages would have caused a short between the small gaps in a breadboard’s circuits. This circuit was constructed on a PCB and tested with the circuits on the breadboards before all circuits were created on PCBs. The high voltage circuits must not have sharp points on the solder, because these can ionized the air and cause the power supply to fail. Oscilloscopes were used to probe the circuit and check to make sure there were no short circuits and the voltages and currents were at the designed values at all nodes in the circuit. The laser power supply was then connected to a GFCI outlet and the node values were checked. Then it was connected to a standard wall outlet and the node values were checked. A dummy load was the first load to be tested. This was a resistor rated for 50 W. The nodes were checked, especially the output current, which must not vary much from 730 V. Next, the power supply was connected to the flash tube laser system and the nodes were checked. It will 33 also be turned on for continuous operation for a length of time to see if the heat is dissipated without damaging the power supply and the output stays constant. 7.4 – Build All components were bought from online distributors, making sure they arrived on time and then the soldering and other building were done in the senior design lab. Some inductors were bought professionally wound, and other larger inductors were wound by hand in the senior design lab. The laser power supply is housed in a container to eliminate anyone from damaging it, or anyone being injured by the high power in the converter. 7.5 – Evaluation Plan The laser power supply must meet the requirements of a voltage output of 730 V. Once all the circuits are combined on PCBs and tested, the final version is tested with all other hardware to see if the desired results had been achieved. If not, they would be redesigned either on breadboards or PCBs and tested again. The power supply is air cooled and it was made sure that it did not overheat and require more cooling. It is important that the design for the high power circuits were accurate, because they were not prototyped on a breadboard. 34 SECTION 8: TEC Power Supply Unit 8.1 – Design Thermoelectric cooling was designed for the previous laser diode system; however, the current laser flash tube system does not require it. Air cooling is sufficient for the flash tube laser operating at a few pulses per second. If the pulse rate is increased, a water cooling system would be used to cool the flash tube system. In the future, a laser diode that outputs the correct wavelength could be acquired and the TEC system could be used. This will probably happen, because the laser diode can etch boards much faster than the flash tube system, and the diode would probably be worth the investment. This section explains the power supply used to power the thermoelectric cooler (TEC) for the laser diode system. The power supply must be reliable and precise to keep the laser diodes operating in a safe range of temperatures. The TEC power supply must have an input of 120 V AC at 60 Hz from the AC mains and deliver an output of 60 V DC at 3 A. The temperature is sensed to prevent damage from overheating. 8.1.1 – Rectification and DC to DC Conversion The AC mains is converted to a DC voltage before it can be used to power the TEC. This rectification was similar to that of the laser power supply, except the transformer was utilized to step-down the voltage. The first part of the rectifying stage filters out high frequency AC noise using a low-pass filter. A fuse was used on the incoming line to prevent any current surges from reaching the power supply. A metal oxide varistor (MOV) has a high resistance at low voltages and a low resistance at high voltages, and it is used to protect the power supply circuit from power surges. If there is a surge, it will send it to ground instead of the power supply. After this, a 60 Hz transformer provides electrical isolation from the AC mains and it is a step-down transformer. The winding ratio is two to one to transform 120 V AC into 60 V AC. The output of the transformer enters a rectifier bridge with a filtering capacitor on the output to change the single phase AC to a DC waveform. 8.1.2 – Cooling Control The DC waveform then enters a buck converter is used to control the power sent to the peltier (Figure 8.1), the thermoelectric cooling device. The amount of cooling is proportional the power sent to the peltier [11]. A thermistor circuit is used to sense the temperature of the laser diode and create a signal to be sent to the microcontroller. The microcontroller adjusts the duty cycle from the PWM that controls the switching MOSFET of the buck converter, giving it a larger duty 35 cycle if more cooling is needed. The ripple is not an important factor for the converter, because the voltage has already been stepped down with the transformer to 60 V. Since four peltiers are being used, they require nearly 60 V and it will not damage them if 60 V is applied. As long as the ripple is not more than about 10% to 15%, and the frequency of the switching MOSFET is above about 1 kHz to 2 kHz, the peltiers should operate well [11]. A high current is not required, so only one switching MOSFET is required to provide the 3 A output. Figure 8.1: A peltier that has been acquired. 8.2 – Prototype/Test The prototyping and testing was similar to the laser power supply testing, including the parts acquisition, testing in the senior design lab, and putting only low power circuits on a breadboard. Oscilloscopes were used to probe the circuit and check to make sure there are no short circuits and the voltages and currents are correct at all nodes in the circuit. The precision of the control circuit and the PWM was verified for proper cooling of the diodes. The laser power supply was then connected to a GFCI outlet and all node values were checked. Then it was connected to a standard wall outlet and all node values were checked. An ohmmeter cannot be used to measure the peltier, so a resistance test was done with an LCR meter, which measures the resistance using an AC voltage [11]. A dummy load was the first load to be tested. This needed to be a heat source, and the heat source we used were the hot sides of spare peltiers. The peltiers were run at a certain temperature, and the temperatures of the heating and cooling peltiers were measured. The data sheets for the peltiers were checked to see if they are operating at the expected efficiency. Next, the TEC was to be tested on the high power laser as the final test. 8.3 – Build Similar to the laser power supply build, the TEC power supply would have had all components bought from online distributors and then the soldering and other building was to be done in the senior design lab. The inductors would have been bought already wound, instead of being wound manually, so that they are professionally wound. It would be housed in a container with the laser power 36 supply to reduce the chance of anyone damaging it, or anyone being injured by the high power in the converter. 8.4 – Evaluation Plan The TEC power supply must meet the requirements of a conversion of 120 V AC at 60 Hz to 60 V DC at 3 A. The voltage ripple must be less than about 10% to 15% of the output. Sufficient testing sessions at durations comparable to that of a PCB being etched that inspect every voltage, current and temperature would determine if corrections needed to be made to the power supply. After iterations of corrections are completed, the final build would occur and be placed in the final housing for the etcher. 37 SECTION 9: Q Switch 9.1 – Types of Q Switches A Q switch is an optical device that changes the quality (Q) factor of the laser cavity. One of the main reasons to implement this technique is that it allows the laser to generate a high intensity pulse instead of a continuous wave. To generate the high energy laser pulse there are two main principles. First when the Q switch is off the laser cavity has a low Q. In this state all the laser cavity is being dumped out of the cavity and preventing the cavity from oscillating. This also allows the gain medium to become saturated. The second state is when the Q switch is turned on. At this state the laser cavity generates a high Q factor and oscillation begins. Since most of the gain medium was becoming saturated in the first state, when the cavity starts oscillating the gain medium generates a population inversion and most of the medium dumps all of its energy into one pulse. The first use of this technique was used on a ruby laser [12]. When the first tests were ran the ruby crystals fractured because of the immense pulse energy. The reason for this was that the lasers were pumping out many megawatts of laser light. There are four main devices used for Q switching. The easiest to use are mechanical shutters or choppers. These work by physically placing an object into the cavity to reduce the Q factor. The main drawback to this design is that the standard pulse duration is less that 200ns and the mechanical device would have to move fast enough to open and close the shutter in this time period, or the output energy would be reduced. The following is a common chopper that would normally be used for CO2 laser systems (Figure 9.1). Figure 9.1: Mechanical chopper for Q switching 38 Another technique is to use a Saturable Absorber. This technique employs a crystal such as Cr:YAG or bleachable die. The material reduces the Q by absorbing all the light until it becomes saturated, once that happens it becomes transparent and the cavity begins to oscillate. The main drawback to this design is that the crystal generates a lot of heat when it is absorbing the light; this prevents the laser from operating at high repetition rates. The crystals used in this technique over time will start to darken and reduce the power output. The third design is an acousto-optic modulator (AOM). The AOM works by generating a pressure wave in a crystal medium. This pressure wave bends the lights path. When the crystal is off, the laser light passes straight through the crystal. In high powered laser designs the cavity is setup to run on the first order path that is bent when the crystal is on. The reason for this is that with high power the little light that doesn’t become bent is enough to start lasing. The following is the standard output beams of the acousto-optic modulator (Figure 9.2). Figure 9.2: AOM diagram (Permission granted Wikipedia.com) The last design is to use a pockel cell. There are two common types of crystals used for this cell, they are BBO and KD*T. These cells work by rotating the polarity of the optical beam and using a polarized beam splitter to remove one of the polarities. When the crystal is off the beam is not rotated and the beam exits through the beam splitter. When high voltage is applied to the cell the crystal rotates the beam’s polarity by a quarter turn and when it bounces through it again 39 it rotates another quarter turn. The Beam then passes through the beam splitter, and oscillations begin. The following diagram shows how the polarized wave reacts after leaving the pockel cell (Figure 9.3). Figure 9.3: Pockel cell diagram (Permission pending) For this project it was chosen that we use a pockel cell. The reason is that it will allow easer alignment than an AOM and will allow higher power pulses than the other two régimes. The crystal type that we chose was a KD*P crystal. The reason for choosing this type of crystal is that it would fit in the budget. The drawback in this crystal compared to BBO is that the crystal cannot be modulated at higher frequencies. Since our goal is to modulate around one kilohertz this crystal will work well. 9.2 – Previous Design In order to drive this Q switch, it will need to have a differential of around three to five kilovolts. The switching speed of this will need to be around 10 ns. To accomplish this there are three common methods, they are planar triode, avalanche transistors, and fast FETs. The main reason that a planar triode was not chosen was that it is hard to find in common electronic stores and the government highly regulates the selling of them. The reason that the Q switch driver was not designed using avalanche transistors is that basing each transistor would generate many issues and create a larger part list. Therefore the best solution would be to use fast FETs. The driver works by generating a high voltage power supply and driving the voltage to ground using the fast FETs. The power supply was broken into nine sections that would allow easer for easer testing. The following block diagram will help explain the breakdown of the high voltage power supply (Figure 9.4). 40 +12V Microcontroller Voltage Regulator 40kHz Oscillator 1:98 Transformer Darlington Transistor Voltage Multiplier Filter Caps Fast FETs Voltage Divider Figure 9.4: High Voltage Power Supply Block Diagram 9.2.1 – Q Switch High Voltage Power Supply The design of the oscillator for the high voltage power supply is a square wave generator using two operation amplifiers. The reason that a square wave was chosen was because the darlington transistors used generate a non linear gain. The non-linear gain would modify a sine wave, if it was used and the amplification would generate more of a square wave. It seemed that using less parts and loosing the efficiency of not using a sign wave would be the design of this part. The transformer used for this high voltage power supply is a CCFL transformer. The reason for choosing this transformer is that it is commonly available from electronics stores and the cost associated with it is minimal compared to having a transformer custom made. The transformer has a primary tap that is split this will allow bidirectional pulling. This is why two operation amplifiers are used. The first one generates the square wave and the output drives the one of the darlington transistors, the output also drives the second operational amplifier, who is set up and an inverter. This output will then be connected to the second darlington amplifier. The scheme will allow the transformer to have a push pull operation and generate a more efficient system compared to just modulating one side of the transformer. The transformer also has a feedback coil that would commonly be used to generate the oscillations, but for our project it was determined that allowing the device to freely oscillate may generate instability when the circuit is connected to unknown devices, therefore the outputs from the feedback coil are left floating, and the main coil is driven at a set frequency. The frequency of the oscillator is controlled by the RC constant of the circuit, using the following equation the values of R and C are rounded to the nearest common value. The R was set to one kiloohm and the C was set to 4.7 nanofarad. This combination generates a frequency of around 50 kilohertz. The following is the schematic of the oscillator (Figure 9.5). 41 Figure 9.5: Schematic of oscillator circuit The specification sheet for the transformer gives a range of usable frequency to run it, they range from 40 to 80 kHz, and therefore the given RC values are within specifications of the datasheet. The following is the simulated output of the oscillator circuit (Figure 9.6). Figure 9.6: Simulated outputs of oscillator The voltage regulator for this circuit consists of a transistor that limits the current that enters the transformer. The transistor is controlled by an operational amplifier that compares the voltage that the voltage divider circuit gives and the voltage that the microcontroller gives and if the voltage is lower than the microcontroller, the operational amplifier give a high state and the transistor permits more current to enter the transformer. When the voltage is above the microcontroller’s, the opamp gives a negative state and reduces the current that the transistor is sending to the transformer. This design does generate a voltage swing between the two states, but this voltage change would be low enough to allow the Q Switch to operate correctly. This current limiting design was presented in “The variable High-Voltage Power Supply 0-3kV [13].” The Voltage multiplier section of the High Voltage power supply consists of a Cockcroft–Walton multiplier. The reason that this section is needed is that the maximum voltage that the CCFL transformer can deliver is 1.34 kilovolts. To get the five kilovolts needed to run the Q switch the output of the transformer goes through a two stage voltage multiplier. This will generate a four times 42 multiplication. Since the cost of high voltage capacitors that are needed to run the voltage multiplier are exponentially expensive verses surge voltage, it is more cost effective to run the capacitors in series. Running the capacitors in series will allow higher voltage handling while maintain a low cost for materials. To prevent one of the capacitors form generating a higher voltage then the others, in its series, each capacitor will have a ten megaohm resistor. This will allow the capacitors to discharge when not in use and prevent one of the capacitors from generating a voltage above its specification. For the diodes used in the multiplier it is also cost effective to use multiple diodes in series than to use just one. The diodes used are the HER108. The diode is rated to have a 1000 volt reverse voltage and is designed for fast switching with a recovery time of 75 nanoseconds. The reason that this diode was chosen was that it was a cheap diode that is readily stocked and allows a faster recovery rate compared to the standard 1N4007. The following is the schematic of the voltage multiplier (Figure 9.7). Figure 9.7: Schematic of Voltage multiplier The left terminals are connected to the CCFL transformer and the right side terminals are connected to the filter caps. The filter caps were added to the circuit to regulate the voltage and to create a storage tank to prevent voltage drops when the FETs are switch on. Like the voltage multiplier, it is more cost efficient to use multiple capacitors in series than to use one capacitor rated for the five kilovolts. The capacitance chosen was not too critical because the voltage multiplier smoothes out the voltage as it passes through the circuit. The capacitors chosen was a 0.15 microfarad capacitor rated for 3000 volts and eight milliohms for ESR. This is the same capacitor used for the voltage multiplier. The following is the schematic of the filter cap design (Figure 9.8). 43 Figure 9.8: Schematic of the Filter Cap layout To allow the circuit to regulate the voltage for this power supply, a voltage divider will be used the divide ratio will be 999:1. This ratio will allow the voltage to be read at safe levels of three to five volts. The high voltage resistors used are the 8.2 megaohm metal film resistor, and one 100 kiloohm resistor and a 6.8 kiloohm resistor. The current rating for this circuit is 0.25 watts and the rated values for the resistors are 0.5 Watts. To protect the comparers that the voltage regulator uses there will be a Zener diode on the output that is rated for a breakdown voltage of 5.1 volts and a power rating of 1 Watt. This circuit will prevent voltage spikes form destroying the comparers. The voltage regulator circuit is a circuit that will take the voltage from the voltage divider circuit and compare it to the voltage from the digital to analog chip that the microcontroller set. The voltage comparer circuit checks to see if the voltage form the divider is lower than the digital to analog converter. If it is lower the output is railed to high. This output is sent to an N type transistor. The current is regulated by a 330 ohm resistor. The transistor used is the 2N3055, this transistor was chosen because it has a voltage rating of 60 volts, which is well above the 12 volts that the circuit uses, and it was used in the reference high voltage power supply [14]. The comparer used for this portion of the high voltage power supply is the standard LM358 comparer microchip. This was chosen because of its reliability and it is commonly available. The following schematic illustrate the voltage divider and the voltage regulator (Figure 9.9). 44 Figure 9.9: Schematic of the Voltage Divider and Voltage Regulator The output from the voltage regulator is sent to the CCFL transformer. The 12 volts that this power supply uses is from an ATX power supply. The reason that this type of power supply was chosen was that it is cheap and more stable than a wall version. Using an ATX power supply will also allow this circuit to be smaller because there will need not be a reason to have a voltage regulator regulate the 12 volts for the circuit. This will also reduce the space that this power supply occupies. For the microcontroller section of the high voltage power supply, The Digital to Analog chip that was used is Microchip’s MCP4251. The reason that this chip was used was that it has a low cost and had 256 divisions [15]. This will allow the computer to have step control of 20 Volts per step. There will also be override pins that will be connected to a multi turn potentiometer. The reason for the override scheme is that it will allow easer testing of the circuit, and give an alternative to have the voltage permanently set if the microcontroller fails. The microchip is controlled by SPI serial. The microcontroller will read the preset values from its EPROM and send it to the Digital to Analog potentiometer. If the computer requires changing the voltage, the microcontroller will get the packet from the computer and resend the data to the Digital to analog potentiometer. The microcontroller will also sample the voltage form the voltage divider and when the voltage does not reach the correct voltage after a preset number of cycles the microcontroller will send to the computer a fault and shutdown the power supply. The Microcontroller will have seven main functions that will be personalized for the Q switch power supply and driver. In the first section it will read the EPROM, this is the data that the microcontroller will send to the high voltage power supply when the chip turns on. The second section will be computer change data, this will read the USB data packet and will determine to change the value of the Digital to Analog potentiometer. The third section is the Change EPROM, this will 45 read the USB data packet and change the EPROM data that relates to the Voltage that the potentiometer sets. This section will also call the fourth section to update the potentiometer. The fourth section of code will read from the EPROM and send the data to the potentiometer to update the voltage. The fifth section will read the onboard Analog to Digital circuits and determine if the voltage is within the given range that the potentiometer set. The sixth section will determine if the voltage is below the specification for over one second the microcontroller will shutdown the power supply. Shutting down the power supply is cutting the 12 volts power supply. The cutting of the 12 volt power supply is done by shorting a relay coil that cuts the voltage. This section will also send a USB data packet to the computer, with the data that a fault has occurred and at what voltage the chip read. The last function that the controller uses is the pulse function. This section will toggle a pin from low to high and then back to low. This will trigger the fast FETs to switch on. This function will be called when a USB packet is sent by the software with the command to call this function. When the device shuts down, to create isolation from the circuit and the ATX power supply, a relay will be switched on. To switch the relay on and to keep it on until the device is reset, a SCR is used. The SCR used for this section is the 2N5061. This SCR was used because of its pricing and that it allows the on state hold current is within the specifications of the relay that will be used. The relay that will be used for this section is the G6RL-1-DC12. This relay was chosen because it has a coil voltage of 12 volts and a current usage of 18.3 milliamps [16]. The reason for the low current design is to be a little more efficient in power management. This size of this circuit is a little bigger than if solid state components are used, but it is a little more reliable than the solid state versions when it comes to electrostatic discharge. The reason is that many times when the solid state relays fail, they are normally shorting the switch on. Since the design of this section is geared for safety, that scenario would be defeating the purpose of this circuit. So a relay was chosen because it is more resistant to electrostatic discharge. The only part of this circuit that is sensitive to ESD is the SCR and if the SCR would be destroyed, it will turn on the relay coil and cause the circuit to shutdown. The setup of the relay is that the switch is normally closed. This will allow the relay to only be used in a shutdown situation. This will increase the lifetime of the relay because it is not switching every time the power supply is turned on. The following schematic will show how this section is connected to the high voltage power supply (Figure 9.10). 46 Figure 9.10: Schematic of the Shutdown Circuit 9.2.2 – Q switch Fast FETs The main design of the fast FETs section is that there will be two banks that will be charged by the high voltage power supply. When the laser needs to pulse, one of the banks will be discharged through the fast FETs. This will create a differential between the two banks and will switch the Q switch on. When the pulse is over the circuit will fire both banks, so that they will be shorted to ground. This will then generate a differential of zero between the two banks and turn the Q switch off. The RC component of the bank will then start to refill the banks and the voltage on both of the banks will be back to the high voltage power supply’s voltage. There are six components to the fast FETs circuit. The flow diagram below shows how they are linked together (Figure 9.11). Figure 9.11: Schematic design of the fast FET section The microcontroller will send a pulse to the pulse generator. This section was covered in the above literature for the High Voltage power supply. The 47 microcontroller will just toggle the states from low to high. The pulse length of this toggle is about two clock cycles. Since the clock of the microcontroller will be running about 48 MHz, the pulse duration will therefore be 41.6 nanoseconds. The next section that the microcontroller passes the toggled pulse to is the pulse generator. This section will shorten the pulse and generate the second pulse to turn off the Q switch. The pulse generator will consist of a LC delay network that will be connected to the input of the circuit. The output from the delay circuit will then be compared with an exclusive OR gate. This will generate an output of two pulses. To remove the falling edge pulse the output will be compared with the original input signal, using an AND gate. The output will then be the pulse that will be sent to the first bank to turn on the Q switch. This pulse is also connected to another passive LC delay network and generates a delay of around 20 nanoseconds. This section will be allowed to be changed because when tweaking the pulse energy of the laser this delay time will greatly change the efficiency of the laser pulse. The output of this section is connected to the pulse driver of the second bank and when fired it will turn off the Q switch. The pulse driver is used to drive the main inductor coil. The pulse driver will be a 120 volt line driver that will amplify the five volt pulse that the pulse generator created and amplify the voltage to 120 volts. This is done by first generating 120 volts DC. This is created by taking the 120 volts from the AC power line and passing it through a bridge rectifier. The output of the bridge rectifier is then filtered with a 10000 microfarad capacitor. The bridge rectifier is just four 1N4001 diodes. The reason that they were used is because the current needed for this section is minimal so buying a premade bridge rectifier would increase the cost of the design. The output of the filtered DC source is then passed through a one kiloohm resistor. The resistor is to limit the current that will be generated when driving the pulse driver. The driving mechanism is four MOSFETs that are connected in parallel. This will generate a faster turn on for the pulse than just having a single MOSFET. The MOSFET used for this section is the STF5NK100Z. This MOSFET was used because it will also be used for the FETs section of this project. The inductive coil that is used to bias the MOSFETs in the FETs sections, consist of a Teflon wire that is also covered with an additional Teflon sleeve. This will generate the isolation that is needed for the circuit. The wire is then placed in the center of six ferrite beads. Each bead will have a loop of Teflon wire that will be connected to the base of the FETs and the gate of the FETs. When the pulse enters the inductive coil, a voltage will be generated on the gate and will turn on the FETs. The FETs section will consist of six series of MOSFETs. Within each series there will be two MOSFETs connected in parallel. The reason for the series design is that high voltage MOSFETs are not commonly stocked through electrical distributers and the cost of a high voltage MOSFET is significantly higher than 48 the cost of multiple transistors in series. To prevent some of the transistor from generating voltages high than their specifications, each series connection will have a ten megaohm resistor connected to the source and drain. This was the same idea that was used for the high voltage filter capacitors. At the end of the FETs section the output of the last series is connected to the ground plane of the board. The beginning section is then connected to the RC bank. This section and the pulse driver sections are duplicated for both the ON Q switch bank and the OFF Q switch bank. The last section is the RC bank that is used to connect the high voltage power supply, the FETs and the pockel cell together. The resistor that is used is a high voltage resistor that is rated at 750 kiloohms. The voltage rating of the resistor is 5 kilovolts. The capacitor that is used is a high voltage ceramic capacitor. The voltage rating of the capacitor is six kilovolts and the capacitance rating is 47 picofarads. The connection to the pockel cell will consist of a high voltage screw terminals. The pockel cell will be connected to the terminals using high voltage Teflon wire. The voltage rating for the wire must be greater than five kilovolts. The following schematic is the pulse driver, the inductive coil, the FETs, and the RC bank (Figure 9.12). Figure 9.12: Schematic of the Pulse generating circuit 9.3 – Current Design Since the old design’s laser cavity was large enough to add in a pockel cell, this was what was going to be used for Q switching. Now that the laser cavity is less than 10 cm long, a pockel cell could not be added to the cavity. In order to still have a Q switch design, the alternative is to add a saturable absorber. This device only takes up 3 mm to the cavity. 9.4 – Prototype/Test To prototype the electronics for the Q switch, the electronics will be broken up into two main sections. The first section consists of the high voltage power supply 49 and the second section will be the fast FETs. The reason for the splitting of the electronics in the two sections allows ease for testing them. Once the power supply and the fast FETs electronics are verified to be working the boards will be joined together with a high voltage Teflon wire. To prototype the high voltage power supply as a whole, a circuit board will be generated on the computer and the board will be etched out. The reason for not building the supply on a bread board is because it will be generating high voltage that would be able to jump the traces in the bread board and short its self out. Some of the sections that were explained in the design section can be made on the bread board. The sections that could be made on bread boards are the shut down circuit, the 40 kilohertz oscillator, the voltage regulator and the microcontroller. Once those parts are verified to be working the board will be designed and when the board is made, the parts will be soldered in place and verified that the connections are in place. Sections that need special care are the high voltage sections. The high voltage sections must be checked to see if there are any sharp solder points. These points will start to ionize the air and could generate a failure of the high voltage power supply. When the board passes its visual inspection, the board will then be connected to a GFCI outlet and tested with high voltage probes. The board will also then be connected to the microcontroller. The high voltage power supply will then be regulated by the microcontrollers set values. The results will also be verified by testing it with the high voltage probes. The microcontroller will also simulate a power supply will then be safely biased incorrectly. This will test to see if the microcontroller will shut down the high voltage power supply. The next step will see if the computer will be able to control the voltage of the high voltage power supply. The computer will send the USB data packet to change the voltage to two kilovolts. Then if the power supply works correctly it will be changed to other voltages and verified as well. The next step would be to see if the other functions that were programmed will also work. Since the complexity of the fast FETs electronics, by using mostly surface mount parts, it is unreasonable to prototype this section on a bread board. The first step in prototyping this section, is to break it up into the six sections that were broken up in the design section. This will allow the ability to test the circuits to see what characteristics they have and how to modify the delay networks in order to improve on the switching speeds. Once the sectional boards are verified to work correctly they will be designed to be on one board. To prototype the fast FETs electronics, they will also be drawn up on the computer and a circuit board will be made. To test the circuit, a lower voltage of around one hundred volts will be applied to the high voltage power supply section and when the pulse is generated, the high voltage probes will check to see the fall rate of the circuit. It will also tell if the circuit is working correctly without destroying the majority of the components. Then the board will be tested at the five kilovolts to see if it will switch and at the rate specified for the pockel cell. Then if all goes well, the high voltage power supply board and the fast FETs board will be connected and 50 retested to see if they will work together and that the system will be within specifications to run the pockel cell. 9.5 – Build Once prototyping and testing is finished the boards will be remade on one board and mounted in an enclosure. Like before in the prototyping section care must be taken in checking to see for sharp point on the high voltage side. Because of the high voltage characteristics of this power supply, the board will be elevated a quarter of an inch above the enclosure using fiberglass spacers. This will generate an isolation of five kilovolts. The enclosure will also be labeled “Caution High Voltage.” The inputs to the box will be a USB port and AC power jack and a 12 volt terminal. The outputs will be two high voltage Teflon coated wires with enough length to connect to the pockel cell. 9.6 – Evaluation Plan The evaluation plan for the Q switch electronics is to first layout the sections of circuits that could be tested using bread boards. Then after fully testing the circuits that were made on the bread boards the parts that could not be tested this way would be designed and prototyped on printed circuit boards. Once all the sections are tested and working correctly the main design two sections will be designed and created in printed circuit board material. The Boards will be built and tested. If the boards work correctly they will be joined together and retested, otherwise they will be redesigned and redo the testing. After the boards pass the testing a new printed circuit board will be constructed, this one would include the electronics for the high voltage power supply and the fast FETs. Once built, it will be tested. The board will then be packaged in an enclosure and will be ready for use with the pockel cell. 51 SECTION 10: Motors and Motor Controller Unit 10.1 – Design To move the mirrors into the location for milling away the copper substrate, a motor was used. The delivery mechanism for moving the mirrors is through a belt. There are two main types of motors to choose from. The first is a DC motor. The biggest problem with a DC motor is that the reliability that the motor will stop in the same locations time and time again is very minimal. This could be improved by attaching a rotary encoder. This device would allow the microcontroller to know the location of the big steps. The down side of this is that if the motor needed to make smaller steps than what the encoder measures, then it is more of a guessing game. The reason is that if during the step the motor experiences inconsistent load changes, then the position location would not be the same location every time. The second type of motor that could be used is a stepper motor. The stepper motor allows high reliability and accuracy compared to a standard DC motor. The stepper motor also has the advantage of allowing microsteps. These steps would be divisions of the major steps and would still be more reliable compared to the standard DC motor. The biggest problem with stepper motors is that the controlling electronics to move the stepper motor is more complex than a standard DC motor. For an example, a standard DC motor would only require an H-bridge to control the movement of the motor. For a stepper motor, the electronics can vary from using two H-Bridges. This scheme would only allow the motor to move in the major steps. The second type of electronics that could be used for a stepper motor, that would allow the microstepping scheme, is a full bridge configuration. There are three different kinds of wire configurations that can be used to run the stepper motor. The more common variety is the unipolar configuration. This configuration consists of two main coils per phase. Each coil also contains a center tap in the coils. This configuration my also come with two of the ends of the coils connected. This would reduce the amount of wire used from six wires to five. The five wire scheme also allows easer design for the electronics. If a six wire stepper motor was reconfigured, it can be used to generate the second most common type of stepper motor. The second type is called a bipolar stepper motor. The bipolar stepper motor is the same as the unipolar stepper motor in that it contains two coil windings per phase. The difference between the two is that there is no center tap for the bipolar scheme. This allows the wire count to be down to only four wires. As said before, this design can be created using a unipolar motor scheme by just ignoring the center tap wires. The last variety of stepper motor is the eight lead stepper motor. This is a hybrid version of the two varieties given above. The reason for the hybrid design is that the stepper motor can be designed for high torque operations and then switch to high speed operations with low current consumption. An example of this form of operation is for a lathe CNC machine. The reason is that when the bits are not cutting the 52 material they can be moved quickly to the next position and when the bit would need to be cutting the material the circuits would switch to a high torque portion of the motor. This design would not be needed for this project because there will not be changes in the torque while the machine is in operation. This leads the choice of using a bipolar motor or a unipolar stepper motor. After looking at the current availability of the stepper motors available through our current distributers, the stepper motor that was chosen was a unipolar stepper motor. The motor is from Jamco. The reason that this motor was chosen was that it had a step angle of 0.9 degrees. This is half the stepping angle of standard stepper motors. The holding torque for this stepper motor is 30 oz per inch. Since the gears that will be driving the belts for this project will be around a quarter of an inch, the holding weight that the motor will hold will be seven and a half pounds. This is far higher than what would be needed to run the XY portion of the XY table. The motor is run as a bipolar motor because the electronics to run a bipolar motor are commonly built in a single package design. The reason that we chose to use the electronics that are in a single package design, compared to just using discrete components, is that the part count is far lower, and the need to customize the electronics to match the stepper motors by using discrete components is not needed. The reason is that this project is not running on a battery or with other unique design criteria that would prevent the use of an all-inone stepper motor driver. There are many different types of stepper motor driver chip that are commonly used by many hobbyists. The chips range from using multiple H-bridges to dual full bridge modules. The most common one is the L298. This is a full bridge MOSFET driver. This chip was designed for running stepper motors with a driving current of one amp. The chip also has a continuous drain current of four amps. This was chosen because there are many coded examples for driving this chip for microstepping. Even Microchip has an article for using this chip with the PIC18C452 to drive a bipolar stepper motor [17]. The model that is used for this project is the vertical mounted L298N. This chip was made from STMicroelectronics. The reason that the vertical mounting scheme was chosen was that the chip will be generating a great deal of heat when the chip is running microsteps. There must therefore need to be a heat sink connected to the chip to prevent them from overheating. Since the microcontroller that is used for this project is the PIC18F2550 series, the microcontroller only has two PWMs. To run the circuit for microsteps the chip must have four pulse width modulators. One way that was noted from Microchip was to use logic chip, such as two inverters and four AND gates. This scheme is used to modulate the PWM to make four PWMs from two. The following schematic is what is used for the microcontroller and the full bridge driver for the stepper motor (Figure 10.1). 53 Figure 10.1: Schematic of microcontroller and full bridge driver To prevent the feedback that is generated from switch the stepper motor, a snubber circuit was added to the terminals of the stepper motor. The snubber circuit will be primarily two diodes that will be connected to the 12 volt power supply and ground. The diode that STMicrochips recommends for this type of application is the 1N4001. This diode is the common diode that is used in other designs. For this project the diode that was chosen was the 1N4001. The main reason for choosing this diode was because of the recommendations and because it is the most reliable design since the popular use of it. This would help 54 in debugging this section of the circuit because of the review that others have generated. The power supply that is used for this portion of the project is one of the 12 volt leads from an ATX power supply. The ATX power supply is able to drive the circuit at a much greater current that what the circuit uses. It is therefore a reasonable choice to use the ATX power supply than to build a voltage regulated power supply that would need to drive more than four amps per stepper motor. This design that was created would only be able to drive one of the stepper motors. Since this design will be the same for both the X and Y axis the circuits will be duplicated for each. When the circuit first starts up, the stepper motors must move to the home position. The reason for this is that when the machine is turned off the motors can be moved to any position without having the microcontroller knowing where it is. When the machine is turned on the microcontroller will move the motor backward until it hit the home position. Once the motor reaches the home position the stepper motor will stop and will be ready to receive the commands from the computer. The stepper motor knows when it reaches the home position because there will be a limit switch located at the end of the rails. When the axis hit the limit switch the switch will send a low to the microcontroller and the microcontroller will stop the stepper motor. The circuit for the limit switches must contain low noise. The reason is that if the noise level is too high then a false limit will be hit and the zeroing of the axis will not be correct. The method that will be used to prevent the device form generating high levels of noise is to connect a pull up resistor to the pin that is used for the input. The value that was chosen was a one kiloohm resistor. A capacitor was also be added to the circuit to further reduce the noise on the lines. The capacitor that will be used is a multilayer capacitor. The value for this capacitor is 0.1 microfarads. This limits much of the noise that is generated from the stepper motor and the other electronics. There is also a limit switch that is placed on the extreme locations of the axis. The reason is that in case the commands that are sent to the microcontroller are incorrect or that there was a false homing position, then the stepper motors will not destroy the machine. The microcontroller will also send this data to the computer when this fault occurs. The computer also can have the ability to send to the microcontroller the command to go to home. This would rerun the same code that would run when the microcontroller turns on. The microcontroller is able to maintain the position of the axis. This is important if the computer would send an absolute position rather than a relative position. The microcontroller is also able to move the stepper motor in full steps as well as the microsteps. The stepping space of the microsteps only needs to be about two microsteps per major step to get the proper resolution, but more microsteps will be used. This value is calculated by taking that each major step for the stepper motor is 0.9 degrees, and that the gear that drives the belt is a quarter of an inch, so for each major step the movement is around two thousandths of an inch. So to get the resolution of one mil, the resulting value was divided by one mil. This value then needed to 55 be rounded to the nearest decimal place to allow ease in calculating the pulse widths in order to create the microsteps. The initial design of this system was to allow the laser to have the accuracy of one mil, but to allow the laser to achieve this accuracy the stepper motors must be able to move with an accuracy of more than one mil; therefore, the microstep size was increased by a factor of four. This allows the motor axes to be moved with a step size of 0.00025 per inch, even though this accuracy was not possible through slippage through the gear and the belts used to drive the axes. This helped in debugging the errors generated through the machine. 10.2 – Prototyping and Testing For the motor controller, the first step was to prototype the microcontroller. The testing of the microcontroller consisted of looking at what the waveforms would be when the microcontroller is moving the stepper motor to the home position. The next task was to see if the waveforms stop when the limit switch is initiated. The next step was to see if the microcontroller works with the computer by sending an error message when the other limit switch is activated. If all the above tests worked, the next step was to build the board with both the microcontroller and the full bridge driver. This was then connected to one of the stepper motors. The testing of this stage would consist of seeing if the stepper motor moves in the correct direction and to verify that the stepper motor microsteps correctly. The last task would be to verify that everything is working correctly. 10.3 – Building For building the stepper motor power supply and controller unit, the first step was to redesign the board that was used for prototyping. The newly designed board was then etched out of the copper substrate. After the components are soldered onto the board, the next step was to test the board. Testing the board would consist of checking that the limits work correctly and that the emergency shutdown works. The next step was to verify that the motors are moving the correct way. The last step was to connect it to the XY table and check to see if everything worked correctly. 10.4 – Evaluation Plan For the design of the motor, this project uses a unipolar stepper motor. The controller that was designed used the L298. The first step in completing this portion of the project was to first prototype the microcontroller. The next step was to design and prototype a board that contained the microcontroller and the full bridge driver. The next step after building the prototypes was to test the designs. The last step was to build the final board. If a problem occured, the basic process of first locating the error and to trying to recreate the problems on the prototyped boards was the first step. The reason to try to recreate the issues is to see if the result was an initial design flaw or a problem with the current board. The last step 56 was to connect the stepper motor control board to the XY table and test to see if all worked correctly. 57 SECTION 11: XY Table 11.1 – Design For the XY table, we needed a way to access all of the parts of the board to be milled. There are two options on how to do this. We first discussed using a system (Figure 11.1) where the laser is redirected above the PCB, and the PCB is actually moved. Figure 11.1: Alternative XY Table Design This would have the benefit of having less moving parts in the laser system. However, the seeming simplicity of this system is its own downfall. In this system, we would have had to include a method for users to attach their boards to the moving XY table. Furthermore, we would have needed to have the capability of handling the different weights of the boards. Even a small change in either a different size of a board, or a new board type would change the dynamics of the system. This could add slip, reducing the accuracy of our milling process. Because of these problems we decided on moving the optics assembly above a stationary PCB. This is shown below is Figure 11.2. 58 Figure 11.2: CO2 laser engraver XY table This eliminated the problem of needing to strap the board down, as all that needs to be done is correctly align the board. This also solved the problem of varying weights; the optics will always weigh the same. We may still incur slip, but at least in this system we have a constant amount of slip over time, and can correct for it in software. We also have identified the need to change the distance from the board being milled and the XY head if different boards were used. This necessitates the addition of a Z axis. We at first considered implementing a fully motorized Z axis. This would have used a lead screw threaded inside a stationary nut on the platform holding the PCB. This would have been useful as we would be able to vary the height of the board through our main program for various thicknesses of boards. This would be a necessity if standard users were capable of using boards besides FR4, and a wide range of board thicknesses were used as the focal point of the laser needs to precisely located at the surface of the PCB. However, after some consideration we found this to not be the issues and have disallowed the use of anything besides FR4 boards by standard users. We had several design decisions left once we eliminated the motor controlled Z axis. The first of those decisions was how to carry the mirrors and focusing lens that will be moving above the PCB. We discussed the merits of using either precision milled rods or open rail system similar to desk draw sliders. We decided on using the precision milled rods due to the fact that the rail system necessitates the use of exposed bearings. The open bearings would have accumulated too much dust for this project, and would have required cleaning. It is possible to construct this system using only two rods and a caster on the end that is not connected to a motor. However, this allows for the possibility of the entire assembly to torque and the machine to lose alignment with the board and the laser. To counter this possibility, we have designed a system that uses four precision milled rods, two for each axis. We then had to make a decision on using either bushings or linear bearings. This was a simple matter of cost, the bushing are cheaper to purchase than the linear bearings. This is important as this is one of the most likely components of the project to wear out, and we will need spares. To move the assembly we had the choice of using either Acme threaded rods or a belt system. For similar reasons that we did not use the open 59 rail system, the Acme threaded rods have a tendency to get clogged. Furthermore, we have observed that a belt system allows for faster movement than a threaded rod system. To move this whole assembly we used two stepper motors. For more information on these motors, please see Section 10 of this report. The motor to move the Y axis of the table is stationary and has its shaft horizontally oriented. Since we are using two precision milled rods that are some distance apart for the Y movement of the XY table, we had to attach a long shaft to the spindle of this stepper motor. This shaft had to be very accurately aligned with the stepper motor spindle to reduce any possibility of wobble. We did this through the use of adhesives and a stout collar mechanism. Then, we attached gears to this shaft at the locations where the carriage is aligned. These gears attach to the belts that drive the actual Y movement of the table. Since the two belts for the Y movement of the table are synchronized by the common shaft, there is no difference in the movement of each side of the machine. This is critical to our design. The other end of the belt is attached to a stationary stand that holds a freewheeling gear of the same type and size that is attached to the timing rod. The X movement of the machine is slightly more complicated than the movement in the Y direction. This is due to the fact that the entire X axis assembly has to move in the Y direction on a carriage system. The stepper motor for the X axis is attached to this carriage with its spindle oriented in the positive Z direction. This spindle will be directly couple to a gear that will interface with the belt driving the X movement of the XY table. The other end of this belt will be attached to a stationary stand that holds a freewheeling gear on the other end of the carriage. This carriage also holds the optics that are responsible for the transfer of the final laser to the PCB surface. The laser will be shot down the left Y axis of the XY table, hit a 90 degree mirror, move along the X axis of the carriage, hit another 90 degree mirror, turn down, and then finally hit a focusing mirror before hitting the PCB surface. 11.2 – Prototype/Test We accomplished this with the attachment of a laser pointer directly to the head of the XY table. Then, using time lapse photography we ran through multiple iterations of moving the head around the board. Looking at the resulting image, we were able to verify that the laser is hitting the same location every time it gets to a certain point in the run. We were able to tell if the machine is running itself out of square by this method also. After we had gone through this stage of testing, we needed to align the real laser with the head and do a few test runs using the same time lapse photography system as before, but with the laser on a very low power setting. The next test that we performed was one to remove the time lapse photography system altogether. This was a test with the laser on a medium power setting with a paper substrate laid down. Over a large number of iterations of the machine being forced to go to different corners and travel different paths, we were be able to tell if the machine is going out of square of if we are accumulating slip anywhere if holes start to appear in new parts of the paper. 60 11.3 – Evaluation Plan We needed a working laser system, software system, and power system before we can do a realistic test. While the tests that we planned were good metrics at determining the accuracy of the table, the metric that we needed to evaluate is speed. It took some time to do the mill procedure, and any amount of extra speed that we could achieve in the movement of the mill head helped greatly. Our main goal was to replace the current milling machine that resides in the senior design lab. To be capable of replacing this machine, we needed to be able to approach it in speed of milling. The capability of the laser to punch through the copper determines one part of this, but the speed of the movement of the XY head determines the other. If the PCB that is created by our machine matches the users input specifications, and is created as specified by the users input Gerber file then this section was a success. A further evaluation that could be used is the comparison of a professionally milled PCB with a PCB that our machine creates using the same Gerber file. If the two matches are identical, then we would definitely call this section of the project a success. However, even if the PCB’s are very similar we would have considered this section a success. This machine is only intended to be used in the prototyping of PCB’s, not production runs or extremely precise work. 61 SECTION 12: Microcontroller 12.1 – Design The first step in the design of the microcontroller section of our project was the decision of what our project requirements were. A Pulse Width Modulation (PWM) circuit will be needed to allow for microstepping of our motors. The microcontrollers that we decided to use also needed to be able to interface with sensors, while being easy to implement, program, and low cost. We are planned to implement seven types of sensors: contact, temperature, light, current, voltage, humidity, and flow rate. In total, we planned to have twenty three sensors inside our project. Due to this large number of peripherals that we will have to interface with, we know that one microcontroller was not able to handle all of our needs. The microcontroller that we used must need to be easy to implement. We have a large range of systems from various disciplines going into this project, and the last thing that we needed was to incur artificial complexity due to a poor design decision. For this reason, we have decided to eschew any microcontrollers that require assembly programming and are only going to look at microcontrollers that support the C programming language. To help easy implementation, we also searched for a microcontroller that has a large repository of code already written for it. It will also need to be easy to reprogram. We are only human, and it is very likely that we would make a mistake in the programming of the microcontroller. The harm of this was limited some by having the main program handling occur on our control computer, but errors were still most likely occur in our microcontroller code. For this reason, we have decided to try and find a microcontroller that can be programmed in the final circuit of our design, without having to be removed. We did not want to have to remove precision aligned optical equipment to just change a few bits around in a microprocessor, so this is a very important requirement. This requirement necessitates that we use a microcontroller that has Universal Serial Bus (USB) support if we do not want a large number of wires inside our project box. Our final requirement is that the microcontroller be cheap. This seems slightly counter intuitive, as we have some very expensive optical equipment in this project. However, we went through a fair number of these microcontrollers as we move through multiple revisions of our project, and went through testing of all of the various components. We could not anticipate all of the problems that might occur this early in the project, but we weanted to be able to swap out microcontrollers fairly frequently if we need to. For this reason, we did not use a system such as the Arduino that has a support system already built in, but for a cost almost an order of magnitude larger than a bare microcontroller. A major factor that contributes to the cost of all microcontrollers is their data bus width. We expected that a 16 bit data bus width would suffice for our needs. However, these microcontrollers are significantly more expensive than their 8 bit counter parts. To overcome this obstacle, we have decided that we will search for an 8 bit microcontroller. The difference is in how we would program this microcontroller. 62 The standard ANSI C programming language allows for an integer to be created that can be two data entries wide. This allows an 8 bit microcontroller to be used as a 16 bit microcontroller, with a minimal loss of performance [18]. The lead microcontroller designer in our group was already familiar with two microcontrollers that fit these needs, the Microchip PIC18F2550 and the PIC18F4550. These two microcontrollers are nearly identical, except that the PIC18F4550 has one more “Capture/Compare/PWM Peripheral”, 3 more ADC’s, 8 more output pins, and a streaming port [19], [20]. Very early on we decided to eliminate the PIC18F2550 from the competition. The PIC18F4550 offers more functionality in a slightly larger package for just slightly more money. Furthermore, this microcontroller meets all of the specifications that we have defined above, while still remaining cost effective. Another plus if we were to use this microcontroller, would be that we already have the software setup, and the support hardware (namely a microcontroller programmer) that we would require. This would allow us to cut down on our initial development time considerably. We were unsure of where to go from here in finding other microcontrollers to research for our project. However, we found that the Mouser Electronics website has a tool that can find similar products. We used this tool on the listing for the PIC18F4550 and found the Silicon Labs C8051F342-GQ, the Atmel ATMEGA162-16PU, and the Freescale Semiconductor MC9S08JS8CWJ [21], [22], [23]. For this research, we decided to compare these microcontroller offerings to the PIC18F4550 to try and determine if we could find one that exceeded its qualifications. Through former work in a similar area of one of our members, we already knew that the PIC18F4550 would work for our purposes from firsthand experience. At first glance the Silicon Labs C8051F342-GQ appeared to beat the PIC18F4550 in nearly every field. It has a larger program memory size (64KB versus 32KB), a larger data ram size (5.25KB versus 2KB) and the same clock frequency. However, this microcontroller only has twenty five programmable input/output pins, is in a surface mount package, and is twice the cost of the PIC18F4550. We still did not know how many sensors our final project would have, and we did not want to limit ourselves with a microcontroller that does not have enough input/output pins. Furthermore, we were trying to avoid the use of surface mount components in the microcontroller section of our design. We wished to do this to aid in the prototyping process, as it will allow us to use breadboards without creating custom breakout boards, and to ease the soldering process for the final product. The Atmel ATMEGA162-16PU is in the type of package that we wish to use (PDIP-40), and has the same number of input/output pins as the PIC18F4550, but is seriously lacking in other areas. First off, it only has a maximum clock frequency of 16MHz. We planned on doing a large amount of data manipulation and calculation, and did not want to be limited by a slow clock rate. Also, the ATMEGA162-16PU only has a 16KB program memory size. We would be loading complex path following and contour routing algorithms into this microcontrollers memory, and once again we did not want to be limited by buying a substandard chip. While we could have looked at the next microcontroller up in Atmel’s offerings, the ATMEGA162-16PU was already over 63 our $5 limit for each microcontroller, and Atmel’s offerings just increased in price from there. The Freescale Semiconductor MC9S08JS8CWJ microcontroller really never had a chance of being selected. It only has a 16KB program memory size, a 256B data dram size, and only one timer to the PIC18F4550’s four timers. This microcontroller looked appealing, as it is only half the cost of the PIC18F4550 at the time of this writing, but it just does not have the requirements that we believe will be necessary to make this project a reality. After some consideration, we have decided to use the PIC18F4550 as the main microcontroller in our project. It is simply has more to offer in terms of hardware, has a larger user community on the software side, and we already have experience and support hardware in developing for it. The next decision that we needed to make, was on which topology that we wished to implement. One method of designing the microcontroller system for our project that we considered using was to connect the computer to one main microcontroller, and that microcontroller would then be used to send and received commands and data from other less complex microcontrollers. These less complex microcontrollers would be used to do the interfacing with each of the individual sections of our project. These sections include the power supplies and the motor controller. One attractive aspect of this design is that these less complex microcontrollers, we were discussing using PIC16F54’s, would be much cheaper to purchase than the PIC18F4550 that we have ended up deciding to use. However, the main reason that we have decided to not use the PIC16F54’s is that they are not capable of running assembled C code. We would have had to write all of our code in assembly. After some deliberation, we decided that this would add too much time to the development cycle for a small monetary reward. Our project is going to be complex enough that we do not need to be artificially adding difficulty. In this design, we were going to use a PIC18F4550 to do the control of the other microcontrollers, and to interface between the machine and the computer over USB. For our next design, we decided to solely use this chip. The final design that we have come up with for the microcontroller of our project is a topology of one to many. This has the computer directly connected to many microcontrollers. This is possible since every PIC18F4550 that we are using can be directly interfaced with through a USB connection, and a theoretical limit of 127 devices can be connected to a single USB host controller [24]. We have nowhere near this many microcontrollers in this project, and we have a dedicated control computer that has at most three USB devices (mouse, keyboard, and flash drive) connected to it at any time. The main reason that we have decided on this design is one of simplicity. These microcontrollers will allow us to do all of our circuit programming while they are already in the project, with only one pin (pin RC0) pulled to high and a restart of the board. With this design, our main controller will be the computer. This allows us to easier record errors, and allows us to have tighter control of how we implement procedures. 64 Now that we have decided on which microcontroller that we are going to use, and what topology we are going to use the interface the computer with our multitude of sensors, we needed to decide on what protocols we are going to use to talk between the computer and the microcontroller. As the PIC18F4550 is fully USB 2.0 compliant, we have a data bandwidth of 12Mbps and will be sending 64B packets at a time. This is a standard of the USB 2.0 specification. Following the standard for most microcontroller applications, the first character, or the first eight bits, of this packet will be a control code determining what function to run on the microcontroller. The other 504bits are used for data. This is an entirely arbitrary setup, but we are able to call 2^8=256 functions with this method, while still having plenty of space for our data to be passed. The following functions can be viewed from the aspect of the compute sending the microcontroller commands. These functions include moving the XY head in the X direction, moving the XY head in the Y direction, turning on the laser, turning on the Q switch, turning off the laser, and a verbose senor reading state. Due to the way that we are planning on designing our software, we are be sending a command every time we want the XY head to move, and therefore these commands take up the bulk of what we are sending to the microcontroller. Furthermore, we needed to decide if the Q switch should be on or off for each location that the XY head is capable of being located at. For this reason, and due to the nature of the Q switch, the command to cut the Q switch on and off is a pulsed command that is a sub routine of the X and Y movement functions. To simplify the move functions, there is only one move function that reads in specific digits that tell the machine to move in the X or the Y direction. There is another bit that tells the machine to pulse the Q switch. The laser is cut on at the beginning of the mill operation, and left on until the job is finished, as it will not actually be lasing in this state and thus will not be actually removing any material. The verbose sensor function will be used to do diagnostics on the machine, and will give priority to sending a large amount of sensor readings back to the graphical user interface. This will be very useful when we are fine tuning the laser output power. Finally, we implemented a shutdown function. This function will read specific bits out of the data regarding which parts of the machine need to be shutdown, and if the machine needs to go through a safe and normal shutdown or if it needs to do an emergency shutdown. An emergency shutdown has a high likelihood of damaging equipment, and would only be utilized if there is an imminent safety concern. We can also look at the functions that are solely focused on sending data to the computer. These functions are mainly sensor readings and log file operations. These files will take a background existence to the commands coming from the computer, as they are less important. Since we have a flat topology, we are able to poll and send sensor readings. They are not real time, but will be only slightly delayed. This is required as we have a large number of sensors, and each sensor requires the use of the analog to digital converter for it to be read. For other things, however, such as the limit switches on the XY table, or the contact switch on the case, we will be able to read those in real time as they will be coming in as a digital signal. These digital signals can be read on a per buss basis. This is necessary as we want to stop the XY head as fast as possible if it has hit one of the limit switches, 65 and we want to shut down the laser system immediately if someone has forced open the case without entering the administrative override. We are planned on having two commands go to the machine for every one command that comes from the machine. This gave us a good data rate for sending commands, and still gave us a good sensor and log resolution on the computer side of things. We do not have a fancy method to handle memory bandwidth bottlenecks. We simply enter a loop until the data that has been requested is received. 12.2 – Prototype/Test The figure below (Figure 12.1) shows the schematic that we used to create the prototype board, and Figure 12.2 shows an actual picture of the board that we have created for testing. Figure 12.1: Schematic used to create prototype board 66 Figure 12.2: Picture of the actual prototype board This board was created in house using an etching process. A FR4 board was first evenly coated in a layer of black spray paint. The portion of the coating over areas of the PCB where we wanted the copper to be removed was then etched off using a CO2 laser on a professional laser milling machine. The now exposed copper was then removed using hydrochloric acid and hydrogen peroxide. This finished board will be used for the prototyping of each section of our project that is going to require a microcontroller. There will be a microcontroller for each axis of the XY table. The main purpose of the prototype board was to determine which pins we will need to use for that section. This allowed us to make the final boards with the exact layout that is required. Extensive testing was be required before we can actually use any of the microcontrollers in our project. The number one thing that we needed to test for is logic errors. This included things like the machine reporting an error, and a result occurs such as the laser power increases instead of the machine shutting off. This took the longest of all of the tests, as a large number of combinations needed to be tried. The main thing that we were be looking for, however, was simple mismatches between event codes and actions. So, while this took the longest to test it took the shortest amount of time to fix. After we have assured ourselves that there are no logic errors in any of the microcontroller code, we tested the connections between the microcontroller and the peripherals themselves. This involved connecting each individual sensor to the prototype board, and applying a stimulus to the sensor and verifying that the correct result is received by our software. After we had verified that each individual sensor 67 worked, and that the microcontroller is reading those sensors and getting the data back to the computer correctly, we tested the combinations of sensors that will occur in each section of the machine. This is to make sure that sections that have to process multiple sensors that use the analog to digital converter, such as the laser sensor microcontroller, are capable of handling reading all of the sensors, and reporting any changes to the sensors in a timely fashion. 12.3 – Build We used the same process that we used to design the prototyping board for the actual boards that went go into the machine. The difference in the actual boards and the prototyping boards is that each section’s board was custom made for it. 68 SECTION 13: Software 13.1 – Design For this section of our project, we first needed to decide which programming languages we wanted to use. The C programming language was a given for the embedded portion of the project due to the PIC2550’s support of it. This allowed us to avoid the tedious task of hand coding assembly. The other reasons for choosing the PIC2550 have been discussed in Section 13. For the portion of our project that is running on the control computer we have chosen to use the Java programming language. The other options that we considered were the C programming language and Visual Basic 6. The main reason that we chose the Java programming language was that our main coder for the GUI and computer/machine interactions has had the most experience in graphical user interface design in the Java language. The C language does not support the creation of a GUI as easily as Java does, from a standpoint of object oriented programming as well as from the standpoint of the Netbeans IDE available for Java. We did not chose to use VB6 as our language of choice as there are some issues with it interfacing with a PIC microcontroller, along with our coder not being familiar with the language. Furthermore, the jPicUsb Java library allowed us to easily send and receive data from the PIC microcontroller from within Java. The Java programming language was used to display the GUI to the milling machine user, make calculations, and send data to the machine itself. The GUI initially presents the user with a simple interface to load a Gerber file or to load a PNG file. The Gerber file format is able to be produced through a wide range of PCB layout software, and is the current standard used by many professional PCB manufacturers. The two main files that we are concerned with are the *.GTL and *.GBL which are the layers for the top layer copper trances, and the bottom layer copper traces respectively. The format supports other layers such as a silk screening layer (*.GTO) and a solder resist layer (*.GTS), but these are not implemented in this project. If a project requires those two layers, the user will need to contact a professional PCB manufacturer to have their project processed. The processes used to transform the Gerber files into a format that our machine can handle are discussed later on in this section. To determine the user’s access level, a user name and password combination is used. This was initially going to be done with a hardware based user access card that stored the user access level in an encrypted format. This turned out to be one too many additions to this project and has been cut for the foreseeable future. The user’s password will be assigned to the user at the time of their milling machine certification. The user name is the students NID. The password is a random string generated from lower case letters and numbers that is between six and eight characters in length. This access level determines the interactions that a user is capable of with the machine. These interactions are discussed further in the Security section of this paper, Section 15. The program then takes the bitmap 69 generated from the Gerber file and allows the user to place it in the valid areas of the board. The GUI for this project will consist of several parts. The first part is the window (Figure 13.1) that will allow a user to log into the system. The main part of the GUI will contain the rest of the options, including the placement of the image on the board and the options for the users above the level of Standard User. These features will be discussed in more detail below. At this stage the user will enter their user name and password combination in Figure 13.1 that was assigned to them at the time of their certification. This will determine the user’s access level so that they are not shown restricted options in the next step. If the user name and password combination do not exist in the memory of our program the user will be returned to the dialog asking for their user name and password until they enter a valid combination or exit the program. The user name entry will be a simple JTextField, but the Password field will be a JPasswordField, so that the password is hidden when the user is typing it in. Figure 13.1: Enter a User Name and Password In this stage, the Next button will call the method authUser(userName, password) to determine if the user is a valid user or not. Additionally, this method will return the user’s access level. If a -1 is returned the entry is not valid, if a 0 is returned the entry belongs to a Standard user, if a 1 is returned the entry belongs to an Experienced user, and if a 2 is returned the entry belongs to an Administrator. This authentication will be accomplished through the use of the SHA-512 hashing function. The user name and password pairs will be stored in a plain text file in the same directory as the main program. Each time a new user is certified, their user name will be entered into the file along with the hashed value of the password they are assigned, slightly modified to provide the user’s level. Instead of simply storing the user’s password as a hash, we will compute the hash of a combination of the user’s password and their assigned access level. For example, if the user aa123456 is assigned to user access level 0 and they are assigned the password b1234cd, the string that will be hashed is “0+b1234cd.” When the user gets to this window, all of the user name and hash key pairs will 70 be loaded into a TreeMap. When a user enters their credentials at this step, the user name they enter will be used as a key for the TreeMap data structure. This will return the stored hash key, and this stored hash key will be compared against the four hash key’s that are possible for this user’s password that was just entered. The user will be granted their access level depending on which of these hashes matches the hash on file. The security applications of this implementation are severe. Since hash functions are one way, it will be difficult for someone to guess a user’s assigned password. However, if the user obtains access to the main password file, it would be trivial for them to change their access level by simply re-entering a hashed entry of a new access level concatenated with a password. We planned to eliminate this possibility by dynamically setting the permissions of the user access file and the user data folders. The user access file would then only be able to be read or write when the main program needs to read or write it, and the user data folders will only be able to be read or written when the correct user is logged in. We thought this would be possible through the use of the windows command line tool CACLS, however it is not. This is the main area where the user will interact with the milling machine. Figure 13.2 shows the layout of the full GUI that an Administrator would see. All of the content in this window is displayed based on the user’s access level. This figure shows what a user of access level Administrator would see after logging in. If an Experienced User logged in, they would only see the Standard and Experienced user boxes. The reason for displaying the options like this is three fold. First, the GUI is shown in this manner in the spirit of security. There is no need for users to be able to see the options available to them at a higher access level, and be tempted into trying to trick the system into granting this higher access level. This sounds like the principle of security through obscurity, but it is mainly to take away the temptation for users to break the system. The actual methods that will be controlling the features contained within the GUI will all be locked based on the user access level. Second, this is done for reasons of simplicity. The vast majority of users will be standard users, and will not need to see the Administrator options, even if they will not work for them. Third it cuts down on the number of windows that need to be opened for the user to interact with the machine. If we had spawned a separate window for each access level the software would have been difficult to work with. The top row of Name, Access Level, and Status are shown no matter what level the logged in user is. The userName and accLevel fields are not modifiable, and are included in this window to allow someone to easily tell who is logged in by glancing at the screen. The userStatus field will display either OK or ERROR, with OK being displayed when the machine operating at full capacity and ERROR being displayed when the machine has any error occur that limits the operation or safety of the machine and the user. This status is left purposefully vague, as the Standard level users will not be able to fix any of the errors that are serious enough to result in an ERROR status. 71 Figure 13.2: Shows how the individual user sections fit into the main GUI The Standard Users box (Figure 13.3) within the main GUI is where most of the work will be done, and is accordingly the largest area on the screen. This box will contain the area where users will load their file, place their image on the available mill area, reconnect to the machine, and start the mill procedure. Furthermore, the user will be able to redisplay the console if they have closed it by accident from this pane. 72 Figure 13.3: Standard user input pane The load file button will produce a GUI that displays the possible locations for an image to be placed. The area that will be used for the placement of the image on the mill area will be the most complicated part of this GUI. This area will start off with a 700x700 pixel square drawn on the Java Canvas class with the paint() method. This hollow square will be in white, and represents the area that can be milled on a new FR4 board. Then, a filled in red rectangle was going to be drawn on top of this square to represent the area that cannot be milled due to a user file being loaded. If no user file has been loaded, then there will be no red rectangle drawn. This feature was removed because of time limitations, and currently user’s simply need to know the extents of their boards and be wary of them. The user image was going to start off following the computers mouse. This was to be accomplished through the use of the getX() and getY() methods of the MouseEvent class. The result of these methods would have been used to move the rectangle representing the users Project image around the board, based on the location of the top left corner of the image. This feature was removed in favor of allowing the user to move the image around with the arrow keys, as this was easier to implement and less confusing for the user. The isValidImageLocation() method was to be used to determine if the image that the user is attempting to add to the board is in a valid location. It was to be accomplished through two checks. The first check was to be based on the centroid of the image being placed and the remaining area that can be milled. If the centroid of the image is within that area, the image will not be allowed to be placed there. This will be used to eliminate any images that are too large for the remaining area that can be milled. An example of this case is shown below (Figure 13.5). 73 Figure 13.5: Invalid image placement locations, condition one The second check (Figure 13.6) would have been based on the lines that make up the image, the maximum area that can be milled, and the area that has already been removed. If the lines belonging to the image that needs to be placed intersect any of the other lines on the display, a false will be returned. This would have been accomplished through the use of the intersects(Rectangle2D p) method in the java.awt.geom.Area class. This method returns true if the current Area object is intersecting the specified Rectangle2D object. This will take care of the cases that appear on the following image. Note, only one image is actually going to be placed on the window at a time, this is just showing the possible areas of conflict that the intersects(…) method will detect. Figure 13.6: Invalid image placement locations, condition two We were unable to implement this check due to time constraints. In the current design of our machine the user needs to be cognizant of the amount remaining of their board and where the home position of the machine is to keep from running out of available PCB material. We were going to implement an automatic placement algorithm, but time did not permit and without a valid image location check it would have been impossible. This algorithm would have taken the user image and attempted to place it anywhere in the image. As of right now, the only way that we know of doing this would be to start with the two corners of the image and the maximum area that can be milled and move the image over pixel by pixel until the right most side of it reaches the right side of the millable area. Then move down a pixel, and sweep to the left. Every time the image was moved a pixel, the isValidImageLocation() method would have to be called. In the worst case scenario of a 1pixelx1pixel image, this would result in 144,000,000 calls to the isValidImageLocation() method. This is an unacceptably large number, and 74 until a better algorithm can be found for moving the image around this will not be implemented. We were going to allow users to create a user file that could store a previous boards remaining millable area. Clicking of the New User File button would have performed several tasks. First, it would have saved and closed the current user file. Every time a user file is created, it is named by the convention of YYMoMoDD_MiMiHHSS.user where DD is the day in two digit format, MoMo is the month in two digit format, YY is the year in two digit format, and MiMiHHSS is the time. This user file would then be displayed onto the GUI in the Millable Area box. Furthermore, the corresponding entry to the millReady String would be set to a zero, explained below, as the image has not been properly placed on the new user file. Even if the image is in a correct location, it must be moved at least once, even if it is back to the starting location, for the isValidImageLocation() method to trigger. The Load Previous User File button would have presented the user with another browse window, much like in the earlier part of the GUI, that would only have displayed *.user files. This browse window will default to the user’s directory on the controller computer. The last thirty saved user files would have been stored in this file, along with the last thirty PNG files that have been created from user input Gerber files. These features were not implemented due to time constraints. The Mill button will do just that, and start the mill procedure. This will first check with the millSet() method. The millSet() method will check the millReady String to verify that all entries are a 1. We have designed the system this way so that we can easily implement additional checks before the mill procedure is ran. While we have not decided on the final length, or what all will be included in the checks, if there is even a single 0 in the String readyToMill will stay false and the mill procedure will not be allowed to move forward. A for loop checking each entry will be responsible for the verification using the substring() methods and the length() method of the String class. If the string is found to contain all 1’s, the readyToMill Boolean variable will be set to true. Once the millSet() method returns true, the mill() method will be run, and the readyToMill variable will be returned to false. This is to prevent users from double clicking the Mill button, and causing two mill procedures to run simultaneously. And finally, the saveUserFile() method would have been run. This would have saved the user file in use to the user’s folder, and check if there are more than thirty user files present. If there are more than thirty, a policy of least recently used will be implemented, and the oldest files will be deleted until there are only thirty left. Due to this policy, it is unadvisable for users to store their custom user files in this directory if they wish for them to remain for more than thirty milling cycles. The mill() method will be discussed in this section below. We had planned on including an option for user’s to enter the dimensions of the remaining millable area of their board. After some consideration, however, we decided that this was too advanced a feature to include in the GUI of the 75 standard user, but something that standard users might still find useful and thus something that could not be exclusively part of one of the higher user access level groups. Therefore, we have decided to just include documentation on the format of the user files, and allow users to input the data themselves into a file. A final format for the user files has not been decided on yet, but it will most likely be pixel coordinates outlining the areas that have already been removed from the board. A single entry would be sufficient to remove a rectangle from the board, but any other shapes would require multiple entries, each describing a rectangular area that cannot be milled on. The conversion factor from inches to pixels is simply 1000 pixels per inch. Therefore, if you have a 12inx12in board, and a square that is 3inx3in has been removed from the top right corner, the entry in the custom user file would be ‘9000 12000 0 3000’. The first two numbers are the X coordinates that have been removed, and the second two numbers are the Y coordinates that have been removed. We will use the convention that the top left corner of the board is 0,0. Figure 13.7 is the window that the user will see after clicking on the load file button on our main GUI. The options available to them in this window entail entering a file name or the more advanced option of entering a PNG file. Both of these options can be accomplished through the use of a text box and simply typing in the full path to the file, or using the Browse button to the side of it to locate the file on disk. The Clear button will just clear the specific text field. This allows a user to accidentally enter a file name, clear it, and then enter a PNG file without causing an error. If the PNG file option is used, the user needs to have cleared the file name box before proceeding with the Next button, and vice versa. The user will only be allowed to proceed past this stage if no errors occur. Errors will be caused by having both an entry in the File name, and PNG File fields, if one of the files that are specified does not exist, or if a required field is left blank. The only required fields are the File Name or PNG File fields, but not both at once. If an error occurs, the same window, with the same inputs, will be shown to the user after an explanation of the error is shown to the user in a popup window. The user will be given two more chances to fix the error using the same inputs. If after three errors, the user has not cleared all of the errors, all of the inputs will be cleared for the user to try again. This step does not ascertain the fitness of the input files, it just accepts them. After the user presses the Next button, only then does the system try to determine if the files are well formed. 76 Figure 13.7: Select a File Name and User File The Browse button functionality in this section is handled by the Java JFileChooser class. This allows us to show a fully functional browsing window that we can pull the path name of a file from, and still limit the user to what types of files they select. We used different instances of the JFileChooser class for each of the two Browse buttons. This is required as we want each button to filter to only a specific type of file that can be selected. The File Name browse button will only be able to select *.GTL and *.GBL files while the PNG File browse button will of course be only able to select *.PNG files. This would cause some inconvenience to the user, as each new instance of the JFileChooser class would default to the logged in users home directory while most of our users will be either accessing their files off of email or a flash drive. We will solve this problem by saving the first directory that the user enters with the getCurrentDirectory() and setCurrentDirectory(File dir) methods of the JFileChooser class. Every time a browse button is pushed, a check will be run if a directory has been used besides the default directory of My Documents. If a new directory has been used to open a file, then that directory will be displayed when the Browse window is displayed. This will be useful, as most users will have all of their files in either a single directory or in directories that are close to each other on the file tree. The result of the file selected in the Browse window will be stored in the text box next to the specified button with the getSelectedFile() method. Since this is a text box, the toString() method of the File class will need be called to be able to display this information. This String will be written to the text box with the setString(String str) method of the TextBox class. The Clear button will simply use this same method to set the String in the text box to null. The Next button will be responsible for several tasks. First of all, it will popup the next window, but with the Go button disabled. Next, it will perform a final check to verify that there are no errors in the types of files in each text box, that either the File Name or PNG File field is filled in, and that the files actually exist at the specified location. These tasks are accomplished through the use of string 77 comparison, Boolean logic, and by attempting to open the files while checking for a FileNotFoundException to be thrown. The logistics of these tasks are trivial, and will not be mentioned in this report nor will tasks such as this be mentioned again. If there are no errors from these procedures, the next step of determining if these are well formed files is done. The easiest way to check if the input Gerber file is a valid Gerber file is to actually run it through the gerb2tiff program, and check the error messages that are returned, if any. If any error messages are returned, the first GUI window will be redisplayed with a copy of the error message shown in a popup window. To check the PNG image we will have to do a pixel by pixel read of it to determine its fitness. Since this is done in the conversion of the PNG image to a format that the machine can use, we will simply run the convertPNG(String str) and issue a flag if a discrepancy is discovered. A discrepancy would be if the file is composed of anything besides black and white pixels, or if the file is too large. The board size would be too large if the PNG file is more than 12,000 pixels in either dimension. This check will also be completed on the PNG that is automatically created if the user chooses to input a Gerber file, to keep users from trying to mill projects larger than the largest available milling area. We arrived at this number as we will support a maximum of 12inx12in boards, and will be running our XY table at 1000dpi with one dot equaling one pixel. Again, if a discrepancy is discovered the first GUI window will be redisplayed explaining to the user that their PNG image is malformed. If no errors are found, the first GUI window is closed, the Go button is enabled, and the machine will go through its startup procedure if it was not already on. The next conditionally displayed box (Figure 13.7) is the one that would have belonged to the Advanced user group. We decided to not implement Advanced users in this implementation of the program. Advanced users would have all of the permissions of the Standard users and will be able to modify the attributes of existing boards and modify the available PCB materials. When a user clicks the ‘Select Current Board’ button, the window in Figure 13.8 would have appeared. Figure 13.7: Advanced user input pane 78 Figure 13.8: Select Current Board This window would have allowed an advanced user to select which type of board is going to be mounted in the machine. This will remain the default board for the machine until this setting is changed. Figure 13.9 shows the window that would have opened when an Advanced user clicked the ‘Modify Available PCB Materials’ button. In this window, the user would have been able to select which types of boards that can be selected in the Modify Board window discussed below. We have designed it this way to allow us to be able to easily add and remove boards that our machine can work with, as we will only be able to tell how well the machine works with a certain type of board after we have tested that board on the actual machine itself. Any number of the jRadioButton’s can be selected. We have included options to select or deselect both individual groups, as well as every entry displayed. Figure 13.9: Selection of PCB Materials 79 When a user clicks on one of the ‘View Saved Attributes’ buttons, Figure 13.10 figure will be displayed. None of these entries are editable, as this window is for the sole purpose of allowing a user to see what that particular board’s previously saved attributes are. Figure 13.10: Information about PCB Materials Figure 13.11 shows the window that would have opened when an Advanced user clicked the ‘Modify Attributes of Existing Board’. Notice, Advanced user’s are not capable of adding new boards to the system, only modifying boards that are already in the system. This is accomplished through the use of the jComboBox that will populate the variable savedBoardName. The entries that will be in this drop down box will be decided on by the aforementioned ‘Modify Available PCB Materials’ button. When a previously saved board has been selected, the entries in this window will all auto populate with the data stored in the data structure used to store the boards. For more information on how the board data will be saved, see the section below on adding new board types. There will always be a default saved for normal FR4 boards that can not be edited by any users under Administrator level. Furthermore, the four laser entries in this window are only suggestions. Advanced users are not laser experienced service technicians, and adjusting these settings could cause harm to the machine. For this reason, when an Advanced user makes a suggestion on the laser attribute entries, they will only be able to use this setting in a test mill. A test mill will allow a user to run the mill procedure, but will only allow the procedure to run for a set amount of time. We will determine this amount of time after we have built the machine, and tested its response to various laser settings. This test mill will be sufficient for the Advanced user to determine if the settings will work for the current type of board. Advanced users are not allowed to over ride any safety measures, and therefore they will only be able to vary the laser power and pulse rate slightly. An Administrator must verify the laser settings from this window before they will be available for a normal mill procedure. 80 Figure 13.11: Board modification options The next conditionally displayed box (Figure 13.12) is for the Experienced user access level. These users will be responsible for the training and certifying of Standard and Advanced users, and will almost exclusively be members of the Amateur Radio Club at UCF. For this reason, they will be able to add and modify users, and to add new board types to the system. Figure 13.12: Experienced user input pane Figure 13.13 shows the window that will be displayed when the ‘Add User’ button is pressed by an Experienced user. The userName should be the students NID. The other two fields, Access Level and Password, will be conditionally displayed. Since Experienced users can only add Standard and Experienced users, they will only be able to select an access level of 0 or 1 for the new user. Furthermore, experienced users will not be able to override the password restriction and will be forced to use the ‘Generate Password’ button. Administrators will be able to select any one of the four access levels, and will be able to manually type in a password. The ‘Generate Password’ button will generate a password of the format x####xx, where x is any lower case letter and # is any single digit decimal 81 number. This can be accomplished through an extrapolation of the code snippet shown below (Figure 13.14). Figure 13.13: Add a user to the system Figure 13.14: Example of Password Generation Code For the full program that will be generating our passwords, please see the code titled ‘Password Generator’ in Appendix C. The isValidUserName() method will be called when the ‘Done’ button is pressed to verify that the user name that was entered is a valid NID, if the user is not an Administrator. The check to see if the user name is a valid NID is bypassed when a user with the access level of Administrator is logged in. After this is completed, a folder is created for the user in the main program directory and its permissions are set. For more information on user folder permissions, please see Section 14. Figure 13.15 shows the window that will be displayed when an Experienced user clicks on the ‘Modify User’ button. The isValidUserName() method will run after every keystroke into the userName field. This will be done by checking the KEY_PRESSED field of the java KeyEvent class after every entry into the box. The isValidUserName() method will return true if the user name is found in the system. We were originally going to verify that the user name is a valid NID here, but we have decided to skip that step as Administrators can create user accounts that do not have an NID for a user name. The user’s current access level will be read out of the data structure that we are using when isValidUserName() returns as true. User access levels will be placed in a TreeMap along with the user name and hashed password pairs when the user access level files is first opened. Experienced users will only be able to click on the 0 and 1 buttons, as they are only allowed to modify a user to become a Standard user or an Experienced user. Furthermore, if the user’s access level is returned as that of Experienced or 82 Administrator, an Experienced user will not be able to edit the access level at all. Administrator users will be able to change anyone, even other administrators, to a different access level. Due to the way that we are storing user passwords, hashes, there is no mathematically possible way to retrieve a user’s password. To overcome this, we will only be able to re-issue passwords to users. This will be accomplished through the same method that the Add User window used, and will only be available to Experienced and Administrative users. Figure 13.15: Modify user account Figure 13.16 shows the options that would have been available to an Experienced user when the ‘Add New Board Type’ button was pressed. It is very similar to the ‘Modify Attributes of Exiting Board’ button that is available to Advanced users, but with the important distinctions that Experienced users are allowed to add new boards and that Experienced users do not need to wait on the authorization of an Administrator to change the laser power output. The entries (Name, Substrate Material, and Copper Thickness), under the information heading are for human information and records keeping only and do not come into effect at all. The entries under the Data sections are the values that are actually used by our main program and the machine itself. The width and height values are used only in the main program, and the laser power settings will be fed to the microcontroller. 83 Figure 13.16: Add a new board to the system The Administrator section (Figure 13.17) of our GUI is by and far the largest section. We used this section to test our laser system, XY table, exhaust system, and TEC system while we are building the project. Furthermore, this section helped us to troubleshoot any errors that arose, and adjust laser output power for new board types. This section can be split into two areas. The top part is mainly controls that control some aspect of the state of the machine. The bottom part is mainly sensor readings to determine the health of the machine. It is important to note also, that there are instantaneous state controls, and controls that only matter for the next mill operation. The instantaneous state controls are the movement of the milling head up, down, left, or right, forcing the laser either on or off, and adjusting the lasers power up or down. The controls for adjusting the amount of power used to remove either the copper layer or the copper and substrate layers will only affect the next mill operation. This is possible because the values that are stored with the board types have already been loaded into a temporary data area. These controls only change that temporary data area, and the next time that a user logs in, or a new board type is selected, the temporary values are overwritten. Furthermore, Administrators have the ability to override safety measures which entails opening and closing the cover during the machines operating, turning on and off the TEC, and turning on and off the fume extraction system. The last two controls that the Administrator has access to is the ability to verify the laser settings (Figure 13.18) recommended by an Advanced or Experienced user, and to force the stepper motors to run back to the origin until they hit their limit switches. This return to origin button is necessary because the stepper motors will lose their position data if there is a power outage. 84 Figure 13.17: Administrator user input pane 85 Figure 13.18: Verify Laser Settings As for the XY table head movements, we went with a stepped system for this based on time. For the first five seconds that one of the up, down, left or right buttons is held down, the XY head moves at one tenth of its maximum speed. After five seconds, the head will move at half of its maximum speed, and after ten seconds the head will move at its maximum speed. This algorithm will only apply in the central milling area. When the XY head gets close to the edge of the milling area it will be forced to slow down no matter how long the control has been held down, just so that no physical damage is done when the head hits the limit switch. Where applicable, the sensor data that is being displayed primarily in the bottom half of the Administrator section will have units incorporated with this display. This allows us to vary the scale on the displays in real time as the values vary of a large range. The same main Java program was also used for the backend of the user interface. This backend was responsible for transforming the input file into a milling format, performing operations on the created file, transmitting the file to the machine, and handling errors thrown by the machine hardware. The first step of the backend was transforming the user input Gerber file into a format that can be sent to the machine. This is done by transforming each Gerber file into a monochrome bitmap TIFF file. The conversion process is handled through the use of the Gerb2tiff program created by Adam Seychell. Our machine is capable of producing 1000 dots per inch (DPI), and therefore the gerb2tiff program is passed the argument to set the DPI to 1000. This will help keep the file sizes down, and will make further image process less time intensive while not losing any resolution. 86 Since we have to do pixel by pixel operations on this image, and Java does not natively support TIFF images, we first need to do an image conversion. The PNG (Portable Network Graphics) image format was chosen for our final image type because it is natively supported by Java and employs a lossless data compression scheme. We did not want to use an image format that implements lossy data compression, such as JPEG, and risk image artifacts ruining the mill procedure. This conversion process was done through the use of the ImageMagick software suite, most specifically the convert.exe binary. This conversion can easily be run programmatically through Java in a very short amount of time, one to two seconds on the tested TIFF transformed Gerber files. The reason for the conversion from Gerber format to a tiff image, and finally to a PNG image, is one of abstraction. This abstraction will allow us to implement other milling formats in the future, if time permits, as all of our backend processing of the image will be on a standard format PNG image file. Also, if a user wishes to implement a nonstandard feature of one of the major PCB layout programs, they will be able to directly input a formatted PNG file. A feature allowing users to save converted PNG files from pervious runs will be included, which will be the easiest way for a user to have a starting PNG to make changes to that is in the correct format. The final operation on the PNG file is the actual read. This was accomplished through the use of the BufferedImage Java class. The getWidth() and getHeight() methods of this class will allow us to create a double nested for loop that will traverse every pixel in the PNG image. These pixels are then placed in a two dimensional integer array of the same size. The locations on the board that will either have the copper removed, or have the copper and the PCB material removed, will be indicated by a black area in the image and a 1 in the integer array, while the areas that will not be touched will be indicated by a white area in the image and a 0 in the integer array. There are separate layers for areas that just need copper removed and areas that need copper and PCB material removed, as the laser will need to be set to a higher power and spend more time at the location for the second case. This will allow us to do a mill of one side of the board in two steps, copper removal and copper and PCB material removal. Currently our laser system is not capable of penetrating the PCB substrate, and this design for the input to the machine will allow us to at least accomplish the copper removal successfully. Users could then be able to but the board on a standard drill press and drill the holes themselves, while still getting a prototype far cheaper and faster than the professional PCB manufacturers. The next decision that we faced was to do a raster or a vector mill. Raster is the obvious choice as our data on where to cut the laser on, where an integer of 1 is stored, and where to leave the laser off, where an integer of 0 is stored, is already in a raster format. We were initially hesitant to use this format though. A raster mill procedure will take significantly longer than a vector mill procedure, just due to the movement time of the XY head where the laser is not on. Furthermore, a raster mill will add undue wear and tear to our drive motors and 87 table assembly. A vector mill would locate and mill contiguous objects, instead of simply just sweeping over the entire accessible area of the XY table. This would add a large amount of computation time to the computer side of the program. However, it would reduce the wasted amount of time during the actual mill process. This would be the most favorable way to run the machine, as it also provides the minimum amount of movement of the motors, which translates into the minimum amount of cumulative slip generated and thus provides the highest tolerances. We have been unable to find an algorithm to successfully do a vector mill operation on the shapes that would need to be milled in a PCB. Therefore, we implemented the raster mill procedure. However, as we are implementing this in an object oriented fashion, we designed the interfaces in such a way that a vector mill operation will be able to be implemented in the future. This is made possible due to the way that we are sending data to the milling machine. Java was also used to interface with the PIC2550 MCU’s on the milling machine. This was accomplished through the use of the jPicUsb interface created by Geronimo Oñativia. The main portion of the data that we are sending to the MCU will be relative position data along with a binary value of whether to cut the laser on or cut the laser off. Since we will not be sending any complex pictures or data sets to the microprocessor side of this project, it doesn’t matter how the directions are provided. In the raster mill procedure that we will be implementing, the directions are mostly along the lines of ‘Move Right/Left/Up/Down X Steps’, ‘Cut laser on/off’. The difference between this and the vector mill procedure is that the directions would be telling the XY head to move around the shape of objects. Either way, the microprocessor is only seeing commands on where to move and if the laser needs to be on or not once we are in the main portion of the program. The jPicUsb software only needs three commands to be instantiated. These commands are “iface.load();”, “iface.set_vidpid(“vidString&pidString”);”, and “iface.set_instance(0);”. After this, data can be sent back and forth from the main Java program to the microcontroller through the use of the Write(…) and Read(…) methods. Please see Appendix D for the documentation of these methods. The mill() method makes up the bulk of what could be considered our core program. This method is responsible for doing two things: calling the translateData() method and sending that data to the PIC2550. The translateData() takes the internal data structures that we are using in Java and translate them into something that can be used by the PIC2550. We will have to send commands to turn the laser on and off, commands to turn the Q switch on and off, move a distance in the X direction, move a distance in the Y direction, and a go home command. The data on how to move the XY head and whether to cut the Q switch on or off will come directly out of the array created from the processing of the PNG file. This will be done line by line in the mill() method itself. As we will not be sending any complex data structures to the microcontroller, when the X array index moves over one location, we will send a command for the XY head to move in the X direction one step. The same goes 88 for the Y direction. If the integer at that index is a 1, the Q switch will turn on, else the Q switch will stay off. The number of times that the Q switch will pulse before the head moves on to the index will be set by the type of board that is loaded or based on what the Administrative over ride has been set to. After this entire run has been completed, the XY head will move back to the origin. This will be done through the running of the returnToOrigin() method. All that this will do is move the XY head back towards the origin until the two limit switches in that corner trigger. We are doing this to limit the amount of slip in our XY table between the copper remove and the process that removes copper and PCB substrate material. We have separated these two processes as we were unable to get through the substrate material in our burn test. If nothing else, the user will have a location to drill at and a drill bit width to use in that location if the machine fails to punch through. After the mill procedure, they will be able to put the board on a drill press and drill out their hole locations accurately. We will be using the *.drl file of the same name as the Gerber file to get the data for the location of the holes to be made. As this is a file intended to be used by a mechanical drill, we will be ignoring a large portion of the file. The entries that we will mainly be interested in are the tool sizes, indicated by the T prefix, and the absolute X and absolute Y position. Please see Appendix B for an example *.drl file. This T code would look something like “T1C0.025”. This indicates that tool one (T1) will be making holes that are 0.025inches, or 25mils. The line indicating where this hole would be placed would look something like “X4.775Y-3.625”, after a “T1” had been issued. This absolute location would be where the center of the hole made by T1 would be located. Instead of delivering this information directly to the milling machine, we will be doing the processing on it in our Java code and sending the same style of relative position and laser on or off commands that we sent for the removal of the copper layer. To accomplish this, we were first going to plot the locations that the exterior of the circle will touch in an array of 12,000x12,000 entries. This will equate one cell in the array to one mil on the actual board. This would have resulted in an extremely large array that would be difficult to work with. Instead of this, we have decided to use a multilevel indexing strategy where we will take the entire 12000x12000 array and divide each dimension by 8. Then, we will have an offset that will index inside this initial index, and can select the correct bit within this index. The way that we were initially going to accomplish this was with the code in Figure 13.19 below. Figure 13.19: Code snippet of circle tracing algorithm 89 The code that we used in our final project is very similar to this code but with the index translations described above. In this implementation (Ax, Ay) describes the locations that the outside of the circle traces, (Bx, By) is the location of the center of the circle, and D is the diameter of the circle as read from the tool entry of the *.drl file. We started with a map of all zeros, and each position on the map that intersects with the trace of the circle will be turned into a one. We will then take this array, and go line by line cutting the Q switch on, just the same as before, whenever the array index matches up with the stepper motor position. Our main program’s backend will also be responsible for handling high level errors thrown by the machine. Any immediate concerns that could affect user or machine safety are handled by the onboard PIC microprocessors and be echoed to the main program for logging purposes only. These errors (Table 13.1) are things like a laser diode is getting too hot, the cover has been opened, or the XY table is not responding. The solutions to these sample problems are outlined below. Problem Laser diode overheating Solution Increase chilled water flow to that particular diode OR reduce the power to the diode OR shut off the diode Cover has been opened Stop all activity except for critical cool down procedures (some exceptions, discussed in Section 14. XY table is not responding Stop sending commands to the steppers motors to attempt to lessen the damage. Turn on a warning light on the outside of the machine. Table 13.1: Problems handled by the microcontroller The main program is responsible for handling less concrete errors (Table 13.2), and general errors that get thrown that we have not programmed specific resolutions to in the microprocessors. These errors are things like the input data is malformed, the machine is in an unrecognized state, or there are ambiguous power fluctuations. The solutions to these problems are outlined below. Problem Input data is malformed Solution Request user to resend data unless the user has a level of Administrator. Then the machine will mill the given data unless it would damage the machine itself. Request help from the user. Log the actions that lead up the error. Report the problem. Increase Machine in unrecognized state Power fluctuations 90 monitoring of power fluctuations unless the problem has disappeared. If problem is determined to be detrimental to the hardware, a flag will be issued to shut down the machine and not allow it to be restarted without resolving the issue. Table 13.2: Problems handled by the Java code 13.2 – Prototype/Test We realized this was going to be a complicated project from the start. We have lasers, moving parts, high power, and lots of data moving around. Because of this, we started prototyping the software as soon as we had decided on the project. The sections of the software that have already been prototyped are described as follows. We started a preliminary prototype of the software needed to pass data from the main Java program and the program running on the PIC microcontroller before the end of last semester. This attempt was hampered due to some difficulty we have had in developing the hardware interface between the microcontroller and the computer. The software to transform the Gerber file to a TIFF file, and then into a PNG file had also been prototyped at this time. The software that handles this is written in Java, and will be incorporated into our main program but relies on two external programs. These programs are command line oriented, and are thus easy to run, send commands to, and receive info from, directly from Java. The program that handles the Gerber to TIFF conversion is gerb2tiff by Adam Seychell. We call this program with arguments indicating the location of the file that needs to be transformed, and a parameter setting the DPI of the output image to 1000. The gerb2tiff program supports the use of a user defined file name to save the TIFF image as, but as this will just be an intermediary step we will be using the default mode that simply appends a .tiff to the end of the original file name, extensions and all. For example, if Project.gtl is input as the Gerber file to be milled, the intermediary file Project.gtl.tiff will be created. So far in our testing of this program, we have not run into any problems with the Gerber to TIFF conversion process. A problem that may arise however is mentioned on Mr. Seychell’s documentation of the program, the entire RS-274X standard is not implemented. The gerb2tiff program will abort and report an error to the main program if the parameters AS, IR, RO, IJ, KO, or SR are contained within the Gerber file. These parameters are rarely used features of the specification, but if the gerb2tiff reports this error we will stop the mill procedure. As of right now, we do not have plans to manual read the Gerber file, and thus the file that the user is trying to import will fail for our machine. The only recourse in this instance for the user will be to use a different CAD program for their circuit layout, produce a PNG file of 91 the correct format, or contact a professional PCB manufacturer. After the conversion from a Gerber file to a TIFF file, the method handling this portion of the code will call another method to handle the TIFF to PNG. This method will call the convert.exe program out of the ImageMagick software suite. We chose this software as it is licensed under the GPL, and thus is free for us to use in our project and is well supported in both code maintenance and tutorials with several books having been written on the suite. While we are planning on using the ImageMagick suite for the foreseeable future, we are not committed to it in any way. Our project is only using a very small part of this advanced software suite, and we do not need anywhere near this level of functionality for what we are doing. Literally, all that we need to do is convert a TIFF image into a PNG image. We have found that the convert.exe binary can run independently from the actual ImageMagick suite. However, to the best of our understanding this would violate the license that the software is published under. Due to this restriction, we will have to actually install the entire software suite on the machine running our Java program. While this is not necessarily a problem, as we are already constrained to a PC running Windows, it does add one extra piece of software that would need to be installed and configured correctly if our control computer is ever replaced. If we are able to locate a program, or have time to design one ourselves, that can convert a TIFF into a PNG image, and can be run as a standalone binary under the GPL, we will switch our project over to use that software. This will allow us to decrease the work load on the maintainers of the project while increasing the portability of the project as well. Currently, we are planning on simply installing the software on the machine and hardcoding the location of the binary into the Java program. This will be an adequate solution as long as the one computer that we setup is the one that always controls the milling machine. If we have time, we will create a software package that can be installed on any Windows based machine. This software package will have a text file that contains the path locations of all of the necessary external programs, such as the Java virtual machine as well as the ImageMagick suite. The text file will allow new versions of the programs that we are utilizing to be installed. This way whoever is the current person servicing the machine will be able to install the files to any location that they wish. The Java program should run on any operating system that has a Java virtual machine installed, however our project will not. This is due to the fact that the way that we are running the external programs is Windows specific. The programs that we depend on will only run on a Microsoft Windows PC also. For these reasons, the machine that is controlling the milling machine will have to be Windows based. It would be possible to run our project on a different operating system, but substantial changes would need to be made. The changes that are required for our project to run under a GNU Linux operating system are outlined below in Table 13.3: Method currently used gerb2tiff program Possible solution Create or find a program that does the same conversion Find a program that can handle ImageMagick program 92 TIFF to PNG conversion that is not Windows specific jPicUsb program Create a custom interface between Java and the Microchip API that is not Windows specific Table 13.3: Possible solutions to the Windows dependence The main changes are shown above, but other smaller changes would also need to be done in the source itself. The changes necessary would mainly be in file handling sections of the code. 13.3 – Evaluation Plan We wish to write robust software, and have therefore extensively tested our software. This was accomplished through the use of both black box and white box testing procedures. Black box testing is a method of testing that treats software as a ‘black box’ that is impossible to view inside. This means that the code was tested with no knowledge of what internal structures, methods, or external programs are being used. We accomplished this testing by writing some automated software testing programs. These programs are responsible for checking to see what exactly can break our main program, and reporting that result to us. For each version of code that is accomplished, the testing tools will be run against that code to ensure that no functionality has been lost. In short, these testing tools will run all possible ranges values into every possible input of the program. This may be somewhat extreme, but it is necessary as we have a wide variety of technical competence among the users of the machine. To accommodate these testing tools, we implemented a command line version of our program that can accomplish the same tasks as the GUI version. Currently, we do not plan on this being a supported option for the end users, but if time is permitting we will write the documentation and open the ability for them to use our program in this manner. The testing tools that we ran included a test for multiple instances, a file input test, a file format test, a PNG test, a user access check, and a user file test. These tests are contained in one monolithic file that simply cycles through them The multiple instances test makes sure that the program does not allow multiple instances of itself to be run. This would cause havoc with the mill procedure if it was done at the wrong time. The file input test will verify that any range of file names can be accepted by the program. The file format test will check to see if a wide range of Gerber files are transformed correctly into TIFF images. We will collect a sample of Gerber files from various CAD software packages to test. The TIFF images will need to be inspected manually. The PNG test will verify that a PNG image that is read in is treated the same as a file that has been transformed from a Gerber file to a TIFF file to a PNG file. The user access check will run all commands available to the user on each user access level and verify that the restricted users can not access the functionality of the higher access levels. The 93 user file test will test an assortment of various premade User files, and ensure that the user can not place drawings to be milled in that location, and that the machine can only access the locations specified in the file. White box testing is a method that relies on knowledge of the internal workings of the software being tested. This testing uses the same testing tools as the black box testing, but will purposefully try to break the system with certain input values. This causes there to be a smaller number of values that need to be tested, and thus allows us to test faster. Furthermore, this test is more important than the black box testing, as these are the cases that we need to find and either prohibit users from accessing or warn the users of the possible consequences and are the most likely to cause problems. The black box testing is only to find errors in places that we did not expect to find them, such as a Java method mishandling a string of a certain length while the white box testing is to verify that we don’t have problems with something such as reading the first value, the last value, and not the value after the last value of an array. 94 SECTION 14: Security The main focus of the security aspect of this project is the support of the safety of the user, and to a secondary extent the safety of the machine. We accomplished this through the use of a multi tiered security paradigm. The first level of this security scheme was to be a user access level that is read off of the user’s identification card. Since the identification card was to be a proprietary format that we were going to design for this project it would be difficult for a user to spoof a higher access level than they have been assigned through the use of standard card reader hardware. However, we have since decided to use a user name and password combination for access to the system. The user names will be students NID’s, and passwords will be of the format x####xx where x is any letter and # is any single digit decimal number. The user passwords will be hashed and stored in a file in the directory under the main program. When a user enters their password, this password will be hashed and their user name will be used as a key into a TreeMap. If the value of that location in the TreeMap is returned as the same hash, the user is allowed access to the system and is assigned the access level that is listed in the same file on the same line. To protect this file, we will be implementing a system of dynamic permissions, so that no user can simply open the file and change their access level. Furthermore, we will be running the machine on a copy of Windows XP that has been severely crippled to allow the user to only run our program. The possible user access levels are Standard User, Advanced User, Experienced User, and Administrator. Each increase in access level provides the user with more privileges on the machine, as well as more responsibility. The logs of the machine will contain which user was logged in at the time the event occurred. These logs will be kept on the control computer until the log file folder reaches 100 MB, and then the oldest log files will begin to be deleted. Each mill procedure or machine access will generate an individual log file. The name of the log files will in the format YYMoMoDD_MiMiHHSS.log where D represents day, Mo represents month, Y represents year, Mi represents minute, H represents hour, and S represents seconds. The logs will be kept for such a long time so that we can hopefully determine who was using the machine at the time that a user preventable, or user caused, error occurred. If that user has an access level that indicates that they should have had the ability to deal with the error, or known better than to cause the error, they will either be demoted in access level or permanently banned from further use of the machine depending on the seriousness of the infraction. The Standard User access level is what is assigned to certified Senior Design students. This access level will allow the users to open the machine when it is not running and attach their boards to the static portion of the XY table. These users will only be allowed to mill FR-4 boards, and will not be allowed to add additional board types to the machine. We will not be checking the type of the 95 board that the user enters, but the height of the XY table will need to be adjusted for different board thicknesses. This is done to insure that the surface of the board is at the focal point of the milling laser, and if a different board is added the machine will still run with the FR-4 board height setting. This will most likely result in an unusable board, or at best a board that requires multiple runs through the machine. Additionally, Standard users will not be able to add other users and must strictly follow all safety measures. The next level after the Standard User access level is the Advanced user. These users will not be senior design students, but rather other students that have gone through the milling machine training sometime in the past. These users will have needed to prove themselves as responsible Standard level users, and will almost exclusively be past senior design students that are now working on their graduate degrees. These users will have all of the privileges of the Standard user access level as well as being allowed to modify unique sizes of boards and being allowed to change the selection of different PCB materials. Additionally, Advanced users will not be able to add other users and must strictly follow all safety measures. Experienced users will the users that are responsible for the day to day operation and upkeep of the machine. These users will be ARC members that have agreed to take care of the machine, as well as train new users. They will be able to add and modify Standard and Advanced users, but will not be able to add or modify permissions for other Experienced users. These users will also have the permissions of the Standard and Advanced user access levels but will also be able to add new types of boards to the machine, These users must follow all safety procedures, but they will be able to suggest the laser output power when adding new types of boards. An Administrator must verify and allow this suggestion before it is available for an Experienced user to choose from. The laser power will be held in check by the safety guidelines however, so these users do not accidentally violate them. The last, and highest, user access level is that of Administrator. This access level will only be used by laser experienced service technicians. This is due to the fact that users in this access level can ignore all safety measures. This could potentially cause harm to the machine and to the user, so it will only be issued to people that have demonstrated knowledge and experience of working with high power laser systems and all of the risks that are involved in those activities. Furthermore, all users at this access level will be required to have a liability waver on file with the Amateur Radio Club. The only thing that a single Administrator cannot do is run the machine with one of the covers, explained later, open. This will require for two administrators to log in consecutively. This is to ensure that at least one responsible user is nearby incase the Administrator doing the work is incapacitated in anyway. This could be caused by the fumes coming out of the machine or interaction with the laser itself. 96 The physical security of this project was accomplished through the use of the external case of the machine. The external enclosure will be designed this way to ensure that the enclosure can removed for easy access to the internals of the machine. We initially planned to have a hierarchical security scheme. This was going to be comprised of the external enclosure, along with enclosures for the laser subsystem, the XY table, the power systems, and the microcontroller section. The idea behind this scheme was to allow users to access portions of the internals of the machine, but not others. We have precision optics in this project, along with dangerous power systems, and if something needs to be repaired we did not want that technician to mess with other sections of the project. This plan fell through due to the complexity of securing the boxes inside the main box, and the fact that we decided that this project will stay a student endeavor. The only people that will be working on it will be other students that we trust to not mess with something that they have not been properly trained on. The compromise that we have come upon is that there is only one main box. 97 SECTION 15: Personnel 15.1 – Nathan Bodnar Nathan Bodnar is an undergraduate student working on his B.S. in Electrical Engineering at the University of Central Florida. In 2008, Nathan joined Dr. Richardson’s Laser Plasma Laboratories EUV group, there he works as an undergraduate researcher. In the summer of 2009, he took part in the International REU program with the main emphasis in droplet formation. Current projects that he is currently working on includes a time resolving FTIR spectrometer, building a mass spectrometer, designing motor controllers for the droplet delivery system, and testing new compounds that generate EUV emissions. Nathan’s spare time is spent working on projects ranging form building high-powered lasers to plant tissue culture. 15.2 – David Dowdle David Dowdle is a senior working on his BS in Computer Engineering. He is currently employed with the biology department working on amplifiers for electrostatic disturbances generated by amphibious animals. David previously worked under Dr. Chew as an undergrad researcher for packaging of the 70 cm transmitters for high altitude experiments. During his leisure time he diligently works with the Amateur Radio Club at the University of Central Florida. Here he works on projects and helps maintain the environment of the senior design lab. 15.3 – Ryan Maticka Ryan Maticka is an undergraduate Electrical Engineering student at the University of Central Florida and expects to complete his courses for Electrical Engineering in the spring of 2010. He also plans to obtain a major in Computer Science and minor in math after the spring of 2010. After graduation, he would like to work for several years and then return to school to complete a master’s degree. 98 SECTION 16: Bibliography [1] Richards. J. R. "Control of Particulate Emissions," APTI, 1995. [2] D. J. Meier, S. H. Schmidt, and LPKF Laser, “PCB Laser Technology for Rigid and Flex HDI – Via Formation, Structuring, Routing,” 2002. [Online]. Available: http://www.lpkfusa.com/articles/hdi/pcb_laser_technology.pdf. [Accessed: Dec. 13, 2009]. [3] B. Kelly, C. Hallman, D. Arnold, and R. Weiss, "Project ANGEL," Undergraduate Senior Design Project, University of Central Florida, Orlando, 2007. [4] Red Optics, “KD*P(DKDP) Crystal (Potassium Dihydrogen Phosphate and Potassium Dideuterium Phosphate),” 2007. [Online]. Available: http://www.redoptronics.com/KDP-crystal.html. [Accessed: Dec. 13, 2009]. [5] Red Optics, “LBO Crystal (Lithium Triborate),” 2007. [Online]. Available: http://www.redoptronics.com/LBO-crystal.html. [Accessed: Dec. 13, 2009]. [6] Red Optics, “BBO Crystal (Beta Barium Borate),” 2007. [Online]. Available: http://www.redoptronics.com/BBO-crystal.html. [Accessed: Dec. 13, 2009]. [7] Red Optics, “KTP Crystal (KTiOPO4),” 2007. [Online]. Available: http://www.redoptronics.com/KTP-crystal.html. [Accessed: Dec. 13, 2009]. [8] Red Optics, “Anti-Gray Tracking KTP Crystal,” 2007. [Online]. Available: http://www.redoptronics.com/Anti-Gray-Tracking-KTP-crystal.html. [Accessed: Dec. 13, 2009]. [9] Batarseh, Issa, “Power Electronic Circuits,” Hoboken: John Wiley & Sons, Inc, 2004. [10] Maxim Integrated Products. “DC-DC Converter Tutorial – Maxim,” Nov. 29, 2001. [Online]. Available: http://www.maximic.com/appnotes.cfm/an_pk/2031. [Accessed: Dec. 5, 2009]. [11] “Thermoelectric Peltier Device Information (TE Heater / Cooler / Generator Modules) – General Info,” 2009. [Online]. Available: http://www.peltierinfo.com/info.html. [Accessed: Dec. 12, 2009]. [12] F. McClung and R. Hellwarth, "Giant Optical Pulsations from Ruby," Journal of Applied Physics, 1962. 99 [13] “The Variable High-Voltage Power Supply 0-3kV,” 2008. [Online]. Available: http://www.elecfree.com/electronic/the-variable-high-voltage-powersupply-0-3kv. [Accessed: Dec. 13, 2009]. [14] ON Semiconductor, “2N3055(NPN), MJ2955(PNP),” 2005. [Online]. Available: http://www.onsemi.com/pub_link/Collateral/2N3055-D.pdf. [Accessed: Dec. 13, 2009]. [15] Microchip, “MCP413X/415X/423X/425X, 7/8-Bit Single/Dual SPI Digital POT with Volatile Memory,” 2007. [Online]. Available: http://ww1.microchip.com/downloads/en/DeviceDoc/22060a.pdf. [Accessed: Dec. 13, 2009]. [16] OMRON, “PCB Relay G6RL,” 2008. [Online]. Available: http://www.omron.com/ecb/products/pdf/en-g6rl.pdf. [Accessed: Dec. 13, 2009]. [17] Microchip, “AN822 Stepper Motor Microstepping with PIC18C452,” 2002. [Online]. Available: http://ww1.microchip.com/downloads/en/AppNotes/00822a.pdf. [Accessed: Dec. 13, 2009]. [18] Microchip, “MPLAB C18 C Compiler Libraries,” 2004. [Online]. Available: http://ww1.microchip.com/downloads/en/devicedoc/51297c.pdf. [Accessed: Dec. 12, 2009]. [19] Microchip, “PIC18F2550,” Oct. 27, 2009. [Online]. Available: http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010 280. [Accessed: Dec. 12, 2009]. [20] Microchip, “PIC18F4550,” Oct. 27, 2009. [Online]. Available: http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010 300. [Accessed: Dec. 12, 2009]. [21] “C8051F342-GQ Silicon Labs Microcontrollers,” 2009. [Online]. Available: http://mouser.com/ProductDetail/Silicon-Labs/C8051F342GQ/?qs=sGAEpiMZZMvu0Nwh4cA1wWtRoPcQBaz3BDp7SQlE0jo%3d. [Accessed: Dec. 12, 2009]. [22] “ATMEGA162-16PU Atmel Microcontrollers,” 2009. [Online]. Available: http://mouser.com/ProductDetail/Atmel/ATMEGA16216PU/?qs=I3kMT7EEIOUre5FsjF6g7A%3d%3d. [Accessed: Dec. 12, 2009]. 100 [23] “MC9S08JS8CWJ Freescale Semiconductor Microcontrollers,” 2009. [Online]. Available: http://mouser.com/ProductDetail/FreescaleSemiconductor/MC9S08JS8CWJ/?qs=t6o%252baWFra1eNwN1CL2tWgw %3d%3d. [Accessed: Dec. 12, 2009]. [24] “USB overview and Plug & Receptacle pinouts,” Jul. 19, 2009. [Online]. Available: http://www.accesscomms.com.au/reference/usb.htm. [Accessed: Dec. 12, 2009]. [25] “IGBT or MOSFET: Choose Wisely,” Oct. 18, 2000. [Online]. Available: http://www.irf.com/technical-info/whitepaper/choosewisely.pdf. [Accessed: Apr. 12, 2010]. 101 SECTION 17: Facilities and Consultants Throughout the project the Laser Plasma Laboratories team in the CREOL department helped in generating the burn test required for this project. The staff also helped in simulating the laser cavity and gave thoughts on how to improve the design of the Nd:YAG laser cavity. For the testing of the laser diodes and the calibration of the wavelength of the outputs from the diode will also be done with the LPL team. When first testing the laser diode the laser diode driver will be supplied as well from the CREOL department. This would allow a high accuracy for the outputs of the laser than if the laser power supply that this project is building were to be used. The output power will also be measured with a high powered light meter that will be barrowed through the LPL team. 102 SECTION 19: Budget and Financing This laser milling machine will primarily be funded by Nathan Bodnar. Some of the supplies may be donated from the Laser Plasma Laboratories at CREOL. The group will also attempt to obtain donations from some of the major optics supply companies, such as Thorlabs and Melles Griot. Some of the parts that cannot be acquired through donations may be obtained from eBay, which will greatly reduce the cost of the parts. For all other parts that cannot be obtained through the above sources they will be purchased from optics companies. The following list outlines the general cost of the parts required for this project. • • • • • • • • • Software – free Parts for XYZ table – $200 Laser setup – Q-switch – $512.95 – 808nm Diodes – $486.99 – Nd:YAG rod – $125 – KTP(KD*P) – $43.22 – Directing mirrors – $27.19 – Lens – $420 – Quarter wave plate – $74 – Polarizer – $49 Parts for Laser Power Supply – $200 Parts for TEC Power Supply – $35 Parts for Q switch Power Supply – $140 Parts for Stepper Power Supply – $30 Parts for Power Management Circuit – $50 Fume controller – $30 Total: $2423.35 103 SECTION 20: Milestone The following is the milestone of the Laser PCB Milling Machine project: Research 85% Bought Materials Laser Cavity Laser Power Supply Q Switch Power Supply 70% 12% 15% 20% TEC Controller 90% XY Table 80% Software 60% Total 54% 0% 20% 40% 104 60% 80% 100% SECTION 21: Project Summary The goal of this project is to replace the current milling machine used by senior design students. This machine has a history of being bereft of problems, causing it to almost continually be in a state of disrepair awaiting funding or a particular component. We aim to eliminate the problems that the machine has suffered in the past by radically changing the method that is used in the mill procedure. While the current Quick Circuit 5000 uses a spinning drill bit to remove copper from copper clad boards, we will use a Nd:YAG laser. While there are health and safety issues with the light from the laser and the fumes from the copper, we believe that we can significantly improve the overall safety of the senior design students, while improving the uptime of this resource. Our solution will achieve this through the use of strict user access control, both software and physical, and through the use of an intuitive graphical user interface. Because we are designing this project to be used in an enclosed environment, in a building that is not designed to house high powered lasers, we have had to make some allowances in our design. The most important of these is the air scrubbing system. This is an absolute must, as this machine will be running in an enclosed room in close proximity to students. Furthermore, the air scrubbing system removes the vaporized copper that is being made by the laser. If this is not removed as soon as it comes off of the board, we would very quickly have the inside of our enclosure coated in a layer of copper. We wish to make our project self sufficient, and because the location where this machine will be located has no high powered laser power supplies we have had to design our own supplies that we will incorporate into our main project box. Lastly, there is no chilled building water supply in the Engineering 1 building. We have therefore had to design our own Thermo Electric Cooling system to provide cooling to proper cooling for the laser diodes. We have design a large amount of software based feedback control into this project. The reason for this is twofold, safety and mean time to failure. It is an absolute necessity that we provide a safe environment for users to work in. Therefore, we have designed twenty four sensors into the project that will continuously feed information back to a graphical user interface. Errors happen, no matter how well a system is designed. Because of this, we have implemented a detailed logging system any time there is a system error. These errors may or may not shut down the machine, and may or may not force the machine to stay in an off state until the problem can be resolved. This information will help administrators decide on the best course of action on any errors that might occur. A safe environment for users to work in is also a safe environment for the machine to operate in. We are dealing with very expensive equipment, and we wish for it to last as long as possible. Through the use of judicious safety practices, we will also accomplish our second goal of reducing the mean time to failure of the machine. 105 SECTION 22: Project Operation 1) Plug power supply into AC wall outlet. 2) Plug both USB cables into computer. 3) Launch the software by double clicking on the executable Jar file. Figure 1: executable Jar file 4) Type in the username and password. Figure 2: Login Screen 5) Click on Load File Figure 3: Click on Load File 6) Click on either Browse Gerber or Browse png 106 Figure 4: Load Image 7) Click on next. 8) Place Circuit Board in the Laser Milling Machine table positioning the board at the top left hand corner. 9) Click on Mill. Figure 5: Click on the Mill Button 10) Wait a very long time. Time R equired ≈ Size X (mils ) ⋅ SizeY (mils ) ⋅1sec Equation 1: Timing estimate Ex: 4”x6” board will take: 0.76 years! 11) Remove the now finished board. 12) Close the software. 13) Turn off the Laser Power Supply. 14) Unplug the USB cables. 15) Unplug the Power supply 16) Go home! 107 APPENDIX A: Copyright Notices A.1 – jPicUsb License Permission pending A.2 – gerb2tiff License GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software 108 Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. 109 GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but 110 AND does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. 111 If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the 112 integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 113 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. $Id: GPL,v 2.0 1998/12/12 08:05:30 roessler Rel $ A.3 – ImageMagick License Licensed under the ImageMagick License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 114 Figure 9.2: Copyright Notice Figure 5.6: Copyright Notice 115 APPENDIX B: Example DRL File M48 ;DRILL file {PCBNEW (2007-07-09)} date 26/3/2009-21:21:07 ;FORMAT={2:4 / absolute / inches / decimal format} R,T VER,1 FMAT,2 INCH,TZ TCST,OFF ICI,OFF ATC,ON T1C0.025 T2C0.032 T3C0.040 % M47 G05 M72 T1 X4.775Y-3.625 X4.425Y-3.325 M30 116 APPENDIX C: Password Generation Code import java.lang.Math; public class passwordGenerator { public static void main(String[] args) { String alphabet="abcdefghijklmnopqrstuvwxyz"; for (int i=0; i<100; i++) { int ch=(int)(Math.random()*26); String partialPass1=alphabet.substring(ch, ch+1); ch=(int)(Math.random()*26); String partialPass2=alphabet.substring(ch, ch+1); ch=(int)(Math.random()*26); partialPass2 += alphabet.substring(ch, ch+1); int num1 = (int)(Math.random()*9); int num2 = (int)(Math.random()*9); int num3 = (int)(Math.random()*9); int num4 = (int)(Math.random()*9); String numString = num1+""+num2+""+num3+""+num4; System.out.println(partialPass1 + numString + partialPass2); } } } 117 APPENDIX D: jPicUsb Documentation 118 119