Lawnbot Transmission

Having decided to use the worm gear motors that I found at the local surplus store, my job of gearing down the drive speed became much easier.  As I mentioned in an earlier post, these motors run at about 180 RPM and they already have a ton of torque.  I need to gear this down to about 20 RPM, and I’ll gladly take more torque, so a gearbox is in order.

The math here is pretty easy; the motor turns at 180 RPM and I want a final output of 20 RPM.  180:20=9:1 gear ratio.  The simplest route would be to use one tiny gear and one huge one, say a 10 tooth and a 90 tooth.  Given that the main body is only 12″ tall, a 90 tooth gear would have to have a pretty small tooth in order to have a small enough diameter.  Since I’m initially making my gears out of MDF (later to be cast in ABS plastic), I need to have a fairly large tooth, so a 90-tooth gear is out of the question.  Instead, I’ll compound the gears, allowing me to use multiple gears with fewer teeth per gear.  What I have decided upon is two pair of 21 and 7 tooth gears.  21:7=3:1.  3:1 + 3:1 = 9:1.  Yay!

A single pair of 21:7 gears looks like this:

gear model

For a full size image, please see the pdf copy here.

The motor turns the smaller gear, which turns the larger gear at one-third the speed.  At this point, the second pair is added.  First large gear that is turning at one-third the motor’s speed is directly connected to the second small gear.  This means the second small gear is also turning at one-third the motor’s RPM.  The second small gear turns the second large gear.  Since the second large gear turns at one-third the speed of the second small gear, which is already turning at one-third the speed of the motor, the second large gear turns at one-third of one-third, or one ninth the speed of the motor, hence 9:1 gear ratio.

Here is what the whole thing looks like assembled:

Gearbox

Gearbox

 

Advertisements

H Bridge

As I mentioned in earlier posts, an H bridge is a type of circuit that allows a motor to be controlled by a micro controller.  Both the speed and direction of the motor are controlled by output pins on the microcontroller.

In the image below, the motor is in the center of the H bridge.  The H bridge circuit is made up of four NPN transistors.  Two act to provide voltage (Q1 and Q2)  and two act to drain the voltage to ground (Q3 and Q4).  The transistors are controlled by two PWM outputs.  PWM means that the output pin can be turned on and off at such a speed that it appears to have a varying voltage, as opposed to a normal output pin that can only output a single voltage, based on the type of micro controller.

Let’s take a look at what happens here.  Let’s say that D10 has no output and D11 produces a duty cycle of 50%.  In this example, Q1 and Q3 would receive 50% power at the base (the horizontal line coming out of the transistor).  The percentage of power going to the base equates to the amount of power that passes from the collector to the emitter (top pin and bottom pin of the transistor, respectively).  If the battery in this example is a 12 volt battery and the base is getting a 50% duty cycle, roughly 6 volts passes through Q1, into the motor, and out through Q3, completing the circuit.  If the duty cycle of pin 11 goes up from 50% to 100%, Q1 and Q3 will pass all 12 volts through the motor, causing the motor to increase in speed.

Let’s say that pin 11 goes low (no output).  With both pin 10 and 11 low, all four transistors receive no power at the base, meaning that no power can pass from the collector to the emitter.   If no power passes this way, the motor does not get any power and it comes to a stop.  If pin 10 goes to 100% now, Q2 and Q4 receive power at the base, allowing electricity to pass through that line.  Power comes from the battery, through Q2, through the motor, through Q4, and back to the battery.  Since this circuit passes a voltage through the motor in a different direction, the motor spins a different way.

H bridge schematic

H bridge schematic

Lawnbot v.2 Electrical

I’m happy to report that this project is going to be significantly cheaper than I expected.  This is due to the fact that I was originally planning on driving everything off of cheap cordless drills from Harbor Freight.  Yeah, that would have worked, but even the cheap ones are expensive enough.  He hero to all of this: Ax Man, the local surplus store.

On a recent trip to Ax Man, I found a pair of worm-gear motors.  They are 12 volt motors geared down to about 180 RPM.  They were initially designed to be motors inside of motorized car seats in Daewoos.  That doesn’t really matter.  The important part is that they are cheap and they run at a much slower RPM, which means the final gearbox is going to be much less complicated.  Yay, Ax Man!

I’ve begun laying out the electrical work on the new lawnbot.  The following is a schematic of how the whole thing will work:

electrical system diagram

The system centers around a simple sealed lead acid battery (SLA).  The one I’ve picked out is for a garden tractor, available from Menards for about $24.  I will keep the battery charged using a trickle/float charger.  By float-charging the battery, I can leave it plugged in without fear of overcharging.  An automotive switch is connected to the battery and in turn, powers a bus.  Everything else connects to the bus.

An arduino will be used to control the unit.  The arduino is powered by the bus via the arduino’s built-in barrel jack.  When the power switch at the battery is turned on, the arduino will boot.  The arduino will use pins 5, 6, 10, and 11 to control two H-Bridge circuits.  I promise that I’ll have a post on what an H bridge is soon enough.  The reason these pins are used is that these are the output pins of the arduino that can produce PWM.  PWM is a way of turning a circuit on and off fast enough that it actually looks like a varying voltage.  While the arduino can’t output an analog voltage, it can vary the PWM in such a way that other systems will see the output like a 0-5 volt analog range.  This analog-like signal is important to the H-bridges because they control the speed and direction.  The higher the simulated analog voltage coming from the PWM pins, the faster the motor will turn.  Each H-bridge gets two PWM signals: one for forward, one for reverse.

Lastly, a digital output pin on the arduino is used to switch a relay for power output.  In this case, the pin is #2.  The output will be used to power things like the cutting head of the mower attachment.  It may  also be used to power an inverter if an AC device is required.

Hello world!

What kind of developer would I be if I were to remove the “Hello World” post from my feed? 

As a programmer, I love the concept of Hello World.  Two simple words have created the standard for ‘Your first program written in [fill in the name of the language you are working with here]’ .  It could be JAVA or .NET.  It could be HTML or COBOL.  For some reason, we have decided that this is the way to knock out your first example.  There is even an entire web site devoted to writing a Hello World application in every known language:

http://www.helloworldexample.net/

I remember thinking that it was odd to have a program say “Hello World” since the author isn’t writing it with the intention that the whole world would be seeing that program (some may argue against that in the confines of a web page, but I digress).  After some seasoning as a developer, however, I see that applications are “born unto the universe” as it were.  In this light, the developer isn’t the voice saying “Hello”, but rather the program itself as it runs for its first time in reality.

Having declared that this blog is its own entity, may I say on its behalf, “Hello World.”