February 2008

You are currently browsing the monthly archive for February 2008.

After dissecting a RC car, this is time for dissecting a RC tank… It’s been a while since I wanted to build a robot, a mobile robot, with tracks. Because tracks are cool, give nice mobility. But tracks are expensive. Very expensive. Tracks from lynxmotion cost about 220$, this price seems to be an average… So, using a rc tank could give a nice frame with tracks, ready to be used. Of course, quality cannot be the same (at least for the tank I have), but that could be an interesting proof of concept.RC tanks can be found easily on eBay. Prices vary a lot, but if you wait enough, you can get a nice one for very few. I got mine for 30€, shipping included (my first purchase on eBay). This a Leopard II A5 (but whatever…).

So what can be found ? Can this toy make a viable/usable frame ? Let’s have a look…

First of all, let’s have a look at those tracks. As in many tracked-vehicule, tracks are shorter on the bottom than on the top. This ensure minimal frictions while rotating (but less stability). Every wheels over the tracks have suspensions. While this seems cool, the poor quality may add a lots of “noise” while controlling the future rc tank based robot… Only the very last rear wheels drive the tracks. This is where motor are connected. All other wheels are just guide.
Batteries can be found on the reverse side. These are NiCd 1000mA / 9.6V. On the same side, five screws protect the tank from seeing its guts… Only one connector, which can be plugged/unplugged as needed, separate the base with tracks from the turret. Thats really good news, as hacking this tank won’t be too invasive.
Rear wheels connected to motors. With holes to drive the tracks. Tracks look very cheap… There’s no joint, it just looks like plastic ribbons (but seem adhesive). Tracks’ quality varies a lof according the tank (and its price…)…
Here’s the motors’ block… Opening the block shows two DC motors… As expected, both can be controlled separately.
The bottom frame is nice: lots of space, quite flat. The remaining board is for RC control. Probably to be removed. I’ve put my last mainboard on it, just to have an idea… I think this will be great :)

It’s been weeks since I’ve tried to build a DC motor controller board. Particularly, this board must include a way to control and monitor the motor speed. This is an important step since it’ll be used as a dead-reckoning system on my future robot.

There are several ways to do this. Using code wheels (or encoder discs) with photoelectric or Hall effect detectors seems to be the easiest way, in a software point of view, but requires mechanical adaptations to include the code wheels. This would affect the design of the bot, and would be too invasive to include in a “hacked toy” (such as a tank rc, this is what I plan to do, the mechanical parts on the tank cannot be modified, and shouldn’t be). Anyway…

Another way to do this is measuring the back-emf feedback. This is well described here. Basically, voltage coming from the motor, while it’s turned off (not powered), must be measured using ADC. The value is proportional to the speed of the motor. Compared to the voltage applied, it’s possible to know if the motor is turning as expected or not (too fast, or more plausible, too slow). And possibly to adjust the applied voltage to correct the speed.

I found this nice page on back-emf using control feedback, with the same parts I use (16F88, L293D). This is what I’m currently trying to implement. Master Patrick also helped me a lof, with advices, suggestions and patience…

After several tries, first results are quite interresting. Here’s a series of screenshots from an experiment. There’s one DC motor. Its speed is increased at each step, using PWM. One step consists in activating the motor for 2 seconds, then shutdown the motor for 1 second. When PWM is turned off, an ADC measure is acquired and sent through serial link. This gives…

Lot’s of noise (more on this later), but we can clearly see how the motor is accelerating, step by step. As expected, while the PWM increase step is constant, acceleration is not linear.

Also note, during  the very steps, PWM is not high enough to make the motor rotates. There’s a voltage applied to it, but none generated…

  Zooming on a step show interesting things… First, each step looks the same:

  • an acceleration phase (not linear). PWM is turned on
  • a constant phase. The end of the phase is when PWM is turned off.
  • and a deceleration phase, quite linear. No more voltage is applied to the motor, but it produces voltage while “slowly” spinning down…
As said, there’s a lot of noise. Precisely, while measuring voltage produced by the motor, measures vary a lot. The motor produces a lots of electrical noise. Looking at the graphs clearly shows a main trend. Master Fenyo suggests to compute a sliding average in order to extract this trend. This is can be easily computed with:

An = k.An-1 + (1-k).an


  • n is the current step,
  • An is the current average being computed
  • An-1 is the average at previous step
  • an is the new measure for current step
  • k is a coefficient used to balance the average with the new measure. 0 < k < 1

During this last experiment, I voluntarily slow down the motor several times. The green line is the sliding average, using k = 0.98 (the new measure has only 2% weight in the average). More readable, heh ?

“I plan to plot serial data from my PIC, in kind of real-time”. That’s what I’ve said to Master Fenyo. He said: “gimme a pen, you’re going to understand”. Here’s what he drew (click on pictures)…

(that’s about queuing theory, signal procressing, Fourier transform, sliding average and easy way to compute it, Poisson andNormal distribution, Markov process, PABX, alternative worlds in a probabilistic view, as in Sliders, dividing by 0.8 with a PIC,

As a robot builder, what can you expect to get from a rc car ? In great “Robot Builder’s Bonanza“ book, authors say: “You should consider hacking an existing toy to build you own robot platform. You’ll save a lot a time”. Building a robot mainframe from scratch is clearly time-consuming, particularly if you don’t have correct tools et materials. This being said, what can you really expect to get from a hacked toy ?

I’ve recently bought a rc car. Really basic, really “standard”, it cost approx. 30€. I wouldn’t consider the following as “hacking a toy” but as “dissecting a toy”. Here’s the list of pieces (from left/right, up/down):

  • a plastic frame, with a slot for Ni-Cad batteries,
  • a tri-state dc motor, used to turn left and right. This is just like a servo, but with only three positions: left, neutral and right,
  • a dc motor, with its gear reduction box (real crap),
  • several shafts,
  • a 6-pack Ni-Cad batteries,
  • four wheels,
  • a charger,
  • and four suspensions

That’s all… I plan to assemble some of this pieces to build a mobile robot.