cnc laser for printing images and engraving - shapeoko 2 based
by：Luteng CNC Parts2020-09-19
If you own or plan to build a Shapeoko 2 CNC milling machine, the instructions will guide you through the steps required to add a 2-watt laser capable of printing Gray Scale the image on many surfaces. You can also find the details of how to fully carve. I will take you through all the steps required to build the laser to control the laser from the GRBL CNC controller of Shapeoko 2, including the modifications required for the controller software to enable Gray Zoom the output by changing the laser intensity. I will take you through the photo engraving software as well as the more traditional Shapeoko/MakerCAM/Inkscape image engraving. While I personally would love to have an Epilog Laser, this manual will guide you in building a tool that can do many of the same things, albeit at a slower pace. This is a great tool for any manufacturer and you will find hundreds of uses! If you follow the instructions in this manual, it is absolutely necessary to obtain and use proper eye protection. 2 W laser can make you blind instantly! It can also cause a fire and quickly ruin anything it is looking! Do not try this project without taking all the necessary safety precautions and without fully understanding the risks associated with the use of high power lasers and CNC machines. You only have one pair of eyes, don\'t ruin them! Shapeoko 2 is an open CNC factory for hardware desktop. The complete kit can be purchased online or you can purchase the parts and build a custom version of Shapeoko 2 according to your needs. When I build my Shapeoko 2 from the full suite provided by the stock product, I can find the details of Shapeoko 2. Com, I ordered several upgrades. For this project, you don\'t need most of it. In particular, if you plan to follow the instructions that allow gray in this project Zoom the image print by changing the laser intensity, do not install the limit switch. Limit switches can be added, but additional changes need to be made to the GRBL controller to detect limit switches on different Arduino pins. ( More follow-up steps. ) The upgraded scrap board is very helpful. I purchased the drag chain upgrade but did not find any use for it. You will notice in my photo that I have run most of the cables through a small piece of PVC pipe with cable ties. This effect is very good. GShield case and fan are very useful upgrades in my opinion. If you don\'t already have a runnable Shapeoko 2, this is your first step. Assemble the Shapeoko website according to the instructions. Run the Mark test. The spindle is not required for this project, but having the spindle will make your Shapeoko 2 more valuable. After following the instructions in this manual, the laser can be easily removed when you want to do CNC milling with the spindle. Last Note on Shapeoko 2: instructions provide machine wiring methods that do not require welding. I choose to weld and heat. Shrink all the connected wires to provide a more durable solution. In addition to the functional Shapeoko 2, you will need the following supplies: tools used: installing the laser to Shapeoko 2 can be done in a variety of different ways. What really matters: the bracket I will show you needs a lathe to process the aluminum. If you are unable to use this feature, find another solution to achieve the same purpose. If you search on the Internet, you will find that others have modified the CPU cooler, just like the CPU cooler I modified in this manual, so that the laser module can be tightly placed inside- Or fixed in some way similar to what I will show, but no need to use a metal lathe. Try it a little and you will find a satisfactory solution! You can also view the following laser module housing websites that you can purchase and then modify if necessary to install in Shapeoko 2-- Or put on the spindle holder: there are at least two ideal places to install the laser on Shapeoko 2. The most obvious is on the spindle stand. If your module is connected to the spindle stand-- Even with the spindle stand, you can use the Z-Axis command to lift and lower the spindle stand. This can even be used to focus the laser. Keep in mind that if you would like to use the technology I will show to control the laser intensity, you will need to be able to turn the Z-Axis command into PWM ( Pulse width modulation) Signal to the laser diode. You can\'t control the Z axis while controlling the laser intensity. This should not be a problem, however. In the modified GShield code I provided, Z- The shaft can be placed on the laser- Mode and switch back and forth at will. Another ideal place I recommend is under the spindle base. You will see this in the next photo. In this position, the distance to the scrap plate is fixed and you have to focus the laser according to the thickness of the material you burn. Nevertheless, when milling operations are carried out with the spindle, it is relatively accessible and allows the removal of the laser, which can be kept on Shapeoko 2 while the laser is installed. ( Still, I highly recommend removing the laser before stirring the dust using the spindle! Take a piece of 1 \"aluminum corner and cut it to the length of the CPU cooler you would like to install on one side of Shapeoko 2. You can cut it off with a hacksaw ( Like me because I don\'t have a metal cut band saw yet) Or you can cut the band saw with metal, a little straight. Mark the aluminum corners of 2 mounting screw holes on each side. 29 holes will be drilled and then 8- Install bolts through 32 taps of the CPU cooler. After using the aluminum angle as a guide to drilling into the CPU cooler, drilling can be done. Both the CPU cooler and the aluminum corner can be tapped at once. Mark the center of the aluminum corner. Drill a 27/64 hole for the laser bracket in that center position. Use a few double beds Double sided tape, connect the angle aluminum to the bottom of the CPU cooler. Drill the aluminum angle into the CPU cooler using the drill press and previous drilling as the guide. Use 8-when the tape still keeps the aluminum angle unchanged-32 tap. Then fix the angle aluminum to the cooler using two 8-32 screws. This will prevent it from moving while drilling larger holes. ( There is no display in the photo, but it will be a better way. ) Fix the angle aluminum on the CPU cooler base and drill a 27/64 hole in the center of the angle aluminum. Then twist the hole at least 1/2 with 1/2-13 tap. Use the tapping fluid carefully to avoid entering the fan, or temporarily remove the fan and drill the fan out of the tapping. Keep the CPU cooler and aluminum angle at X- The shaft gantry of Shapeoko 2 and use the mark to mark the position where the slot is aligned on the aluminum corner. Close to the edge of the slot, drill into 25 holes through the aluminum corner and enter the CPU cooler side with a depth of about 1/2 \". Next use 10-24 tap. Be careful to separate the holes so you don\'t touch the screws that fix the aluminum angle on the CPU cooler. The laser will be installed on the Shapeoko thread for two months -- After passing through the slots in X-24 cap screws enter these holes The shaft gantry can be seen in the photo of this step. Drill a hole near the top of the CPU cooler that is aligned with the 1/2 hole at the bottom and penetrate the hole. We will use this new hole to cross the side from the laser module. 5/16 should be enough. The wire should be protected with a heat shrink tube. Start with a round bar of 1 \"6061- T6 aluminum of about 1 to 1. 5\" long. Put it on the metal bed facing both sides. Then close the distance of about 3/8 to 1/2 on one side to finish a good finish. Then turn along the bar of about 3/4 until it is ready to work with a 1/2 threaded connection13 die. Using the mold, carefully keep the 3/4 \"as close to the base as possible without bending the aluminum. If you are good at cutting threads with a lathe, you may want to do so instead of using a mold. Next, cut off the workpiece about 1/2 above the thread. I used a parting tool to do this, but the band saw works fine, just like a simple ground to a piece of stuff until it\'s about the right length. Once it is cut, flip it in the lathe chuck so that the thread end is inside the claw but not caught by the claw. Do the pilot hole with the center drill, and then drill the hole of 15/32 ( Laser diodes are allowed to be installed above 12mm) About 1/2 deep. (See photo. ) The laser module will be held here. Drill a 7/32\" (or thereabouts) Hole all the way through the bracket. The wire from the laser module will extend all the way to the thread end. After cleaning the workpiece on the lathe and chamfer any sharp edges, remove the workpiece from the lathe and put it into the vice. Using the drill bit, drill 29 holes in the thick part of the bracket, all the way to the 15/32 holes in the center. Next 8- 32 tap and insert an 8-32 screw. This will be used to push the laser module firmly onto the bracket. To assemble the laser holder, first apply hot grease/compound on the aluminum corner and CPU cooler they will be in contact. Then install the screws that hold the angle with the CPU cooler base. Slide a heat shrink tube on the wire that will enter the laser diode. I used a power cord with a bucket adapter. Make sure there is a matching barrel Jack- This will be connected to your FlexMod P3 laser diode drive. Run the now protected power cord through the side of the CPU cooler and remove it from the 1/2 threaded hole on the base. Then go through the thread end of the laser bracket. Now attach the bracket to the thread hole at the bottom of the CPU cooler, after widely applying the hot compound to the thread and bottom of the bracket. The wire is then welded to the laser diode. Be sure to track polarity! ( Know which line is negative, which line is positive, and how it maps to the bucket adapter. ) If you haven\'t done so yet, shrink the Heat Shrink tube and make sure the bare wires are exposed now. Note that in this setting only the upper half of the laser module (with the diode)is used. This provides more space between laser and engraving/printing materials. Apply the thermal compound to the base of the laser module and insert it into the bracket. Be careful not to get hot oil on the lens! Finally, tighten the screws on the side of the laser bracket and fix it in place. Install the laser to x-as mentioned earlier- Shaft gantry using 10-1 sapiko 2 After cleaning up any excess hot compound, 24 cap screws. Run the power cord between the gantry and the CPU cooler until it does not interfere with the operation of the gantry. See photos for more information. It is important to follow the direction that comes with the FlexMod P3 driver. The input power of the driver should be about 6 volts. It\'s no problem to be a little more, but keep it below 8 volts. The power supply should be able to provide at least 2 amps. FlexMod P3 needs to be calibrated so that 0 PWM (Or land value) On the modulation input, the laser diode is barely turned on to make it visible. A full 255- The value or 5 volts on the modulation input should not exceed 1. 8 Amps! Test this with a multimeter using the directions provided by the FlexMod P3 driver! After calibration with FlexMod P3, it\'s time to connect everything and put it in the box. I used 22 gauge stranded lines from the radio shed, as well as heat shrink tubes and good welding. Choose a small item box that comfortably accommodates FlexMod P3, 2 barrel Jacks One for power supply and one for connecting to a laser diode. It should also have another socket that leads to two wires to the Arduino/GShield. Drill holes in the project box for the power jack and drill holes separately for any type of wire or connector you will run to Arduino/GShield. I suggest putting the laser output on the other side of the power input box. Mark or mark the Jack clearly. You will see from the photo that I am lazily burning the words \"power\" or \"laser output\" near the jack with a soldering iron. Next, take care of the polarity and weld the wire to the jack. Push the wire into the project box and pull the barrel Jack in place. Fix them on the box using the nuts that come with the power jack. Then weld the wire to the FlexMod p3. The power supply positive line is connected to the V connection of FlexMod p3. The grounding wire of the power supply should go to G (nd) Connection on FlexMod p3. You need another ground connection to the Arduino/GShield. I splice into the ground wire and run the extra wires as needed by the Arduino. About laser diode output /- Side welding of FlexMod P3 leads to wires for the laser power output jack. All the way to the laser diode to keep the polarity correct! Need to leave another set of wires for the box. You can use another Jack or another type of connector. I chose the shrink wrap wire and took out a hole on the side of the box. The other end of these wires can be connected to a 2-bit interlock connector or can be soldered directly to the Arduino/GShield. The ground wire is connected to any ground welding point on the GShield. Signal line, welded to M (od) The connector on FlexMod P3 will be soldered to the connection point on the GShield, which is connected to pin 11 on the Arduino. ( See photos for details. ) Using a thermal compound between the two, connect the appropriate radiator to the transistor on FlexMod P3. Connect the radiator to the project box if needed. Seal all of this in the project box and stick it near your Shapeoko 2. While this part is optional, I also have another project box with DC relay control that is connected to the GShield for the spindle to open (M3) And spindle closure (M5) The command sent to GShield will power the laser on and off. This is optional because you can simply turn the power on and off from the power supply when the laser is in use. In any case, you should never turn it on without constantly checking the work of the laser. If, as happens sometimes, the software that sends a signal to GShield freezes, or the gantry stops moving and the laser stays on, it will start burning your workpiece very quickly. The spindle on/off command can be added to the start and end of the file sent to GShield to ensure that the laser is turned on after the work is completed and before it is turned off, but this is not a good alternative to looking closely at work. There are many ways to do this if you want to use relay control. I bought a Seeed relay shield and put it in my own project box and then run the wires from GShield to relay shield to control one of the relays. ( The relay shield is designed to be inserted into the Arduino, but one relay requires a signal. ) The box is also equipped with a power input jack and a power output jack. Connect the ground between the two Jacks and the positive supply line goes through the relay. I made a similar box with an 8 amp solid state relay to control my AC spindle. For this step, you will follow the instructions in the previous step. However, this photo will explain where GShield is welded. You will notice a piece of tape on my GShield. No, it\'s not bad. It\'s just to make it easier to remove GShield and reconnect to Arduino without removing all GShield from the GShield box connected to Shapeoko 2. I had to try a lot of things in the process of getting it to work and had to re-program the Arduino multiple times. Hope you only need to do this once. Note: If you have upgraded shapg or other controllers, you will have to use the product documentation and possibly re-program the controller to allow laser intensity control. Many boards like TinyG allow spindle speed control using PWM outputs. This should be feasible. My initial attempt was to control the laser intensity of GShield using the spindle speed control command. However, I find that the spindle speed control is out of sync with the x, y, and z-axis motion. So I reprogrammed the Arduino to allow the z- The value of the axis from 0 to 255 is converted to a PWM output on pin 11 to control the laser intensity. The Z axis does not move in laser mode. More details will be provided next. The Arduino Uno that comes with my Shapeoko 2 kit comes with grbl firmware version 0. 8c. This version of firmware allows the M3/M5 Command to enable or disable signals on Arduino pin 12. It also provides support for spindle direction control. However, it does not provide spindle speed control or any other type of signal that we can use to control the intensity of the laser. To do this, I modified the GRBL source code to allow GShield to be placed in \"laser mode \". \"When the shield receives the $ L1 command, Z- The shaft motor is detached, and the positive Z value from 0 to 255 sets the laser intensity. The Z0 value sets the laser to the lowest current setting determined by calibrating the FlexMod P3 driver. The Z255 value sets the laser to a maximum current setting of no more than 1. 8 amps if FlexMod P3 is calibrated correctly. The power from Z1 to Z254 should gradually increase. To disable laser mode, restart Z- Shaft motor, send $ L0 command to GShield. This allows the \"GRBL\" program to enable and disable laser-mode as needed. If you are very inclined, you can access my source code changes to the GRBL firmware in github through the following link: After cloning the tree, be sure to select the LaserMode branch. If you want to start with pre-compiled file (recommended) You can download the attached grbl. hex file. After installing on the Arduino, it should show Version 0. 8laser. There are many ways to install. HEX file on Arduino Uno. I highly recommend that you purchase a new Arduino Uno to use with your Shapeoko 2. If you are having a serious problem reprogramming Uno with the new GRBL code, please take the old one as a backup. It should be possible to re-program using Arduino Uno\'s own USB port. I tried to do this from Windows 8 but did not succeed. 1 PC however. The software freezes on me and puts the Arduino in an unusable state. To fix this, I simply re-programmed the Arduino using the USBtinyISP programmer from Adafruit. If you do a lot of work on Arduino or micro controller, this is a must have tool! You can also try to use other USB-based vr programmers, from sales of Sparkfun to more expensive sales (non-hobby) Version sold by ATMEL. You can go pre- There are also built-in programmers, such as this programmer who only has a hobby King for $3. 99. After downloading grbl The Hex file, simply connect the ISP programmer to the Arduino Uno and upload the grbl as per the programmer\'s instructions. hex file. For more information on how I can use the USBtinyISP programmer, please see the attached photo. To follow my process, you need to install Arduino development software on your Windows PC. Don\'t worry, if you don\'t program, you can turn it off after we finish this step. I may do some pre-preparation if there is enough demand Although I don\'t have a plan to do so at the moment, the program can be purchased on eBay. From a cmd. Exe prompt, find the folder containing grbl. hex file. Then run the following command. Adjust the directory to point to the correct location of the computer if needed: You can also use burning. The bat file that comes with this step. Once you receive the confirmation message \"avrdude is completed. Thanks \", you can separate the ISP programmer and connect the Arduino Uno directly to the USB port. Then connect to the Arduino using your favorite GRBL controller software. In the attached photo, I used a completely new copy of the photo sender Beta. This is made by the author of PicLaser Lite and we will send the photo to Shapeoko 2 print using PicLaser Lite (or really burn) Grayscale images on various materials. If you have done this before PicSender is officially released, you can use GRBL controller 3. 6. 1 ( Used to introduce some of the images shown in the steps. ) You can also use the \"universal GCode sender. \"However, I will warn you that generic GCode senders of about 150,000 lines or more should not be used with large GCode files! Because it\'s a Java program. - All Java programs are unfortunate and it has little control over how memory is used. After sending about 150,000 lines to GShield, the universal GCode sender slows down, causing the laser to burn the target material after the image is printed for an hour or more. While I believe the worst problem stems from the choice of language, hopefully the fix for this software will be available. PicLaser Lite is a cheap program that allows you to load bitmap files and generate G-from it- Code Shapeoko month and Z- Set to generate the axis value of the grayscale image. First pick a picture that you think will look good in gray. You may need to resize it using Microsoft Paint or other tools to get the desired output size from Shapeoko 2. The output size is largely determined by the pixel size setting. For more information about the settings I recommend, see photos. Once you are satisfied with the settings, click Load file. Then click make GCode. Now, click save Gcode and give the file name you will remember. If you add $ L1 to the machine setup code, edit the output file and place $ L1 on a single line. See photos for more information. The file is now ready to be sent to Shapeoko month. While I am concerned that the feed rate may be a bit slow, I will send this picture to a cheap one ( Buy at Walmart) The artist painted on cardboard. We can use various GCode sender programs to send files to GShield on Shapeoko 2. Since I promised the owner of PicLaser Lite that I would test his Sender program, we will use this program in this example. Most programs are the same. Grbl Controller 3 and PicSender may be one of your best choices. Both are loaded with features and do not use Java, there is a problem when they reach 180,000 rows. Open the sender first. Select COM port to connect to GShield-- There is usually only one choice. Please make sure the baud rate is set to 115,200. Then click open. Next, put the controller in laser mode by entering the $ L1 command. You will receive a message confirming the laser mode. Wear laser safety glasses! Turn on the laser when the controller is in laser mode and the safety glasses are turned on. If you do not use the relay to control it, turn on the laser power. After turning on the laser, you can focus the beam on the minimum clear points that may exist on the target material. Now, click load and select the file you created from PicLaser Lite. The contents of this file will be displayed in PicSender on the left. When the laser Holder is in the main position and the target material is fixed in place, you can now click the send button to watch the laser print your picture. A small image of about 4x6 \"will take more than an hour. The size of 0075 pixels and the feed speed of 60. You can also use Inkscape and MakerCAM to generate gcode for shapeoko2. In order to put GShield into the laser, you need to modify the MakerCAM output Mode and set the Z value to control the laser intensity. This is the best for line. Like a sign with words and so on. Typically, you set the Z value to close to full power. You can use the M3/M5 Command in the non- If you have a relay to control the movement of the cut/burn, or you can manually modify the gcode to set the laser output to z0. The gcode generated by MakerCAM is definitely not the best. When the 8x10 symbol with text is generated, you will see that it draws a letter in the middle Right, move all the way to the bottom left, draw one more, then move to a completely different place and draw another letter. This is painful observation and greatly slows down the process of producing anything. I made an order to solve the problem. You can optimize the line program of gcode generated by MakerCAM. It has a laser. Mode, which adds the M3/M5 Command toburning moves. With Grbl 0. 8 laser you still need to modify the optimized output so that the laser can be turned on to full power with Z255 first, if there is no relay control, change the M3 command to Z255 and change the M5 Command to z0. This software was originally written before I knew I could control the laser intensity. Maybe I will update it when time allows to use it with Grbl 0. 8laser. The source code of this software is provided here: The Windows compatible version of the software is attached to this step, called gcodelaseropt. exe. Run it without any parameters to see the details of how to use it. Be sure to check the file it generates to make sure it does what it expects. You should be familiar with basic gcode commands, such as: More details can be found on the gcode Wiki page. The important thing to keep in mind is that you have to modify the gcode to use our settings as shown below: If you have not made an SVG file for entering MakerCAM using Inkscape ( You should try at least once, draw a mark on your spindle stand or use the spindle to draw the text. Then, as long as you follow the steps outlined above to use the laser, you will not have any problems. There are plenty of instructions online on using Inkscape and MakerCAM with Shapeoko 2. The main difference between laser combustion is how to set the cam settings. Since the laser does not need to move up and down, the safety height can be set to 0. This will also produce a 0 Code to prevent the laser from moving between unaffected areas. You can set the tool diameter as low as 0. 007, though you should be warned that this will produce very large files for pocket operations, lasers sometimes overlap and burn more than expected. You can try the value between 0. 007 and 0. 02. The target depth should be- 255, should cooperate with 255 to step down. We will solve these problems later. The inventory surface can be maintained at 0. You need to experiment with the feed rate on different materials. Too slow, you will burn the material over. Too fast, burn will be too light. In the attached picture, you will see a very simple example where a gcode generated by MakerCAM and MakerCAM settings produce it. On the far right, highlighting in yellow is the only change that needs to be made to the file to make it compatible with our CNC laser. By changing Z- We set the laser to a maximum strength of 255 to z255. Adding $ L1 to the top of the file will put the controller in laser mode and keep the Z- Moving from the impossible axis (255 inch)height. Since this is a very simple file, no other changes need to be made. If we are going to add another path or pocket operation, we need to make sure we change all Z- 255 to Z255 and make sure there is an o2o Z0 line between operations. More complex operations can benefit from the gcode Optimizer. Almost anything that can be burned, burnt or melted with a laser can be printed out in some form. Reflective metal should not be used and the laser strength is not enough to burn them. Below is a partial list of what I have tested. You may also be interested in trying many other new things. For example, it would be fun to write someone\'s name on a sandwich with a laser, or melt a layer of chocolate on a strawberry or candy bar. Please comment on your experience. Let everyone know what looks good and works well!