Search SpikenzieLabs:

Documenting the process of converting a child’s electric ride-on toy into a mobile robot platform.

Mobile Platform

Home

Intro:


While browsing at a yard sale last year I spotted a Fisher-Price Power Wheels ride-on four by four. The owner said it worked well but that the battery did not hold a charge and that he didn’t know how to change it.


I thought, for a few bucks I could do something with this. It had big wheels, a 6 volt motor, gearing and steering parts.

Objective One: Build a mobile platform


The first step in the conversion process was to remake the chassis. The 4x4 did have nice storage area under the seat where the battery and motor were located, but overall the shape of a plastic quad didn’t seem too practical for converting into a robot. Also, other than the steering linkages and pivot points the steering was very heavy.


I decided to go with a plywood chassis, since it is easy to work with hand tools and future accessories (range finders, cameras etc ...) can easily be screwed onto the platform.

Objective Two: Get it rolling


The second objective was to get the platform rolling around, I was going to be concentrating on basic platform locomotion, without any autonomy. So, I decided that I was going to first make a large “remote control” car, and after it was functional, converted it into a microprocessor driven vehicle, without rebuilding it’s core drive and steering parts.


One way that I like to do projects is to divide them into many smaller steps. Here are the two main steps in getting the platform rolling.


  1. 1.Steering

  2. 1.Locomotion

Step 1: Steering


The original large yellow handle bar on the quad had to go. For my first attempt at the steering I looked though my junk boxes and found a tape eject mechanism from a VCR. It looked good, it had a worm gear and provided what seemed like a lot of torque.

So, I modified it by adding a swing arm to connect to the Power Wheels steering and also so that it would fit into plywood chassis.


The results weren’t so great. The main problem is that is was very slow, but it also had a lot of slack and seemed like the worm gear would break if the front wheels were forced.

Another problem with the eject mechanism steering is that it would require a more complex circuit to control. To move both right and left the DC motor in the eject mechanism would need a H-bridge and it would require one or two position sensors (switches) for maximum steering limits so that it would know where to stop.


I decided to go with a really big hobby servo, called a 1/4 scale servo. This servo had a lot of advantages over the eject steering; it is easy to control with both an Arduino or a RC receiver, provides lots of real torque (In fact, I have hurt my hand by turning the wheels with my hand in the way!), doesn’t require extra hardware and if it breaks I will be able to find spare parts at a hobby shop.

Step 2: Locomotion: Motor Power


The main parts of the drive train from the Power Wheels were simply transplanted into the plywood platform. I also kept the square plastic axel bearings by building a sub base with square holes in it around the transmission box. A side benefit to this is that it raised the back to be level with the front.


In testing the speed of the platform I found that at 6 volts the speed was “ho-hum”. I tried to find the specs on the motor, but it only had a OEM part number on it, though it did say “Mabuchi”. Mabuchi is a manufacturer of small motors in Japan. I looked through all of their specs and noticed that most of the motors that looked like the one from the Power Wheels worked over a voltage range. Though my research was not conclusive, it didn’t seem like powering the motor over 6 volts would be that bad. So I doubled my 6 volt batteries and at 12 volts it moved nicely! (I think the 4x4 comes with only a 6 volt battery so kids don’t fall of the back when they press on the gas.)


To drive the motor I decided to go with the LM298 Dual full bridge driver. The part contains two H-bridges which could allow you to control either four motors in one direction each, two motors both CW (clock-wise) and CCW (counter clock wise) or a single stepper. It can also be used in “parallel mode”, in this mode, you use both bridges at the same time which doubles the amps that it can handle, at the cost of only running one motor.

I tested the current draw of the Power Wheels motor. While running suspended off the ground (only turning the gears) it drew 0.9 amps, rolling with the weight of the platform and batteries 2.2 amps and stalled around 2.7 amps.

The LM298 is designed to drive 2 amps per channel which means that in this situation the LM298 should be configured in parallel mode which would make a single 3.5 Amp bridge.

Arranging the driver board into parallel mode, was easy. I simply spilt each the control lines to go to two inputs at a time, and joined the four outputs into two.

Step 2: Locomotion: Motor Control


In order to work the hardware bugs out of platform, I would need to drive it around. Rather than get right into an Arduino controlled version, I decided that I would make the platform into a RC vehicle. This way I could drive it around (and have some fun) and make sure that all the hardware works.


I last year I bought an inexpensive Futaba 2 channel RC transmitter, receiver and servo kit. Getting the steering to work was very easy, I just connected the servo to the receiver and I was done.


Getting a DC brushed motor to work with the RC receiver wasn’t going to be that easy.

First idea: I remember reading about controlling a DC motor in Myke Predko’s book, 123 PIC Microcontroller Experiments for the Evil Genius, were in one of his experiments he controls a small DC motor with a pot. To use it, you turn the pot one way to speed up the motor in one direction, with it stopped in the middle and turn it the other way to speed it up in the other direction. I was first going to build this and have the other channel of the RC receiver physically turn the pot with another servo.

I’m sure this would have worked but on second thought I didn’t like the idea of having servo turn a pot and pondered on another solution.

Second idea: I decided to interface the RC receiver into the motor power board without any moving parts.


The signal that comes out of the RC receiver is a continuous repeating pulse that is from 1 to 2ms in length. With 1ms being one extreme and 2ms being the other. Reading this pulse is an easy job for a microprocessor. To learn more about hobby servos check out Darren Sawicz’s great text called Hobby Servo Fundamentals.

The big idea: Making a RC to Brushed DC motor interface


What I ended up with was a small Microchip PIC microprocessor, that would read the RC receivers pulse, and then output direction and a PWM signal (to control the speed), to the motor power board.

How it works: Reading the pulse


Many microprocessor have build in peripherals, such as serial ports, I2C busses and counters. The chip that I decide to use is the PIC12F629. It is a low cost 8 pin chip and it has a peripheral that is called a timer / counter, in this case I use it as a timer since I want to find length of time of the pulse.


To time the pulse, I have the RC signal going into a pin that is set-up to cause an interrupt when the signal goes from low to high on the pin. This is the start of the pulse. At this point I set the next interrupt to happen when the signal goes from high to low (end of the pulse), clear the timer, and start it.


When the next interrupt occurs, reading the timer will give a value for the total length of time of the high pulse.

How it works: Interpreting the pulse


The next part of the PIC program, “filters” the pulse’s timer value. First, it strips off the first 1ms, since all pulses are at least 1 ms in length. Next, it determines if the motor is stopped (center position of the RC controller stick) or going CW or CCW. It also produces an eight bit number (from 0 to 255) based on how fast it should be going depending on how far the controller (joy stick) is from center position.


This eight bit value is then feed into the custom PWM (Pulse width modulation) programming that turns the motor on and off very quickly to produce different speeds.


Some microprocessors like the Arduino have built in PWM output, but this low cost PIC does not. The custom PWM programming also uses another one of the PIC timer peripherals. In this case another timer is programed to cause an interrupt when it overflows (reaches it’s maximum value +1). With a bit of manipulation, the pulse value is used to set the ON (high) time of the PWM signal. In order to keep the period (total time of both the one high and one low time) of the PWM signal the same, I use the inverse of the high value to create the OFF (low) time of the signal.


For example, lets say that the period we want is 15 time units long and the high value is 4. The program would determine that the low time should be 11 so that the period is consistent 4+11 =15.


To do this the PIC uses bits based functions: Example


Dec.        Binary

4       =     0100         inversed 4 = 1011 ~ this is 11


Example of similar Power Wheels vehicle that was used for the mobile platform.

Photo: Fisher-Price web site.

Bottom view of “eject” steering.

Demonstration of slow sloppy steering.

Schematic from L298 spec sheet showing paralleled outputs for higher current.

Bottom view of the large 1/4 scale servo with bent cloths hanger linkage to the Power Wheels transplanted steering parts.

To attach the large servo to the existing Power Wheels steering, I simply drilled an extra hole in the steering linkage and used a bent cloths hanger to connect to the servo horn.

Prototype motor driver board. The main part is the L298 driver with a large heat sink. Included is a fan from a laptop for extra cooling. This prototype board also has a 5 volt voltage regulator for the motor driver board logic circuit.

RC receiver to DC motor board. This board reads the servo position pulse from the RC receiver and uses the pulses length to determine speed and direction to feed into the motor power board. The three wired cable plugs directly into a receiver like a standard servo.

Example of servo position depending on RC pulse.

1ms pulse

1.5ms pulse

2ms pulse

Indoor test drive:


Initial testing of the mobile platform indoors are positive, but outdoor testing is required due to lack of space!

What’s Next:


Working on some hardware improvements.


1. Steering: Replace the coat hanger linkage with something that is more balanced.

With the steering linkage connected only to one side there is uneven turning power when turning left vs right. (Even though the steering works well)

2. Front suspension: The tops of the front steering pivot points will have to be solidified to handle rough terrain and the vehicles weight ...

With the weight of two batteries and rough driving the platform starts to push the front wheels out.

Plywood mobile platform without any electronics.

To be continued:


After the hardware improvements are finished, there will be some roboting for the platform !

Buy

Projects

Povard

Sippino

8x8

How To + Info

Contact

Links