Academia.eduAcademia.edu

Computer Controlled Laser Engraving System

2015

The objective of thiss project is to develop a solution to custom laser engraving that is user friendly to operate. The proposed solution should also be able to execute its operation within a reasonable amount of time after the user has committed an image to engrave. This project incorporates a variety of different concepts that are found in the industry, such as but not limited to: motor controls, hardware communication, software integration, power systems, and laser control. Index Terms — Control engineering computing, Diode lasers, Embedded software, Microcontrollers, Object oriented programming, Power Systems.

Computer Controlled Laser Engraving System Jose Rivera, Han Ly, Juan Pumarol, and Brandon Workman Dept. of Electrical Engineering and Computer Science, University of Central Florida, Orlando, Florida, 32816 Abstract — The objective of thiss project is to develop a solution to custom laser engraving that is user friendly to operate. The proposed solution should also be able to execute its operation within a reasonable amount of time after the user has committed an image to engrave. This project incorporates a variety of different concepts that are found in the industry, such as but not limited to: motor controls, hardware communication, software integration, power systems, and laser control. Index Terms — Control engineering computing, Diode lasers, Embedded software, Microcontrollers, Object oriented programming, Power Systems. to the machine, and etch the image on the material. This is done by passing position data values through a UART that is going to be sent to the MCU. Once the data has been received the MCU will send commands to execute motions to the motors by using pulse width modulation to determine how far to go in a given direction. Due to the nature of the driver's ability to microstep, a fine degree of accuracy in motion is possible. Once the position has been moved to, another pulse width modulation signal will be sent to the laser to execute the engraving process. The laser will quickly turn on for a fraction of a second before turning back off waiting for the next engraving command to be passed. The process of moving and engraving will continue until the entire image has been engraved into the material. The nature of the selection of where to move next will be dictated by a simple path solving algorithm to help minimize the total operation time of this process. I. INTRODUCTION The Computer Controlled Laser Engraving System project is a two dimensional computer numerical controlled laser etching system. This project offers a fine level of detail that is required for custom pattern design. The inspiration for CCLES is seen in the necessity for a quick and autonomous system with minimum user input which makes it user friendly. This solution should offer a low operating cost while producing products within a set standard of quality. The simple interface that will be presented to the user will provide requires no intense training to operate this machine. Thanks to the integration of computer software into the manufacturing process, the user will be able to visually see what the machine will produce, prior to actually committing material. This will give the benefit of working out design issues before sending it off to the machine, reducing the chance of wasting material. When the CCLES program is first initiated, a visual GUI will be presented to the user where they will be able to upload or draw an image to be etched. When the image is finalized, a series of events will take place to convert the image to real-world coordinates, transfer the coordinates II. FRAME The XY plotter is a frame system made up of Anodized aluminum with physical dimensions (L×W×H): 620mm × 620mm×140mm, while the maximum working area of (X×Y): 310mm×390mm. The plotter operates in two dimensions, non-elastic timing belt driven through two stepper motors. Beside lightweight and durable, the frame reinforced precision and stability through dual-way transmission mechanism utilizing two shafts on each axis. The XY plotter was advertised to be an excellent candidate for projects that needed a plotting table with a sense of precision. Being lightweight, the Makeblock XY Plotter has the mobility of a laptop which makes it is very easy to transport and move around once the frame structure is built. The plotter itself contains two stepper motors which will be used to move the laser apparatus in the two X and Y cardinal directions. Each of these motors are physically affixed to the outer side of the frames which makes wiring the simpler as none of the wires should be moving during operation. Each motor also has a timing belt fixed around the axial to guarantee that each motion is consistent. III. MOTORS The main three main requirements that were looked at when choosing the motor were cost efficiency, reliability, and accuracy. The motor needed in this project must have been able to fit on the space allocated on of the frame, be reliable that each step would be consistent, and must have a high torque for controlling motion whether it be moving or just holding still. The Makeblock XY Plotter kit comes with two 42BYG stepper motors. The 42BYG hybrid bipolar stepper motors will provide motion for the laser utilizing timing belts to move it in the operational range. The 42BYG stepper motor fall within NEMA 17 Stepper Motor standards. It has high torque at starting and low speed of holding torque at 40N/cm min and detent torque of 2.2N/cm maximum. The motor revolt 1 full revolution of 200 step with each full step of 1.8 ° with 5% rate of errors. Precision can be increase through micro stepping using motor driver with 1/2, 1/4, 1/8, 1/16, 1/32 and more. The 42BYG stepper motor rated at 12 volts DC which can be easily supply through designed power system. The 42BYG stepper motor has 4 wires although there are only two legal pairing allowed when wiring them. Black and green must be wired to one phase and red and blue must be wired to a second phase. Any deviations from this setup would cause permanent damage to the motors which make them inoperable. The colors that indicated in the image needs to connect to the same polar terminal. This specific 42BYG stepper motor of Makeblock, it has two phases. Below is the wiring diagram if the two phase stepper motor. IV. MOTOR DRIVER The DRV8811 Stepper Motor Controller IC offered by Texas Instruments was selected for this project. This particular motor driver offered a variety of settings that can be easily toggled by the MCU. The stepper motor driver is capable of 1/8th microstepping and can output up to 1.9 A per winding. The key aspects that made this driver favorable over the rest was the ability to control the microsteps per phase, the ability to use pulse width modulation to drive the motor, and the ability to put the driver into a lower power setting which helps cut back on power usage. The driver requires two input voltage sources that include a 5V line to enable the driver and a 12V line to help generate the current required to drive the motors. There will be four particular pins that will connected to the MCU per driver. These four pins are the direction pin, the stepping pin which drivers the motor, the sleep pin which puts the driver into a low power state, and the enable pin to active the driver. For this project special consideration has to be looked at when dealing with the sleep and enable pins. To turn off the motor it can't be simply be done by turning off the enable pin. During testing it has shown that the motor continues to attempt to step when a rising edge comes in causing the motor to stutter in place. To prevent this problem the sleep pin is set up such that when the motor is not in use the driver goes into a lower power state that ignores all signals. This is extremely beneficial because the motor doesn't stutter when rising edges from step come in, the motors also idle silently opposed to just disabling the enable pin, and most importantly the drivers are less prone to overheating which has negative effects on the motors functions. V. LASER The constraints had a large impact on deciding the integration of a laser subsystem. In order to meet specifications and satisfy constraints the system would not take up a large volume as the overall system should be light and convenient enough for a single person to carry, the cost had to be minimized due to the funding being provided primarily by the members of the design group, and due to the small amount of time available it had to be simple to integrate without involving additional subsystems. Using these criteria most practical systems fall short of consideration for the project. Neodymium-doped yttrium aluminum garnet based systems would provide a very large power output relative to the project’s requirements, which would allow for greater versatility with materials and applications for the CNC system. However this system is far too inconvenient to implement with our constraints as it can take a large amount of space due to the general set up of the system and safety considerations, the cost to build and integrate would be out of our budget, and it would require a very involving method for cooling the system which we cannot fulfil given the time available to us. Gas based lasers proved to be a strong candidate for consideration due to their operating wavelength being effective on organic materials. The cost would have been within the budget we decided upon and provided sufficient power for a wider range of applications. The size of the system however would be to inconvenient to transport for a single person, and a more involved cooling system would be necessary to maintain the laser for long periods of time. The only viable system we could choose from that met our specifications and constraints was a laser diode based system. In order to properly etch and engrave organic materials requires an output that is less than 10 watts. Specific laser diodes are capable of delivering up to 6 watts with a single diode, and for our purpose of etching and engrave up to 2 watts is sufficient. In order to reduce the divergence of the laser diode, glass lenses will be used to focus the beam and allow optimum power output. Other diodes capable of delivering more power are found to have a much higher divergence even with glass lenses. With higher divergence the diode would produce a larger burn mark or multiple burn marks close to each other which is undesirable in our application as it requires a localized burn in the working area. The laser diode we chose for the project is the 445 nm M140 laser diode. This specific diode is widely used by hobbyists in similar CNC based projects and can be acquired for $39. The M140 is capable of a 2.2 watt output however we will be operating it at 1.4 watts. This output will provide an adequate tool to quickly burn materials in a focused area. Higher output may be desirable but laser diodes are current driven devices, therefore in order to obtain 2.2 watts or more a larger current is required. More than necessary would require a more complex current source to deliver the current as well as a larger trace in the final printed circuit board. Similar to all of the considered laser systems for the project steps must be taken to minimize the effects of the high temperature which will be achieved by the diode in order to maintain its performance and maximize the diode’s life span. The diode was mounted on a copper host which provided good thermal conductivity and a large area to handle the laser diode comfortable. The copper host is part of an overall module which contains a screw on aluminum case to cover the laser diode pins, wires, and if necessary a small driver circuit. The aluminum case provides additional area and thermal conductivity as well. The entire host is then placed inside of a small ribbed heat sink unit with a screw to hold the module in place. Since the laser diode will be repeatedly turned on and off these measures are sufficient to ensure suitable working conditions and reasonable life. VI. POWER SYSTEM The main components of the system which require power are the microcontroller, the stepper motor drivers, the laser driver, and two fans which will be used to cool the circuit board. In order to deliver sufficient power to these sub-systems the biggest factor when choosing the method to power the project is how long it must be powered for and how reliable the source of power is. For a CNC system it would be a waste of material if an assignment stopped in the middle of it being processed, and it can be expected that multiple materials will be used for a design to be etched. Therefore we will use the AC mains line to provide power for the project. The device chosen to provide step down the voltage from the AC mains is the VPP16-3500, a 56 VA rated transformer. This transformer will provide 16 volts capable of up to 3.5 amps of current. This is well above the estimated current for the system which should not exceed 2.5 amps. The stepped down signal will be rectified with the KBL10 full bridge rectifier which has a peak reverse voltage of 1000 V and a maximum DC current of 4 amps. The rough voltage drop to be expect from the bridge rectifier between the power source and the rest of the system is between 0.7 V and 1.4 V depending on the current. A smoothing capacitor will be used to provide a DC current, in order to minimize voltage ripple the capacitor used will be at least 6800 uf, depending on the space available a higher value can be used. The resulting DC source will be used as the main voltage source for the system which will regulate the power through switching voltage regulators and be connected directly to the laser driver. The voltage will be stepped down to 3.3 V, 5 V, and 12 V. The 3.3 V and the 5 V will be provided by the TPS563200 voltage regulator, designed by Texas Instruments. The TPS563200 is a small voltage regulator which can regulate up to a 17 V input with at least 90% efficiency. This voltage regulator also contains minimal external parts which is critical in our design since the PCB components must be hand soldered. The 3.3 V line will be used to provide power to the microcontroller which requires 5 different 3.3 V inputs each with a 0.1 uf bypass capacitor. The 5 V line will provide the VCC for the stepper motor drivers. The 12 V output will be produced by the TPS54531 step-down regulator by Texas instruments. The TPS54531 has a maximum 28 V input with a maximum output current of 5 amps. This meets our specifications since the main role of the TPS54531 is to provide power to the stepper motor drivers. The laser driver used will be the LM3406 LED driver designed by Texas Instruments. A constant current of 1.4 amps is capable by this device in order to obtain 1.2-1.4 watt output form the laser diode. The device also has a dimming pin which can be used to turn the laser diode on and off with the microcontroller which allows for the system to efficiently implement the design making the laser diode be on only when it is required to burn. VII. PRINTED CIRCUIT The design of the printed circuit board required some consideration regarding the placement of the transformer. It was decided that since the step down system from the AC mains had few but large components we will place them on a perforated board and place the rest of the circuit in a PCB. Using a trace width calculator we determined the appropriate trace width based on the amount of current we expect would go through each trace and allowed room for error. The 16 V trace would receive the primary input from the step down sub-system and decided to match the current input to the maximum current expected form the transformer which is 3.5 amps. Since the traces are not internal the width was calculated to be 20 mil. The 12 V trace and the laser driver would not deliver more than 1.5 amps to the motor drivers and set the width to 15 mil. The 3.3V trace and all other signal traces would not deliver a high enough current for consideration since the minimum trace width required by OSH Park, who fabricated the PCB, was 6 mil, which allowed for more than sufficient current for these signals. The microcontroller required bypass capacitors for the input voltage which were place as close as possible to the microcontroller as per the design guidelines. The two pins which are known as VDDC were traced together and a 2.2 uF, 1 uF, and 0.1 uF capacitors were used as bypass capacitors. In case more pins are required we added 14 pins to the board and connected them the general input and output pins in the microcontroller. To load the program into the microcontroller a JTAG interface was required, 10 pins were placed on the board in order for a debugger to be used to load the program. Some components, namely the LM3406 and the TPS54531 have a thermal pad underneath which require a connection to ground, so traces where connected form them to the ground pin, this was also done to connect them to the copper pouts which will be used as the ground plane where allowed. These ground planes will provide great thermal conductivity and allow for heat dissipation which is critical for these devices. To further help with the heat dissipation four pins were placed in the 12 V trace to provide two terminals for two fans which will be used to improve air flow. IX. JTAG DEBUGGER When we were in developmental phase, we used Tiva CTM4C123G microcontroller that has a built in debugger. When looking at the final product a separate debugger is needed when the PCB is manufactured to load the program onto the TM4C123GH6PMI7 chip. There was a product researched called mikroProg which could load the program onto the chip. On the PCB they are four reserved pins for connecting with the mikroPro debugger via JTAG programming. X. PULSE WIDTH MODULATION This project will utilize three separate pulse width modulation modules. The purpose of these modules is create an analog signal from a digital interface to create a means of driving a signal to control other ICs that require a specific clocking frequencies. Two PWM modules will be used to control the motor stepping and the third will control the toggling of the laser. The two motor PWM modules will be set to 8.333 kHz to allow data to be transferred to the DRV8811 driver with a 10% duty cycle. This allows smooth stepping to occur without stuttering motions between steps. Fig. 5 illustrates one of the PWM settings for one of the stepper motor drivers. It can be observed that the active high time is 18 microseconds with the frequency of 8.333 kHz. VIII. MICROCONTROLLER The microcontroller that will be used for the project is the TM4C123GH6PMI7 from Texas Instruments. It is designed around a high-performance 32-bit ARM CortexM based architecture. It also can achieve 80Mhz clocking speeds with 256 KB single cycle flash memory. In addition it has 32 KB of single-cycle on-chip SRAM. It has five different communication protocols that can be easily configured by multiplexing functionality of certain pins that are predefined which makes it an ideal candidate for this project. The microcontroller contains 6 ports of 8 pins that can act as general purpose input/output pins. These are another asset to the project because they will be used to help act as interrupt pins during motor movement, will help set set settings for the drivers for low power states and enables, and finally enable and disable the laser drivers during operation. XI. UART The TM4C123GH6PMI7 is capable of supporting up to eight UART modules with speeds up to 5Mbps for regular operations. In this project one UART will be used to transfer data from the computer software to the MCU. The UART will be preconfigured to a baud rate of 11500, 8 data bits, 1 stop bit, no parity, and no hardware flow control. The UART on the chip is complient with the International Organization for Standardization 7816. The UART was written to mapped to GPIO PA0 and PA1 which is traced along the PCB to two pins that will extending out. These pins will needed to be connected to another device to send the data from the computer to the MCU. The physical hardware that will be used to communicate with UART will be a product called KEDSUM CP2102 module. This product is a USB to UART converter which allows any device that has a USB to interface with the module. It contains six pins but only two pins will be interfaced with the MCU, the receive and transmit pins. XII. SOFTWARE Two different programming languages were used in development for this project, C and Java. Java was used to design a program for the user to draw an image. C was used to take the image and engrave it onto a physical material. Java was chosen as the language to be used for the user interface due to a couple of factors. The main factor is that three out of four of the group members have done Java programming for two or more years prior to this project. The second factor as to why Java was chosen is because it is cross platform. There are a few factors that contributed to C being chosen. The main factor is that three of the four group members have proficient knowledge in this programming language. The second factor this language was chosen is because at least two of the four group members have moderate knowledge of programming and running a C program on a microcontroller prior to this project. After considering many different integrated development environments, Eclipse and Code Composer Studios were chosen for our programming environments. We will be using Eclipse Luna, version 4.4.2, to develop our Java program. Eclipse was chosen for the Java program due to its simplicity when it comes to creating user interfaces. With Eclipse we are able to import the Java libraries “swing” and “awt” to create the user interface. To make this process a little simpler, we will be using a third party plugin for Eclipse that will allow us to quickly design the user interface. The plugin we will be using is WindowBuilder Pro for Eclipse. This plugin will allow us to easily design the user interface and change it as needed. We will be using Code Composer Studios, version 6, to develop our C program. Code Composer Studios is an IDE that’s combines the advantages of the Eclipse software framework with enhanced embedded debugging. Code Composer Studios supports a broad range of TI’s embedded processors making it easy to interface the program with the microcontroller. This allows the IDE to easily transfer the program from the workspace to the microcontroller. Another feature is that the IDE comes prepackaged with the correct libraries for our microcontroller. The libraries will be made easily available without having to find and download them for another IDE. This will help ensure that the program is loaded and stored correctly. Two programs were designed for the functionality of the laser engraver. The first program was programmed using Java with Eclipse as the developing environment. The second program was programmed using C with Code Composer Studios as the developing environment. The first program is a graphical user interface (GUI) that will be running on the user’s computer. This program allows the user to draw an image and submit it to be engraved by the Computer Controlled Laser Engraving System (CCLES). The second program will be a driver controller that will run on the micro controller of the CCLES. Fig. 6 shows how each program interacts with each other and the devices being used. The user and the GUI will interact with each other with bidirectional data flow. The user will be using a mouse to give inputs to the program and the program will be displaying relevant information on the screen. The GUI will be interacting with the driver controller with bidirectional data flow. The GUI will be sending coordinates to the driver controller and the driver controller will be sending error codes back to the GUI. The driver controller will be interacting with the CCLES will unidirectional data flow. The driver controller will be sending out instructions to the various mechanical parts through data signals. The graphical user interface is the program the user will be interacting with. This program will offer a variety of options that the user will be able to select. The program will present the user with a canvas and menu options. The canvas will start out as white and allow the user to draw an image. The user will be able to draw with the left mouse button and erase with the right mouse button. The user will only be able to draw in black with a square pen. The first menu option will allow the user to start with a completely blank canvas. When this option is selected, the program will delete the old canvas and initiate a new one. The second menu option will allow the user to upload an image from their computer. When this option is selected, the program will ask for a file path for the image they wish to upload. The program will then replace the canvas with the image they selected. The selected image has to be a pgm and 310 by 390 pixels. The third menu option will allow the user to save an image to a given file path. The current canvas will be saved as a pgm. The fourth menu option will allow the user to engrave the image. The user will not be able to interact with the canvas will the program is engraving. When this button is clicked, the program will display a confirmation window. If the user selects yes, a progress window will be displayed. The window will display a progress bar with a cancel button. The user can cancel the task at any time if needed. When the engraving is finished, the user will be able to continue drawing on the canvas. The fifth menu option will allow the user to close the program. There are five classes that are used for the functionality of the GUI as seen in Fig. 7. The first class is the GUI class. This class will handle all the code that is used to generate a user interface. This includes the canvas, menu options, and any other displays that may appear during operation. The GUI class will use the MyPanel class in-order to generate the canvas the user will be drawing on. The MyPanel class will be overriding the paint component method for the canvas being used by the GUI. By overriding this method, the program is able to draw a square where the user clicks and save any previous edits. The FileHandler class handles saving and opening images. The Communication class handles data transfer between the user’s computer and the microcontroller. This class will locate where the black pixels in the image are and transfer those coordinates. The driver controller (DRC) is the program that is running on the microcontroller. This program is used to control the stepper motors on the XY plotter and the laser. When an image has been submitted by the user to engrave, the DRC program will start receiving data from the graphical user interface. The DRC will receive one set of coordinates at a time and return a code based what occurred during performance. The program will convert the coordinates to instructions for the motor driver and send the signals to the correct components. When the motors move to the correct position, the program will turn the laser on to burn the chosen area. The program will finish execution when data received from the graphical user interface indicates that the job is done. When this data is received, the program will return the motors to the initial starting point to be ready for the next time it is used. Fig. 8 shows the class diagram for the program that will be executing on the microcontroller. There are a few functions that will be controlling the two motors, a function to control the laser, a function for error handling, and a function to control initialization. BIOGRAPHY Jose Rivera first started his studies in computer engineering in the fall of 2009 where he plans to graduate in the summer of 2015. He has aspirations to continue his studies after he finds a master's program in security or hardware development. He wishes to find employment in a company that will to continue to allow him to grow in his fields of interest. Han Ly is currently a senior at the University of Central Florida majoring in Computer Engineering. He has attended the University of Central Florida for four years now. Han’s goals after graduation are to pursue a career in US Air Force and continue his study to obtain a master degree in Computer Engineer. XIII. CONCLUSION After the construction of the Computer Controlled Laser Engraving System, a higher sense of understanding of how to extend our abilities that we learned in our curriculum into a real engineering process occurred. The process of basing predefined knowledge that we possessed laid out the success of extending our limits to solving problems in unfamiliar territory. A higher level of appreciation of the diversity of what occurs in the engineering field is has shown our members how much more there is to be learned and mastered in our future careers. This was truly felt when little things that were thought to be simple ended up being a large hurdle that took days if not weeks to resolve making each small success meaningful to the entire project. Juan Pumarol is currently a senior at the University of Central Florida and will receive his Bachelor of Science in Electrical Engineering in August 2015. After graduation he plans to pursue employment with the federal government and later on continue towards a Master’s degree. His primary interests are power electronics and biomedical applications. Brandon Workman is 24 years old and currently a senior at the University of Central Florida. He will be receiving a Bachelor’s of Science in Computer Engineering in August of 2015. He plans to pursue a professional position in the computer engineering field as a software developer.