Let's Make Robots!

Advice for a noob on adapting an RC car

Hi all!  Apologies for the essay - thanks in advance if you stick with it all the way to the end! ;)


First of all: great site!  Loads of fantastically useful information; I've learned more here than I ever have!  Oh, and congrats on a good choice of CMS platforms - I love working with Drupal :)

A couple of years ago I bought a Tamiya Grasshopper and radio transmitter/receiver package - it was a short-sighted nostalgic decision, as I'd always wanted one since I was a kid.  I took it out about twice after putting it together and since then it's been gathering a rather thick layer dust!   

A while ago, I had the idea of mounting a small CMOS video camera and building a 2.4ghz wireless video send/receive kit, with the possible adaptation of using IR LEDs for "night vision" - therefore, I'd be able to control it remotely even when I could no longer see it.  That never really took off - I had more pressing priorities for my money at the time! However after having looked through this site recently, I think that I still want to do this, but try and take this one step further by using the chassis and existing electronics - minus the RC receiver obviously! - as the base for a robotics platform.

Now I know I have a very long way to go, and an awful lot to learn, before I actually get a robot up and running. But if we don't try, we don't learn, right? ;).  I do however have some questions that I think might need expert advice.  

First of all, it might help to describe the existing electronics.  The whole car is powered by a 7.2v RC battery, using the standard "Tamiya" style connector.  I plan to use this as the power source for the whole platform, as I've got some pretty beefy batteries (i.e. 3.8Ah) and I can use voltage regulators where a lower voltage is needed.  For the testing I just carried out, I had an 8.4v battery connected - I don't use this battery for prolonged use as it's beyond what the components are rated for; it just happened to be the battery that charges quickest!  It uses an ESky EK2-0422 RC receiver, a Tamiya TEU-101BK electronic speed controller, an unbranded "racing spec" motor and a Futaba S3003 servo to control the steering.  I just took some multimeter readings and found the following voltages at the crucial components (or at least what I thought were the crucial components!):

Battery: 9.38v (even though it's a battery comprised of 7x1.2v cells - 7*1.2 does not equal 9.38??!!)

Power to motor (from speed controller): Full throttle +9v,  full reverse -9v

Signal wire for speed controller: idle (i.e., no throttle) 0.26v, full throttle 0.18v, full reverse 0.32v - these readings were taken from the output of the RC unit

Signal wire for servo: idle 0.25v, steering full "left" 0.15v, steering full "right" 0.34v - again, taken from the output of the RC unit


So firstly, would it be a good idea to keep the speed controller, or power the motor directly from a driver circuit?  To start with, I don't plan to use the full motor speed as it's very very fast!  The speed controller can be calibrated at different throttle levels for forward and reverse - so I can simply calibrate the speed controller to run the motor slower when the "full throttle" signal is applied.  Whether this will use the same input voltage, I don't know (but I can easily find out).  I would eventually like the unit to be able to vary the speed of the motor right up to full speed; for example, have it slow the acceleration down as it approaches an object and speed up when it clears the object.  I have to do some more experimenting on this if I choose to keep the speed controller.  At the moment, if the radio transmitter is off, or the speed controller is disconnected from the RC receiver, then the speed controller goes a little "loopy" - the motor twitches and it beeps like crazy!  I am hoping that all it looks for is a nominal voltage across the signal wire - based on the readings above, I can then simulate the signal from the RC receiver by simply applying a voltage to the signal wire.  

Secondly, is it possible to get the voltage of an output pin of a microcontroller to vary within an upper and lower boundary?  If so, I can simply program the microcontroller to output a certain voltage (or level) for idle and vary this for forward/reverse motion.  I'm not concerned about the steering servo, as this is a much simpler set up!

Next, which microcontroller should I use?  I've narrowed it down to either Arduino, or PicAxe.  Picaxe looks very simple to start using, but Arduino seems more flexible (as well as faster) - however Arduino is more expensive as a result...  I plan to use at least three to four collision detection sensors and some form of ambient light sensor (to turn on IR illumination LEDs in dark conditions).  I'm not sure how many outputs I need at this point.

Next, and possibly last, question: what is the best choice for collision detection sensors?  To experiment with, I will probably start by using simple microswitch-based "bump" sensors, and move up to IR or Ultrasound later on.  If I use IR proximity sensors, I am guessing these will be overwhelmed by the IR illumination I plan to use for "night vision".  Is it possible to adequately compensate for continuous IR illumination, or is ultrasound probably a much simpler choice?


If anyone is interested, the 2.4GHz A/V modules I plan to use are available here: http://www.active-robots.com/products/radio-solutions/av-modules.shtml


Thanks in advance for all your help :) 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Get a micro controller, wire up a LED, make it blink on and off.

Then add a speaker! Can you make it beep when the LED is on?

One step at a time is the point.

Indeed, once I actually get all the components there will be a bit of a learning curve; programming doesn't faze me, but it's been a while since I did any electronics work!  Even then it was building very simple circuits with direction from a tutor - about the most complicated thing I ever built was a lead-acid battery charger...


What I don't want to do however was waste loads of money on screwing things up during my learning curve! :)

Well, my apologies for not having updated this sooner!  It's been a while since I did anything with this, but I recently bought an Arduino Duemilanove - I actually bought it with the intention of using it for other projects.  


So far, I've managed to get the arduino hooked up to the RC car, and I have now figured out how to control the steering and throttle.  The steering is simple, as it's just a servo - though there was some trial and error to figure out the upper and lower bounds of movement (the chassis restricts the servo's full range of movement).  Though controlling the ESC (electronic speed controller) was a bit more of a pain.  I did initially try using PWM and analogWrite, but couldn't get any response out of it.  However the code I use now simply treats the ESC as another servo and it works perfectly.  I hadn't actually set out to resurrect this project, so as yet I don't have any sensors; next payday, I'll be ordering some proximity and light sensors.  

Wiring everything up turned out to be far easier than I thought.  The original wiring was roughly as follows: the battery is connected straight to the ESC; the ESC powers the motor; the ESC has a power output which goes to the RF receiver; the RF receiver has a common power bus for each channel and separate pins for PWM on each channel. It was quite a simple matter to wire everything together with a breadboard.  The Arduino now also takes its power from the RC car battery; for testing, I had the power being provided by the Arduino's 5v out, but the ESC can suck down some pretty serious current and I don't want to risk the Arduino board.  So instead it's powered by the same bus that sends power to the servos.  A photo might actually help, so here's four:






And here's a link to some of the code that I've been using to test - the first section cycles through forward speeds for the ESC, then the second commented-out section sets the steering to full right, then to centre, then to full left, back to centre and then repeats in reverse.  The line numbers are added by Pastebin, not me... 



The ESC can also be calibrated: I can set the PWM output pin to a lower value (i.e. slower speed) and can then set the ESC to use that speed as the maximum that it will go to.  This way, it shouldn't run too fast.


Apologies if this is a double post, I'm not really used to this thread/forum system!

The voltages from your receiver to the ESC and the servo are most probably not DC voltages, but the average voltage, as read by your multimeter, of a pulsed signal.

Most servos receive a 1.5ms pulse around every 20ms as their 'centred' signal. This then varies from around 1ms to 2ms for full left and right positioning. I imagine the same is happening to control your ESC.

I can't really offer any advice as to what you should use, as I don't have a lot of experience with RC, etc.

Picaxe is a nice, simple system, though.

P.S. It would be interesting to see the waveform on a 'scope, and see if the receiver is putting out a pulsed 3.3V signal.

I did a small calculation:

1.5ms/20ms = 0.075     and    0.075 * 3.3 = 2.475,  which is pretty close the the voltages you're seeing for both idle signals.

The full right and left signals work out, too.

I'm possibly barking mad.

I've just re-read your post - I'm trying to avoid doing some study! So, you plan to ditch the RC receiver, is that right?

If so, you'll have to be able to send control pulses to the speed controller, assuming you keep it. The picaxe has a 'servo' command that takes care of sending the pulses in the background, so that might influence your choice of microcontroller. It also has an easy to use PWM command, but I don't think you can use that while the 'servo' is operating.

They've added a whole lot of new chips with improved functionality since I last used one, so you may be able to do both with the right chip now, I don't really know.

Anyway ...

Thanks for the replies/advice :)


@joC - Correct, I plan to take the RC receiver out of the picture - photo of the unit uploaded here: http://yfrog.com/4vdscf0674bj  .  "Channel" 1 is the power connector from the ESC, Channel 3 is the ESC control and Channel 4 is the steering servo.  Please ignore the dust in the photo! ;).

Given that it uses timed pulses and not a continuous voltage, it appears that the ESC works effectively as a servo - I hadn't thought of it that way, but it certainly simplifies the equation.  I just did a quick test and the receiver doesn't care which device is hooked up to which channel - I was able to control the steering servo using the channel that the ESC normally uses.  IIRC, RC cars with nitro engines have their throttle controlled by a servo (linkage from the engine to servo) and you don't need different RC receivers for electric or nitro cars.  All I need to do to control forward or reverse motion - I think! - is have the microcontroller treat the ESC as a servo.  If Picaxe has servo commands/control and is easy to program, then I think it kind of makes the decision for me :).  


First off, welcome to LMR! Happy to have you here.

 Now the important stuff:

The voltages

  • Batteries tend to give more voltage when they're fully charged, therefore you can read 9.38V of an 8.4V battery package.
  • The motor voltage is normal, given your battery pack voltage... you lost a bit to the electronic components in the motor driver
  • Now the signal wire voltages: to understand these, you need to know how a servo works... A servo is powered by a constant voltage (usually between the red and black wire) so that its electronic circuit inside keeps functioning and tracking the position of the servo horn (or head). This way, if you try to turn the servo, it will fight back and try to keep its position. If you want to change the position, you need the signal wire. The signal you send through the wire is a pulse of a given length (with a voltage that probably is the same as your micro-controller or servo controllers voltage). The servo receives this pulse and determines where it should be standing by looking at the length of the pulse. Therefore, it is not possible to measure the voltage with a multimeter, you need an oscilloscope for that. Now, the interesting thing is that the motor controller doesn't use the length of the pulse to determine where the motor axis should be, it determines how fast the motor must go and in which direction.

All that follows next will be said assuming that you are going to use a PICAXE micro-controller (for the simple reason that I don't know how an arduino works/is programmed/connects to hardware)

In my opinion, it would be easier to keep the motor controller, this way you can control your motor using only one output, instead of two for (2 outputs, assuming you wish to rotate in both directions). Also, if you use a motor driver IC, you'll need a PWM chip too, to control the speed...

Your second question is a bit of nonsense, as DIGITAL outputs only put out a high or low signal; also, the digital outputs on a picaxe can only send 5mA current, so driving a motor directly from them is not an option.

I'd pick a picaxe chips, I think these are a lot more simplistic than the arduinos, ideal to start with. I'm a serious fan of the PICAXE 28X1

When you go for a picaxe, I'd advise you to go for the SRF05 ultrasonic range sensors for detection off objects. These are extremely easy to use and program. I don't know much about IR but I guess that, if you want to use IR illumination for night view, you'll probably be unable to use IR for range sensing.

 One last thing: if you're going to use the speed controller that is currently used in the car with a picaxe, I'd love to help you figure out the commands or at least hear how you did it. :)

Cheers for the replies/advice :)

Perhaps I didn't explain my second question properly; I hadn't intended to drive the motor directly off the microcontroller output, but the signal control for the ESC.  However, that was under the mistaken assumption that the signal wire uses a constant signal, not a timed pulse.  Given that the RC receiver effectively treats the ESC as a servo - I therefore plan to have the picaxe treat the ESC as a servo; i.e. using the "servo" commands...  Whether that will work or not remains to be seen! :)  I will definitely need to run it slowly at first, as this thing is really quick; it also tends to wheelspin when you jam the throttle fully open! (even on concrete!) :)


I think Picaxe will definitely be my microcontroller of choice; will be ordering a 28X1 starter pack & servo pack when I get paid...

Ah yes, I see now :)

 Do you know how you're going to avoid collisions already?

 Also, if you dont want your car to be that fast, you can change the gears that drive it, that way you can use full speed and still don't fly off to 5000 mph ;)