Let's Make Robots!

RC car

Ok, so I'm working on a plan to bring my little brother's little Niko RC car (you know, these models that suddenly break down for no reason at all after three charges) back to life. The plan is:

  1. Yank out old electronics (fun job, done ^^)
  2. Test steering servo and current draw of drive motor
  3. Build new electronics

Step 2 will be done by tonight but I have a few hickups on step three.

Basically, I'm going to refit the remote with two mini-joysticks and an xbee module. Now here's the thing: I've read that the xbee has onboard ADC's and I absolutely love this (no need for a microcontroller in the remote) but I can't seem to find a lot of info on how this whole system transmits it's data. With "transmitting it's data" I mean: what comes out at the receiving end and how can I read the ADC's output with my ARDUINO in the car (first time I'll be using arduino :D). Is there anyone here with any experience in this department?

Also, I've built a design for a simple H-bridge and wanted to know if it looks any good. So if you could comment on that, that would be great!

Thanks a lot guys (and girls)!

AttachmentSize
H-bridge.png56.92 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I've recently started using the L298 Dual H-Bridge available for only a few dollars.  This thing has current limiting (up to 2 amps per channel if i recall correctly) and TTL Compatible inputs.  Someone also made up a PCB design available from http://www.dprg.org/projects/1998-04a/ .  I've used 2 of these to run car window crank motors (with the two sides paired to get double the capacity).  This way if you draw a nominal 3A and if it goes up to 4A, no problem.  It just won't be able to draw more than 4A -- but no smoke!.

This motor draws 15A when stalled, at start up it should be able to draw that amount of current so that it can accelerate quickly. So 4A is definitely not enough

Thanks anyway :)

Just because a motor draws 15A during stall, doesn't mean it should or will be able to handle that much current -- not for long.  If the car hits a wall and stalls, you don't want the motor(s) drawing 15A continuously, so the current limiting of the L298 is a good thing.  Unfortunately, the electronics to allow a short - high stall current during initial acceleration are much more complicated than a simple H-Bridge driven by some sort of PWM signal. :(   Would be nice if it was that easy.

Yes, startup is similar to a stall and normally doesn't happen all that much, but in an RC style car there tends to be a lot of switching between forward and backward, repeated stalls.

Beware the blue smoke that makes electronics go!  Your motors are the most difficult thing to replace as you've designed everything else from scratch and can easily fix it.  If you go with 15 A capable transistors, you'll have to keep an eye on the temperature of the motors until you get a feel for how much abuse they can take.

Thanks for your tremendous help! That only leaves the xbees unanswered...

Did the motor have a closed attached gearbox, or an open frame of gears? You may be able to find an appropriate sized motor for cheap and replace it.

Or... parts!

YEAH! I forgot about a very old RC car platform I had lying around in my bedroom... Going to use that, has a way more powerfull (or is it powerfuller? nah, that can't be right) motor :D Great!

A 1k transistor at the base of each transistor should be fine.

I forgot to mention before, be very careful that you never turn on both transistors on one side of the h-bridge at the same time (Q1 & Q2 together or Q3 & Q4 together). This will shoot current straight through from power to ground and probably smoke your h-bridge.

Some people like to use a combination of npn and pnp transistors for their h-bridges. This way, it takes a combination of a high and a low (referring to pin1 and pin2 your schematic) to turn on the h-bridge. When your microprocessor first wakes up, gets in a weird state, or you just have a programming error, it is possible that all output pins will accidently get set high. This puts your current h-bridge in a "smoke me" configuration.

I've used all npn h-bridge designs in the past. They work fine, but if you are building from scratch anyway, that is something to consider. Just replace Q2 and Q4 with matching pnp versions of your npn transistors.

I agree with IgnobleGnome.

If there was ever a time when both input one and input two were high at the same time, you would immediately test your robot for Maximum Smoke condition.  In other words, there will be a dead short across your power supply.  Besides rapidly losing the h-bridge transistors you might ruin your batteries as well, and in the prosess, possibly other parts of the circuitry (You microcontroller).

 

Here is your drawing with some slight modifications.

 

Thanks for the schematic. Just for the record: I knew that the resistors were needed, just forgot to draw them on the schematic. I forgot about the possibility of 2 high pins though. Could you explain the PNP to me? Is it like this: NPN=normal open, PNP= normal closed?

The capacitors (three) for motor noise reduction are already hardwired to the motor, but thanks for the reminder :)

again: thanks for your help so far (and for the future help :D)

NPN and PNP transistors are the same except reversed in polarity, and therefore reversed in how they react to a certain input.

Your idea of normally open or normally closed does has merit as long as you are thinking about it with respect to what the input signal is doing. Because they are reverse in polarity to each other, They will react to the same signal input in reverse ways.

Signal from microcontroller is high (more positive):

        an NPN will be in an ON state (conducting),

  while a PNP will be in an OFF state (non-conducting),

Signal from microcontroller is low (more negative):

        an NPN will be in an OFF state (non-conducting),

  while a PNP will be in an ON state (conducting),

for the reasons 'IG' explained.  This is why it is a good choice to make an H-bridge out of both types. One is off while the other is on and vice versa, so they will not conduct at the same time and therefore cannot short out the power supply given the same signal input.