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.  http://www.sparkfun.com/tutorials

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.

THIS IS BAD!!!

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.