Semi Automated Drill Press (Polar + Cartesian Motion)
by hannu_hell in Circuits > Tools
1255 Views, 8 Favorites, 0 Comments
Semi Automated Drill Press (Polar + Cartesian Motion)
First and foremost you might be wondering why its called "semi" automated drill press. Well, its because I have modified a normal hand drill press which I got awhile back. I have added functionality for positioning the workpiece to the drilling positions using linear and rotational motion. I still need to press the drill bit manually to drill holes when the workpiece has been positioned in the correct position, hence the name semi automated drill press.
Drilling holes using a hand drill can cause some major issues specially during assembly of parts which need precise alignment. Having a small drill press can solve this problem though positioning the workpiece on the platform can be time consuming and tedious specially if many accurately positioned holes need to be drilled. In addition to that human error can also cause accuracy problems while positioning. In this instructable I will show you how I have attempted to solve the problem by modifying a normal hand drill press.
Using polar with cartesian motion to position allows for maximum optimization of space for drilling on the workpiece. In this use case if we were to implement a two axis cartesian motion system there would definitely be a loss in workspace due to the limited space available in the y-axis caused by the support pipe holding the drilling motor. This arrangement allows a workarea with a radius of 85 mm (170 mm in both the x and y directions). To minimize unnecessary movements, path planning from one point to the other needed to be calculated. Minimizing motion can also increase the life span of the tool and mechanical errors. After laying out the mechanics and mathematical model on pen and paper, the rest was to decide on the hardware to use. I used a Raspberry Pi Pico for control as it has plenty of GPIO pins to interface with the rest of the hardware which I had in mind to use.
Some parts of the design were 3D printed and some were machined using a hobby grade 3018 CNC machine. The machined parts were of Polyoxymethylene (POM) which is an engineering plastic that allows for a more sturdy and strong design. Its worth noting that drilling on heavy and thicker materials is not an option on this drill press as the present arrangement of having the rotational platform on top of the x-axis lead screw doesn't allow for alot of mechanical parts for support in between given the dimensions of the drill press I had to work with. The z-distance from the drill to the platform allows for a maximum workpiece thickness of around 5mm. These are ofcourse variables which may be affected by selecting a different drill motor having different dimesions, selection of material thickness for the work platform and so on. I have chosen what I think is appropriate for my use case and the materials I was able to gather.
Creating a user friendly interface was the next thing on my mind. The workflow of the tool should proceed in a gradual manner where for the most part, my work had to be to place the workpiece accurately in the initial position. Movement of both the polar and cartesian platforms in predefined steps ranging from 0.1 - 50 millimeters meant that once the workpiece was clamped and centered there would be least amount of errors when moving the workpiece to position it correctly. I have used a lead screw with a lead of 1mm so I can get finer positioning. This also meant that the motion was slower than that of a higher lead but on the other hand having the complementary polar motion to arrive at the final position meant an increase in speed. In any case it would be faster compared to a traditional two axis cartesian planar motion system having the same lead. Theoretically the stepper motor can move the motor shaft in precise microsteps but practically when assembled with mechanical parts there are times when it skips steps if smaller rotations are made on a higher pitch lead screw which can add up in errors. So there is that to consider.
Before going any further lets outline some of the things I wanted to accomplish.
- The ability to move the platform both manually and automatically. By manually what I mean is in steps which I predefine (0.1, 1, 5, 10, 50 mm) in both the x and y directions and in doing so achieve accuracy upto 0.1mm. Automatic motion is when the drill press computes the path once the coordinates are given and arrive at each point in the given order and implement the functionality to move between those positions.
- The ability to control the drill. Turn it on and off with a press of a button once arrived in the desired position.
- Power the drill press with a single 12V 8A power supply.
- Isolate programming mode and general use mode by sliding a switch.
- Create a user friendly interface that allows smooth operation.
Supplies
Tools
- FDM 3D Printer
- 3018 CNC (optional as you could also 3D print the parts)
- Hand Saw
- Pliers
- Screwdrivers
- Ellen keys M2.5, M3, M4
- Elecrtic Drill
- Soldering Station
- Long Ruler
Supplies
- T8 (Lead:1mm, Length:250mm) lead screw x 1
- SS rod with M4 threaded hole at ends (Length:300mm) x 2
- Pillow Block Bearing (Bore Diameter:8mm) x 1
- M3 hex screw (Length:12mm) x 4
- M3 hex screw (Length:50mm) x 4
- M3 hex screw (Length:20mm) x 8
- M4 screw (Length:8mm) x 2
- M2.5 hex screw (Length:20mm) x 12
- M2.5 hex screw (Length:10mm) x 4
- M5 screw (Length:10mm) x 2
- M2.5 nut x 16
- M3 nut x 12
- M5 nut x 2
- 5V Relay Module (1 Channel) x 1
- Flexible Shaft Coupling (Inner Diameter:5mm, Outer Diameter:8mm) x 1
- Flange Coupling (Inner Diameter:5mm) x 1
- Nema 17 Stepper Motor (42x34) x 1
- Nema 17 Stepper Motor (42x48) x 1
- Blue POM (Thickness:10mm, Dimensions:300mmx200mm) x 1
- Black POM (Thickness:10mm, Dimensions:200mmx100mm) x 1
- White POM (Thickness:6mm, Dimensions:200mmx200mm) x 1
- Dual DRV8255 Stepper Motor Driver PCB Module x 1
- DRV8825 Stepper Motor Driver x 2
- LM2596 Adjustable Buck Convertor x 1
- 12V DC Electric Drill 775 Motor with B10 Drill Chuck x 1
- Hand Operated Drill Press x 1
- M8 screw (Length:30mm) x 4
- M8 nut x 4
- M4 hex screw (Length:20mm) x 4
- M4 nut x 4
- 6061 Flat bar aluminum sheet (Thickness:5mm, Dimensions:250mmx50mm) x 1
- Green Spray Paint - Optional x 1
- ON/OFF Micro slide switch x 1
- DC Barrel Connector (5.5mmx2.5mm) x 1
- Perf Board (Dimensions:50mmx50mm) x 1
- 1.8 inch TFT Display x 1
- LM8UU Linear Bearing x 2
- Limit switch x 1
- 28 AWG Electrical Wire x 1
- Square Push Buttons (Red, Yellow, Green, Blue) x 4
- Rotary Encoder module with knob x 1
- 12V 8A DC Power Adapter x 1
- Raspberry Pi Pico x 1
- Micro USB Data cable x 1
- Stepper Motor Cable (4pin to 6pin) x 2
- T8 anti-backlash nut and flange (1mm lead) x 1
- Custom PCB x 1 ( I will attach gerber file )
- 'C' groove aluminum extrusion (Length:1000mm) - Optional as this is used to clamp workpiece to rotating platform x 1
- Aluminum rod (Diameter:5mm, Length:200mm) - Optional as this is used for centering the drill chuck to the base of the drill press
Part Design and Naming Convention
The naming convention used for the parts will be followed thorughout this instructable whenever any part is referred to in order to avoid confusion. I have tried to name them as best to describe them but feel free to reference the .stl files if in doubt. Most of the parts are 3D printed except for the XAxis_Platform and the Polar_Platform. I decided to machine them from POM as they would bear most of the load. Having said that, you could also 3D print them as long as you know the limitations.
Some characteristics of POM
- Polyoxymethylene (POM) is an impact and abrasion resistant semi-crystalline thermoplastic and is know for its high mechanical strength and stiffness.
- It has good sliding properties and great wear resistance.
- It can easily degraded under high temperatures.
- It has a tensile strength of 7000-9000 PSI and is less dense than metal making it suitable for lightweight parts requiring high strength.
- It is a durable material with good resistance to fatigue failure in the temperature range -40 to 80 degrees Celcius.
- It has good dimensional stability even after loading.
- It is also an insulating material.
- POM does not respond well to adhesives due to its chemical resistance. Therefore it can be difficult to create an adhesive bond.
Important to note when machining POM
- Low grade POM can crack externally and internally while machining.
- General high speed steel and carbide tools can be used to machine POM , but care should be taken to not use blunt bits as it might create heat and melt away the material leading to damage bits and workpiece aswell.
- Make sure you level the material before doing any milling operation.
- It is always good to make multiple passes when machining POM to avoid melting and cracks. If you can find a way to cool the material while machining it will be helpful.
- Make sure to use a low feed rate and cutting speeds. I dialed my spindle to 1500 rpm but you may want to do a trial and error on a sample piece before proceeding with the real piece as the quality and types of POM may differ.
Fitting the Drilling Motor to the Drill Press
The dimesions of the 775 Motor allows a tight fit in the mounting hole of the drill press. This specific drill press allows the motor mount to rotate around the metal hollow tube it is supported on so make sure to center it facing directly front before tightening the screw on the back. I used an aluminum pipe of 5mm diameter attached to the drill chuck to determine the alignment of the drill point. By doing so I can check if the drill center is aligned to the center of the hole in the base of the drill press.
After aligning the drilling motor, the nut on the back can be tightened to fix it in place. There are two screws at the top and bottom between the spring which adjust the force required to press on the drill press for drilling. If they are tightened too much more force is required to press on the drill press.
Drill a hole on the bottom of the hollow tube so that the wires of the motor can be routed from the top to the bottom through the pipe.
Base Platform Preparation and Assembly
The blue 10 mm thick POM material will serve as the base in which all the parts will be laid out. The material is strong and resists deformation and it is fixed onto the drill press base with four M8 bolts.
- Take the 10 mm thick POM flat sheet and cut it to to the dimensions of 200mm x 300mm using the hand saw.
- Place it on the bottom of the drill press and after aligning it to the middle, mark the slots of the drill press base on the POM sheet.
- Drill 8mm holes on four corners 30mm apart from the center aligning the marking of the slots drawn on the POM sheet.
- Use the four M8 screws of length 30mm to fix it to the bottom of the drill press by pushing it through and fastening it from the bottom of the drill press with M8 nuts.
- Take note to align the POM sheet to the center before fastening the nuts.
Assembling the X-Axis Lead Screw
The lead screw and guide rails need to be assembled first before fixing on the base platform.
- Take the Base_Back_Bracket and press fit two M5 nuts in place.
- Take the Pillow Block Bearing and fit it from inside and use two M5 screws to fix it in place.
- Align the anti-backlash flange to the XAxis_Mid_Platform_Strut and screw the M2.5 (10mm) hex screws and nuts.
- Guide the spring and screw in the lead screw following the anti-backlash nut.
- Press fit the linear bearings to the XAxis_Right_Platform_Strut and XAxis_Left_Platform_Strut.
- You can now push the two 300mm guide rails through the holes in the Base_Back_Bracket and the XAxis_Right_Platform_Strut and XAxis_Left_Platform_Strut through the guide rails.
- The Nema 17 (42x48) Stepper motor is fixed to the Base_Motor_Bracket with four M3 hex screws (12mm).
- The guide rails are then slotted into the holes on both side of the Base_Motor_Bracket and M4 screws (10mm) are used to fix it in place.
- The flexible shaft coupling is slotted to the motor shaft and the lead screw and fastened in place with the set screws.
- The limit switch can be screwed in place as shown in the picture. You will need to align it before screwing in so that the XAxis_Mid_Platform_Strut can trigger it when the platform moves to the extreme left.
You can machine the XAxis_Platform from the 10mm Black POM (200mmx100mm) sheet or you could 3D print it.
- The XAxis_Platform is screwed in place after aligning the holes to XAxis_Left_Platform_Strut, XAxis_Right_Platform_Strut and XAxis_Mid_Platform_Strut with eight M2.5 (20mm) hex screws and nuts.
- The X-Axis Lead Screw assembly should be aligned to the middle of the base platform.
Assembling the Rotating Platform
You can machine the Polar_Platform from the 6mm white POM (200mmx200mm) sheet or you could 3D print it.
- The aluminum material with grooves were cut into pieces of lengths 30mm, 40mm and 50mm. Four sets of each length were cut and then glued to the Polar_Platform. This is optional as it is used to clamp the workpiece on it.
- Fix the flange coupling to the Polar_Platform with M2.5 (10mm) hex screws and nuts.
- Attach the Nema 17 (42x34) Motor to the flange coupling.
- The Polar_Motor_Base can be then aligned to the XAxis_Platform.
- The screws on the back of the Nema17 motor should now be removed and the stepper motor placed on top of the Polar_Motor_Base. You will replace those screws with the M3 (50mm) hex screws.
- Use M3 (50mm) hex screws to guide from the bottom of the XAxis_Platform thought the Polar_Motor_Base into the holes of the stepper motor and thread them in place.
- You can align the XAxis lead screw assembly now joined with the Polar_Platform Assembly to the middle of the base platform.
- Once aligned in place, you can trace markings of the holes on the Base_Back_Bracket and Base_Motor_Bracket on the base platform so that you can fix them in place with M3 hex screws afterwards. Make note to clamp the assembly in place before drilling as misalignment will resist motion of the lead screw causing unnecessary trouble.
- After drilling the holes on the blue POM sheet the X-Axis Lead Screw assembly together with the Polar_Platform Assembly can be screwed in place with eight M3 (20mm) hex screws and nuts.
- After fixing the Polar_Platform double check to see if drill position is centered.
Control Box
For user interface with the drill press I have used four buttons, a rotary encoder, a small slide switch and one 1.8 inch TFT display. The slide switch is used to switch between programming mode and normal use mode since I had to do a lot of testing and also allows for future developments in the code. When the switch is slided to the programming mode the pico is powered using the USB cable and during normal use mode it will be powered by the 12V power supply.
All the functions of the buttons are described on the display corresponding to the respective screen. The TFT display and the Pico are soldered to the custom PCB and the rest of the pins on the Pico which are used have traces to connection pads on the PCB. Apart from the TFT display the rest of the hardware are NOT soldered onto the PCB. Solder wires to the connection pads on the PCB according to the schematic diagram and screw in the PCB to the Screen_Base using M2.5 hex screws (10mm) and nuts. The wires can be routed from the two holes located on the back of the Screen_Base.
The 12V powered delivered from the adapter is connected in parallel to the buck convertor, the stepper motor driver and the relay module. The output from the buck convertor is adjusted to supply 5V and the ground lead of the output is connected to the middle pin of the slide switch. Check the connectivity with a multimeter if you have to identify the pins on the slide switch. They normally have three pins and the common pin is in the middle. The ground of the Pico needs to be connected to the terminal facing upwrads in the slide switch. Once the power connections are made they can be fitted inside the Control_Box_Base. The slide switch needs to be soldered onto a piece of perf board (20mm x 10mm) and fitted in the allocated cutout on the back of the Control_Box_Top. The Barrel Connector also needs to be soldered onto a piece of perf board (20mm x 15mm) and screwed in place to the Control_Box_Base. The rotary encoder can also be fitted in from the back of the Control_Box_Base and tightened in place with the thing nut from the top. The wires from the leads of these will be soldered later onto the wires from the PCB. The push buttons can also be fitted in place after soldering wires to two terminals on each button. The yellow button is positioned on the top left, the green on the top right, the blue on the bottom left and the red on the bottom right. It's important to position them this way as later on in the code we will display the buttons in the same arrangement on the TFT display and show the button click animations.
Circuit
The DRV8825 stepper motor drivers are connected to a dual stepper driver module and allows for configuration of micro stepping by connecting the jumper caps. The Base Stepper Motor which drives the lead screw is configured with the first stepper driver and the stepper for the rotating platform is configured with the second stepper driver. Both steppers have a rotation of 1.8 degrees per step in full step mode. The base stepper driver is configured to run at full step which is 200 steps per revolution. To configure the driver module for full step all the jumper caps need to be removed. The second stepper which drives the rotating platform is configured to run at 6400 steps per revolution. For this configuration the first and second sets of pins need to have jumper caps on.
Fixing the Control Box
Test out the wiring conections before closing up the control box. The Screen_Stand supports the Screen_Base on the Control_Box_Top. The stand needs to be glued to the Control_Box_Top after aligning with the cutout on the Control_Box_Top to route the wires from the PCB to the components in the Control Box.
To fix the Control Box on the base platform the aluminum flat bar is drilled with four M4 holes 30mm apart and the holes are traced on the base platform and drilled on the base platform. I used a handsaw to cut out the excess bit on the alumunum flat bar so that it lines up well with the edge of the base platform. After drilling the holes, I painted it green to match with the colors on the drill press. The Control Box is glued to the right end of the flat aluminum bar and the left end is screwed to the base platform. Since the aluminum bar is 5mm thick it provides enough support strength.
Path Planning for Moving Platforms
Since the objective is for the moving platforms to work in coordination to position the workpiece below the drilling point we need to calculate the linear distance to move on the x-axis and the angle to rotate on the polar platform from the origin. The workpiece needs to be clamped with the drill bit below the set origin so that the platforms can move to the input coordinates. The goal is to move in the x-axis direction ( i.e. linear motion) first and then rotate in the polar platform to arrive at the coordinates.
Since the given coordinates make a right angle triangle from the origin, we can calculate the hypotenuse of the triangle to get the radial distance (here I have mentioned as P_handle) from the origin to that point. So we basically move the linear platform to that distance in the required direction.
To arrive at the final location we still need to calculate the angle (theta) that makes with the x-axis and the point and since we know all the sides of the triangle it makes we can get the angle theta.
Make sure the platforms move in the desired directions. The lead screw should move the XAxis_Platform to the left for positive values and to the right for negetive values from the calulated distances. The Polar_Platform should move anti-clockwise for positive angles and clockwise for negetive angles.
This is all fine if we are to move with respect to the origin point 'O', but if we were to implement it with just this we would always have to move back to the origin point to navigate to the next point - say after moving from point 'P1', we would have to move to origin 'O' and then implement it to move to point 'P2'. This is not very practical as there would be unecessary motion involved and consumes more work time. It would also reduce the work life of the tool. A better way would be to navigate with respect to the point it is at - say from point 'P1' to point 'P2' without moving to the origin.
To implement that we would need to do the following,
- Calculate P1_handle from the Origin.
- Calculate P2_handle from the Origin.
- Calculate the cartesian displacement between P1 and P2.
- Calculate the displacement vector between P1 and P2.
- Calculate the angle (Beta) between P1 and P2 points from the Origin.
- Adjust P1_handle by moving Lead screw to match P2_handle
- Check rotating conditions.
As for the last step we need to implement it because there are two possible ways to arrive at the point (i.e. in the clockwise direction and anticlockwise direction). Obviously one of those paths would require more rotation, so we calculate the least amount of angles to rotate to arrive at the desired position. To achieve this we divide the circle (Polar_Platform) into four quadrants and label them as [+ +], [- +], [- -] and [+ -]. They are labelled according to the x and y axis positive and negetive directions.
Depending on the which quadrant P1 and P2 are located we can get the directions to rotation with the least amount of angles. The rotational conditions are included in the picture. Here I have shown the workaround between point P1 and P2 and the same functionality is applied to navigate between all the points whereby the first point (P1) will be the point the workpiece is placed currently and P2 will be the point it has to move to.
The block of python code below implements the path calculation and identification of the quadrants of P1 and P2 from the given coordinates to assign the rotation direction for the Polar Stepper motor.
User Interface
The user interface shows the a menu of the functions each button corresponds to in each screen. It is simple to navigate around and allows easy access to important functions in most screens such as step selection for moving the platforms. Most buttons have functions related to the current screen it is displayed.
Below is the sequence of actions and screens that allow you to navigate through them.
- On start up the home screen shows a bitmap image which i created using GIMP to show an image of the drill press with modified fucntions.
- It then starts to home the x-axis by moving the XAxis_Platform to the extreme left until the limit switch is triggered. Then it moves to the center point and zeros its coordinates.
- The first asks to clamp the workpiece centered to the drill point and then gives you the option to rotate the Polar_Platform for better alignment. You also have the option to home the X axis again if required on this screen. Once clamped you can press the Confirm to move to the mode selection screen.
- You can select Manual control ro auto control in the mode selection screen. At this point you also have the option to select the steps to move both platforms. You can also go back to the previous screen by selecting Main Menu.
- On Manual Mode select, you will have options to move the XAxis_Platform and the Polar_Platforms by moving them in the preselected steps.
- On Auto Mode you can add coordinates for it to move to one by one. After all the coordinates are added, you can select Confirm for it to start moving to those points. You can also navigate between those points by pressing next and previous.
- Once the workpiece is placed in the defined point your screen will give an option to activate the drill, abort operation or move to next point. By pressing the drill you can engage the drill and pressing it again will deactivate it.
- The rotary encoder allows to scroll between the range of coordinates which you can select which is between -85 to 85 and the button on the rotary encoder allows for selection.
Importing Libraries
I used Micropython and Thonny IDE to code the program and below is a list of libraries I used to implement the final code for the semi automated drill press. Check this article on how to install libraries from package manager in Thonny. Some packages need to be installed manually by copying them to the Pico. I will mention them below.
- Stepper Library for Micropython - Using Package Manager in Thonny
- ST7735 Library for TFT display - Manually copy the files. Here is a guide.
- Rotary Encoder Library - Manually copy the files. You just need to copy the two files rotary_irq_rp2.py and rotary.py
Beside them the math library, time library and machine library are used which are built in libraries in Micropython.
Program
The final code for the Semi_Automated_Drill_Press attached at the end.
Below I have included some snippets which are useful but is not the entire code.
Importing Libraries
Hardware Setup
You can reverse the direction of the stepper motors if they are not moving in the direction you want by setting invert_dir = True. In my case I had to invert the direction for both motors. The direction depends on the wiring of the coils to the stepper motor driver module.
Defining Variables
User Interface - TFT display Functions
The 'show_menu' function has all the code for displaying the content on each screen and is called whenever a screen is active.
Stepper Motor Functions
Moving the stepper motor functions have an additional parameter which I defined called disp which allows to update the display to the coordinates it has moved. In some cases specifically in the main menu when we move the Polar_Platform the screen doesn't show the coordinates in which case I have assigned the disp to False (0).
Downloads
Conclusion
Using Polar and Cartesian positioning of the workpiece has its advantages by increasing the workarea in this case where the hollow pipe of the drill press restricts motion in Y axis. Using Polar motion allows faster positioning compared to a planar two axis cartesian system. Having said that I've come to know of the limitations of this specific build such as using 3D printed parts gives room for wobble in the x-axis specially when drilling but it could be overcome by using machined parts.
By going over the path planning it has somewhat shed some light on how gcode handles precise motion although it probably uses a much advanced algorithm compared to what I have shown in this instructable. I hope this instructable can help you in your builds and have shown some insight into Polar Motion implemented with one axis cartesian motion. Thank you for reading till the end.