Off Topic: Is a Gas or Electric Dryer Cheaper to Operate?

Our electric dryer went out this week. We bought it used 6 years ago when my wife and I got married, and I figured it would be a good time to buy a new set. Our family is growing, and we are doing more laundry than ever with two little ones in our house.

We have a gas hookup behind our dryer, in addition to a 240V outlet, so we have the option of buying either a gas or an electric dryer. I’ve never owned a gas dryer before. But my intuition is that all things considered, it may be the less costly choice. All the laundromats I’ve seen use gas dryers, and you typically heat your water and home with gas. I assume that’s because it costs less money than electric heating.

Is a gas dryer cheaper to operate than an electric one? How would changes in fuel or electricity costs affect the answer to that question? An electric dryer is about $100 less than a gas one as of this writing. Can the additional cost of a gas dryer be justified through lower fuel costs over time? How long would it take to recover that additional cost?

These are all questions that I had trouble finding answers to online. Most of the commentary on gas versus electric was about the quality of drying, not the cost. And when I did find answers to the cost question, there was little supporting analysis. This is my attempt to put numbers to those questions as I make this decision.

Natural Gas Cost

A good place to start with this analysis is the cost to power the dryer. I need to know what the next marginal kWh of electricity and Therm of natural gas will cost me.

To calculate these figures, I need to strip out the fixed costs in my electric and gas bills. These are costs I will pay regardless of my actual electricity or gas consumption. I can divide these non-fixed costs by my usage to calculate the cost of using one more unit of energy.

Let’s start with my gas bill. I want to figure out the cost of using one additional Therm.

My gas bill for the October and November.

To do this I need to identify the fixed costs in my bill. These appear to be the Customer Charge of $16.94 and the Gas System Reliability Surcharge (GSRS) of $3.19. Everything else appears to be an itemized charge based on usage.

Subtracting these fixed costs from my total bill gives the cost for the 57 Therms I used in this billing cycle:

The non-fixed natural gas cost.

Dividing this number by my usage is roughly what it would cost me to use an additional Therm of gas:

The cost of using one additional Therm of natural gas.

A Therm is 100,000 BTU. Google tells me that the energy in one Therm is equivalent to 29.3 kWh. The per kWh cost of natural gas is then:

The cost of natural gas in $/kWh.

This number represents the cost I will pay for one more kWh of energy from natural gas. It needs to be in units of kWh so I can compare it to my electricity cost, and to simplify subsequent analysis.

Electricity Cost

Below are the relevant charges from my electric bill:

My electric bill for roughly the same period as my gas bill.

The Basic Service Fee of $14.50 is a fixed cost. Everything else appears to be based on usage. I compared this bill to prior ones and every other charge varies with the amount of electricity used.

Subtracting the fixed costs from my total bill gives the cost for the 498.17 kWh I used in this billing cycle:

The non-fixed electricity cost.

And dividing by my total usage is roughly what it would cost me to use an additional kWh of electricity:

The cost of using one additional kWh of electricity.

If I stop here and compare these two numbers, it appears gas is the obvious winner. For the same amount of energy, electricity is more than 3 times the cost of gas.

Electric Versus Gas Dryer Efficiency

But there’s more to the story than just fuel and electricity costs. A gas burner doesn’t convert gas to heat with 100% efficiency, and electric dryers don’t operate with the heating coil on 100% of the time. Additionally, a gas dryer uses both gas and electricity in operation: they have a motor that turns the drum and an electronic control panel, same as an electric dryer. These details must be considered for a complete analysis.

Short of buying both units and measuring their actual gas and electricity consumption, there’s not a great way to answer these questions. Fortunately, most dryers marketed for sale in the US today have Energy Star ratings. The Energy Star website quotes a Combined Energy Factor, or CEF for certified dryers. It’s defined as:

The definition of the Energy Star Combined Energy Factor (CEF).

The CEF takes all energy used by the dryer into account. This formula can be used with the energy costs we calculated previously to determine whether a gas or electric dryer is cheaper to operate.

In this formula, C is the weight of a load of laundry. I’m guessing this is the weight of wet clothes that go in the dryer. C is 8.45lb when the Energy Star folks evaluate dryers for certification. Energy is in units of kWh, so the units for CEF are pounds per kWh.

For a dryer with a CEF of 3, you could dry 3lb of clothes using 1kWh of energy. Though the Energy Star website doesn’t state it explicitly, it stands to reason that energy used from both gas and electricity are measured and combined to calculate the CEF for a gas dryer.

For the rest of this analysis, I’m going to examine two GE appliance models that come in both a gas and electric version. The electric model number is GTD65EBSJWS, and the gas model number is GTD65GBSJWS.

The electric dryer has a CEF of 3.93. The gas dryer has a CEF of 3.48. This means the electric dryer can dry 3.93lb of clothes with 1kWh of energy, whereas the gas dryer can only dry 3.48lb of clothes with 1kWh of energy.

This makes sense, I think. If I remember my circuits and heat transfer classes from school right, converting electricity into heat with resistive heating is almost 100% efficient. Burning gas is pretty efficient, but only in the neighborhood of 80% from a brief web search, so we’d expect the electric dryer to be more efficient from an energy perspective. But what about the cost to operate them?

Cost to Operate an Electric Dryer

The only power source for the electric dryer is electricity, so the quoted CEF values and the cost of electricity I calculated previously can be used to estimate the cost to dry a given load of laundry. Drying a 10lb load of laundry in the electric dryer costs:

The cost to dry 10lb of clothes in the electric dryer at my current electricity rates.

Cost to Operate a Gas Dryer

Calculating the cost to dry the same 10lb load of laundry in the gas dryer is more complicated. A gas dryer sources power from both gas and electricity. The relative portions of gas energy and electric energy must be calculated so we can multiply both by their respective energy costs to get an accurate estimate of the total operation cost.

The owner’s manual for the gas dryer states it uses electricity at a rate of 6A at 120V, so the electric power the gas dryer uses is:

The electric power used by the gas dryer.

The owner’s manual also states that the gas dryer consumes gas at a rate of 22,000 BTU per hour. This comes out to:

The gas power used by the gas dryer.

The CEF values are for total energy consumption, both electric and gas. We can use the numbers computed above to breakout the portion of energy used by the gas dryer that is electricity and gas. The portion of power that is gas is:

The portion of power used by the gas dryer that comes from natural gas.

And the portion of power that is electric:

The portion of the power used by the gas dryer that comes from electricity.

The cost to operate the gas dryer per kWh of energy used, accounting for both the gas and electricity consumed, is:

The cost per kWh to operate the gas dryer at current natural gas and electricity prices.

Drying one 10lb load of laundry in the gas dryer costs:

The cost to dry 10lb of clothes in the gas dryer at my current natural gas and electricity rates.

Accounting for Differences in Machine Cost

The GTD65EBSJWS electric dryer costs $799. The GTD65GBSJWS gas dryer costs $899. How many 10lb loads of laundry would I need to do before the additional cost of the gas dryer is paid for?

The energy cost difference between the electric and gas dryer for one 10lb load of laundry is:

The savings from drying 10lb of clothes in a gas dryer instead of an electric dryer.

If I’m doing 7 loads of laundry per week, the cost savings per week is:

The cost savings of using a gas dryer per week if I’m doing seven 10lb loads of laundry.

The number of weeks to recover the $100 additional cost is then:

The time it would take to recover the additional cost of a gas dryer.

Alternatively, the annual cost savings of a gas dryer over an electric dryer is:

Annual gas cost savings at my current electricity and natural gas prices.

So not a bad deal. I need to verify with the Mrs. that we are indeed doing about that much laundry. But 7 loads sounds pretty reasonable. And as our family grows both in size and in quantity, it seems to reason that that number will only increase over time.

Variations in Natural Gas Prices

The price of natural gas seems to be rising. Let’s assume the price doubles. How does this affect the math?

To answer this question, the cost to operate the gas dryer needs to be recalculated using the new natural gas price. Recall that it is powered from both gas and electricity. Doubling the gas cost and leaving the electricity cost unchanged:

The cost to operate the gas dryer if natural gas prices double.

The cost to dry a 10lb load of laundry in the gas dryer under these circumstances is:

The cost to dry a 10lb load of laundry in the gas dryer if natural gas prices double.

In this scenario, the energy cost difference between the electric and gas dryer for one 10lb load of laundry would be:

The cost savings of the gas dryer over the electric dryer if natural gas prices double.

The gas dryer is still cheaper to operate than the electric dryer in this scenario. Assuming the same 7 loads of laundry per week, the cost savings per week is then:

The weekly cost savings for using the gas dryer if natural gas prices double.

The number of weeks to recover the $100 additional cost is then:

The time required to recover the extra gas dryer machine cost if natural gas prices double.

And alternatively, the annual cost savings of a gas dryer over an electric dryer is:

The annual cost savings of the gas dryer if natural gas prices double.

In this scenario, a gas versus electric dryer is closer to a wash, but still saves a little money. Over the life of the gas dryer, I will probably recover the extra cost.


Gas seems to be the winner in this analysis, even accounting for steeply higher natural gas prices. They would need to go up by a factor of 3.4 before the electric dryer is cheaper to operate.

The EPA says that 34% of electricity in the US is generated from natural gas. If natural gas prices increase, electricity prices will probably go up as well, because a portion of electricity is generated from natural gas. Alternatively, electricity costs would need to fall to about $0.03/kWh before the operating cost of an electric dryer becomes competitive with the gas dryer. I don’t anticipate that happening.

The more laundry you do, the better the gas dryer is. Our family isn’t going to be doing any less laundry over the next decade. If we did 10 loads of laundry that weighed 10lb every week, at current natural gas prices the additional cost to buy a gas dryer is recovered in 61 weeks, just over a year.

There are other, non-monetary benefits to having a gas dryer. Burning natural gas gives off carbon dioxide and water vapor. Most gas dryers I’ve looked at direct these exhaust gases into the drum and out the vent. The moisture in the drum can help reduce the static electricity in clothes after drying. We might save on dryer sheets if this is true.

You also get more heat when you’re drying. The gas dryer burner is capable of generating 6448W of heat when drying, whereas the electric dryer only outputs 5600W when operating at 240V. That might mean lower cycle times as the clothes dry faster, resulting in more laundry throughput, which I’m sure the Mrs. can appreciate.

One other thing that I find interesting: the CEF for the electric dryer is 3.93, while the CEF for the gas dryer is only 3.48. It’s true that the electric dryer uses the energy supplied to the machine more efficiently than the gas dryer. However, it’s not true that it costs less to operate, at least for my situation.

Furthermore, if the electric company is burning natural gas to make the electricity that powers an electric dryer, that’s actually a much worse scenario for the environment and your wallet than just burning natural gas in a gas dryer.

Every time you convert energy from one form into another you do so at less than 100% efficiency, so the extra steps of generating electricity from natural gas and transmitting it to your house involve losses that could be avoided by just burning that same natural gas in your dryer. This becomes less true if natural gas isn’t involved in electricity generation, but as stated above, that’s generally not the case. Some of that electricity comes from sources like coal, too.

I feel pretty confident in this analysis, but I’m posting it so I can have other folks verify its validity. Are these assumptions and calculations reasonable? Please let me know if you find any errors!

Comments from anyone who has owned a gas dryer are welcome, too. What was the experience like? Do you prefer gas or electric?

The Main Goal

The robot mower project has been frustrating lately. I find myself working on problems that are easy to solve but ultimately unimportant. Like balancing the mower blades.

Problems like these are easy to focus on because solving them creates the illusion of progress. But in the big scheme of things, they’re peripheral to the main goal of the mower project: how do we make an autonomous robot lawn mower?

The robot I’ve built cuts grass autonomously if it has a clear view of the sky. It relies entirely on RTK GNSS to know where it’s at. If you put it under the maple tree in my front lawn, it will lose the RTK fix, and as it exists today, the robot can’t mow my lawn autonomously. So there remains work to do to achieve the primary goal of the mower project.

The robot needs another way to know its position when RTK GNSS isn’t available. That positioning method needs to be at least as accurate as the RTK GNSS position. There are a few ways this could be accomplished.

It’s possible we could rely on wheel encoders and the Pixhawk IMU to estimate the robot’s position by dead reckoning until we reestablish an RTK fix. But the longer you go without an RTK fix, the greater the position drift you’ll have to reconcile once you do reestablish the robot’s actual position.

You could minimize the drift by using some kind of visual odometry with a very high quality IMU. But this only conceals the underlying problem: you still don’t exactly know where the robot is at, and you don’t know when in the future you’ll rediscover its location with a new RTK fix.

Other solutions like LIDAR or depth sensing cameras require a companion computer to analyze the sensor data and send position estimates to the Ardupilot software. Which puts me at a big crossroad.

I’ve really enjoyed running Ardupilot on the Pixhawk due to its simplicity. But adding a companion computer complicates things greatly. If I’m going to be using ROS on the companion computer to do SLAM and send position estimates to Ardupilot, isn’t that just using ROS, but with more steps? I might as well just jump headfirst into trying to figure out ROS if that’s the choice I’m faced with.

The learning curve with Ardupilot was steep, but the learning curve with ROS appears almost insurmountable to me as a mechanical engineer. The upside, though, is that there are some things that you can only do with ROS at the moment, like using LIDAR for position estimation and integrating a depth sensing camera. So the education investment appears worthwhile.

From my cursory research, it appears that a 360° LIDAR sensor would complement the RTK GNSS positioning method very well. When something occludes the robot’s view of the sky, chances are it will be detectable on the LIDAR.

I haven’t even started considering obstacle avoidance. This is something else that ROS also seems to have more capability for than Ardupilot. But that’s a can of worms for another day. Let’s build a robot that can actually mow my lawn before we worry about crashing into my sprinkler system well again.

Can anyone speak to the accuracy of these thoughts? Any ROS users out there willing to chime in?

Vibration Issues (Continued)

The vibration in my mower deck is caused by unbalanced mower blades. The distance between the mower blade’s center of mass and the rotation axis of the motor shaft is often referred to as eccentricity, and this eccentricity results in a centrifugal force as the mower blade’s center of mass is swung around the axis of rotation.

A cheap prop balancer from Amazon with a 0.5in diameter keyed shaft from McMaster Carr. The two head press fit bushings ensures the keyway doesn’t interfere with the shaft’s rotation.

At high rotation speeds, even a small amount of eccentricity can result in a big centrifugal force. To see how far out of balance my mower blades were, I purchased a small RC plane prop balancer off the internet. With a few pieces of hardware from McMaster Carr I was able to get it to work with my mower blades.

One side of the blade was heavy, so I started putting scotch tape on the opposite side to see how much mass it would take to balance the blade. It soon became apparent I was going to need more mass than a few strips of tape, so I stuck a few #8-32 hex nuts on there. Once I got it pretty well balanced, I removed the tape and hex nuts and weighed them.

It took almost 3 grams of mass to balance one of my mower blades.

Because the mass of the blade assembly is not coincident with the rotation axis of the prop balancer, there exists a moment about the rotation axis when the center of mass is not directly below it.

By putting tape and hex nuts on the opposite end of the blade, we created an additional balancing moment. The sum of these two moments must be zero for a balanced blade at equilibrium.

We can measure the mass of the blade, which is 798.1g. We also know the mass of the balance weight, 2.8g. And we know the position of the balance weight: it’s half the length of the blade, 6in.

Using this information, we can solve for the eccentricity:

Calculations for determining the mower blade’s eccentricity, or the distance away from the rotation axis the mower blade’s center of mass lies.

And the resulting centrifugal force is:

The resulting centrifugal force if a mass of 798.1g is 0.021in away from the center of rotation at 4800RPM. I find some calculations are easier to do in SI units, making the conversion back to imperial units at the end.

To be fair, I didn’t get my motors up to 4800RPM. But at speeds near the natural frequency of a structure you get a lot of force magnification, so it’s entirely possible the mower deck was experiencing a force at least that large or larger.

I know what you’re thinking: that’s a lot of words to say “balance the blades, dummy.” But there’s a few reasons this exercise is valuable.

Firstly, it gives me a rough idea of how much material needs to be removed from the mower blade. It needs to be 2.8g lighter on the side opposite where we placed the balance mass. The volume of material that needs removed is:

The volume of material that needs to be removed from this specific mower blade assembly to align the center of mass with the rotation axis.

If the blade is 0.203in thick and about 2in wide, that means we need to grind the end of the blade down by about:

How much material that needs to be ground off the heavy end of the mower blade to achieve balance.

That estimation will hopefully save me a few trips between the blade balancer and the grinder.

Secondly, these calculations shed some light on how significant the imbalance is between the various blade assembly components. It’s not just the mower blade that’s unbalanced: the adapter, screws and even the motor shaft (it’s keyed on one side, after all) also contribute to the unbalance.

However, their combined mass is smaller than the blade’s mass, and their locations from the axis of rotation are also relatively small. For example, you’d have to add nine 1/4 washers to one of the mounting bolts on the blade assembly to offset the unbalance that exists in the blade:

The number of 1/4 washers you’d have to add to one of the mounting bolts to offset the imbalance inherent in the mower blade.

That stack of washers would be almost 5/8 of an inch tall and weigh 20.7g. So the lowest hanging fruit in our attempt to balance the blade assembly is going to be working on getting the blades themselves better balanced.1

And lastly, these calculations reveal a major flaw with my mower blade assembly design: nothing holds the blade fixed relative to the adapter. The screws are inserted through clearance holes in the blade, and if you loosen them, you can wiggle the blade around relative to the adapter by about 1/16 of an inch.

The bottom of the mower blade assembly. The two screws are the only thing that sets the position of the blade relative to the shaft adapter.

If 0.021in eccentricity already exists in the mower blade, and that creates enough vibration to peel open an eyebolt on my mower deck mounts at resonance, then any slippage of the blade during operation will easily re-introduce that vibration.

It might be worthwhile to redesign the mower blade adapter to locate off the center hole in the blade to prevent this from happening. And to also redesign how the mower deck connects to the robot chassis. But for now we’ll focus on balancing the blades and see what that does for us.

  1. Adding washers like this would likely change the orientation of the inertial axes and introduce couple unbalance. I’m unsure how significant this couple unbalance would be. While one or two washer shims might work for fine tuning the balance, attempting to eliminate the unbalance like this may create a situation where the blade is balanced statically but still vibrates when rotating.

Vibration Issues

Before using the robot mower, I always power the blade motors on in my garage for a few minutes to make sure everything is working right. I pulled our vehicles out of the garage, told the missus to expect some loud noises, and made sure that Mr. Mower Jr. was safe inside the house.

The nice thing about the new motor controller I’m using on the blade motors is that I can vary the rotation speed of the blades. So instead of commanding full throttle from the get-go like I had been doing with a relay, I decided to slowly ramp up the speed. It’s pretty incredible listening to the crescendo of the blades as they spool up.

About halfway to full throttle, I started to get a ridiculous amount of vibration. It was extraordinarily loud. The vibration was so intense that it peeled open the eye of one of my deck support eyebolts.

The eyebolt on the turnbuckle supporting the mower deck. The vibration was so intense it peeled it open.

At first, I thought this was just a fluke, or that perhaps the eyebolt was already close to failure, so I replaced it with a spare and repeated the process. I’m not very smart. The result was identical.

When I was in engineering school, I had a choice to take Design of Heat Exchangers or Vibrations and Acoustics for technical electives. As you can probably guess by looking at my mower deck design, I chose Design of Heat Exchangers. It was a fun class, but pretty useless for anything mower related.

So to work through this issue, I’ve had to do some homework. Lucky for me, I managed to stumble upon a copy of Timoshenko’s Vibration Problems in Engineering at the Goodwill a few years ago, which has proven a valuable resource in my vibrations education.

Timoshenko says it better than I can, so I will quote him directly:

By an impulse or sudden application and removal of an external force, vibrations of the [spring mass] system can be produced. Such vibrations are maintained by the elastic force in the spring alone and are called free or natural vibrations.

Vibration Problems in Engineering, page 1

The mower deck is a kind of spring mass system, though geometrically more complex. There is a frequency at which it will vibrate if you were hit it with a hammer, just like a tuning fork will vibrate at 440Hz if you strike it against a hard surface. That unique frequency is called the system’s natural frequency, or frequency of free vibration.

Unfortunately, we’re not just hitting the mower deck with a hammer once. We’re hitting it with a hammer 4800 times per second. That oscillating force does not allow the mower deck to vibrate freely. That’s not free vibration. It’s forced vibration.

In the case of the mower deck, the frequency of that forced vibration is whatever speed the motors are spinning at. Because the motors go from zero to 4800RPM, the mower deck experiences vibration at every frequency along the way. Chances are good that the motors will create forced vibration at the natural frequency of the mower deck at some point as they spool up to operating speed.

A very curious thing happens when you force a structure to vibrate at it’s natural frequency. You get resonance. And the amplitude of vibration becomes very large at resonance. Absent damping it will become infinite. Timoshenko includes a chart that illustrates this phenomenon very well.

Resonance, and the Magnification Factor, from Timoshenko’s Vibration Problems in Engineering, page 42.

When I was spooling up the mower deck motors, I consciously decided to do it slowly to minimize electrical current spikes. This created a problem that didn’t previously exist with the relay, where we rapidly turned on the motors. Timoshenko explains:

The amplitude of vibration [at resonance] increases indefinitely with time… This shows that, while we theoretically obtain infinite amplitude of forced vibration at resonance in the absence of damping, it also takes time to build up these large amplitudes.

Vibration Problems in Engineering, page 48

In other words, if we maintain forced vibration at the natural frequency of a structure, the amplitude of vibration will increase continuously to the extent allowed by any damping present in the system.

By slowly increasing the speed of the motors, I was allowing the mower deck to experience resonance and the accompanying large vibration amplitudes for a period of time long enough to damage the turnbuckle eyes. Who’d have thought?

Something else I noticed was that I had trouble getting the motors to speed up once they were at speeds close to the mower deck’s natural frequency, when it started vibrating really bad. Timoshenko has something interesting to say about that, too:

Experiments show that if any vibrating system is once allowed to reach a steady state just below resonance, it then becomes difficult to accelerate the machine through the resonance condition. Additional power supplied for this purpose is simply used up in increasing the amplitude of vibration rather than the running speed of the machine.

Vibration Problems in Engineering, page 48

I think I have a good grip on what the problem is. Next post I’ll discuss some things that can be done to mitigate this surprising issue.

Wiring Improvements

I’ve spent most of this winter re-wiring the robot mower. In hindsight, I should have spent a lot more time planning the wire runs. I made a lot of design choices about how the chassis should look and where enclosures should be located that are inappropriate given my more complete understanding of how the wires need to be connected between components.

At some point you have to build something that’s not perfect and work through the bugs later. It’s against my nature to operate that way, but if I hadn’t started building the robot mower in reality at some point, it would still be a picture in my CAD program.

In the rest of this post, I’ll describe some wiring related improvements I’ve been making to the robot mower.

The original power enclosure. The phrase “rat’s nest” comes to mind.

The picture above is how the power enclosure used to look. It used to contain the Sabertooth 2X60, the voltage/current sensor, the BEC, a positive and negative terminal stud, a small 5V relay board to trigger two larger 50A relays, a power switch and an XLR charging port. It was a mess, to say the least.

The reorganized power enclosure. No relays or terminal studs, just two motor controllers and a BEC.

The reorganized enclosure contains the Sabertooth 2X60, the BEC, power switch, XLR charger port, and a motor controller for the deck motors exclusively.

The reason I tried to pack so many components into the power enclosure was so I didn’t have to put anything other than wires in the battery bay. It is a battery bay, after all. I was hoping to make an entirely modular power enclosure I could build up separately from the robot and then basically bolt on.

While that’s nice in the CAD software, in reality it didn’t work. If I’d selected a larger enclosure it might have been possible. But an unintended side effect of putting everything in one enclosure is that you have to run 24V and ground into the enclosure, but you then turn right around and run a ton of wires right back out of the enclosure.

As I have learned, relays are not a great way to control motors, especially if they’re using a lot of power. And on top of that, those “200A” relays were kind of a scam. They terminals are only rated for 50A, and I’m pretty sure I managed to fry one out in the field. I decided to replace them with a single channel motor controller that can supply up to 200A of current.

The nice thing about having a motor controller driving the deck motors is that I can dial back the blade speed if the mower is cutting the grass just fine. There’s no sense in running at 4800RPM when 3600RPM will do the job. I’m hoping this will allow the robot mower to run for a longer period of time.

A fuse block for the mower deck motors.

I was using wire nuts to connect all of the deck motor wires together originally. I wanted to make things a little more professional than that, so I decided to replace the wire nuts with a fuse block.

In theory, the deck motors should only use about ~30A each at steady state, and with the new motor controller, I think I can spool them up slow enough to where a fuse doesn’t blow. We’ll see how good this assumption is soon.

One thing I like about the fuse block is it allows me to easily disconnect power from the deck motors: just pull the fuses. This makes safe troubleshooting easier. The fuses will also provide a layer of protection for the motor controller. But at the same time, a blown fuse creates exactly the situation that caused my wire failure. I intend to also have a Zener diode between the supply terminal and ground to hopefully protect against this situation, too.

Components relocate into the battery bay. From left to right, there’s an RC controlled relay board, a solenoid, the voltage/current sensor, and a master fuse block.

All of the power in the robot now runs through a MEGA fuse, and from there it runs through the voltage/current sensor. After that, it runs through a solenoid, which supplies power to the drive and deck motor controllers. The solenoid can only be powered if the E-stop switch and RC relay board are in safe states.

I also put rubber boots on every exposed terminal, including the batteries. They look a little ridiculous on that solenoid, but they are adequately insulated.

The RC controlled relay board.

The RC relay board is controlled by a switch on the RC transmitter. If the RC relay board doesn’t detect a valid RC signal, it will open the relay. This allows me to have a remote E-stop switch.

One thing I don’t like about this RC relay board: when you power it on, it automatically closes for a second, then goes open. That’s a really crappy design, in my opinion. But without the Pixhawk armed it’s kind of a moot point.

A proper ground plane for the GNSS antennas. The foil to the left was what was underneath the RTK GNSS receiver previously.

I also finally got around to putting a proper ground plane under my GNSS antennas. We’ll see how much this improves performance.

I hope to have these wiring improvements wrapped up soon. The grass is green and growing out here in Kansas!

Inductive Kickback

I’ve learned a lot about the behavior of DC motors from the book Introduction to Mechatronic Design. Much of what I will discuss in this post comes from chapter 20 of this book. Electrical engineers reading this post will laugh at how elementary some of this information is, but it was news to me as a mechanical engineer.

I find that I solidify my understanding of ideas and concepts by writing about them. So what follows is a brief book report on a phenomena often called inductive kickback, which I believe was the cause of the wiring failure on my robot.

A motor is an inductor. Inductors store energy in magnetic fields. When you apply voltage to a motor, a magnetic field is created around the motor. A unique characteristic of inductors is that they resist changes in the flow of electricity through them.

If you were to suddenly disconnect the voltage source, the magnetic field would try to keep electricity flowing through the motor. But because there is no where for that electricity to go, the voltage across the motor terminals increases instead. And it can increase to very high levels, sometimes thousands of volts.

A typical graph of Inductive kickback voltage from Introduction to Mechatronic Design.

The energy stored in the motor’s magnetic field has to go somewhere. What usually happens is the voltage becomes high enough across the motor terminals that a nearby component becomes a target for electricity to arc through and flow out of the motor.

I didn’t state it in my previous post, but to power on the deck motors I’m using a large relay. To turn them off you have to open the relay, and you end up creating exactly the inductive kickback situation described above. And with nowhere for electricity to flow, I think the voltage between some of my wires became so large that it arced through the insulation.

What could have been the ignition source for a Kansas grass fire, save for my 100A fuse.

The damaged wires in the picture above are the + voltage wire on the motors and a battery ground wire, curiously enough. And notice how close they are to each other: a perfect place for electricity to arc. Better than the contacts inside the relay, which was still functional, surprisingly.

I now know why wires are voltage rated: it has nothing to do with the conductor material or size, and everything to do with the insulation. The insulation will only prevent arcing below a certain voltage threshold. And in the field several weeks ago, it looks like I greatly exceeded that threshold, whatever it was for those wires.

I checked the Posi-Lock website, and their connectors are rated for 600V. I don’t remember where I got my wire from. I’m sure it was the cheapest knock-off stuff I could find. The insulation has no identifying marks, so I’m not sure it’s voltage rated at all.

Next post I’ll describe the changes I’m going to make to robustify the wiring and electrical components in the robot mower.

How Not to Wire Up a Robot

What could have been the ignition source for a Kansas grass fire.

If you look closely at the charts in the previous post, you’ll notice they end quite abruptly. The picture above shows why.

I have the robot mower configured so the blades only turn on when you hold the rudder stick to the right. The stick is spring loaded, so letting go of it returns it to center, deactivating the blades.

A typical shrub out in the field. Most were about 18in tall.

The field I was testing in had several large shrubs in it. One of my goals in the field was to push the envelope on what the mower was capable of cutting through, so I let it mow over several of them in autonomous mode. However, there was a particularly large shrub in the robot’s path, and so I decided to turn the mower blades off by releasing the rudder stick.

As expected, the blades stopped. But the robot stopped moving, too. This was curious: the robot should have continued driving. So I pressed the emergency stop button on the robot to immobilize it, and walked over to the truck where I had Mission Planner running on my laptop.

A screenshot of Mission Planner telemetry log after I returned to the truck. The reported voltage is 12.50V.

The Mission Planner screen was frozen as if it wasn’t receiving telemetry from the robot. It took me a few minutes to realize that the issue wasn’t Mission Planner or my laptop radio: it was that the robot wasn’t sending telemetry. And even more curiously, the voltage reading on my SLA batteries said 12.50V. I was worried that I’d really fried my batteries, so I walked back over to the robot to investigate.

Opening the battery bay I found a slight amount of smoke and that awful burnt plastic smell from melted wire insulation. But other than that everything seemed fine. There wasn’t a smoldering fire inside the robot. The batteries weren’t hot to the touch.

At first I chalked it up to too much current running through the wires. The robot uses 120A at peak current, and at those levels even a small amount of resistance could cause the wires to heat up a lot. Perhaps the wires just got hot enough to melt the insulation and came into contact right at the moment I decided to shut the mower blades off?

One of the melted wires. The yellow blob on the end is a portion of a Posi-Lock.

This just so story didn’t sit well with me. What an awful coincidence that the wires failed at exactly the same moment I was shutting off the motors, especially after the robot ran fine for five minutes prior. Why didn’t they fail earlier?

Additionally, why didn’t the exposed wire conductors fuse together after they came into contact? I’ve heard of people using SLA batteries smaller than mine to spot weld 18650 battery tabs together. The wires were really close together, but weren’t touching when I opened the battery bay. And the wire strands don’t seem to be melted judging from the picture above. Which was extraordinarily lucky, given how bad that could have been.

I did have enough sense to put a 100A fuse on my batteries. It seemed logical that the fuse was what saved my bacon. But using the multimeter to test the fuse revealed that it was not, in fact, blown. At this point I was completely bewildered. I thanked the good Lord that the robot hadn’t turned into a massive lead acid fireball, made sure all my batteries were all disconnected, packed up, and went home.

I’m sure readers are ready to scold me for all of the janky things going on in my battery bay, and I certainly deserve that criticism. My mantra is make it robust, and I definitely did not live up to that standard with my wiring. Below is a full picture of the battery bay.

The robot mower battery bay. How many janky things can you spot?

I have my own list of janky things in here that I intend to fix. What do you see that is janky? Feel free to comment below!

In the next post, I’ll explain what I think went wrong, and the improvements I’m going to make to mitigate the problem and eliminate all the redneck wiring I’ve got going on.

Robot Mower Performance

I didn’t spend much time in the field testing the robot mower, but the little time I did spend gave me a treasure trove of information about how the robot mower performs. Below are some high-level measures.

Performance characteristics for the robot lawn mower in the field.

I set the robot cruise speed to 1m/s or 2.2mph. I’ve run the robot mower faster in manual mode, but for obvious safety reasons, a moderate walking pace seemed best. If the robot gets out of control, I want to be able to catch it.

I am using a Mauch PL-200-HV current sensor on the robot. The sensor is connected to the positive terminal on my batteries, so it reports the total current used by robot: sensors, drive wheels, mower deck motors, etc. Once the mower is spooled up, current consumption levels out at about 90A.

Current consumption used by the robot mower.

The first portion of the graph above is the robot mower operating autonomously without the deck motors turned on. The huge spike is when the deck motors get turned on. It’s curious it says the peak is 196A: the PL-200-HV is only rated for 200A. I wonder if the spike was actually larger than shown, but due to its current rating, the sensor only reported ~200A.

There is a surprising variability to the amount of current used by the deck motors. In the garage, the deck motors would use 46A +/-1A. It was kind of impressive how steady current consumption was. But throw some grass under the robot and you get a ton more variability. Current consumption for the whole robot varies from 65A to 120A with the deck motors on.

Grass is typically pretty homogenous, even out in the field, so this was unexpected. I went and reviewed the logs from my backyard, and they look about the same. Even controlling for pivot turns at the end of a pass, the current consumption is all over the place.

Current consumption versus steering commands. Each spike on the green line is the robot mower making a pivot turn at the end of a pass.

It does appear to dip a little with each turn, but only ~15A. Maybe I’m reading into it too much. There were some small shrubs and some pretty gnarly crab grass plants out in the field. The current variation might just be the mower running over those things.

I also wanted to see how much the battery voltage dropped when running the deck motors in a real-world situation.

Battery voltage level before and after the mower deck motors were turned on.

I made sure all four of my batteries were individually fully charged before going to the field. But any way you cut it, asking 90A out of four 35Ah SLA batteries is pushing it. With the deck motors on, the nominal battery voltage drops to 20V.

I toyed with the idea of using lithium ion or similar batteries from the start when designing the robot mower. But they’re pretty pricy, and for the time being, SLA batteries will work well enough for field testing. The four 35Ah SLA batteries were less than $200, so I can afford to run them like a rented mule.

To get the total power consumed by the robot you need two things: current consumed and the voltage level when it was consumed. Mission Planner will do the math for you by multiplying the current and voltage at each time step and then adding them up for a total energy consumed graph.

A running total of the energy used by the robot over time. Find the slope of that line and you’ve got the average power consumption over that time period.

Unfortunately, Mission Planner won’t differentiate that graph for you so you can see what the power consumption was at any given time. But if we assume the power consumption is linear over the five minute time interval above, we can estimate it.

A simple way to calculate the power consumption for the robot mower.

This number is encouraging. I’ve seen the drive motors on typical electric riding mowers consume more than 1kW by themselves, excluding the deck motors. I need to do some more testing to see how efficient the robot mower is on less flat terrain. But as you’d expect, there appear to be a lot of power savings to be had by getting rid of the guy riding the mower.

Regarding the blade motor rotation speed, there are two ways I can think of to estimate this. One way is based on the current consumed by each motor. Take that number to the motor performance charts and you can estimate rotation speed.

The other is to see at what frequencies the mower is vibrating at. Thanks to some new developments by the Ardupilot folks, this is a pretty straightforward task. If you can find the frequency where you get strong vibrations at, you can assume that’s the probably speed at which the motors are rotating.

The mower uses about 5A when running without the blade motors on. That means all three motors consume 85A, or each motor consumes 28A.

Performance curves for the AmpFlow E30-400 DC motor.

At 28A of current consumption, an E30-400 motor spins at 5100RPM, uses 540W of power and and achieves 1N·m or 0.74ft·lb torque. One of the big question marks in the robot mower design has been how well the motors would perform. It appears they’re just about perfect, operating right at the peak of its efficiency curve.

Speaking of efficiency, one thing I did notice about the deck motors was that even after a few minutes of operation, they were very hot to the touch. So hot I couldn’t keep my hand in contact without significant discomfort. Yes, I did try. I’m guessing they were north of 140°F.

Even if the motors are 79% efficient, that means that 21% of that 540W, or 113W, gets turned into waste heat. That’s a fair amount of heat to dissipate through a 5in long, 3in diameter cylinder by free convection. It might be worthwhile to come up with some kind of cooling fin to attach to the motor housing.

Ardupilot now has a feature that lets you analyze logs to see where vibration issues might exist. It looks at data recorded by your IMU and does a fast Fourier transform on the data to find frequencies at which you have high levels of vibration.

Using this method to estimate the motor rotation speed gives you several graphs that look like the one below.

The amplitude of vibration in the X, Y and Z directions on the robot mower across the frequency spectrum.

My understanding is that this graph gives you the strength of vibration at certain frequencies. I am unsure of the units on the Y axis. I think they’re m/s, but that seems awfully high. But then again, the mower deck is basically a giant vibratory table. I have no reason to believe they’re not accurate.

One thing that is interesting to note is that the amplitude of vibration is high in the X and Y directions across the spectrum, but less so in the Z direction. I think X is the forward to aft direction and Y is the left to right direction on the robot. So high levels of vibration along those axes makes sense when you think about a giant unbalanced motor rotating along an axis perpendicular to those two directions.

I’m assuming that all three motors are spinning at close to the same speed, but in reality, I’m sure they’re all off by some amount. I’m not sure how that affects the accuracy of this method of estimating the mower blade speed. Regardless, 4680RPM jives with the estimates obtained from the motor chart. The truth is probably somewhere in the middle, perhaps 4800RPM.

The calculation for blade tip speed with a motor rotation speed of 4800RPM and a blade length of 1ft.

15000ft/min is well below the 18000ft/min limit that manufacturers abide by. But judging from the good cut quality in the field, it might be possible run the motors slower. This would reduce the power we need to run the robot. AmpFlow makes a motor that is identical to the E30-400 that is a little bit shorter and uses less power. I might see if it would make sense to use this motor instead.

The fix status for the ZED-F9P GNSS module. 6 is RTK fixed.

I made some setting changes to the RTK GNSS modules based on some great comments I received a few posts back. I outlined those changes in this post. After that post, I made one additional change to the CFG-NAVSPG-DYNMODEL configuration item. I set it to 3 = Pedestrian.

The graph above shows the RTK fix status. The changes I made in that post resulted in a rock solid RTK fix. The little dips in RTK status were less than a second in duration. Thank you to Sean Smith and Frank Beesly for their valuable feedback!

The magnetometer performance was more or less garbage. I think a good portion of my cross track error is due to the compass variance corrupting an otherwise good position solution given by my wheel encoders and RTK GNSS.

Reviewing the telemetry logs, before I was even in autonomous mode, the EKF was reporting a marginal compass health reading. And the chart below tells you all you need to know about the rest of the compass performance.

The magnetometer’s reported Y magnitude versus the total current used by the robot.

The reported magnetic field strength jumps by 0.15 Gauss after you turn the deck motors on. It might be possible to zero this out in the software by finding the offsets when the deck motors are on, but I have so little confidence in the magnetometer at this point, it’s not worth the effort in my opinion. RTK GNSS yaw seems like a much more robust solution for heading.

Keen observers will notice something peculiar at the 17:16 mark on these graphs. More on that in the next post.

The Robot Mower in Action

The robot mower making its first autonomous stripes on a field.

The past few Saturdays I’ve been playing with the robot mower in my backyard. It’s been fun manually driving it around my sprinkler well, flower beds, and garden. The fun ends a lot faster than I’d like: my push mower is 21in wide, but the robot mower is 36in wide, so it doesn’t take very many passes to get most of it mowed.

I’ve spent a lot of time in the backyard for two main reasons: firstly, I want to make sure the mower is safe before I take it somewhere it could hurt a bystander. And secondly, I want to make sure it doesn’t do an embarrassingly bad job at cutting grass.

Before I even took the mower out into the backyard, I ran it in my garage with the door down for a good hour or so to make sure the blades were installed securely. The first time I spooled it up was pretty scary. The garage is a giant echo chamber, and so it sounded a lot louder than when I had it running in the backyard.

Once I was satisfied it wasn’t going to vibrate apart, I maneuvered it into my backyard to see how it handled in manual mode, and how good of a job it did cutting my grass. Overall, it performed very well, making grass clippings without any difficulty. I did, however run into two issues:

The turnbuckle holding the deck to the chassis needs to be larger.

In manual mode, you can take turns pretty quickly, resulting in some large side forces on the turnbuckle eyes. These turnbuckles were only rated for 36lbf in tension and I wondered how well they’d hold up. Guess we know the answer to that question.

Locknuts are effective only if the locking portion of the nut is engaged with the threads.

While taking one of those fast turns in manual mode, I had a tire pop off. Yikes! Upon closer inspection, it turns out the nylon portion of the locknuts on the motor shaft were not actually threaded onto the shaft.

In my CAD model I had 1.5 threads engaged. Not great, but enough engagement to where I wasn’t worried about it. In reality, I didn’t get them threaded on all the way. I replaced both locknuts with a split lock washer and a jam nut.

These were good issues to discover in the backyard, where I could easily fix them without much embarrassment.

The field. A great view of the sky and a few weeks’ worth of grass growth to test the mower’s capabilities.

Satisfied that everything was working well, I loaded up and headed out to the field to try an autonomous mission. My backyard is great for manual mode, but it’s too small to run an autonomous mission.

It’s always good to have goals when you head to the field. For this field trip, I wanted to accomplish the following:

  1. Practice getting the mower from my garage to the field. With four 35Ah lead acid batteries in the mower, it weighs close to 300lb now. Getting it from point A to point B is turning out to be an art in and of itself.
  2. I made some changes to the ZED-F9P RTK GNSS settings based on comments made on a prior post. I wanted to determine if these changes helped or hurt my ability to maintain an RTK fix.
  3. Being in a field with tall grass, I also wanted to push the envelope and see what the mower could cut effectively. The homogeneous fescue in my yard isn’t that difficult to cut.
  4. Collect some general data about the mower’s performance. How much power does it actually use? How hot do the motors get after running for a while? How well does it mow autonomously?

Before I was using the mower deck, I only had two batteries in the battery bay. Loading and unloading isn’t too bad in this scenario: you can pretty easily drive the mower up the ramps and into the bed of my truck. With the other two batteries installed, that process becomes a little sketchier.

The wheel chair gearmotors have a neat little quarter-turn mechanism that disengages the output shaft from the rest of the gear train and lets the wheels spin freely, so I used this feature to push the mower up the ramps and into the bed of my truck. It’s too difficult to precisely maneuver the mower up the ramps and into the bed using the RC transmitter with the added battery weight.

Once in the field, I drove the mower out a safe distance away from the street to let it start working on an RTK fix. I wasn’t worried about absolute position, so I had the RTK base station configured to survey-in its location and used whatever it eventually settled on.

The first autonomous mission for the robot mower.

After I had an RTK fix, it was off to the races. I made a mission that was approximately a 100ft square and planned passes that were spaced 30in apart.

I configured channel 4 on my transmitter, the rudder stick, to control the power to my mower blades. This way it functioned as a dead man switch: if I let go of it, it would spring back to the neutral position. I designed relays inside the power enclosure to engage when the stick was held to the left. To keep the mower blades on, the stick must remain in that position.

After the mower made a few passes autonomously, I turned the blades on. That’s what you see in the video at the top of this post.

The cross track error was pretty large. You can see my tape measure lying in the grass for scale.

If the mower had maintained its position perfectly during the mission, each pass should have overlapped 6in because the mower deck is 36in wide and each pass was spaced 30in apart. Unfortunately, the mower’s position floated around by a fair amount. The un-mowed portions of the field are a result of this position error, which I’ve heard referred to as cross track error.

In some areas, the width of un-mowed grass was as large as 16in. This was a little disappointing. On average it was closer to about 8in. I need to find ways to improve the mower’s position estimate, so I don’t have to tighten up the spacing between passes.

The robot was using the magnetometer for heading, and you can see in the video that after each 180° pivot turn, the mower weaves a little bit as it tries to figure out its heading again. I intend to run another mission in the field soon with the magnetometers disabled to see if this improves the heading. Long term, I will look into using an additional RTK GNSS receiver to estimate the robot’s yaw.

This post is already pretty long, so I’ll make a separate one to review the logs and performance metrics I wanted to measure out in the field.

Mower Blades: More Complex Than You’d Think

A typical mower blade.

While designing the robot mower, I spent a lot of time working on the chassis, electronics enclosures, and wire routes. I tried hard to select components I could easily acquire at a reasonable cost, and that effort paid big dividends when I went to get everything built.

Unfortunately, I didn’t spend nearly as much effort on how the mower blades would attach to my motors, or even what the mower blades would look like. I assumed I could easily find any mower blade size I would need, or that making my own custom blades wouldn’t be difficult.

Now that the blades are the only thing missing on the robot mower, I’m realizing how mistaken that assumption is. I designed the mower deck for three 12in long blades, thinking that surely such a size exists. But most blades are generally in the neighborhood of 20in long.

Small gasoline powered mower engines operate at speeds in the range of 2,500RPM to 3,000RPM, and to achieve an appropriate blade tip speed slightly less than 19,000ft/min, the math forces you to use a blade that is between 19in to 22in long. Blade sizes outside this range aren’t common.

Initially I decided this wasn’t an issue: I’ll just make my own blade. It’s just bar stock with two sharp edges, right? Well, kind of. There’s a fair amount of metallurgical considerations that go into mower blade fabrication. On the one hand, you want a soft, ductile blade that doesn’t shatter when it hits a rock or tree stump. But on the other, you want the blade to be able to keep a sharp edge for a long time, which means making the blade, at least near the sharp edge, more brittle.

Cutting grass creates an inherently moist environment under the deck, so mower blades are usually painted or feature some kind of corrosion resistance. And on top of all this, a good blade will have a small bend opposite the cutting edge to create a little wing so that the grass clippings can be pulled upward resulting in a nice, even height cut.

The more you learn about mower blades the more you start to realize that buying one is really the way to go. In your research you’ll come across horror stories of guys who made their own mower blades and either welded them poorly or jury rigged them to work and then got hurt or even killed by the shrapnel from a blade shattering. Just this video alone should give you pause: there’s a lot of energy under a mower deck.

So off I went to find a 12in long mower blade. The closest I could find was one that was 12.125in long, which leaves 0.375in between the blade tips when they rotate past each other instead of the 0.625in I had designed for. We’re about to find out how accurately the mower deck weldment was made. I really hope I don’t have to grind the ends of the blades down because they crash into each other.

Finding a blade is only half the battle. How do you attach it to the 0.5in diameter keyed shaft on the E30-400 motor? The crankshaft on most push mowers I’ve seen has a threaded hole in the shaft for bolting the blade on. The E30-400 has nothing of the sort.

Could you drill and tap a hole in the end of the shaft? Possibly. But a #10-24 threaded hole is about the biggest you could drill and tap, and that only gives you 0.083in of edge margin from the major diameter of the threads to the keyed portion of the shaft. Too close for comfort in my mind.

The first solution that I came up with was to take a piece of 1.5in long, 2in diameter round stock, bore a 0.5in hole in it, key the hole, and then drill and tap holes for mounting the blade and some set screw holes to clamp the key up against the shaft. But in this scenario, the set screws are the only thing that holds the blade on the shaft. Better than nothing, but not by much.

My first idea for a mower adapter: a machined piece of round stock. Expensive and heavy, not what you want in a blade adapter.


I got a few quotes on three of these parts and the keyway really kills you on cost. I got several no bids because of the keyway alone. And the quotes I did get back were pretty high. Because I don’t like spending $300 on blade adapters, it was back to the drawing board.

What I really need is something with a keyway already in it. Initially I looked into some keyed pulley bushings, but they too have no way to hold themselves on the shaft. That and they have to match your hole pattern on the blade, and none of them met that criteria. They’re cheap, which is nice, but don’t really work for this purpose.

Eventually I got turned onto the idea of using solid shaft couplings. They’re keyed and include set screws. But the outer diameter for most half inch couplings is 1.5in or larger. That leaves no clearance for the bolts to mount the mower blade, which are 1.625in apart.

A 0.5in ID X 1in OD solid shaft coupling with four set screws. McMaster has them for $16 apiece, but if you search on eBay you can find them closer to $6.

After some more digging, I found these smaller OD shaft couplings. And on top of their 1in outer diameter, they come with 2 pairs of set screws offset by 90°. Not bad! Take one of them and weld it to a plate with a hole pattern matching your mower blade, and you’ve got a custom mower blade adapter for ~$30 a piece after material and labor. The result looks like this:

the best option
The 1in OD shaft coupling welded to a plate. The cotter pin keeps the coupling on the shaft.

The nice thing about the plate is that you can get a lock nut on the back side. I’m less worried about things vibrating loose compared to the machined adapter where the bolts run straight into a threaded hole.

But even with four set screws clamping up against the shaft, you really need some positive retaining feature to make sure the blade stays on the shaft. To meet this design objective, I figured it’s best to keep things simple: drill a small hole perpendicular to the coupling and the motor shaft, and then run a small hairpin through it. You don’t need a big one to keep it on the shaft.

The hairpin will add a little bit of eccentricity, as will the set screws. How much? I guess we’ll find out soon. Once the parts get back from the shop I’ll post some graphs and pictures.