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.

Sunday, July 28, 2013

New Project - Mini Combat Robot

For a number of reasons we (the combat robot club at my school) have started work on a mini combat robot competition that will take place on campus. This summer we've worked on getting the competition ready for the coming school year. The first thing I started with was the drivetrain. I wanted to avoid making all of the gears as I have for many of my other motorized projects, so I looked for a cheap and easy to purchase solution. I found large RC vehicle (car, plane, boat, etc...) servos have very cheap replacement gear sets. I bought two sets of the largest common servo I could find. This gear set works with the HITEC 805 servo series.

All of my motorized projects now use brushless motors. They deliver the most power in the smallest package. They are also very cheap compared to other motors. These little transmissions use a set of 220 watt motors. Each motor is about 20mm in diameter and 40mm long. The only down side to these small motors is they spin very quickly which requires a large gear ratio to make them useful. Thankfully the servo gears make this gear ratio easy to obtain. I designed the maximum output torque of the transmission not to exceed the original servo's rated torque. This should prevent the gears from immediately stripping. Wear may become an issue because of the increased gear speed, but I'm not too worried about that because they're a cheap and easy to replace solution.


Since these transmissions are for a mini combat robot, the screws also have to be small. I had quite a few #2-56 holes to tap. As always I was afraid of breaking the tap, but in the end I tapped 24 holes without incident.


Dowel pins are used as a bearing for the intermediate gears. Everything except for the #2-56 screw is metric in this transmission (I didn't want to buy metric taps and screws when I already have a large stock of English taps and screws). The output gear takes ball bearings, which should make this transmission pretty tough and smooth.


Overall the transmissions look pretty beastly. I'm waiting on pinion stock for the motor gears to come in from an order. I'll test them once I can actually transfer motion from the motors to the rest of the gears.

The next step in the mini combat robot build process is to get the motor controllers designed (yes; I'm making the motor controllers from scratch) and to finish the chassis CAD.

Sunday, June 30, 2013

Desk Lamp FINISHED

Now that it's the summer, I finally had the time to finish the desk lamp. The combat robot destroyed any amount of free time I had. I had been using the lamp without the base for over a semester, while the half finished base just sat on my dorm room floor.

It took a creative setup to machine the other side. I used a 4 jaw chuck from a lathe and clamped it to the mill table. I also added a bolt in the center to hold the part flat to the chuck. The part seems to be flat within .002" which is pretty good because it doesn't matter at all for a desk lamp.


I put some cutting fluid on the part and I used compressed air to keep the chips from clogging up the end mill.




The final base looks perfect!

I snapped a couple photos of the lamp against a whiteboard. It makes a really good background for taking pictures.







I even set it up on my messy desk in my summer apartment.


It definitely goes well with my guitar. I'll need to work on making a desk and other furniture to go with the rest of the things I've been machining lately.

PROS
-The LED is crazy bright. It lights up not just my desk, but also a good fraction of my room.
-MEGA REACH! I can get amazing lighting on any part of my desk.
-Aesthetics. I think this lamp looks amazing.
-Low power consumption. Everyone loves going green now...
-Runs colder. Most desk lamps will give you a nasty burn. This one is pretty warm, but I've held my hand on it without any problems.

CONS
-The ball bearings in the base have too little friction. It swings around on its own on a non-level table.
-Not dimmable. Sometimes its too bright. (I don't think my roommate appreciated it when I pulled all-nighters to finish homework.
-It's fragile. Most of my projects are tough to damage... Not this one.

Overall this is a pretty sweet lamp. A number of people have asked if I am going to make more. I'll probably come up with a production version of the lamp, which gets rid of the CONS and reduces the material and machining costs. There are a few LED desk lamps on the market, but they all suck in my opinion. For now I'll keep using this as my main desk lamp and see how long it lasts (forever hopefully).

Thursday, May 16, 2013

Heavy Weight Combat Robot - Competition

Competition was very interesting. We didn't do particularly well, but we did make it there with a complete and tested robot (not every team could say that). We also left with a complete and functioning robot (lots of teams couldn't say that).

During testing we discovered that the belt drive used to transfer torque between the motor and spinner was slipping pretty badly. The belt was designed to slip some. During an impact, the spinner stops almost instantaneously. The belt was meant to slip under this condition to protect the motor shaft. We heard from other teams that used the same motor for the same application that their shafts sheared when chained to the spinner. Our concept was good, but the implementation was bad. A belt tensioner was added between testing and competition. It helped, but it didn't fix the problem. We also added a belt dressing which was supposed to make it grip better. In the end it just made the belt disintegrate much faster.


Here's Robespierre right before competition. It looked pretty sweet. The others in our division saw that too. They also warned us that the first tournament would be a "learning experience"... they were right. We went up against two wedge bots. Since the belt was slipping the spinner wasn't able to gain enough kinetic energy to take out the opponents. Just like any vehicle, it can only takes one critical part to cause the whole thing to fail. 99% was good, but that 1% belt prevent it from being amazing. The carbon fiber arms broke off as we had guessed they would. otherwise, the robot received nothing more than a few scratches. We were proud we held up to the beatings delivered by the other robots. Sadly I don't have videos because I was part of the drive team.

A few things we did worked amazingly well. The brushless drivetrain saved a ton of weight. It was a risk that we took because it was an unproven technology in the heavy weight class, but it really gave us an advantage in building our robot. The magnets were also a big boost to performance. Our first match had the magnets on. The robot was firmly planted to the floor at all times. Our last match we didn't have the magnets (the judges were less than amused when a magnet fell off and adhered itself to the arena floor). That match we were jumping up in the air during impacts. It also let us get wedged.



The belly pan got fairly scraped up. I think it looks better with the scratches... it's battle tested!

I'm not really sure where to go with the PROS and CONS list.

PROS
-It breaks stuff.

CONS
-It's only use is breaking stuff

Overall the biggest things we need for the robot are improvements. There are minor fixes that need to be completed before the next competition to make it a real competition. Some are small changes like changing out the belt with something that grips better. Other changes are increasing the ground clearance and making a better magnet system (so they can't fall off during a match).

New Project (finished too) - Heavy Weight Combat Robot

I guess there aren't going to be any project updates for this project considering its already done. This is the first amount of free time I have had all semester... and it's finals week. At the beginning of the first semester of this school year a small group of my friends and I decided it would be a good idea for the school to have a combat robot club, with the ultimate goal of competing in the 2013 RoboGames competition. With a little bit of work we were able to obtain adequate funding from the school to do pretty much whatever design we wanted.

Originally we wanted to enter into the 110 pound middleweight competition, however after watching videos we decided this weight class was a little lame (very wrong conclusion, even the 3lb robots are scary and exciting to watch). After some group brainstorming and preliminary weight estimates for our design, we
realized the 110 pounds wasn't going to happen, so we just switch to the 220 pound heavy weight class. Looking back, I kind of regret this decision because it made for twice the work, but I'm also glad we chose this weight class because there's a fairly small group of individuals that have attempted the 220 pound robots. It also really pushed me to put myself to my limit to get this project done while maintaining my grades!

One thing we wanted to do with the design was use components that teams don't currently use because either they're new and untested, or harder to use. These three sets of new components are as follows:

-Brushless motors
-Li-Poly Batteries
-Neodymium Magnets.

The first thing we decided to work on for testing was the brushless motors. These aren't just regular brushless motors, they're RC car brushless motors. The funny thing is that most people wouldn't consider these motors because they're designed to run RC cars that are only a few pounds. In addition, the motors are very small (around 1.5" in diameter, 2"-3" in length, and around 1 pound). Compared to the motors used on most combat robots in the 110 and 220 pound weight classes, these things are toys (most 220 pound combat robots use brushed motors that weigh upwards of 10 pounds and are 4" in diameter) The reason we thought these motors could work is that they had power ratings over 1800 watts, not far off from the big motors.

We decided to make a test platform to determine whether or not these motors were actually able to put out the power they advertised.

The idea for this platform was to measure the torque output over a range of different rotation rates while the motor was provided full power. Normally this is done by connecting the new motor to an existing one that has known parameters. We couldn't do this because we didn't have a motor that could spin 40,000 rpm and handle 2-3 HP. Instead I cooked up a platform of our own that tells the torque and rpm. There is an aluminum disk bolted to the motor. A neodymium magnet is spaced very closely to the aluminum plate. The neodymium magnet is held by an axle that is supported by ball bearings. The axle transmits torque between the magnet and a lever at the end. The lever is then placed on a scale.

The setup works by the same physics that cause a magnet to fall very slowly through a copper pipe. When the motor spins the aluminum wheel, the opposing neodymium magnet generates eddy currents in the aluminum (this is going to be a bad physics explanation, but bear with me). These eddy currents generate a magnetic field that opposes the magnet. The eddy currents turn all of the output power from the motor into heat because the aluminum has electrical resistance. The torque is transferred by the eddy current's magnetic field and the neodymium magnet to the lever arm. This torque causes the arm to press down on a scale. This allows us to measure the torque. The rotation rate is found by counting how many times a black stripe on the wheel passes by a light sensor. (Note that the setup uses some of the electronics from the "anti-gravity" robot that my roommate and I were constructing at the time.)

The system showed the motor was providing similar power outputs to the specifications. One mildly dangerous thing about the test setup was the temperature of the aluminum disk. Since the fixture is 0% efficient, all of the output power goes into heating the aluminum disk. Within a few seconds of testing, the disk was well above boiling (wet paper towels hissed as if they were touching a soldering iron)



The video shows a small piece of tape on the end of the motor shaft. The motor was surprising loud. Given that we verified the power output we decided to go with the brushless motors for their higher power to weight ratio. The only down side is that they need to be geared down a ton. ~40,000 RPM is not particularly useful on a combat robot drivetrain.

The weapon for our deign is a spinner. Spinners require massive amounts of horsepower to spin up within a reasonable amount of time. We bought the massive PERM motor. it can run up to 72 volts and have a peak power output of around 34 HP.




Even with only 12 volts I almost wasn't able to hold the motor down during start-up. We scored a good deal on the motor using ebay. It was sitting in someone's garage for a few years, but it was in perfect condition.

Naturally, the robot was drawn up before machining to ensure the parts all fit together and there wouldn't be any nasty surprises along the way.


I had trouble getting the colors to look good on the full render, so here's a contour render. It makes a great desktop background. (I've been making more of these contour renders because I think they look much better.)

I'll just include a bunch of pictures of the machining process. There were lots of cool parts. Since this was a school club project, we worked to get as many people involved in the production process. I was able to see many students go from having never seen or heard of a mill to being able to operate a CNC and make perfect parts.


This is the first time I ever used a water-jet. It made production of the large plates on the robot much smoother. This part was made in January, and was one of the first parts made for the robot.



Here you can see the motor on top of the belly pan. The belly pan greatly increases the shear strength of the chassis. It is also a great mount for the electronics. It is 34" x 22" x 1/8". This also shows how massive the spinner motor is compared to the rest of the robot. The limiting factor on the robot height was the motor.



After being back at school for less than 24 hours (came back from winter break), we already cranked out the transmission plates and some of the axles. In addition we picked up the gear stock for the transmission. One drive motor and motor controller are also in the picture.


We made a will call pickup from McMaster! (You can order on a Saturday and pickup the order an hour later!) Lots of screws. The metal came from Online Metals, but we put it in the McMaster box to keep the dorm room as clean as possible.


Here's our double vice setup for the chassis side rails. There's only one vice per mill in the school shop, so we had to jack the second vice from another mill. There are 4 of these parts on the robot. Lots of tool changes without an automatic tool changer is a horrible pain.



I used a machinable collet to hold the gears. The collet was bored out to the OD of the gear stock. This way the gear teeth were guaranteed to be concentric to the bore. This was much more pleasant than making custom jaws for the 3 jaw chuck.


Here is a finished gear stock. Buying 3 gears was more expensive than buying a whole gear stock, so for the 64 tooth 32dp gears we had lots of spare material.


The cutoff tool was used to remove most of the material, but the horizontal bandsaw was used to cut each blank off of the stock. This way stock could be supported by the live center at all times while inside the lathe. The rest of the facing and boring was done with the custom bore collet.



Gear stock makes great noises...



I designed the transmission to use as many of the same tooth number gear as possible. This way I could use the gear stock to its fullest. I made a full set of spares just in case some catastrophe happened during competition.


In just about 2 weeks we managed to make it this far. This is amazing considering we all have copious amounts of homework and there is only one CNC mill and lathe. The limiting factor has really been the single CNC mill. The manual machines are in such poor condition that even facing stock turns out poorly. All milled parts on the robot have to pass through one machine.


Thankfully I didn't cause this crash. That was 1.5" diameter stock. The tool holder was a little messed up afterwards, but thankfully there was no harm to the machine.

PRO TIP: Watch where you extend your stock relative to the zero of the machine. The program was written to face off the first .1" of the stock. If the stock is extended past that by lets say.... an inch or two, the machine rapids into the part.



The crash didn't really set anything back (aside from morale). The hubs for the wheels were made in a few hours. We used 3" diameter wheels. This reduced the amount of gearing required for the transmissions. The cool thing is that the chassis is so short that the wheels still stuck up past the top.




A quick rolling test verified the chassis could roll. We added some cardboard boxes to make it look cooler... not sure if we succeeded.

I flew back home to get the rest of the water-jet parts made. Lots of 3/8" 7075 aluminum plate and 1/2" 6061 aluminum plate.




 This is one of my favorite pictures from all of the machining.


Yeah... the spinner is pretty large.



A couple hours worth of water-jet time made the biggest jump in completeness for the robot.


I got to use my insert endmill again (GMT tools are really awesome in looks, performance, and price). It's pretty boss.


These bearing blocks are pretty large compared to the mill. The bearings are 70mm ID tapered roller bearings. Considering they handle all the damage potential, they need to be pretty strong. I also realized how much the student CNC mill needs flood coolant and an enclosure. removing copious amounts of material takes forever.


The finished wheel assembly looks really awesome. The sprockets were cut on an EDM machine. All of them were cut in one stack, so it wasn't a waste of machine time.


I made chain tensioners, but hoped the chassis wouldn't need them. I lucked out and the chain was perfect. #35 chain is pretty robust and can take some slop without any problems.


This is starting to look like a real battlebot.


A quick drive test greatly boosted morale (morale was good before the test, but it was super high after the test). The robot easily carried 3 people. The acceleration skids the wheels on the floor. The massive rpm of the motor makes the gears scream. It sounds pretty mean. This also proved we didn't screw ourselves by going with the brushless motors. The next priority was to build the rest of the spinner.


The stock was only wider than the 3 parts by .03" and thicker than 2 parts by .01". We had to get creative. This was very material wasteful, but considering the original 27 lb slab of 7075 was from a metal recycling place for only $2 a pound, I was cool with machining away half of the material.


Getting closer to the final assembly. Finishing the robot in time for competition is a little more stressful that we had originally thought. The CNC mill kept needing to be used for class projects, which killed the productivity.


The spinner looks pretty menacing on the robot. Now all it needs are the hammers and tool steel blades.


This shows how the parts interlock. The hammer is locked by geometry to the arm plates. This ensures the bolts don't need to take the shear force from the impacts. The 7075 of the arm corroded some which is why it is so much darker than the 7075 used in the tie rod blocks above the hammer.


I cut the protective lexan shields for the electronics using the CNC router. It was surprisingly easy considering some of the troubles I have had with the router in the past (my longboard).


Carbon Fiber tie rods. These parts connect each of the arms to improve the overall strength. We knew carbon fiber might be a mistake, but we used it anyways because it was light and we had it. It was a mistake, but we didn't find out until competition.


The spinner looks really awesome... mostly because its shiny. This weekend was a major push because testing was scheduled for that Sunday. We got access to a gravel pit across from the school to ensure we could be a safe distance from the robot.


Remember the idea of adding neodymium magnets that I talked about at the top of this post?


Yeah they work... We were able to jump on the chassis and not have it fall from the thin sheet metal door. (The concept of adding additional down force led us to design the "anti-gravity" robot)


We also tested it on top of 1" thick steel plate at the school construction site to make sure it could drive with the additional couple hundred pounds of down force. It didn't really seem to notice the extra force, but we had trouble removing it from the ground.


Greasing the spinner bearings... YUMMY


We finally made the S7 tool steel blades.



And heat treated them too... (had to pull 4 all nighters in a week to get to this point because the robot had to be finished for testing the following day)


We also have a robot name!

Considering this was the first combat robot any of us had ever built, we needed to test it. We needed a safe place to test it where we could control who was going to be near the robot. In addition we wanted no property near it just in case there was flying debris or a catastrophic spinner disintegration. We got permission to use the gravel pit next to the school. It's a giant gravel pit that takes up a few square blocks. No debris could escape.


The tool steel blades look pretty scary. The mac was broken, so it was cool to smash. You can imagine what shape the mac was in after the impact.



The mac was eaten up pretty quickly.




I like how the CD drive ejected. It isn't visible in the pictures, but there were a number of IC chips that flew off the board. The impact G's were so high the surface mount components flew off the boards! That's pretty cool.


Needless to say, the microwave didn't stand a chance.


The microwave got smashed in one solid hit.



The tool steel spikes seem to do their intended job pretty well.

Testing was a great way to prepare for competition, mostly because it was fun.

I'll summarize the competition in another post