**ROBOT ENERGY**

**Introduction to Mechanical Engineering Theory, Energy**

This tutorial will cover the practical applications of understanding energy with
respect to robots. I do not want to lecture you on high school physics, so I will
just go straight to the juicy stuff. What will make this tutorial very useful
is that you can simply use the laws of physics to determine the minimal amount
of energy your robot needs to perform any desired task (will help you select a battery).

A warning to those who don't like math - this tutorial has a lot of it.
If you don't want to bother with the theory, feel free to simply skip to
my Robot Energy Calculator.

**Potential Energy**

Potential energy is the energy 'stored' within an object 'at rest'. For example,
if you hold a rock in your hand, it has a potential energy of:

potential energy (measured in joules) = mass (kg) * gravity (m/s^2) * height (m)

Now unless your robot is a rock, this at first appears to be useless math.
Now suppose your robot were to climb a cliff, how much energy will be drained
from your robot battery? Well, the energy your robot would need
would be equal to the potential energy at the top of the cliff.

Or suppose you had a robot helicopter and you wanted to determine the maximum altitude
it can go with a particular battery. Then you would simply reorder the equation slightly
and get this:

(note that this does not leave enough energy to survive the trip back down)

**Kinetic Energy**

Kinetic energy is the amount of energy required to accelerate/decelerate a robot.

Lets say you have a typical wheeled robot running on perfectly flat zero friction loss terrain. In this
scenario, there are only two drains on energy - acceleration and deceleration. Both
can occur at any time, not just at stop and start locations, but also when turning and rotating.

So how do we calculate this? Simple, use the kinetic energy equation:

where velocity is the desired maximum velocity.

For example, lets say our 1kg robot starts at rest and accelerates to 1 m/s, rotates 90 degrees and then
travels at 2 m/s, then decelerates back to zero velocity. How much energy was spent?

Simplifing the above, it starts moving, stops to rotate, moves again, and then stops again. Or:

energy = 1/2 * 1 kg * ( 1 m/s + 2 m/s)^2 * 2 = __18 Joules__

Notice that I multiplied by two - this is because the robot accelerated twice and decelerated twice.
The energy to start moving equals the energy to stop moving!

**Unified KE/PE**

Now at any point in time your robot has some amount of both kinetic energy and potential energy.
For simplicity, in this tutorial we will assume that horizontal motion requires kinetic energy and vertical motion
requires potential energy (see below image).
When summing this amount, we can then calculate how much energy your robot will require to
perform any task.

For example, lets suppose our wheeled robot is driving up a hill. In other words, your robot is
doing two things - going up, AND driving horizontal. If you calculate each separately,
you can then sum them up for total energy required.

**Energy Losses**

The above examples only occur in ideal situations. In reality your robot will lose
energy from a great multitude of sources such as air friction, ground friction, gears, thermal losses,
circuit resistance losses, etc.

Typically, these sources are too complex to mathematically calculate, and so we have two choices.
We build mockups/prototypes to test, or we just guess based on intuition.
If you are unable to create a mathematical model for your first design,
you must use intuition and guesswork. If you wish to build
'new and improved' designs, then you can experiment on your previous prototype.

Since you are reading this tutorial I am assuming you do not have a good intuition when
determining these energy losses so here is a quick guide:

For most robots **air friction** can be ignored. Only account for air friction when your robot
is very large (huge surface area), shaped like a parachute (you get the idea), or has a high velocity
(air friction is proportional to velocity). To otherwise mathematically model this would require
CFD, or computational fluid dynamics simulations.

**Ground friction** losses occur as distance is traveled. If your robot was operating on say rough terrain
and traveled a specific distance, your robot would need to constantly accelerate to counter the friction induced
deceleration.

For example,

deceleration_ratio = # of times to re-accelerate / unit_distance

energy loss from friction = deceleration_ratio * distance_traveled * kinetic_energy

A perfectly designed system in an ideal environment would yield a deceleration ratio of 0.
A ratio of 1 would be realistic, and even higher would represent high friction in your system.

**Gearing losses** are much easier to calculate.
Check out my gearing efficiency tutorial.

If your robot does not use a thermal form of energy (like a combustion engine), then
you can ignore **thermal losses** as they would be fairly small. Calculating thermal losses
(in realistic settings) is way to complex for all but the experts.

**Circuit losses** can be calculated: unused_power = current^2 * resistance, where resistance
and current can be derived from your schematic, ohm's law, and part datasheets. With today's
electronics this can be considered neglible for most robots.

**Battery Energy**

I have been saying 'energy' for a while now, but how do you relate this number to
the energy stored in your robot battery?

For example, a 6V battery rated at 2000mAh would have 43200 joules of energy.

**Energy Conversion (and losses from)**

Energy conversion is when a form of energy is changed into another form of energy.
For example, your robot battery stores chemical energy. When you attach a motor
to your battery, this chemical energy is converted to spin motors which then
creates rotational mechanical energy.

As a robot builder, you want to have as few possible conversions as possible.
Why is this? Because no conversion is 100% efficient. This is why motors get hot -
thermal energy losses that provide no benefit! As a matter of fact, you can typically
expect most conversions to be between 30% and 70% efficient. That's a huge loss
in energy!

Let me give you a good example on this, a specific example that you should
be able to relate to. And I'm apologizing now for those who think
electric cars will save the world . . .

So suppose I ask you which is more efficient, an electric car or gasoline powered car?
I would make the argument that a gasoline-powered car is significantly more efficient,
and hence wastes much less energy. What is the basis for my argument? Well,
energy conversion efficiency!

Lets start off with how to power the electric car:

Coal at a power plant (chemical energy) is burned (thermal energy) to expand water vapor gas to
spin a turbine (mechanical energy) which acts as a generator to create electricity
(electrical energy) which is then stored in your car battery (chemical energy)
and then used to power the car motors (electrical energy) to provide mechanical motion (mechanical energy).

Counting, that's 7 forms of energy with 6 conversions. Assuming each conversion
is on average 70% efficient, thats:

Now for a gasoline powered car:

Gasoline is stored in your car (chemical energy) and ignited in the engine (thermal energy)
to expand gasses to push pistons (mechanical energy) that rotate your car wheels.

Counting again, that's 3 forms of energy with 2 conversions. Assuming each conversion
is on average 70% efficient, that's:

efficiency^(conversions) = final efficiency

or

.7^2 = .49 = __49% efficient__

I want to stress this is a simplified example and not proof that gasoline powered cars are lesser/greater polluters than
electric cars.
In reality, the typical conversion efficiency of a typical power plant is around 30%,
with yet more losses are experienced when transporting electricity down power lines. Combustion engines have
very low efficiencies, too.
And then there are yet more energy losses such as with trucking in gasoline/coal to various locations, etc.

So if you wanted to calculate a conversion loss for a battery-powered robot,
you would do say:

90% battery to electricity

60% electricity to mechanical motion

Therefore:

Battery energy after conversion = Battery_Energy * efficiencyA * efficiencyB . . .

or

= Battery_Energy * .9 * .6

So to calculate loss of energy from conversion,

Battery_Energy*(1 - efficiencyA * efficiencyB) = Energy Loss

**Final Equation**

Summing up everything you learned we can now form a general equation for calculating
required energy for your robot:

or filled out:

Required_Energy

= mass * velocity^2

+ mass * gravity * height

+ deceleration_rate * distance traveled * (1/2 * mass * velocity^2)

+ Battery_Energy * (1 - efficiencyA * efficiencyB)

or solved for Battery_Energy:

voltage * mAh * 60 * 60 / 1000

= mass * (velocity^2 + gravity * height

+ deceleration_rate * distance traveled * 1/2 * velocity^2)

/ (efficiencyA * efficiencyB)

If your robot makes a lot of stop/start motions, multiply Required_Energy
by that number of motions while distance equals the distance between each motion.

**Addendum**

A reader sent me this very informative email:

*
The Life cycle assessment that you offer compares WELL to wheel efficiency of Electrics to the TANK to wheel efficiency of combustion engines. To make this comparison fair, you really need to either start the electric comparison at the car's battery bank, or start the gasoline comparison at the refinery, and include the losses of transporting the fuel to filling stations via trucks that also use combustion fuels to move (equivalent to power line transmission/conversion losses in the electric life-cycle analysis). Some people even argue that a proper comparison starts the gasoline cycle at drilling for crude, but I think that would necessitate taking electric life cycle back to coal mining or uranium enrichment. :-)
*

*
Also, your assumption of 70% efficiency in the 2 conversions in a combustion engine (a 49% net efficiency) is a little ambitious. According to http://en.wikipedia.org/wiki/Fuel_efficiency, "Passenger car diesel engines have energy efficiency of up to 41% but more typically 30%, and petrol engines of up to 37.3%, but more typically 20%.". Figures from http://www.fueleconomy.gov/feg/atv.shtml suggest an even lower combustion system efficiency of 15%.
*

*
At any rate, these are common, but extremely large oversights when comparing the efficiencies of the two systems. I hope that you will consider revising your opinion and your article in light of this. I do want to thank you again for an otherwise informative and interesting website. Please keep up the good work.
*