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 :)

make a LED blink
Get a micro controller, wire up a LED, make it blink on and off.

The voltages from your

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’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

Thanks for the replies/advice :slight_smile:

 

@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 :).

 

Some answers

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. :slight_smile:

IR disctance sensor can be
IR disctance sensor can be used with a IR illumination for night, if the IR distance sensor beam is modulated, but this should be anyhow the case, because during day you have the IR spectrum also in the sunlight.

Cheers for the

Cheers for the replies/advice :slight_smile:

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! :slight_smile: 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!) :slight_smile:

 

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

Good, I shall look into this
Good, I shall look into this more at a later date… I assumed that there would be some compensation for daylight anyway, but I wasn’t sure if a bank of IR LEDs would simply overwhelm the receiver. I definitely want to mount a small CMOS video camera at some point, but Maplin have scuppered my plans a little bit there by discontinuing some of the products I’d planned to use…

Then add a speaker! Can you

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

One step at a time is the point.

Ah yes

Ah yes, I see now :slight_smile:

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 :wink:

Indeed, once I actually get

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! :slight_smile:

I plan to use either IR or

I plan to use either IR or ultrasound - not sure of the relative merits of either system yet, but that will be a while off. It depends also on cost, as I plan to eventually have several sensors mounted. However one sensor mounted on a servo (maybe the ultrasonic SRF05, mentioned in this thread) will do to start with.

I will probably alter the gearbox at some point; however, as well as the reduction gears, the drive system also uses a differential gearbox so I don’t really want to start messing with that right away!

Gears
Altering the primairy gears won’t do anything to your differentials, so these can be easily replaced or the ratio between them can easily be altered

Depending on the IR receiver
Depending on the IR receiver type you can often calibrate the sensitivity to some degree, so using a big bank of IR LEDs can work out really well.

What’s ur intended speed?

Hi, I tried controlling a RC buggy using a mcu b4, but it’s not easy to control the speed. the minimum signal to get the motor running is simply too fast for indoor env.

Good luck and look forward to ur videos