Showing posts with label CNC. Show all posts
Showing posts with label CNC. Show all posts

Friday, January 9, 2015

New Project - Cheap Hexapod

I've always wanted to build a Hexapod. They look pretty cool with all of the legs moving in sync. They can also be used as a desktop toy, unlike my RC car, which is basically an outside only toy. The biggest problem with hexapods is they are really expensive. A proper hexapod requires three degrees of freedom for each leg. This ensures that the leg doesn't need to slide on the ground. The three degrees of freedom per leg and six legs require a hexapod to have at least 18 servos. The servo cost adds up fast and had previously discouraged me from building a hexapod. Recently I came across micro sized servos (HXT900 9g servos). These servos cost about three dollars each. Even with 18 servos that still isn't too expensive compared to typical on brand servos that cost about 20 dollars each.

I wanted to build the hexapod around my new 3D printer. The first thing I decided to do was integrate the servo splines into the legs themselves. After a number of test prints I was able to confirm it is possible to create micro size servo splines with my 3D printer (Form1+). I also wanted to keep the design minimalistic and avoid over complicated joints and leg segments.


I bought three servos before I committed to building the hexapod. I printed and assembled one leg to ensure the servos would be strong enough to drive the leg. I also wanted to test the tolerances on the servo splines with multiple servos. This image shows the leg prototype, The only change I made to the leg design was an increase in the depth of my logo.


This was the first "production" run for my 3D printer. I had to make six copies of each leg part as well as the body section. Aside from one print failure (on the main body servo mount plate) everything printed perfectly. I literally couldn't make these parts through machining given the orientations of the splines and the shapes of the parts.


This is the body piece ( the one that printed correctly) as it came off of the printer. There was an update to the printer software that dramatically reduced the material wasted in the support structure for the parts.


Here is the part before support material removal. The supports are removed with wire cutters and then the remaining bumps on the part surface are removed with a file.


The final part looks pretty clean. All of the dimensions seem to be within tolerance for the hexapod. There is some warpage in the part that occurred after the post curing, but it shouldn't prevent the part from being usable.


Each servo requires two 2-56 screws to be threaded into the frame. My hand got pretty tired trying to screw all of the servos into the mounting plate. Each servo fit nicely into the plate.


I decided to try fitting all of the pivots into the lower central support plate. It was fun getting to see the hexapod come together.


This was the first time the hexapod was fully assembled. I knew the wiring would be an issue, but I didn't realize how messy the hexapod would look without proper wire management.


Here is my programming testing setup. I was at my house for the winter break and no longer had access to my 3D printer. I had CNC access but I didn't particularly want to get covered in chips as I usually do when machining. I used a raspberry pi model a+ as the controller. This raspberry pi is the smallest one currently available. I wanted to run the hexpod with linux and python because it makes the programming easier. The hexpod currently connects to a computer over wifi which was really easy to do and should be a convenient way to control the hexapod. The two blue boards are PWM driver boards from adafruit. Each board can drive up to 16 servos ( I needed to drive 18 so I had to get the second board). The boards are controlled with an I2C interface. This means I need a minimal number of pins from the raspberry pi to control all of the servos. It helps to keep the wiring from being a mess.


Here is an early motion test. I programmed the legs to look like they were walking. I still needed to calibrate each servo and complete the actual leg motion program. This shows the hexapod moving its legs near the peak servo speed.


This was the first PCB I milled on a proper milling machine. I've always had access to a dedicated PCB mill, so coming up with my own milling procedure was fun. I drew the circuit board in SolidWorks so it would be easy to generate the G-Code for the CNC. A proper circuit CAD program like eagle probably would have been a better choice.


The PCB I milled was for the hexapod's power supply. This supply is capable of driving up to 20A at 5.5V. I wanted to drive the hexapod with a 7V battery, but the servos and raspberry pi wanted 5V. Each servo doesn't draw very much current, however the combination of all 18 which could all be running at full torque at one time would overwhelm most power supplies. I decided to go with the 20A supply to ensure there would never be a sever voltage drop that could shut down the raspberry pi.


Here is the final hexapod assembly. I ended up milling three plates from polycarbonate to create the electronics mount. The electronics are all held in with zip ties. I would have used screws, but I didn't want to make the standoffs required to mount the electronics with screws.

Unfortunately during testing I managed to break three servos. Shipping the hexapod back from break caused another four servos to die. All of the servos broke at the same internal gear. I haven't been able to finalize testing my leg motion code without a fully functioning set of legs . I chose not to use an existing set of code for the legs because I was excited to create my own algorithm from scratch. I need to rethink my servo choice and look into getting slightly more robust servos. Currently I am looking at using metal gear servos that are around five dollars each. I'm sure the hexapod will be up and running quickly once the new servos are integrated into the design.

Sunday, November 30, 2014

Servo Spline Adapters

My transmission design for the Mini Combat Robot uses large servo gears. Unfortunately the output from these gears is a spline shaft. I had to come up with a way to easily adapt to the spline without making a sketchy connection with the servo horns that are meant for those servo gears. My first technique for making a servo spline can be done with a milling machine. It's a fairly straight forward and doesn't require special tools.



I put a "blank" shaft into a collet block. The collet block isn't required, however holding a round part vertically in a vise can be difficult to align. It also has a good chance of slipping which could break tools and ruin the part. The first thing I did was drill a set of starter holes. I used a small carbide ball end mill because it was the only tool that could make a mark smaller than the drill bit I wanted to use. Each hole corresponds to one of the teeth in the spline. I designed the holes so the outer edge would meet up with the tip of each spline tooth.



Once I made all of the starter dents, I proceeded to use the final size drill bit. Each hole was very close, but none of the holes intersected. If the holes intersect the drill bit will likely drift and break. The final step was to mill out the center. Milling out the center creates the inner part of the spline. It is important to design the geometry such that the leftover wall between the drilled holes fits between the spline teeth. I simply plunged and endmill down to the desired depth and let it swirl around to the correct diameter. This opened all of the holes drilled to the center.



This is the final shaft. The part fit snugly on the spline and didn't seem to damage the spline even under loading conditions. I used this part on the Mini Combat Robot until a design iteration forced me to a 3D printed design (I no longer had access to a mill). Any mill with CNC or even a digital readout can produce splined holes.


This is a 3D Printed replacement for the metal adapter. I needed a different pulley, but I couldn't use the metal spline shaft for the upgraded design. I decided to 3D print an adapter instead. I used the same geometry as the metal spline and simply printed a new adapter. It also slipped right on and worked first try.


Here is the 3D printed servo adapter as well as a splined shaft that copied the original servo spline. I doubt an FDM type 3D printer could produce the details required for this spline to work, so I'm glad I went with the SLA type 3D printer (Form1+). Making giant servo splines led me to test miniature servo splines.


The first part to my process to make a servo spline is getting a picture of the spline itself. I use this picture and one reference dimension (the outside diameter of the spline) to trace the spline profile. This seems to be pretty reliable and is able to get details that my calipers can't measure.


Here is a screen shot from the CAD I used for the servo spline. I get the spline dimensions by tracing the profile that comes from the drawing. It is surprisingly fast to CAD this way. The camera image reveals a lot of details that my measuring instruments won't capture.


Here is a servo spline made for a micro size servo (9g servo). The printer was able to handle the small details required to make the spline.


The gear fit perfectly onto the servo first try. I attempted to strip the spline, however I only managed to cut myself with the 3D printed gear teeth. I was unable to get the spline to skip on the servo.

For future projects using large servos I will attempt to make more metal shafts and splines. I find them more durable than the 3D printed parts. I also know the servo gears will strip before the metal spline slips. The 3D printed splines for smaller servos are too awesome. I'm still amazed the printer can handle details like that. The cool part is these splines can be put into any 3D printed part. It doesn't matter whether the part is round, square, or even a hexapod leg!

Saturday, November 29, 2014

Mini Combat Robot Update... again

I decided to use my new 3D printer to solve any engineering problems with the mini combat robot. The first problem was making the motor controllers fit in the space I left for them.


Here is the motor controller mount as it came from the 3D printer. The part wasted a lot of material in the supports. I designed the part to fit the motor controllers perfectly into the robot frame. This part might be machinable, but I would avoid making this part if I didn't have a 3D printer.


The new motor controller mount allows me to fit the wires in to the available space. It may look messy, but I'm just happy I could make the motor controllers fit into the frame. I knew the motor controllers would fit into the frame, but I didn't account for the wires or connectors. These left the space a bit too cramped to properly mount any of the components. The new 3D printed mount allows me to securely mount the controllers without risking damage during combat matches.


The robot looks pretty slick. I was able to replace the old 3D printed parts either with properly machined components or parts printed with my new 3D printer.


This underside view of the robot shows how the motor controller fits into the robot. I still need to replace the top and bottom plates with real armor instead of thin acryllic.

I didn''t quite mange to finish the robot before losing machine shop access. I've been able to replace most of the poorly 3D printed parts with either higher quality plastic components or metal components, however there is still a fair amount left to finish the robot. The biggest thing the robot needs is a spinner.

Sunday, July 20, 2014

New Project - RC Car

I've wanted a real RC car (not one of those tiny indoor only RC cars) since I was a little kid. Now that I'm a big kid I can just go out and get one. In this case I mail ordered a relatively cheap 4WD 1:10 scale buggy. The frame came as a kit. I had to pick out the motor, motor controller, radio, and batteries. I already had the radio from the mini combat robot, which cut the cost of the car. The reason I decided to buy a RC car instead of building one was that I didn't want to build something and then decide it was boring. I figured a cheap RC car would require repairs and could have an opportunity for many custom parts.


Here's a sweet action shot of the car before parts started breaking. I put a "somewhat" larger motor and battery in the car than suggested. The car's peak speed is over 40mph! (timed by driving on a football field) It probably has more power than I can control... I flipped it and hit things a full speed many times as well as taking jumps that brought the car around head height in the air. Needless to say the cheap plastic parts started breaking real fast.


Here's the machining of a new shock absorber mount. The original part didn't break, but it bent ~45 degrees. I decided a metal version would be a good first upgrade for the car.


Here is the aluminum part next to the original (which I bent back). I removed some of the extra "adjustment" holes that were in the original part. I also remade the pockets to make the part considerably stronger. I don't expect this part to break before any of the other parts on the car.


After a few more jumps I busted the front A-arms. I didn't have a spare axle so I was forced to bend this one straight again. Thankfully the axle was made from cheap steel and I have decent pliers.


Here is the A-arm that broke. The plastic split at the axle. This part is not a simple 2D part like the shock mount.


I started the part from flat aluminum plate. I forgot how slow it is to mill with a 1/8" endmill...


I wanted to save material so I did a REALLY good job orienting the stock on the mill table.


Here's a before and after picture of the side machining. The parts required a total of 3 sides of machining each.


My trusty mini-vise did a great job holding the parts. I also tried a set of carbide drill bits. They seemed to drill much better than my sketchy old drill bit set.


The new A-arms look pretty nice on the car. The shock spring mounts rub the aluminum a bit. I'll need to make some replacements to prevent any possible damage to the shocks.


Here's the whole car with its cover attached. The rear wheels are pretty worn down. Those will have to be replaced soon as well.


Here's the car without the cover attached. The electronics are fairly compact. I've been very impressed with the motor and motor controller combination. Neither has melted yet!

Overall I'm glad I bought an RC car instead of making one from scratch. I really wouldn't be able to beat the price I paid for the frame. When a part breaks I can have fun making a replacement. Eventually the whole car will be custom!

Monday, March 24, 2014

Mini Combat Robot Update

I tend to prioritize class work rather than my own projects, so I haven't made too much progress on the Mini Combat Robot. Hopefully I'll find the time to finish this project before the semester is over and I lose access to the nice CNC machines at school. 


The frame started to come together nicely. I quickly held the unfinished parts together with a few clamps just to see how the frame looked in person. I have quite a few 3D printed parts on the robot. These parts are low quality compared to nicely machined parts. I want to see the robot assembled as quickly as possible, so I decided to 3D print a number of non critical parts.. The 3D printed parts should hold up well enough to drive around , however almost all of them will need to be replaced before the robot goes into combat.


The 3D printed transmission mounts might stay... They seem to be strong enough to handle the torque output from the transmission. They're also green which matches the motor's color.


Here is right after I finished drilling and tapping all of the cross bars. this is the first time the robot has actually looked like the final product in the CAD. The robot uses "tank treads" which are made from timing belt. They took less space than wheels and seemed like a simpler, more reliable way to make the robot move.


These are all of the frame parts. Although they aren't the simplest shapes, they can all be made with a standard milling vise setup. They took longer to machine than I had estimated, but I guess that is always the case with machining. Cutting the 45 degree angles took some patience, but they shoud be worth it if there are any other robots with spinners. Hopefully the beveled edges will help the robot deflect any kind of spinner weapon.


This is the state of the robot for now. It is by no means ready for combat. It still needs a spinner, replacement parts for the currently 3D printed parts, electronics mounts, as well as top and bottom armor plates. I'll try to finish this project before the semester ends, but I can't make any promises...

Saturday, December 14, 2013

New Project - 3D Printer

I decided to make a 3D printer. 3D printing seems to be the wave of the future for producing many parts. There are a few different types of 3D printers, one of which, the extrusion type, seems to be the most popular on the market. This kind of 3D printer takes in filament, which is essentially plastic wire, and extrudes it into a small bead of plastic. The printer moves the extrusion nozzle on a table to draw a part. This printer is basically a fancy hot-glue gun that makes 3D shapes. 

The consumer grade 3D printers on the market are pretty slow and they don't produce the best quality parts. In addition, most of them don't use support material. Support material is a second material used by the 3D printer with the standard plastic. The support material can be dissolved so you can make parts with overhangs or other features that require additional support.

The concept for this 3D printer is to use high power hobby brushless motors, similar in size and power to those used in the heavy weight combat robot I built last semester. These motors aren't meant to be used as servos, so the printer needs custom motor controllers as well as additional hardware to properly drive the motors.

The brushless motors have 3 wires: phases A, B, and C. Brushless motors have magnetic coils in multiples of 3, one set for each of the 3 phases. These coils are connected together in a few different configurations, such as wye or delta, which provide different characteristics to the motor. Driving the motor is the same regardless of the coil configuration. Phases A, B, and C must be pulled to supply voltage, ground, or floated to make the motor rotate. A nice resource for this would be AN857 from Microchip. Microchip makes microprocessors, transistors, and other components used in motor controllers. AN857 is one of their application notes on brushless motor control.

Most hobby brushless motors are sensorless, so there is nothing added to the motor to help a controller determine when to switch which phases are being powered. Since a servo needs an encoder, I decided to use this to perform the commutation, or timing for when the motor controller switches which coils are powered.


Here's a picture of the custom motor controller. This board uses power MOSFETs. MOSFETs are a type of transistor that is great for high frequency switching applications. There are 3 pairs of power MOSFETs; each pair corresponds to one of the motor's phases. One MOSFET in each pair is connected to the power line, and the other in each pair is connected to the ground line. If a high-side MOSFET is on, that phase will be connected to the power line. If a low-side MOSFET is on, that phase will be connected to ground. If neither is on, the phase will be disconnected from power and ground. If bot MOSFETs are on, power fill flow from the power line to ground. In this case the MOSFETs will form a short circuit. With a large power source, batteries or computer power supply, the MOSFETs will fry from too much current.

Portions of this project became a group effort for final projects in two of my electronics classes. The motor controller and its design are part of an advanced electronics course. The logic portion of the control, which is built on an FPGA and microprocessor board is part of a digital electronics and embedded systems course.

The logic portion of the motor controller is implemented on an FPGA. This includes PID control, which is being temporarily used until the mechanical portion is built; motor commutation; and coordinate input. An FPGA is a chip that has programmable logic gates. An FPGA allows the user to implement hardware design on the chip. Certain features like encoder counting, and motor commutation are very convenient to implement on an FPGA. Since these features are in hardware, certain situations can be made impossible. One example of this would be short circuiting two of the MOSFETs together.


Here is a quick video of the motor. The motor controller is connected to a variable voltage supply. The motor controller is just switching which phases are powered depending on where the motor is positioned. The voltage determines the peak speed of the motor. I can't remember if this test went up to 12,000 rpm, but the motor and encoder functioned up to this rpm.


This shows the output of the encoder at 12,000 RPM. The signal is very clean. There are two square waves because this encoder is a quadrature encoder. There are two sensors, 90 degrees out of phase from each other, which read lines on the encoder. This lets the controller decode a resolution four times higher than the line count on the encoder. This encoder can be read at up to 8192 counts per rotation.

The mechanics for this project are meant to be relatively cheap to make. Linear slides in the gantry are built using hardened round rails and ball bearing bushings. These components are commonly used in other 3D printers and can be found very cheaply on sites like Ebay. The design for the printer isn't completely finished. There table motion system and mount, material mount, extruder, and heater block have yet to be designed. Thankfully the project proposed for class only required the motor controller, not the full 3D printer. I will likely finish these parts over the winter break when I have more free time.


Here's a screen shot of the CAD in the 3D printer's current state. The gantry design is done and looks pretty sweet. The table still needs some work, and the extruder doesn't exist.


These are the bearing blocks used in the gantry. Each one holds a round rod ball bearing bushing. The bushings are tight slip fits, so you can put them in by hand, but it does require some force to push though. Each of the bushings are held in with snap rings. Most of the dimensions on this printer are a mix of english and metric units. Linear slides are all metric, but screws and part dimensions are english. I wanted to use existing stock and screws for most of this project to keep my costs lower, otherwise I would have made every dimension metric.


Here are most of the components in the gantry. Locating dowel pins are not pressed into the bearing blocks or the blocks that hold the X axis rails.


The frame is made from MDF. MDF was chosen because it is pretty cheap, it cuts nicely on a CNC router, it is relatively dense, and it doesn't produce splinters like other woods. If I get around to paining the frame it will look even cleaner than it does now.


Eventually I will glue the frame together, but for now it's going to be held together with clamps. There are still a few features that need to be cut into the frame, so I want to be able to replace or modify the 6 panels.


 Here is the servo mount. The motor is a 350KV outrunner motor that should be able to output 1200 watts. This is total overkill for the printer. This size motor is used because of the low KV which makes it easier to control at a particular voltage. It also eliminates the need for a gear box, which can introduce backlash to a system. The encoder is mounted on top. The gantry uses an H-Bot design. This design uses one loop of belt within the gantry. The servos can be stationary and mounted to the frame with this design. This makes the gantry much lighter than a traditional gantry design where each motor separately controls each axis. In the H-Bot design the position of the gantry is a linear combination of the two motor positions. The gantry moves in the X axis when both motors spin the same direction. The gantry moves in the Y axis when both motors spin in opposite directions. If only one motor is spun, the gantry moves equally in both the X and Y directions.


 Here is the FPGA board and motor control board wired up to the system for testing. The final system will be wired in a much cleaner way...

I'll try to keep up to date on the progress over break. I have this and a number of other projects to start and complete, so I should post more often than during this semester.