Monday, March 19, 2012


So it's been a busy few weeks and I have good news and a lot of updates!  First of all, I'm transporting this blog over to the WordPress platform.  Now that we've surpassed 1K views I feel it'd be beneficial to upgrade to a more professional blogging platform.  I've already exported all of the posts in this blog to the new one.  The new URL is  In addition to being more professional, WordPress is more customizable and has a lot of great tools for website integration, which is something I'll talk more about next.

Secondly!  Last November I decided to buy a domain for a robotics themed website.  To learn everything I know about robotics I've had to search all over the Internet and piece together many web articles to gain a better understanding of what I'm trying to do.  So instead of all robot hobbyists having to reinvent the wheel as I did, I've decided to create a website that is a wiki with all the articles you'd ever need to be a hobby roboticist.  I've also added sections for robot news, other interesting robotics themed articles, and my own personal blog.  The website URL is so head on over and take a look, and if you're a robot enthusiast like me, join the forums and feel free to contribute some articles to the wiki!

And lastly, the robot is looking good!  I finally gave up on attempting to design a motor controller PCB from scratch, at least for now, and bought the Dagu Wild Thumper Motor Controller.  This board is beautiful!  It has a serial interface, an onboard microcontroller, pins for adding servos, and is able to handle 15 Amps per channel which should be enough for the robot.

So thank you for following my blog here at Google.  If you've enjoyed my posting please follow me at my new WordPress site, or if you're just joining in, head on over to see all the new updates to the robot!  The microcontroller write up will be up within the week!

Thursday, January 26, 2012

Classy Chassis 2.0

At last!  A hellish semester is now over and I have some time to update this blog with all the things I've accomplished in the past few months.  I'll start off by describing how I've upgraded the chassis for differential steering and end with the power wiring I've done.  Plus I'll try and add a video of it actually working!

So when I last left off I had decided to go with differential steering and buy an extra set of Power Wheels motors to give it four wheel drive.

Motor Pictures with shoddy wiring
The new motors I bought are slightly different from the original ones I bought and set me back roughly $70.  However from the tests I've done so far the two sets of motors are compatible enough.  It's also hard to see in this picture, but this motor came without the stock leads so I had to make some pretty poor quality ones by attempting to solder wires inside of the motor casing.

Here's a better picture of the bad motor leads.  The other ones are also a bit fragile so I'll have to be careful they don't get jerked around too much.

These are the wheels I got along with the new motors.  Pretty and purple!

The existing support for the original wheels didn't work for the new ones so I had to build an all new support system out of angle aluminum from Home Depot and Lowes.  It's essentially an aluminum H, closes at the bottom with the wheel axle and closed at the top with a flat piece of aluminum.  Some more pictures are below.

Here's on of the axle caps to keep the wheels attached.

The mounting panel all taped and glued together.

Here's an overview of the total chassis.  I decided to put the new wheels in the back since they're larger,  but it looks a little weird since the front wheels are wider.

The axle width also makes it difficult to fit through doors, which is a little disappointing since I was hoping the robot could be used indoors and outdoors.  But it looks like it's going to turn out being just an outdoors robot which will still be pretty cool.

I also got around to upgrading the electronics system a bit to make it a little less of a rats nest, though I'm not really sure it works.

I finally got the chance to take the breadboarded motor controller and solder it onto a PCB.  The wires are a little fragile and occasionally need resoldering but overall it works well.  For my next iteration of motor controller I'm hoping to upgrade to a custom PCB with MOSFETs, speed control, and temperature detection.

I also bought some power distribution blocks from Radioshack to help regulate the power better.  The white block on the bottom is for the 12V from the batteries and the motor outputs and the black block on the top is for the logic from the Arduino below.

I'm still trying to figure out the logic and control for the robot, but I do know that the first revision will have an Arduino in control of the sensors and movement.  For those of you who don't know anything about the Arduino or microcontrollers I'll try and put up a write up about them soon.

Here's a servo that will eventually be used to sweep the distance sensors back and forth.  This sort of radar/sonar system will use distance sensors to map out any obstacles in the path of the robot.

And lastly for the electronics, I got a fancy new charger for the batteries!  The crappy charger that comes with the power wheels provides a steady current the batteries and doesn't protect against overcharging the batteries if you leave them plugged in too long.  Leaving the battery in the charger for too long could result in hydrogen building up inside the battery and eventually an explosion.  This charger, however, optimizes the charging of the battery and turns it off when the battery is full.  Considering the fact that the batteries were really expensive, it was well worth the $30 for the charger to help elongate the life of the batteries.

And I got a fancy new laptop!  The Lenovo X220 is supposed to be a highly mobile laptop that you can squeeze 10 hours of battery out of!  If I manage to get the system advanced enough to warrant it, I hope to at some point use this laptop as the main brain of the robot and have it do a bunch of cool image processing stuff.

I've also heard that Lenovo laptops are built like tanks so it should be plenty capable to survive the rough ride the robot will give, though to be safe I'll try and add some shock absorption.

So that's what I've accomplished in the past six months or so with the robot.  In the two weeks before school starts again I'll try and get it up and running and put a video up on here.  This semester will probably be far less stressful and busy than the last one so hopefully I'll have more time to work on this!

Wednesday, July 13, 2011

Stuck on Steering

Well, as usual it appears that I've been to hasty in my robot building and have made a few mistakes. I met up with one of my mechanical engineering friends the last weekend, and after examining the chassis together we discovered the reason why the force required to turn is so high. Because the aluminum bars are so tight on the chassis structure, they're causing a great deal of friction when the front wheels are rotated. Worse yet, if I file out the inside of the aluminum crossbars, it'll decrease the friction, but the chassis will become more unstable. The two of us deliberated on several different methods of overcoming this solution.

Tons o' Torque:
I could get a motor with a ton of torque, such as a window motor, and just have it overpower the friction.

These are the motors that lift and drop automatic car windows. I have experience using them in robots for the FIRST Robotics Competition. They're strong enough to handle moderately heavy loads, though maybe not strong enough to steer the robot with all of the frame's friction.

While this may have been the easiest solution, requiring that I only purchase a window motor and possibly gear it down, using brute force would merely cover up the problem instead of actually solving it.

Reverse Tricycle:
I could modify the frame and turn it into a reverse tricycle design, much like a K'NEX robot I built to mess around with a while back,

K'NEX are a phenomenal prototyping (and in some cases, build) material.  I made this robot as a simple test bed for project ideas.  It's driven by two K'NEX motors in the front.

My friend and I actually discussed this option for a while. There were a lot of benefits to switching to this system.

  • Having only one wheel in the back would greatly increase the mobility of the robot
  • The rear wheel could be used as a sort of rudder to direct the steering of the robot, but by turning the wheel perpendicular to the front wheels, differential drive could be used on the two front wheels, greatly increasing the mobility of the robot
  • Front wheel drive is generally more controllable in cars
  • Three points are always guaranteed to be in the same plane, meaning that each wheel of the robot would always be on the ground, eliminating any "wobble"
  • A triangle is the most inherently stable shape, and therefore the frame would also be very stable, at least in the plane of the base.
As ideal as the reverse trike design seems to be, I decided not to go with it due to several reasons, most having to do with the third, unpowered wheel. For starters, the back wheel of the robot would either have to be a type of caster (a wheel that follows the direction it's pulled in), an omniwheel (wheel that can roll in any direction) or a steerable "rudder" type of wheel.

Right off the bat the first two options can be eliminated due to availability. Power Wheels Jeeps are known for their "offroad" capabilities, which I would like to extend to the robot. However, most casters and omniwheels are small and made for smooth surfaces, meaning I would have to build my own for either option. In addition to this major reason, casters are more difficult to use because, as anyone who had those plastic unpowered cars when they were a kid will know, they make turning more difficult. For example, if the robot is going forward, the caster will be following this direction with it trailing behind its axle. However, if the robot were to move in reverse suddenly, the caster would need time to swivel around so it was trailing in front of its axle. While this isn't too much of a problem for small casters, the larger the wheel gets the larger the radius that the wheel has to swivel at, and the more difficult changing direction becomes.

As for the steerable rudder option, the turning of the rear will would still take a decent amount of torque to turn, especially since one less wheel means the weight that the fourth wheel was holding is placed on the other three. Because of this required torque, I would still need to get a window motor and possibly even gear it down, resulting in a robot that has to wait for the rear wheel to rotate before it can make any significant turns.

Differential Drive:

And last but certainly not least, I could spend a bunch of money on a set of two more Power Wheels motors and gearboxes, hope that they run the same speed as the set I already have, and change the robot from car steering to differential steering.

Differential steering is when the wheels on the left side and the wheels on the right side are independent from one another and can either work together or with one another to steer. For example, if the left wheels are moving backwards and the right wheels are moving forwards, the robot will steer to the left, and vice versa. In addition to running in opposite directions, one set of wheels running at a higher or lower speed than the other set will have a similar, but smaller, effect, a useful idea that can be used for slight adjustments in direction.

While this is certainly one of the more expensive risky solutions to the steering problem, I'm confident that it's the best option at this point in time, mostly due to the great maneuverability of differential steering. Differential steering provides the smallest turning radius of all steering methods. The turning radius of a vehicle is actually the diameter of the circle that is created when making a turn.

For example, the turning radius of a car is proportional to the amount that the steering wheel is turned. The more turn on the wheel, the sharper the turn and the smaller the turning radius. A smaller turning radius means more maneuverability because the vehicle requires a smaller amount of space to turn or change direction.

Differential steering, on the other hand, can have a turning radius the size of the robot itself! If the wheels are moving in opposing directions at the same speed, the center of the robot body becomes the pivot point and the robot can turn in place. This results in the robot having the maximum amount of maneuverability possible, because it only needs a circle the size of its length to turn around; especially handy if it gets caught in a tight spot!

As for the detriments of setting up differential steering, I managed to find a pair of Power Wheels motors and gearboxes online for $75. In the event that the two sets I have don't run at the same speed, I could always do some slight modifications to solve this problem, such as varying the voltage to the faster motor to make it run slower, or increasing the wheel radius of the slower motor so it covers more distance with each turn. While neither of these solutions are elegant, there's still a chance they won't even be needed and it is certainly worth the risk to increase the maneuverability of the robot (I also never really liked the idea of car steering, kinda stupid and ugly for a robot, in my opinion).

However, it'll be about a week before the motors arrive for me to work on, at which point I'll need to figure out how to couple them with the wheels, build an axle, possibly rework the chassis, etc. In the mean time, it's time to take a welcomed break from the mechanical engineering and start back to work on some of the embedded systems I've been working on.

Monday, July 4, 2011

Classy Chassis

While the original Power Wheels Jeep covering was nice and all (sexy flame decals!), I got around to thinking that it was due for an upgrade.  The heavy mass of plastic weighed down the 'bot a good deal and really limited the placement options for various parts I've been hoping to add.  And so, two weeks ago some friends of mine came over to take a look at my pet project and we managed to pry off the plastic body of the Jeep.  It actually came off surprisingly easy.  It was only held on by four or so small washers underneath some plastic pieces.  Once those are pried off you only have to disconnect the steering shaft from the front wheel steering bar and the plastic just pops right off.  Here are some pics of the newly liberated frame.

Bare bones frame (Notice the four vertical poles, one at each wheel)

Torn off plastic from the Jeep

My old roomate(left) and MechE friend(right) standing over the remains of the Jeep

The workshop is no place for a woman!  Kidding of course, my girlfriend actually helped a fair bit with some soldering

The only problem with this frame the way it is is the fact that there's no support from the center, and no bracing, which basically means that while the frame should basically be a rectangle, any force from the side can shift it, causing it to take on the shape of a parallelogram.  And so I figured I'd buy some cheap aluminum, drill some easy holes, and get a fairly effective cross bracing system working.

1.5"x1/16"/6' Aluminum, about $10 from Lowes

Measuring and drilling the holes for the four vertical support poles on the frame proved to be far more difficult than I had anticipated.  Turns out that the poles had a lot of play, and this shifting made it very difficult to properly measure the distances between them.  It also turned out to be very difficult to widen the holes without any metal files so I had to use a drill instead.

Pictures of the two side braces in place.  These served mostly to add extra support to the cross braces and  the foam board layer that goes on top.

Here are some pictures of the cross braces once they had been put in.  However, after four hours of filing with a drill bit, I had pretty much had enough and gave up on doing side braces to make a rectangle.  They're also not really necessary since the frame came with some nice steel ones.

I also soldered some longer wires onto the motors to make them easier to access and plug into the batteries.

I cut out two layers of foam core board in the shape of the robot

The foam board mounted onto the robot.

Here's the junction between the top board and the frame.  Depending on how rough it handles while it's driving, I might install some springs at this junction to act as a sort of suspension system.  This will make the on board components, electronics, and especially my computer, less prone to wear and tear from vibrations and sudden jolts and movement.

So while this probably won't be the final frame design for the robot, it's at least a good prototype to work off of for now.  I'm currently in the process of figuring out a method of steering.

Thursday, June 23, 2011

At last! Productivity!

Well I most certainly did not get anything done that week! However, the semester is over, I survived finals, I have a job at home, and I finally have a bit of time to work on the robot. Actually, I managed to get the drive motors working when I got out of school 3 weeks ago. I copped out on using the MOSFETs, though. I figured I'd try a quick and dirty solution to get it working first, and then work out a much nicer and more efficient motor controller later. The following schematic is the one I used, and the one that was suggested to me on the All About Circuits forums.

As you may or may not be able to tell, the above circuit uses relays, rather than MOSFETs. A relay works using the principle that current generates a magnetic field around a wire. A wire can be coiled in order to increase the strength of this created magnetic field. A relay has a coil of wire inside that creates a magnetic field when activated, and this magnetic field attracts a magnetic switch towards it, closing a circuit. The schematic symbol for relays pretty accurately depicts this concept. The relays I used are called Single Pole Double Throw (SPDT) meaning that there is only one switch, but it can close two different circuits. These relays have a normally open (NO) side and a normally close (NC) side that describes which way is a closed switch and which is an open if there is no current activating the relay.

The circuit above has the NC part of the switch bringing both motor leads to ground. This way, when the motor is running, and suddenly told to stop, the current generated by the magnetic field of the motor not wanting to collapse can be sent to ground, allowing the magnetic field to collapse in a much more gentle fashion. Then, when the left relay is activated, the left side of the motor is set to the positive voltage, and the motor runs one way, and if the right one is activated, with the left side being inactivated, the motor runs the other way. And due to the nature of SPDT relays, it is impossible to activate the high and low of one side of the H bridge and create a short circuit.

All in all, the relay h bridge is a quick and dirty solution to the motor controller problem. However, this design does have the following cons:

  • Relays take more energy - The activation coil requires current to turn the relay on so it requires a small amount of current to keep the motors going. This small amount adds up over time and drains the batteries quicker.
  • Relays don't allow for PWM and speed adjustment - Relays are either on or off and so don't have the capacity for scaling and speed control like MOSFETs do.
  • Relays are bulky - As you see in the picture above, relays are fairly sizable beasts and take up a lot of room. MOSFETs, on the other hand, are much more compact and can fit in smaller spaces.
  • Relays are less durable - They are only rated for a certain number of on and off cycles. The contacts inside break down over time due to the sparks that inevitably occur when current is abruptly allowed or stopped.
So basically while relays are nice and convenient, they're not an efficient or elegant way to make a motor controller. Sometime in the future when I actually have time I'll have to work on remaking the motor controller. In the mean time, however, this will certainly work well enough to make the robot move. I'd include some videos of it in action, but the robot isn't actually capable of movement at the moment for reasons I'll disclose in the next blog post. Once it's up and running, however, I'll be sure to throw a video in here!

Tuesday, March 8, 2011

Getting Up to Date

So the last few of these blog posts have been recap of what has happened, as far as the project is concerned, in the past couple of weeks.  This post will be my attempt at getting all caught up so I can start to enforce a development schedule.

The current status of the project is as follows.  My roommate and I wired up the robot using electrical tape so that it can be directly connected to the four batteries wired in parallel.  The motors are also tied directly together and share current from the 6V super battery.  We then wired it through an old analog multimeter so that we could gauge the current drawn by the motors.  This way, we don't have to listen to questionable data sheets and motor curves.  Here are the results of our weight testing for both motors.

The peak current is the current required to get the motor started, and the steady current is how much it takes to move steadily along.

The current direction with the robot is as follows:

  1. We will be using all four batteries in parallel to provide 6V to both motors.  This puts less strain on the motors, extending their life, although it will mean less speed.
  2. The motors will be wired together in parallel as well, which means both motors will always turn in the same direction.  While differential steering would be easier to maneuver, using the already provided steering will will make the robot's movements more realistic and applicable to actual cars if the project ever expands that far.  The elegance in this lies in the fact that if appropriate hardware and mechanics are provided, the same software could work identically on many different machines.

Things required to do to finish compiling data are:

  1. Get a force measurement of some sort of how much force is required to turn the steering wheel.  This will probably be similar to the graph above with a weight vs. force graph.  With this data, it is then possible to buy a adequately rated servo to turn the wheel and drive the robot.
  2. The stall current of the two motors.  I tried testing this when my roommate and I were doing load testing, but the current spiked past 20A which was the maximum current of the multimeter.  This data would be good to know when taking into consideration protecting the motor controller from overcurrent.  Stall current will cause damage to the motors so when it is detected, the motor controller can be shut off.
Things that will require doing to make the robot functional:
  1. Research and decide on an effective method of getting the robot to steer.  The only two options so far appear to be using a motor to slowly steer the robot, or buy servo to do the steering.  The motor would be cheaper, but it would require switches and types of control to monitor how far the wheel is turned.  A servo would have this functionality built in, but would be much more expensive.
  2. Finally design and build the motor controller.  Because I still have 8 MOSFETs of proper rating left over, all that is required is for me to design a schematic and finally solder together the controller on a PCB board.
So that's what's left that needs doing and where the rUD2 project is currently.  Hopefully I can get something done this week and finally get the ball rolling.

Friday, March 4, 2011

5-6 Wrong FET Specs and Poor heat dissipation.

So basically the previous four instances of me screwing up have snowballed up into one massive snafu ending in one, charred H Bridge.  At the risk of sounding redundant, reading the datasheets is EXTREMELY important.  For example, when I looked up the MOSFETs I was going to use, I read that they were rated for 150A, which was the peak current for 12V on the supposedly accurate fisher price motor curve graphs.  So I figured that it was fine, didn't care about any of the other confusing terms on the datasheet, and went ahead and soldered it all together.  This, however, is not the case.  If you don't RTFM, you won't learn things such as, while the FET's silicon may be able to handle 150A, the actual leads of the package that it is inside of will actually melt at 75A.  So that's pretty misleading, but whatever.

Next is the issue of heat dissipation.  Now I'm not the best at math, but basically what's required is to use the Rtheta factors on the data sheet to calculate the amount of heat the package can dissipate without melting.  As I've stated before, since I know I'm not the best at explaining things, here's a link (this will be a common thing, me linking you to helpful sites) that will help a great deal and walk you through the steps of calculating how much it current a FET can ACTUALLY handle.

I've found it to be very helpful, and realized that the FETs I was using could only handle about 20A before melting.  Read through it a couple of times to absorb everything.

Wednesday, March 2, 2011

2-4. Didn't Correctly Read Motor Curves and Crappy Soldering

So basically I misread the motor curves spreadsheet that I posted earlier in this blog.  I believed that the motors would run at 15A usually, however, little did I know that this was at the most efficient running of the motors.  As we all know, life is far less than peak efficiency and so it was more likely that the motor would run at 50A at times.  So long story short, RTFM.  Read the datasheets veeeerrrry carefully.

Second part which pretty much illegitimises the first part.  Forums are a spectacular place, especially engineering forums.  Odds are there's always someone who has done what you're doing and can help you a great deal.  That being said, there are also a lot of unhelpful people who make relatively meaningless posts. Nonetheless, it's still very important to carefully and fully read any threads that you may be looking at or that may be related to your project.  This was the case for the datasheet.  It is contained within a robotics forum, and only the first post.  The posts later in that thread, which I neglected to read until my first H Bridge had gone up in smoke, discussed the unlikeliness of much of the data that the motor curves showed.  It showed that the motor peaks at 150A which is a HUGE amount of current.  I eventually proved this illegitimacy to be true, as will come in a later blog post, but the reality is that the current drawn is far less than that.

In addition to reading through datasheets and forums, it's also a good idea to use your own judgement most of the time.  For one, the fuses on the stock power wheels batteries where 30A.  That alone should tell me that even the stall current (peak current) would be less than that.  And two, 150A running through the stock 14AWG wire would definitely start melting some things.  Considering that this is a children's toy, these dangerous conditions and amounts of current should have thrown up a read flag in my head, telling my that these were unlikely.  All in all, it's a good idea to make sure that your research is thorough so you don't make stupid mistakes like I do.

As for soldering, my circuit board is ugly, as most of you can see.  I used a knife to widen the holes so I could fit in a bigger gauge wire, in addition to an overall poor job of soldering with an old and very worn down iron.  A good soldering job takes time and a lot of practice.  Beautiful solder joints also show professionalism.  Since I am not qualified to show a soldering tutorial by any means, I'll just post a link to a very nice tutorial by the people over at sparkfun.

They have a nice soldering tutorial in the bite sized primers section, in addition to many other good tutorials on basic electronics knowledge.  And now that I've gone over more of my faults as an electrical engineer, it's time to go study for a test.

Tuesday, March 1, 2011

1. Not turning on a MOSFET completely

Let me now address the first of my numerous and amateur mistakes in my first H Bridge design.  If you already read the All About Circuits forum post I put up, then this will just be a recap.  Essentially, what an N Channel MOSFET does, is compare its Gate voltage to its Source voltage.  For the ones I bought, the required voltage to fully turn on is 5V with respect to ground.

For the lower two FETs, this works out fine because the Source pin is tied to ground, and 5V, with respect to ground, is sent to the Gate, making the total difference 5V.  So these two FETs then have no problem turning on.  The real issue, however, arises with the upper two FETs.  Initially, the bottom two FETs turn on fine, and the 0V from ground propagates through the motor and to the Source pin of the upper FETs.  That way, when the top FET Gates receive a signal of 5V, they start to turn on.  However, since the motor in the bridge wants as much of the voltage as it can manage, this means that the Source pin of the FETs is going to increase in voltage and apply that voltage across the motor.  So eventually, the 5V difference between the Gate and Source pins will continue to get smaller and smaller.


When that happens the MOSFETs don't turn on all of the way, and the resistance will be far too high.  With power equaling resistance * current squared, the power being dissipated by the MOSFETs will shoot up.  Those suckers aren't made to take very much dissipation, and so they'll either melt or explode, like mine did, and release a ton of smoke!

To turn fully on, the MOSFETs need a high voltage, 5V, or whatever the recommended Gate voltage is, with respect to the source pin.  Since I'll be running my motors at 6V, that means the source pin will be about 6V for the upper FETs, assuming I use the same MOSFETs, which is unlikely, and 6V + 5V means that I'll need 11V at the Gate to get a 5V differential.

Two types of circuits that would work for a high side driver are listed below.

The top image shows the Gate of the Power FET hooked up to a pull down resistor.  Q1 is a regular transistor.  If a current is not fed into the transistor from the microcontroller pin, then the Gate sees the 0V of ground through the resistor.  However, when the MCU pin is set High, then the transistor turns on, and the current goes through the transistor, causing the 11V across the resistor, and charging the Gate of the FET, turning it on.  Due to the pull down resistor, The motor would then be normally off.

The bottom image shows the Gate hooked up to a pull up resistor.  When the transistor is off, the 11V would go through the resistor, charging the Gate.  However, when the transistor is turned on, the Voltage would all be dissipated through the resistor, causing 0V after the resistor which would then drain the Gate and then turn off the FET.  And so with the pull up resistor, the motor would normally be on.

These are my two options for the high side drivers of the H Bridge.  Now, all I have to decide is whether or not I want my motors to be normally off or normally on, though odds are I'll want them normally off so that the robot stops by default and won't try and run away if it decides to break.

Thursday, February 24, 2011

Managing MOSFETs

So as a continuation from the last post, I'm going to explain the usage (and then the proper usage) of Metal Oxide Semiconductor Field Effect Transistors, or MOSFETs.

For those of you not familiar with transistors, it is essentially a gate controlled by electricity.  It has three pins, the collector, the base, and the emitter.  As the names would imply, current goes into the collector and out of the emitter.  However, it is normally closed, allowing no electricity to run through it.  You open it up and therefore allow current to flow by pushing current into the base.  The common analogy is a water faucet.  The cool thing here is, you can control larger currents with smaller ones.  So if you 1/100th of an amp into the base, you could control 1A with it.  Cool right?

Now MOSFETs are a special type of transistor.  They are controlled with an electric field rather than a current.  So rather than having to constantly supply a current to the base, also called the Gate on the MOSFET, you apply a voltage to it which charges an internal capacitor in the FET and the resulting electric field allows much larger currents to flow through the MOSFET.  Because you only need to supply enough current to charge the internal capacitor instead of a constant one, MOSFETs can be more power efficient in the long run.  They also have the capability to control much larger currents than normal transistors.

I'll be honest, I didn't know much about MOSFETs when I went into this project, but, being the persistent little bugger that I am, I decided to forge ahead anyway.  (I bet you can see where this story is going already)  Anyways, I used a lot to figure out what exactly I was doing.  It's very helpful and tells you a lot of detailed stuff that most other h-bridge explanations won't go into.  Since I'm not nearly as eloquent as the H Bridge website, and since I'm generally busy, I won't go into a detailed explanation of the H Bridge here.  Suffice to say it's a way to control the direction of a motor.  It generally consists of 4 switches, in my case MOSFETs, and by turning on two at a time you can control which way the motor travels.  He's a picture from the H Bridge Secrets website.

If Q1 and Q4 are on, the motor goes one way, and if Q3 and Q2 are on, the motor goes the other way.  I'll from here on out refer to them as upper left and right, and lower left and right.

Now as for the types of MOSFETs I could use, there are P Channel and N Channel MOSFETs.  The differences are that P FET is closed and allows no current through (from the Source pin to the Drain pin) when the Gate pin is held low, and an N FET allows no current through (from Drain to Source this time) when the Gate pin is high.  Due to the fact that N FETs are easier to produce, have a lower resistance, more on that later, and are plain cheaper, I'll be using four of those.

Probably the most important thing to keep in mind when designing an H Bridge is the current draw of the motors you are using.  For the first revision of my bridge, I used the Fisher Price Motor spec spreadsheet found at the following link.

I then decided to use the 12V graph on the second page of that spreadsheet.  So if you look at the general information listings you can see that the stall current of the motor is 148A approximated to 150A.  This means that when the motor is forced to stop turning, like when jeep hits a wall, that's the amount of current that the motors draw.  I wanted to build an H Bridge capable of handling this current and so I searched for the necessary parts.  Looking through them all, I settled on buying 10 IRL7833's so that I would have enough for two H Bridges and then two spares in case something went wrong.  Little did I know things would end very poorly.

I won't go into much detail about how I designed and built the H Bridge, because I didn't put much thought into it and it did not end well.  It was basically scrapped together using an old perforated PCB board, some old romex wire, and a ton of solder.  Here are some pictures.

If you look closely you can see how that the wire is pretty burnt and two of the MOSFETs burst.  There was a lot of smoke and my basement smelled for a while.

Having read several pages on H Bridges, I assumed that the old wire was the problem and went to Radioshack and bought two spools of 12AWG wire.  Only when I couldn't fit the wire into the holes of the PCB board did I decide to post onto a forum and ask for help.

The forum is actually a very nice place, and having recently joined, I decided to post my questions there.  Since I have no shame and already feel really stupid for having made so many mistakes, I'll post the direct link to my thread right here.  I'm Gumbercules, btw.

Essentially I made a boatload of errors, and the very helpful people on the forums had no lack of advice to give me.  To name a few things I did wrong, I:

  1. Didn't turn on the upper MOSFET's all the way
  2. Misread the motor curves on the spreadsheet
  3. Didn't read all of the way through the thread from which I received the spreadsheet
  4. Probably did an awful job of soldering things
  5. Used improperly rated MOSFET's
I'll try and address each of these issues in the next few posts.

Wednesday, February 16, 2011

Procuring Parts and Batteries

My apologies for the lack of posts recently.  I've spent these past few weeks essentially working to earn more money for this project, moving back to my dorm room at school, homework for classes, and searching the vastness of the interwebs for parts that I need.

Basically, the rundown of what I needed is as follows:

  • Batteries:  High capacity sealed lead acid batteries to power the motors of the robot
  • Power MOSFETs to control the motors of the robot
  • Tools to make sure I don't kill myself or start a fire
So with respect with batteries,  one would think this would be easy to accomplish.  You just go out to radioshack, buy some AA's, or even splurge on a lantern battery, and hook it up right?  Not even close!  Batteries are incredibly complex demons and can be very costly.  The jeep I received came with the stock two Fisher Price batteries.  However, since these were dead and wouldn't take a charge, I had to go out and search for more.

Now the things to keep in mind when purchasing batteries are price, weight, ease of use, and capacity.  The lightest and most energy dense batteries are generally Lithion Ion batteries, like the ones used in cell phones or computers.  However, the problem is in order to get the required amount of these batteries, you would have to buy hundreds of dollars worth.  So, instead I decided to go with the classic Lead Acid batteries.  These are generally a little cheaper, as they are used all around in things such as cars, wheelchairs, or other high power applications.  They are also the same type of batteries that come with standard Power Wheels vehicles.  For more detailed comparison of types of batteries, Wikipedia is a great resource.  A general overview can be found here
and from there you can go to each battery technology wiki page to see a more in depth description.

**NOTE:  Do NOT use car batteries to power your project.  They are generally normal lead acid batteries, not sealed, and if not maintained carefully, charging them can produce hydrogen and oxygen gas, which are extremely explosive.  Seeing your robot explode and having sulfuric acid fly everywhere is not fun.  Car batteries are also made to deliver high amperage loads over a short period of time, using it for a steady stream of current can damage the batteries internal plates and greatly decrease the life of the battery.

So now that I've decided to use Lead Acid batteries, it's time to look up their suggested use and handling.

There are two types that can be used in this application, Wet Cell batteries and AGM/Dry Cell batteries.  Wet Cells require a decent amount of maintenance and are not sealed, meaning there is still the danger of hydrogen explosions.  They can also require the occasional refilling of the battery with water.  Both of these are reasons why I opted for the Sealed AGM style battery.  Because it is sealed, it requires less maintenance, and the way it is produced causes it to be more efficient than the Wet Cells, with the trade off being that it costs a little more.

For optimum number of battery cycles, meaning the number of times it can be charged and discharged, this battery should never be drained below 50% capacity.  Another general rule to remember for all Lead Acid Batteries is that they should never be left sitting alone for long periods of time.  Over time, the battery discharges itself, and if left alone for too long, they will lose the ability to take a charge.  It's a good rule of thumb to charge them to full capacity once every month or so.  You can check the overall charge of a battery by checking the voltage.  While the specs for a battery may say 6V, it usually means that it is more like 6.3V when fully charged and 5.8V when fully discharged.

Something I almost forgot to mention was how to determine battery capacity!  Battery capacity is measured in ampere hours, or Ah.  I'll explain with an example.  Say you have a 5Ah battery, and want to see how long you can provide 5A to a load.  Just take the capacity and divide by the number of amperes you're supplying, so 5Ah/5A means 1 hour of battery life, and 5Ah for a 1A load means 5 hours of battery life.

Because I'm not an expert on these things by any means, I went on the Internet and found most of my information from this site.
They go far more in depth than I do, and even have a handy table that lists voltages compared to the charge level of the battery.

As for finding and purchasing the batteries, I searched eBay for Sealed Lead Acid, or SLA batteries and managed to find some good prices.  I ended up buying 4 UB670 6V 7Ah SLA AGM batteries for a total of $42.  Not too bad of a price for a decent amount of capacity.  If I run the robot at 6V, this means I can put all four batteries in parallel and have a total of 28Ah capacity.

And after some waiting...

I've taped them together into two 6V modules.  This is because at first I wasn't sure if I was running the Jeep on 6V, 12V, or both, but for reasons I will explain in the MOSFET post....  I went with 6V

I cut the connectors off of the old batteries and soldered them onto the new batteries using some old Romex wire

Here's the solder joint between the wire and the battery itself.  The wire didn't fit well so I had to widen the hole a little bit to fit it, which explains the metal shavings.

And so here are the battery modules.  Since I'm not sure how much the motors are actually going to draw, I can't calculate how long they're going to last, but I feel as if I'm probably going to need to buy some more at some point.  So please!  Tell your friends about this site!  Every person who visits helps to fund our project!