Arduino Forum

Using Arduino => Project Guidance => Topic started by: TheWumpus on Oct 10, 2012, 06:09 pm

Title: RC Car Robot
Post by: TheWumpus on Oct 10, 2012, 06:09 pm
Hello,

I am a robotics research scientist with several years of experience in industry, but my background his primarily been concerned with high-level topics such as sensor processing, navigation, localization, planning, control, etc. I am interested in learning more about the hardware side of robotics, and as such, have decided to build an autonomous RC car.

What I'm hoping to get out of this post is some answers to questions I have about the process. Other than soldering some wires to convert my son's crib side music player from battery power to a wall socket AC/DC adapter power, I haven't seen any real work with electronics since sophomore year in college (many moons ago).

Anyway, here's what I've purchased, along with intended purposes:

1. RC car - This will serve at the platform for my robot. It's a scale model Hummer H2, which will provide enough space for mounting all the other hardware I have.

2. Arduino Uno - This will act as the "bridge" between a netbook and the RC car's motor control board (and the IMU). It will handle low-level control of the robot.

3. ArduIMU - I want/need some motion sensing.

4. Netbook - This will handle the high-level algorithms for the robot

5. Kinect - For 3D mapping and localization

Now I'd like to walk through my understanding of the process and ask some questions along the way:

Step 1: Open up the RC car and locate the motor control circuit board. As I understand it, the RC receiver will take radio control signals and pass them to the appropriate input pins on the motor controller. I can remove the RC receiver (unless I want to keep it for fun). I then need to connect the Arduino to the controller.

Questions:

  a. Is this correct?
  b. Can I use the motor control board that comes with the car, or do I need to purchase an Arduino motor shield?
  c. Do I need to worry about voltages/currents between the Arduino and the control board?
  d. What kind of hardware do I need for all of this (breadboards, wires, resistors, connectors, etc.), and why?

Step 2: Connect the ArduIMU to the Arduino. I'm assuming I can work this out from the documentation that comes with the unit or elsewhere online, but I may as well ask.

Questions:

  a. I'd like the connection between the Arduino and the IMU to be solid, but not permanent. What's the best option? I don't know a lot about small electrical components for PCBs.

Step 3: Connect the netbook to the Arduino.

Questions:

  a. The Arduino Uno appears to have a built-in USB-to-serial interface, allowing me to communicate with it using serial comms over a USB cable. Will this cable also power the Arduino, or do I need a separate power source for the board?

Everything else I can handle myself.

One more general question, though: if I wanted to add odometry to this robot, what would be the best way to accomplish that? I've seen hall effect sensors before; would that be a solid option?

Thanks in advance for taking the time to read and (hopefully!) respond.
Title: Re: RC Car Robot
Post by: AWOL on Oct 10, 2012, 06:23 pm
Quote
a. Is this correct?
  b. Can I use the motor control board that comes with the car, or do I need to purchase an Arduino motor shield?
  c. Do I need to worry about voltages/currents between the Arduino and the control board?
  d. What kind of hardware do I need for all of this (breadboards, wires, resistors, connectors, etc.), and why?

a) we don't know, we don't know what you've bought
b) see a)
c) yes, very much so. Make sure they've got a common ground and don't exceed about 30mA per Arduino pin
d) don't know until you've answered a) and b)
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 10, 2012, 06:27 pm
Apologies, I didn't realize the answer would be dependent upon the vehicle:

http://www.newegg.com/Product/Product.aspx?Item=9SIA1110EZ4863

Title: Re: RC Car Robot
Post by: AWOL on Oct 10, 2012, 06:31 pm
I'm guessing at that price point the car will gave a single PCB with radio and motor control integrated.
Have you looked at the internals yet?
Googled any hacks for the car?
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 10, 2012, 06:34 pm
No sir, just ordered it. I've seen other posts for other chassis and assumed (perhaps incorrectly) that the concepts would be applicable elsewhere. I take it you're implying that I need a schematic that tells me what pins are responsible for what?
Title: Re: RC Car Robot
Post by: AWOL on Oct 10, 2012, 06:45 pm
Model car kits (Tamiya, Kyosho, Schumacher whatever) unlike toy cars will normally accept radios ESCs etc from the mainstream radio manufacturers.
Toy cars will normally have a single PCB with it all integrated.
It is possible to hack them ( I've done this for a Heng Long tank) but you've got to know what you're looking for, and which tracks to break and which to leave alone.
Title: Re: RC Car Robot
Post by: mrescude on Oct 10, 2012, 07:15 pm
What I suggest is that you open up the car, and take direct control of the motors with a motor driver (Could be the L298n).

Then, using WI-Fi or RF (Xbee) you can communicate with another arduino connected to the computer.

This way you don't have to deal with the single control board that most of the Rc cars have, and manage the motor control and communication yourself.

You can look for the model of the motors in the car and get the right specs.
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 10, 2012, 07:25 pm
Ok, so ditch the control board and drive the motors myself. Can I do that directly from the Arduino Uno or will I need to also get the motor shield?

Thanks, everyone, for the responses.
Title: Re: RC Car Robot
Post by: mrescude on Oct 10, 2012, 07:34 pm
You need a motor shield, the current needed to get the motors running is very high, so do NOT connect the motor directly to the arduino outputs, you'll burn it.

The motor shield acts as a switch between the battery and the arduino, and controls the PWM signal and rotation direction. You have to connect the battery pack in your RC car to the motor shield (Vsupply) and the Vlogic connected to the 5V pin in the arduino.

I advice you to wait for more suggestions before you buy more things, maybe someone else has a better and cheaper approach for your project.
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 10, 2012, 07:40 pm
Excellent, thank you.
Title: Re: RC Car Robot
Post by: holmes4 on Oct 11, 2012, 12:05 am
The logic inside the car is RF stage ---> Decoder -----> motor driver ----> motors.

For step 1 you can

A. Gut the car keeping only the motors body and gears then add a motor controller

B. Cut in between the decoder and motor driver, this saves on a motor driver but is a little more complex.

C. Cut in between the RF stage and the decoder. Only one wire required to do this, but you need to generate the train of pulses the decoder expects.

Mark
Title: Re: RC Car Robot
Post by: oric_dan on Oct 11, 2012, 12:40 am
There seems to be precious little useful information on the neweeg website
about the details of the car, but lots of n/a's.

Can't even tell how large it is. Is it even big enough to carry something the size of
an Arduino bd, and possibly a few extra batteries?

Secondly, the forward speed of the car is a critical bit of information. Most R/C
cars go "much" too fast to be useful as a microcontroller-controlled robot. The
sensors and s.w. can't react fast enough.
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 11, 2012, 01:56 am
holmes4: I think my best bet might be to go with your first option. The board isn't that expensive.

oric_dan: The car is 1/16th scale. A Hummer H2, according to Wikipedia, is 204" x 81" x 82". This means the model is roughly 12.75" x 5" x 5", which ought to be enough space to handle whatever payload I have.

As far as the speed is concerned, surely I can do some kind of PWM to more finely control it? I've seen other RC cars firsthand that have done so.

Re: the speed of the robot for closed-loop control, it really depends on the refresh rate of the sensor and how tight my control loop is. I'll have plenty of horsepower on the netbook, and the Kinect runs at 30 Hz. I've seen robots successfully controlled at ~1 m/s at 10 Hz, and while that's definitely a bit loose for my purposes, I'm hoping the forward speed can be kept in check enough for my control loop to function well.
Title: Re: RC Car Robot
Post by: oric_dan on Oct 11, 2012, 02:33 am
Quote
As far as the speed is concerned, surely I can do some kind of PWM to more finely control it? I've seen other RC cars firsthand that have done so.


PWM'ing won't give you enough low-end torque to move the car, if the gearing
is too high. You'll just have to see how it goes once you get the car.
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 11, 2012, 03:14 am

Quote
As far as the speed is concerned, surely I can do some kind of PWM to more finely control it? I've seen other RC cars firsthand that have done so.


PWM'ing won't give you enough low-end torque to move the car, if the gearing
is too high. You'll just have to see how it goes once you get the car.


Ah, right. Ok, well I will take all this information in and report back here! Thanks for the help, everyone.
Title: Re: RC Car Robot
Post by: keeper63 on Oct 11, 2012, 05:53 am


Quote
As far as the speed is concerned, surely I can do some kind of PWM to more finely control it? I've seen other RC cars firsthand that have done so.


PWM'ing won't give you enough low-end torque to move the car, if the gearing
is too high. You'll just have to see how it goes once you get the car.


Ah, right. Ok, well I will take all this information in and report back here! Thanks for the help, everyone.


You might want to read (in full, and carefully - taking notes along the way) this mega-thread:

http://arduino.cc/forum/index.php/topic,86883.0.html

Long story short: It is likely that the car you have has everything you need to start; most of these el-cheapo R/C cars use the TX2/RX2 chipset, and are very easy to interface with once you understand the circuit. Even if it doesn't use such a chip, you can (with a knowledge of electronics and how to draw a schematic) reverse-engineer the on-board h-bridges of the R/C car that control the speed and steering, such that you can find the proper interface points on the PCB to control with the Arduino.

Something else to note: If the car doesn't have what is called "proportional steering" (most of these cheap cars don't), then you may want to replace build-in steering actuator with a standard-sized regular servo (-not- a continuous rotation one), and control it with the Servo library. At that point, though, you might as well cut the card away and use a regular h-bridge with the drive motor. Just make sure you measure the current consumption of the motor (both running and stall current; especially the latter - you need to size the h-bridge such that it can control the stall current plus about 15-25%) before you buy the h-bridge. You might be able to get away with an L298-based device (in bridged mode it can control up to 4 amps of current) - or you might need to purchase something else. Pololu has several suitable devices; there are other manufacturers/vendors as well.

Finally - next time you decide to build a robot using an R/C car, you may want to check thrift stores (like Goodwill or Savers) first; generally you can pick up something just like what you bought (or similar), missing nothing more than the transmitter (which you don't need) - and everything else is working fine (once again, read the thread - I'm pretty sure I covered it there). I've never paid more than 10 or 15 dollars -maximum- for such a regular vehicle (I did once find an MGA Tarantula without it's controller that I ended up buying for $25.00, though).

Good luck with your project!
Title: Re: RC Car Robot
Post by: mrescude on Oct 11, 2012, 06:17 am
I agree with cr0sh about the servo, if you use the rated voltage for the front motor (steering), it will over heat because it will have the rotor blocked by the limit of the steering. Or maybe just use low % duty cycle in your PWM signal and don't maintain the top steering for too long.

If the motor has plastic parts they could melt and block the rotor. It happened to me once.
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 11, 2012, 02:33 pm
Note to self: next time, come here *before* buying anything. Really helpful, everyone. I'll look into the car's steering - I may be able to return it if I don't open it.
Title: Re: RC Car Robot
Post by: DuaneB on Oct 11, 2012, 02:55 pm
If you do head back to the shop, try and find your way to a hobby shop where you will find options like these -

http://rcarduino.blogspot.com/p/cars.html (http://rcarduino.blogspot.com/p/cars.html)

you can then use an Arduino together with or instead of the supplied controls using the techniques outlined throughout

rcarduino.blogspot.com (http://rcarduino.blogspot.com)

Duane B
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 16, 2012, 04:03 pm
Alright, the RC car arrived. Neither the forward/backward speeds nor the turning are proportional (i.e., output is all or nothing). I've attached pictures of the motor controller. Does anyone recognize it? Does it look hack-able, or will I need to ditch it and get an Arduino Motor Shield?

Some notes on the attached images: the letters along the bottom of the board (right in the images) are G, B, V+, and F. B and F go to the motor; I'm assuming this indicates backwards and forwards in some kind of H-bridge setup. V+ and G, of course, go to the battery.
Title: Re: RC Car Robot
Post by: holmes4 on Oct 16, 2012, 04:44 pm
There is a chip on the small board which is edge on in the photo's - That's the control chip!.

The leads from the 4 chunky things on the right of the photos should go to the main drive motor if so they form the h-bridge.

The 2 small black things with 3 legs just to the left of what I think is the h-bridge are the control transistors for the main drive h-bridge.

The group of 6 small 3 legged black things on the lower left should have leads running to the steering motor. I think they form the h-bridge for the steering motor along with its control transistors.

The rest is the RF stage plus a few bits and bobs.

You need to get the id number of the control chip.

Mark

PS Tanks are much easier to convert than cars!

M
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 18, 2012, 02:01 am
Thanks for the info! The text on the control chip is incredibly tiny, and reading it reminded me that I'm due for an eye doctor appointment.

Anyway, the ID appears to be SDRX2BDS, and there is a string of numbers beneath it that reads 11120006. I've not yet Googled, but am about to do so.
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 18, 2012, 02:55 am
Ok, a little more information: I don't have access to the back of the chip itself; all I see is whatever material the board is made of. Instead, pertinent inputs and outputs to the chip appear to be broken out (bottom-left of the attached photo). Looking out F, B, V+, and G, I think I can trace back to the pins on the chip that I need. I have a meter I can use to check current and such across all of them in various motor states. Question: can I solder directly to the broken out connections in the bottom-left, or should I make my connections elsewhere?

Here are some more stupid questions: what kind of wire do I need to purchase? Are there any special bits of hardware that I can put on the ends of the wires to enable me to connect them to the Arduino without having to solder anything to it?

I apologize for the pathetically noob-ish questions. Just treat me like a slightly advanced two-year-old and we'll be fine. :)
Title: Re: RC Car Robot
Post by: keeper63 on Oct 18, 2012, 06:12 am

Thanks for the info! The text on the control chip is incredibly tiny, and reading it reminded me that I'm due for an eye doctor appointment.

Anyway, the ID appears to be SDRX2BDS, and there is a string of numbers beneath it that reads 11120006. I've not yet Googled, but am about to do so.


You don't have to - that's the RX2 half of the TX2/RX2 chipset (if you look inside the controller, you'll probably find something labeled "SDTX2BDS" or similar). Now, go to that thread I mentioned, and read it. There's a link in that thread to the PDF of the spec sheet for the chip.

You're first issue is to determine what the power source is for the chip, and what it is outputing as a logic HIGH on it's control outputs. You'll need a multi-meter for that. Once you know both of those things, then you'll be set to go to the next step.

I see that the chip is on a "daughterboard" of a sort. That's both a good thing and a bad thing. Good, because it means you can trace with your multimeter and your eyes the leads from the chip to the pins/holes on the "main" board. Bad, because it makes checking the pins and such a bit awkward (especially those near the main board side). But once you have things traced out, you can then carefully remove the daughterboard, and solder wires in place where the pins went, then supply signals to those pins somewhat directly from the Arduino. You may need to add current limiting resistors in between (if they are on the daughterboard and not the main board; hopefully they are on the main board side). Likely power and ground for the daughterboard come from the main board, so those pins may make things really convenient.

But you first need to figure out those voltages. Likely it will be either 3 volts or 5 volts used for the power to the chip and logic HIGH; if the chip is running on 3 volts, then the logic high will likely be 3 volts or close to it. One way to make a "first guess" is to find out what kind of battery it uses; if it is a 6 volt or greater battery, likely it is running the chip at 5 volts (which makes things much easier to interface with the Arduino). Otherwise it is probably a 3 volt system, which means you'll want to do some level shifting on the outputs (you can do this with resistors or diodes, or you can purchase specialty 3.3V <=> 5V level shifters; Sparkfun, among other vendors, sells them).

If you keep the receiver daughterboard intact, and you label the pins on the edge in some manner - you can use that for other control projects (with the transmitter)...

Just take your time, and be very patient and careful, documenting everything along the way. Read that thread I mentioned; you'll note that the OP of that thread ended up messing up his first car, but then got the second working (though IIRC, that one died too) - so be aware of that possibility. This isn't a "fool proof" operation, but many people have done it.

Good luck!
Title: Re: RC Car Robot
Post by: keeper63 on Oct 18, 2012, 06:17 am

Ok, a little more information: I don't have access to the back of the chip itself; all I see is whatever material the board is made of. Instead, pertinent inputs and outputs to the chip appear to be broken out (bottom-left of the attached photo). Looking out F, B, V+, and G, I think I can trace back to the pins on the chip that I need. I have a meter I can use to check current and such across all of them in various motor states. Question: can I solder directly to the broken out connections in the bottom-left, or should I make my connections elsewhere?


As I noted before - once you know what pins do what (and the voltages needed) - REMOVE the daughterboard, then make the connections to those pins (hey, its a convenient breakout, right there). In fact, I would look into getting a breakaway male or female header (like those used on the Arduino, for instance - those are female headers), and solder it in place - then you can easily breadboard and play...!


Here are some more stupid questions: what kind of wire do I need to purchase? Are there any special bits of hardware that I can put on the ends of the wires to enable me to connect them to the Arduino without having to solder anything to it?


I would use some ribbon cable personally (6 inches or so) - put a header to match whatever you put on the board (if you put a female header on the board, put a male header on your ribbon cable, on both ends). Solder it in place, then put some hot glue or such over the connections to make stabilize and insulate it.

Hope that helps.

:)
Title: Re: RC Car Robot
Post by: keeper63 on Oct 18, 2012, 06:29 am
I was looking at the pictures again - and noticed something - I think all the base resistors for the on-board transistors (for the h-bridges) are all on the main board. For instance, see resistors R2, R3, R4, R5 - they all seem to have the same value (though I can't tell the colors easily, so I'm not positive - but I think 2K ohm?). It seems R3 is driving the base of Q2, and R2 the base of Q1, and R5 the base of Q? (can't see it - maybe Q6?).

Anyhow - I'd be willing to bet that the transistors (or mosfets?) on the right side of your first pic (the large squarish things next to the GS-0020R marking) are the driver transistors for the drive motor. Likely they are being triggered in pairs by Q1 and Q2 (via base resistors R2 and R3 respectively). The other 6 transistors are likely used to drive the steering actuator (likely a simple "bang-bang" full left-right electromagnetic actuator). Two of them will again be for the opposite driver "legs" of the h-bridge (likely Q? and Q9 in the middle, but I don't know for certain).

Whatever you do, -don't- turn on both transistors at the same time, or you'll have a shoot-thru issue which will fry the h-bridges.

Hope this gives a bit more insight. I've always found it fascinating how this chipset has been implemented "in the wild"...
Title: Re: RC Car Robot
Post by: keeper63 on Oct 18, 2012, 06:33 am
BTW, TheWumpus -

I've been meaning to (for a long time - since that mega thread) to write up an article (for my website, maybe as a PDF or such - not for sale, all free) on all of this; would you mind if I used your photos of your board, plus any other insights you post here - as part of that project? I'm just wanting to make it something more clear and such. I would give you full attribution on the images and anything else, of course...
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 18, 2012, 03:50 pm
Wow, thanks again. This is a huge help. I'll read the other thread thoroughly and report back as I make progress.

Also, feel free to use anything I post, and don't bother with crediting the photos. I only took them to extract useful information from you all! In fact, if you want better/clearer shots, let me know.



Title: Re: RC Car Robot
Post by: TheWumpus on Oct 20, 2012, 08:35 pm
Alright, so the battery itself is 7.2 V (this is written on it, and I verified it with the multimeter). I had my wife control the drive motors forwards, and held the positive lead on my multimeter at the point where I believed the chip was outputting high for forward. I put the negative lead of the multimeter on the ground pin on the PCB. When driving forwards, I measured 1.6 V. I then repeated the process for the pin that I believed was reverse, and measured the same. The same was true for left and right turning (though they were closer to 1.7 V), though I believe the labeling on the PCB has right and left reversed for some reason.

So now what? Are these voltages indicative of a 3 V system or a 5 V system? I realize that may be a stupid question, but while the voltages are nearer to 3 V than 5 V, they're not very close to 3, and I wasn't sure if the voltage was being stepped down somehow.

Also, do I need to be checking the current across these as well?

Title: Re: RC Car Robot
Post by: keeper63 on Oct 21, 2012, 07:06 am

Alright, so the battery itself is 7.2 V (this is written on it, and I verified it with the multimeter). I had my wife control the drive motors forwards, and held the positive lead on my multimeter at the point where I believed the chip was outputting high for forward. I put the negative lead of the multimeter on the ground pin on the PCB. When driving forwards, I measured 1.6 V. I then repeated the process for the pin that I believed was reverse, and measured the same. The same was true for left and right turning (though they were closer to 1.7 V), though I believe the labeling on the PCB has right and left reversed for some reason.


Regarding the left/right thing - I have seen this kind of thing before with this chipset; that the implementation is in reverse to what the datasheet says. I am not sure why this is - whether it is the manufacturer (or the car), or the datasheet that is at issue. Just as a long as you realize it, it shouldn't be an issue.


So now what? Are these voltages indicative of a 3 V system or a 5 V system? I realize that may be a stupid question, but while the voltages are nearer to 3 V than 5 V, they're not very close to 3, and I wasn't sure if the voltage was being stepped down somehow.


If you can in some manner, check the voltages without the outputs of the IC connected to the base resistors; likely the rest of the circuit is "getting in the way".


Also, do I need to be checking the current across these as well?


I'm not sure what that means; if you are under the impression that things "output" current, you are mistaken. Current is "pulled" from a device, not "pushed" to it. That's the best layman's way I can put it. It depends on the resistance of the circuit and the supply of the voltage across that resistance - ohm's law - I=V/R - so if you have -zero- resistance (ie, a short) the current effectively becomes "infinite". If you have a break (an open), thus "infinite" resistance, then the current effectively becomes zero.

Now - if you do "cut the trace" between the output of the RX2 IC and the base resistor, and you can stick you meter in between and measure the current flow; that might be helpful (once you know the voltage output) - to know if by hooking up the circuit you'll pull more current than what the Arduino (or whatever you use) can supply (in that case, you might need to include a buffer circuit or something to help supply more current).
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 21, 2012, 07:07 pm


I'm not sure what that means; if you are under the impression that things "output" current, you are mistaken. Current is "pulled" from a device, not "pushed" to it. That's the best layman's way I can put it. It depends on the resistance of the circuit and the supply of the voltage across that resistance - ohm's law - I=V/R - so if you have -zero- resistance (ie, a short) the current effectively becomes "infinite". If you have a break (an open), thus "infinite" resistance, then the current effectively becomes zero.

Now - if you do "cut the trace" between the output of the RX2 IC and the base resistor, and you can stick you meter in between and measure the current flow; that might be helpful (once you know the voltage output) - to know if by hooking up the circuit you'll pull more current than what the Arduino (or whatever you use) can supply (in that case, you might need to include a buffer circuit or something to help supply more current).


My recollection of current is that it is analogous to flow (of, say, water), measured in coloumbs/second, which I know is amperes. Voltage is joules/coloumb, and specifies how much "punch" each unit of charge has.

In any case, I was under the impression that too much current through a circuit would fry something. For example, let's say the RX chip outputs 5V for pushing the car forward. Can I really just connect a wire from an output on the Arduino to the location on the board where the chip was outputting its 5V signal and everything will work? Do I need a resistor in there? If I understand you, the answer is no, and the circuit itself will dictate the current.
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 21, 2012, 08:24 pm


If you can in some manner, check the voltages without the outputs of the IC connected to the base resistors; likely the rest of the circuit is "getting in the way".



Any idea how I can do this?
Title: Re: RC Car Robot
Post by: oric_dan on Oct 21, 2012, 08:48 pm
Quote
My recollection of current is that it is analogous to flow (of, say, water), measured in coloumbs/second, which I know is amperes. Voltage is joules/coloumb, and specifies how much "punch" each unit of charge has.


This is a good analogy. The next sentence should logically read something like "Therefore, it's obvious that a tiny diameter
pipe connected to the water source will have a very high resistance, and therefore the flow into it will be small, while a
large diameter pipe will have a low resistance to water flow".
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 21, 2012, 10:26 pm


This is a good analogy. The next sentence should logically read something like "Therefore, it's obvious that a tiny diameter
pipe connected to the water source will have a very high resistance, and therefore the flow into it will be small, while a
large diameter pipe will have a low resistance to water flow".



True enough. I take it, then, that resistance is a result of both the wire itself and by things like resistors and the motors. In that case, assuming the output voltage for my Arduino matches that of the IC output, the only concern becomes whether or not the Arduino outputs can allow *enough* current to pass to meet the requirements of the motor control board, which I believe is something that cr0sh pointed out earlier. Do I have that right(ish)?
Title: Re: RC Car Robot
Post by: TheWumpus on Oct 21, 2012, 11:04 pm
I also drew a rough sketch of how I believe the circuit is designed for the motor controller. F_ic and B_ic are forward and back on the IC, respectively, and M_f and M_b are motor forwards and backwards, respectively. I'm sure I violated all sorts of standards for circuit diagrams, so forgive me, but I think the general idea is there.
Title: Re: RC Car Robot
Post by: keeper63 on Oct 22, 2012, 12:28 am

In any case, I was under the impression that too much current through a circuit would fry something. For example, let's say the RX chip outputs 5V for pushing the car forward. Can I really just connect a wire from an output on the Arduino to the location on the board where the chip was outputting its 5V signal and everything will work? Do I need a resistor in there? If I understand you, the answer is no, and the circuit itself will dictate the current.


It may work, if the circuit doesn't pull more current than the Arduino can safely supply on a pin (about 25-30 mA tops; 40 mA is max, but you don't want to go there). If it pulls more current than that - poof goes the pin (well, the ouput driver in the Arduino).

Usually, you want a resistor in there somewhere; start with about 1K, then drop if needed (no lower than 220 ohms). You can probably calculate it, but without knowing the specs of the transistor you are driving, it may not be possible.
Title: Re: RC Car Robot
Post by: keeper63 on Oct 22, 2012, 12:31 am



If you can in some manner, check the voltages without the outputs of the IC connected to the base resistors; likely the rest of the circuit is "getting in the way".



Any idea how I can do this?


Well - you need to locate the base resistor, assuming one exists. Trace from the output pin on the RX2 IC to the transistor it drives - hopefully somewhere there is a base resistor. Then you need to open the circuit at this point - by cutting a trace, or some other method. Then measure the output of the pin to ground. You may want to try first (just in case I'm wrong) to open the circuit -after- the base resistor, and measure the voltage from that point to ground. In case going directly to ground (even with a meter in between) draws too much current (and poof goes the output stage of the IC).
Title: Re: RC Car Robot
Post by: keeper63 on Oct 22, 2012, 12:51 am

I also drew a rough sketch of how I believe the circuit is designed for the motor controller. F_ic and B_ic are forward and back on the IC, respectively, and M_f and M_b are motor forwards and backwards, respectively. I'm sure I violated all sorts of standards for circuit diagrams, so forgive me, but I think the general idea is there.


In general it looks OK, though you show the output to the motors from the base of the transistors, and it's not really the "standard diagram" of an h-bridge you normally see, but close enough I think. You might want to compare it to the reference diagram in the PDF of the datasheet (I also note not seeing any flyback diodes - which is crucial in an h-bridge design based on transistors - unless those are -not- transistors, and are mosfets instead, which have an in-built diode across the source-drain; this would explain some things)...

I noticed you drew on one pair of transistors the base resistors, but not the ones between the RX2 IC and the first set of transistors - were there no resistors?

Looking at your diagram, the transistors F(ic) and B(ic) are probably being used in a couple of ways: 1) as a means to switch -opposite pairs- of the transistors in the h-bridge on/off (to prevent shoot-thru - which is bad - causes lost smoke), and 2) probably as a way to boost the output current of the RX2 IC to drive the larger transistors in the h-bridge.

If you can figure out or read the part number of these "buffer" transistors, it would be best to know that information. You can then determine (from the datasheet for the transistor) whether you can use it with the Arduino, what kind of base resistor would be needed, etc. Knowing the part number and such for the main drive transistors would also be helpful (especially if they are mosfets and not bipolars, which I am starting to seriously suspect).

You might be able to drive those transistors via their base resistors (I'm also surprised here where two of the other base resistors went?); it would use four digital outputs, of course (you might want to use a buffer driver IC in between), and you would have to code things carefully so that they get switched on/off properly without leaving two of the transistors on the same side of the bridge "on" (shoot-thru). Port manipulation would be best here (with all pins on the same port), or you might be able to carefully craft the software so that, knowing the last state of the pins, it would know how to set the state properly to avoid the shoot-thru condition...