Wednesday, February 26, 2014

Moving My Dog

Though there are a lot of other interesting parts to talk about, whenever I talk about my robotics project (or what is Dad doing in the basement) with my family, they always ask me, "When is it going to move?". I then explain that it is going to take me a while to work out a safe means of controlling the two Razor E-100 scooters I have purchased to form the heart of the drive system.

With a top speed of 10 mph, max load of 120 lbs and a service time of 40 minutes we are talking about something that, if it goes out of control could seriously hurt someone or destroy itself in an impact. This robot is going to have two of these inside and weigh more like 60 lbs when completed so being able to control the motor at far less then it maximum speed is important.

Also of concern is the high current, relatively, that a large DC motor requires. This motor can draw anywhere from 5-15 Amps at 24 volts. The original scooter comes with a controller that manages motor speed that I had to discard because it has a safety feature which detects voltage generated by the motor when the wheels move and prevents it from starting until the rider pushes off and squeezes the throttle. This is never going to happen with a robot unless you want to kick it to get it moving. The built in control system had to be discarded.

If you are interested in what this motor can do a full speed, just search for Razor E-100 on you tube and you can see kids literally zooming all over the place. I needed to demonstrate that the motor could be controlled at low speed with sufficient power to move a 60 lb load. Varying the input voltage is not a good solution because it will cut off the motor entirely before it gets anywhere as near slow enough for my needs. Slowing the motor with a resistor in series is also just a waste of power. What needed to be done was to pulse the 24 volt power supply and vary the frequency to control the effective power being delivered to the motor. This is called Pulse Width Modulation (PWM).

The motor must also be able to be controlled by an Arduino and relays are too slow to do the job so a solid state (transistor based) solution is the way to go. The most common way to control a DC motor's speed and direction by an input signal that an Arduino can generate is by using an H-Bridge circuit. I also needed one that could handle high current loads. I wanted to go with off the shelf parts, particularly for this component, because I am not a fan of fires. I went with the Megamoto Motor Control Shield for Arduino.

If you look at the specs, it can easily handle my expected load with a safety margin but to be able to control each scooter motor independently, I will need two shields but they are designed to stack on top of each other (see the link above). They will also use six of the digital output pins on the Arduino which are a precious resource but it will be worth it for all the trouble this board will save me. Right now I only own one but I will have to purchase a second one soon. Until I do there will be no backing up for this guy. He will only be able to move and turn in a forward direction.

To wrap up this post, here is a video of my breadboarded version of this shield in action. I wrote test sketches that allowed me to slow the motor down to a very reasonable speed. Please ignore the hair brush and the diet pepsi in the shot. The important thing is to see the Arduino is controlling the scooter.

I am starting to collect links and useful documents in a Springpad project which you can check out as well. That is it for this post. Will do another soon.

No comments: