Archive for December, 2007


First Recumbent Electrification: Contributions (thanks!)

Sunday, December 30th, 2007

Many thanks to the people who are making this project possible:

  • Warren Winowich, who explained the forces acting upon a vehicle to me
  • Ben Krasnow, who built a lot of the original bike, debugged the circuit for the current bike in his shop, and contributes invaluable advice
  • Jim Fletcher, who took the time to show me how simple electric vehicles are
  • the knowledgeable folks on the endless-sphere forums, who have been building bikes while I’ve just been thinking about them
  • my other half, Sheila, who pushes me to get this done

First Recumbent Electrification: Cost and Conclusions

Sunday, December 30th, 2007

The bike getting some testing before the installation of the chain

Before coming to any conclusions, let’s review the cost of this project and its variations.

Cost (in money & time): Achieving a balance of expenses in currency and time is important, but it depends on your situation. Originally, I had more time than money. Now the balance is tipped the other way. Still, some activities are just not worth the effort unless you are truly poor.

Bicycle Prototype – Long Wheel Base

  • 1 x Cheap Mountain Bike – free, from college move out
  • 6 feet 1/8″ wall square tubing – $15
  • 1 x 20″ wheel – free (found in a scrap pile)
  • Exercise bicycle handlebars – free, found on trash day
  • Office chair – free (it was headed for the curb side trash pickup anyway)

Total cost: $15

Build time: about 16 hours

Add electric motor, etc, NO batteries (w/ shipping)

  • Kollmorgen 300W with integrated controller – $45 (electricscooterparts.com)
  • 80 tooth #25 sprocket – $15 (tnc scooters)
  • 15 tooth #25 sprocket – $12 (electricscooterparts.com)
  • Sprocket to bicycle freewheel adapter – $10 (http://tncscooters.com/product.php?sku=103210)
  • 120 links of #25 chain, heavy duty – $25 (electric scooter parts)
  • 150 links of #25 chain, heavy duty – $30 (electric scooter parts)
  • Magura twist throttle – $55 (electric scooter parts)
  • Nuts and bolts – $5 (Ace hardware)
  • Batteries (TBD)

Total cost: $197*

Build time: 13 hours. Mostly mounting the sprocket on the wheel and making the motor mounting plate. Note, I was not aware of the time that I could purchase an adapter from the sprocket to a bicycle rear wheel for roughly $10. With this, I would have saved about 5 hours of time. The motor mounting sucked up another three hours. Once you figure it out though, it should be easier to repeat.

Motor Controller

  • 6x MOSFETs – $4 each – $24
  • Atmel microcontroller – $3
  • AVRISP MkII – $38
  • 3x h-bridge drivers – $3 each – $9
  • other assorted pieces – $10

Total Cost: $46 + $38 (one time)

All parts from Digikey.

Oxy-Acetylene Welding Rig

  • Two regulators, torch, cutting attachment, #2 tip, acetylene tank, small cart – $60 (used)
  • Striker – $10
  • Tip cleaners – $5
  • Welding mask & gloves – $5 (garage sale)
  • 3 c-clamps – $5 (garage sale)
  • oxygen tank – $100 (used)
  • Cost to fill tanks – $70
  • 3 pounds mild steel welding rod – $12

Total cost: $267

All parts bought on Craigslist or Airgas supply

Other stuff

  • 250W geared DC motor -$45
  • Kollmorgen 300W with blown controller – $10
  • BMC 750W motor – $160
  • Other h-bridge driver chips – $12
  • SOIC to DIP converters – $10 and about 1 hour
  • Parallel to USB – $25
  • Two parallel AVR programmers – $20 and about 4 hours

Total cost: $282

Cost of this project so far: $833

Other Options

Just for comparison, the other option I considered at the beginning was to use a cheap hub motor. In that case, I would have saved hours of motor mounting time (this time is actually greater as I spent five of those hours working with Ben and we ended up having to use his mill– not a common garage tool by any means). Instead of paying $185 for the motor and accessories, I would have spent roughly $450 and gotten a kit. The questions I have to ask myself when evaluating that option are: Is ~$300 worth nine hours of time? Does the setup I have provide something that the hub motor cannot (weight, performance, gearing)?

As you can see, unless you have a fairly well stocked garage, you may be better off going with the hub motor from a cost/time perspective, unless your needs cannot be addressed by the hub motor (they can be quite heavy, for example).

Lessons Learned

3″x1.5″ square 1/8″ tubing makes for a very strong boom– and a very heavy one. The easiest way to save weight on the bike would have been to use 1/16″ wall tubing instead. It would have probably done the job just fine. When choosing tubing, you can use thick walled by small diameter tubing or large diameter tubing with a thin wall. You get different performance from each type. Larger diameter with a thinner wall is the way to go. It ends up being strong enough, plus, you can stuff electronics and other bits inside. That will keep people from walking off with them!

Tiller steering. It stinks. Since the bike has such a long wheel base, it’s not too bad, since the bike is often too long to make abrupt maneuvers. However, it causes more problems than ackward slow speed steering. The handlebars interfere with the riders legs once they get turned far enough. Cables headed to the back of the bike can’t be located on the handlebars. The routing doesn’t work. Running the cable to the head tube and then back would require an 180 degree turn that the cables just don’t like. That meant welding a bar to the boom to mount the shifters, and having no rear brake.

Each weld costs 30 minutes. Between the time jig the work pieces, get gloves and a mask on, grab some rod, and then clean up the weld, it really does seem to take about that long. Minimizing the number of welds is key to actually building a ridable bike (rather than one that sits half finished in the corner).

No.25 chain is finicky. Even a misalignment along the plane of the sprocket by one chain width caused problems. The motor mounting thus needs a side to side adjustment more than it needs lots of tensioning adjustment. Bolting the mounting at the bottom with two bolts and then having one bolt on top with a lock washer for tensioning worked really well.

Brakes are a pain. Calipers are OK– mostly, they just need the cable to be adjusted correctly. V-Brakes need to aligned in two different axes and then the cable has to be right too.

18 degrees head tube angle (from vertical). I’ve tried going to the extremes in both directions, and bad things happen. In either direction, the steering gets very sensitive and twitchy. With a greater angle, you can fix it by adding an offset to the wheel, but the amount can easily get a little ridiculous.

Cable steering is too complicated for a bicycle. And when it fails at speed, it’s not fun.

Conclusions

It hasn’t quite sunk in that I finished this bike. I thought about it for several months before I even took the project on; and then over the next few years worked on it sporadically. A major part of the problem was a lack of tools, so I spent a lot of time and money fixing that problem. Of course as I worked on that, the bike wasn’t getting worked on, so it felt like a never ending project. Once I had what I needed most (cordless drill, dremel, sawzall and oxyacetylene) all it took to finish was a reasonable deadline. I had to work hard on the bike the last few days, but I finally got most of it finished. It only took a few more hours of mucking with the chain alignment and readjusting the brakes to make it ridable.

Let’s see, I started sometime around January ‘03 and finished the second week of December ‘07. Well, only about 5 years :) Mind you, I did ride the recumbent bicycle a good deal without electric power!

One other consideration: When I started this project I had very little money. I like to avoid waste too. This worked out well with the speaker project I did. Let’s see how it stacks up for the electric bicycle. I have seen lots of builds on the internet that require chopping up multiple bikes and using a limited amount of pieces from each. I really do not like this approach. If we’re making one bike, we should only have to chop up one bike. Any piece that can be reused without too great an effort should be reused. Some people throw things out left and right just because they are easy to replace– I don’t.

Number of donor bikes: 2. This was only because we messed up the front end when welding and rewelding to get the right head tube angle. Remove the bearings before applying heat!

Brakes: fine to reuse the pads. They get a little stiff but work.

Cables: toss the old ones. You can buy a box of them for $7 at Walmart. When the cable rusts up, it’s difficult to get it back in the sheath even after cleaning it.

Chain: unless its really rusty, this isn’t too difficult to revive. I’ve even revived a totally frozen chain by soaking it in WD40 and then working the links with two pliers during my college days.

Seat: a chair destined for the dumpster. Works well!

Handlebars: Also destined for the land fill. One more thing that didn’t get thrown away…

Well, not bad. Time for the next bike!

First Recumbent Electrification: Putting it Together

Sunday, December 30th, 2007

Putting the electric bits on required the following steps:

  • Mount 80 tooth sprocket on 20″ rear wheel (which is actually on the front of the bike). Get a freewheel adapter and this is a 10 minute job. Look on Youtube for how to remove the sprockets on the wheel. Without a freewheel adapter you are looking at some machining time.
  • Create a mount for the motor. The hole needed by the motor seems to be standardized. The motors are mounted using three bolts. I used 1/4″ bolts. Watch that your motor bolts don’t interfere with the chain. You will need a right angle piece of steel at least 1/8″ thick. This must be attached to the bike at three points or it will not hold still when changing the speed of the motor. I used a flat piece of steel across the forks above the wheel held by two bolts. I took my 90 degree angle steel and put one hole through the steel so that the bolt passed through the steel, into the hole where the old caliper brakes used to be attached. The second hole I drilled used one of the bolts for the flat piece of steel I had already attached. The third hole was located in between the forks. I englarged the holes vertically so I could adjust the tension; but actually it turned out to be more important to get the alignment horizontally adjustable, and I ended up using a dremel to make one inch, horizontal slots. To set the tension, I put the lower two bolts on, mounted the chain, then threaded the top bolt (that used the caliper hole) with some washer to set the tension.
  • Replace hand grips or otherwise add a throttle. You can remove the old grips by shoving a screw driver under them, then pouring soapy water in. Then just work them off. Likewise, put a little bit of soap in the new hand grips and they will go on easily. When the soap dries the hand grips will stay in place.
  • Add a battery holder. Uprights often use a luggage rack with saddle bags or ziptied or bungee chorded battery boxes. I welded a metal box to the bottom of my bike, taking care not to interfere with the chain path or my legs.
  • Add wires. I used lamp cord.

Voila, that was all it took. Soldering and other wiring only took about half an hour. The motor mounting was troublesome; but my battery box was the most consuming part of the project. I welded the box out of pieces of steel, and then welded it in place upside down, nearly setting the seat on fire and melting some of my Delron ‘idler’ block. So, please, just find an appropriate box and bolt it on.

The motor mounting was a pain, but luckily using 3 bolts with only the bar at the bottom fixed allowed me to tension the chain without extra work

First Recumbent Electrification: The Controller

Sunday, December 30th, 2007

So you’re looking at a stock Crystallyte controller. It’s $150. You’ve heard they blow their FETs easily. So, you think, “I can build one better.”

Maybe not, but I thought so. I thought I might be able to pull it off cheaper. If not, at least it would be worth the experience.

Well six months later I’m not quite done and I can tell you that it might be better, it was definitely not cheaper, and the jury is out on the experience :) I am still currently working out the bugs in the controller. The parts did indeed cost less than the controllers out there; but the trial and error of assembling it meant spending more. If you’re only going to build one or two, it’s not cost effective. It takes unusual requirements or volume to make it worth the effort.

Getting Started

The general idea is to use the Pulse Width Modulation features of a microcontroller to drive six MOSFETs attached to a brushless DC motor. This is the most practically efficient set up.

There is a wealth of information on the internet about using PWM to control motors. Just start Googling; you’ll find some simple explanations.

Since I have familiarity with the Atmel microcontrollers, I went with those. Atmel has several application notes for motor control that include code that makes getting started easy. I recommend AVR447, as this uses the cheap and commonly available ATMEGA88 and 168 (the note says it works on the ATMEGA48 too, but I could never load the included code into the small program space of that chip). Also, the notes are superior to some of the other examples. Unfortunately the source is written for an expensive commercial compiler; but editing it to work with AVR GCC is not too difficult. The greatest problem is in changing the syntax for storing arrays in flash memory into the format expected by AVR GCC, then using pgm_read_byte to read from flash memory (the commercial compiler is smart enough to automatically do the read for you). Also, the ISR names differ. I’d post the code here, but I’m not sure of the licensing.

AVR447 is based on using the Atmel motor control evaluation board. Since I haven’t got one, and anyway, it is built to drive a small fan motor, it would not work for us anyway. So we are on our own there.

But there are a lot of schematics you can find on Google too. Just search for “H bridge schematic.” An H bridge uses two MOSFETs linked end to end. The motor connects in between the two MOSFETs. One MOSFET is connected to supply positive, the other to ground. Control circuitry alternates which of the two is on. This alternation creates a wave that makes the motor spin. Many of the H bridge schematics use circuits with high parts counts. The easiest way to go is to find one that uses an integrated high/low side driver. International Rectifier makes a slew of these. Look for IRF2101 for example. You can substitute other chips, just make sure the logic input level matches your chip. On the supply side, all the chips seem to be rated up to 200V or 600V, so that should not be a problem. The only other differentiation among these chips that I can see is that some have inverting inputs. You can use these, but then your software must be written for it.

Here is a list of IRF hi/lo side driver parts: http://www.digchip.com/datasheets/parts/ir/parts_ir02.php

Get DIP package ICs if you can. These converters from SOIC to DIP cost $5 each. I clicked on the wrong item at Digikey…

First Recumbent Electrification: Batteries

Sunday, December 30th, 2007

You can really go off the deep end trying to investigate batteries. There are many choices, but they are often limited in many ways, so that making the ‘right’ decision is confusing. There are several popular routes for electric bikes.

Note: adding batteries in ’series’, meaning, connect the + of one battery to the – of another, then use the two unconnected terminals, adds their voltages. Connecting batteries in parallel adds their capacity together. This means connect the – terminals of each battery together and the + terminals, same as jump starting a car.

Discharge rate is how fast a battery is being discharged. This is usually written as a multiplier of ‘C’, the battery’s capacity. So if a 7 Amp hour battery is being discharged at 2C, then 14 Amps is being drawn from the battery.

Cycle life is how many times a battery can be discharged and then charged again.

Calendar life is how fast the batteries degrade over time, regardless of usage.

Life is usually rated in how many cycles or years it takes to drop to 80% of rated capacity.

Capacity is usually rated at the “C20” rate, or how much capacity is available if the battery is discharged over 20 hours. For vehicle applications, this means the rated capacity is usually optimistic, as the batteries get drained much faster. This is explained later in this document.

Depth of discharge or DOD is how much of a battery’s capacity is used before charging. Cycle life tends to drop really quickly after roughly 50% discharge. The Toyota Prius discharges its pack down to something like 40% to increase it’s life.

Here’s a quick rule: as of the summer of 2008, reasonably priced batteries cost $1 per watt-hour for about 700 cycles. I’ll explain this later in the document too.

Lets move on to battery types.

Lead Acid

Sealed Lead Acid batteries (SLA) are lead acid batteries that are sized about the same as motorcycle batteries. They are used in uninterruptable power supplies. They will not spill acid if turned upside down. Instead of being filled with liquid like a car battery, they are usually filled with gel. 12 Volt, 7.5Ah batteries can be had for $16-$20 from Mouser.com and some other sources. Four batteries will power a bicycle. However, they weigh about 20-30 pounds. They are easy to charge (just apply about 14 volts). If you connect the batteries to each other using connectors rather than permanently soldering them together, you can just use a car battery charger to charge each set of parallel cells. Normal car batteries have very poor cycle life and should not be used. Plus they are super heavy. You need deep cycle batteries.

Pros

  • Cheap (~$0.35 cents per Watt-hour)
  • Easy to create a battery pack and charge it

Cons

  • really heavy
  • cannot support high discharge rates (max is about 4C), so you need to carry more Amp hours of batteries to deal with acceleration and the extra weight
  • low cycle life (100-300 cycles)

Thoughts: appropriate for vehicles that are going to be heavy anyway or for those who want very low initial cost.

Nickel Metal Hydride

Nickel Metal Hydride rechargeable batteries are used in digital cameras and many other consumer goods. 1.2v 2.6Ah Sub C (slightly smaller than C cell) can be purchased for about $3 each. It takes about 30 of these cells to equal one 7.5Ah SLA battery. However, thanks to the weight savings and higher discharge rates that are possible, you won’t need as much spare capacity.

Pros

  • Much better performance than lead acid batteries
  • Light weight
  • Sub-Cs have high discharge rates (10C-20C)
  • Safe
  • Proven – NiMH cells have powered cars and consumer products for years and they keep on working. Hard to argue with that.

Cons

  • Charging in parallel is almost impossible. Each series string must be charged separately
  • Building the pack means connecting lots of small batteries together.
  • Costs just about as much as lithium, which has better performance

Thoughts: if you want rock solid reliability, probably your best choice. But you’ve got to deal with the packaging headaches.

Lithium Ion Cobalt

Lithium ion batteries are mostly used in laptops, but are also popular for newer RC vehicles. They’re also making it into some next generation hybrid cars. The nice thing about lithium ion cobalt cells is that they are usually rated for around 3.6v– so even though each cell costs between $5 and $10, you only need 1/3 as many as with NiMH to get the same voltage. Capacities are comparable with NiMH. Additionally, Lithium ion batteries allow much higher discharge rates.

Pros

  • high energy density (3.6+v per cell)
  • high discharge rates
  • light weight

Cons

  • melting laptop batteries anyone?
  • Older cells have a calendar life of 3 years or so
  • Cycle life is OK compared to NiMH (700-1400 cycles)
  • Expensive up front
  • Lithium ion cobalt cells are very sensitive to the conditions under which they are used. Their capacity drops with time. Additionally, if they are abused, the cells will turn into a resistor, heating up with use until they rupture. “Battery management” is required to monitor that the batteries won’t suddenly die. Charging is also more complicated.

Thoughts: unless you get a good deal on these, you might as well go with LiMn or LiFePO4.

Lithium Ion Manganese

Used in many power tool packs. Not as good as A123’s Lithium Iron Phosphate batteries performance wise.

Pros

  • Relatively stable – not as good as A123s, but pretty good
  • reasonable life – about 700 cycles
  • high energy density (3.2v/cell)
  • high discharge rate
  • light weight
  • much more reasonably priced than the A123s (about half the cost up front)
  • If you use the stock power tool chargers you won’t void the warranty on the batteries

Cons

  • still expensive up front
  • The best source is power tool battery packs, and you have to find them and then rip them apart, which is time consuming, or buy connector blocks if you want to maintain the warranty (which also means charging each pack separately, which can get annoying)

Thoughts: Good compromise choice. If Makita and Milwaukee have gone with these, they’re aren’t crap, but the new generation of tool packs is only a few years old, so we’ll see.

Lithium Iron Phosphate

The A123 LiFePo batteries are making quite a big splash. They are expensive when purchased alone, but can be obtained by buying DeWalt 36v power tool battery packs or Ping Battery packs on eBay.

Pros

  • Stable – they won’t catch on fire and they’re tolerant of abuse (eletrical and mechanical)
  • Long life – A123 claims 1000+ cycles
  • high energy density (3.2v/cell)
  • very high discharge rate
  • light weight

Cons

  • expensive up front
  • 3.2v is less than 3.7v– so you need more batteries to get the same voltage
  • The best source is DeWalt battery packs, and you have to find them and then rip them apart, which is time consuming

Thoughts: If you are after high performance and reliability, go with the A123s.

Other Lithium Ion Chemistries

There are quite a few other chemistries in existance. Use Wikipedia for more informatiom.

Lithium Polymer

These batteries are used mostly in RC airplanes and helicopters because they have very high energy density and discharge rates and are very expensive. If you have the money, you could power a bike with these.

Pros: the best performance you can get

Cons: can catch on fire with abuse. Very expensive!

First Recumbent Electrification: Chains and Sprockets

Sunday, December 30th, 2007

There are a number of different chain sizes. The most popular for scooter and electric bikes are no. 25 and no.35. Small sprockets come with a D-shaft or a shaft with set screws. For set screws, drill a small hole in the motor shaft for permanent mounting, then secure with green or blue loctite. For a d-shaft hole, you must secure the sprocket with a nut and washer, otherwise it will just slide off the motor shaft.

No. 25 chain

Cost per foot: about $8 or $9

Cost of a small sprocket: $12-$20

Cost of a large sprocket: $20-$35

Small sprockets range from 11 to 25 teeth and have shaft sizes of 8mm, 1/2″, 3/8″.

This chain is really ‘compact.’ It isn’t as strong as #35 but heavy duty #25 will do for relatively low powered scooters and bikes. I’m not too crazy about this chain. I abused my chain during testing and it ended up being less than straight.

No. 35 chain

Cost per foot: about $2

Cost of a small sprocket: $8 (McMaster)

Cost of a large sprocket: $18 (McMaster)

Popular on go karts. The sprockets cost about the same (with comparable number of teeth, you can purchase sprockets with far more teeth than No.25), though the chain costs a lot less. I’d go with this chain for the next project.

Single Speed Bicycle Chain

This is wider than chain for multispeed bikes. 1/2″x1/8″

Derailleur Bicycle Chain

3/32″ wide

Here are some pictures of the No.25 chain on this electric bicycle.

This is the more common type of rear wheel, where the gear set screws on. BMX style wheels have a cassette instead (search Youtube for instructions).

The No.25 80 tooth sprocket mounted on a 20″ rear wheel (on the front of the bike)

Same wheel as the previous picture, but viewed from the other side

A no.25 masterlink

First Recumbent Electrification: Motors

Sunday, December 30th, 2007

Choosing a Motor

Motor Types

There are a number of motor technologies available. Different authorities classify them differently, but I will break them up based on their input:

  1. Motors where speed is regulated by voltage or current – DC series, DC shunt wound, DC compound wound, etc
  2. Motors where speed is regulated by the frequency of the applied voltage or current wave – Brushless DC (BLDC), AC induction

Motors in category #1 are far easier to control. A basic DC series motor can be hooked straight up to a battery and will just work. It has two legs to attach your wires. You can vary the speed of the motor by placing a resister between one of the legs and your battery. If you want fine speed control, use a potentiometer. The problem with this approach is that you lose energy in the resistor. In fact, you can lose quite a lot. To make up for this, you need more batteries. And batteries are the most expensive part of the whole vehicle.

The specific characteristics of motors in category #1 vary based on the type. Some are better than others, and are differentiated not only by type, but by whoever makes them. They’re cheap and easy to find though. But, I am an engineer and can deal with the hassle of more complexity. So I won’t be using one of these motors.

Motors in category #2 have historically suffered from one major problem: it’s not easy to vary the frequency of the power being inputted. The power company puts 50Hz or 60Hz alternating current through the power lines. So most appliances use what are called single phase AC motors. They are designed to work at one or both of these frequencies. For a washing machine or an electric razor, that’s just fine.

Using analog components, its difficult to get the sort of speed control you’d want. You can chop the frequency in half, or double it, or quarter it, or whatever, but you still have a very finite amount of speed settings available.

Controlling Frequency

The solution is to use electronics to output a waveform. Then the speed settings are limited by the electronics. With todays microcontrollers, you can still run into problems with the barebones microcontrollers, but a few bucks will get your more than enough.

There is one other problem. Digital electronics output either 1 or 0. On or off. How can you approximate a wave? The technique is called PWM, Pulse Width Modulation.

All this does is switch between on and off states very quickly to generate an ‘average’ voltage somewhere in between off and on. By varying the duty cycle of the on time, the average voltage can approximate a wave. The duty cycle is, for a given time period, what percentage of that time is the device in the ‘on’ state? Think about the average voltage over a time period. If my device outputs 5 volts, and the duty cycle is 50%, then half the time the voltage is 5v, the other half of the time it is 0v. The average is 2.5v. Ah? See? Recording the output of a trigonometric function like sine for many valueswill give us the values of voltage for a wave. We can then figure out what the duty cycle should be for each of these values. If you graph the average voltage… it looks like a wave!

To do this effectively, your microcontroller (and any circuitry after it) have to be able to turn on and off really fast.

Imagine if you wanted your bedroom light to be half as bright as it is. You stand for 10 seconds, leaving the light on for 5 seconds, then off for 5 seconds. That would not really be half as bright. What if you flipped the switch every second? You would still notice the difference. If you did it as fast as possible, you’d notice it sort of works.

Well the microcontroller can flip that switch a lot faster than you can. You can probably notice fluorescent lighting at 60hz flickering. With a microcontroller running at 16 million hertz, even if you flip the switch at ‘only’ 1000hz no human being will notice the difference.

This is actually how light dimmers work.

The same effect applies to motors. If you flip the switch on and off slowly, the motor will jerk and the ride on your vehicle will be quite unpleasant. But do it fast enough and you won’t notice.

The circuitry that handles the big amounts of power your motor needs– versus a microcontroller, which can run off a couple of AA batteries is also important. It uses MOSFETs to make efficient motor control possible. Transistors are like switches. The trouble is that before about the 1980s, you had to use a sizeable fraction of the energy you wanted to switch to actually “flip the switch.” Imagine needing a hammer to turn your lights on. MOSFETs relieve us of this necessity. One side effect of the on and off switching is that it might make noise. The switching frequency is limited by how fast the circuitry can go. Remember 20,000Hz is the limit of human hearing). This is part of the reason why a slow moving electric vehicle makes a slight whining noise.

Getting back to motors. There is one other hang up. Single phase AC motors have problems even when controlled with PWM. It’s a matter of the way they are built. There’s a limit to how much you can speed them up or down, and its not very much. The single phase means that they get one “push” each time the motor goes around, so the timing is critical. Imagine riding a bicycle, but you are only allowed to step on the pedals once every time they come around. Thats the single phase part. This makes accurate speed control difficult.

Luckily there are 3 phase motors which take away this limitation. Brushless DC motors and 3 phase AC induction motors fall in this category.

Brushless DC motors, if you look on wikipedia, are about as efficient as AC induction motors. AC motors are actually a bit harder to control than BLDC for more detailed reasons I won’t go into.

Sourcing Motors

Theoretically, you could choose either one. But practically, you can’t. Why?

I can’t find 3 phase AC motors that use less than 120 volts, and these are very rare. And even then, they’re beasts. Way bigger than this bike can handle. It’s because the power company only delivers 3 phase AC to industrial locations. So they get used for things that industry needs.

While a 220V 20 something horsepower motor might be exciting, it would weigh as much as the rest of the bike and tear our tiny tires and bicycle chains to pieces if you ever opened up the throttle. They’re just not practical, though they would work for a car!.

So we’re left with brushless DC motors. Unfortunately, these are mostly used in small cooling fans and for RC airplanes. These motors have power ratings that fall. I suppose it’d be possible to use multiple motors… but it would take a lot of motors designed to fly 1 pound airplanes to push a 200+ lb bike and rider.

Luckily the scooter craze has produced some motors totally suitable for bicycle use.

Scooter Motors

The original scooters used series DC motors. The trouble is a scooter can carry even fewer batteries than the bike can. The lack of efficiency is an even bigger problem. I suppose that is probably why people make BLDC scooter motors. In any case, there are a few manufacturers of scooter motors:

  • Kollmorgen
  • BMC
  • Some Chinese companies
  • I forget the others, sorry

Apparently Kollmorgen has stopped making motors for the meantime, so we’re left with just BMC and the Chinese motors, though it’s still possible to find Kollmorgens for sale. Now it comes down to finding suppliers. I couldn’t find distributors for the Chinese motors. That leaves BMC motors. These are carried by

  • PowerPack motors
  • EVdeals
  • One more site I forget now that was too expensive :)

Powerpack had the lowest price so I bought a motor from them. It was labeled as in stock, but took a few weeks to get to me. Looks very beefy though!

Hub Motors

Back when I started this project, there were a couple of exorbitantly priced hub motors available. The variety expanded, though the price stayed high.

Then came the Chinese motors.

You can buy a big name hub motor from ebikes.ca like an X5 or a Puma or a lower wattage 4xx series. It will cost you $300+. Or you can go to goldenmotor.com and buy a 500 Watt hub motor with all the electronics for $145 (since I wrote this, it’s actually gone up to ~$350). Hmm. With a price jump that big, I’d think the Chinese motor is worth a shot. It turns out the golden motor hub kit has really awful QA, and is not worth purchasing. The motor alone may be acceptable, though it is very heavy.

Hub motors come in two flavors: with gearing and without. Geared motors are more expensive. In addition, one brand has a built in torque sensor that, when used with a compatible controller, will ‘help’ a rider pedal rather than using a throttle. I think this is really slick but some people hate it.

The reasons I didn’t buy a hub motor are: 1) they are very heavy 2) they cost more than a stand alone motor 3) limited gearing options (though this is a good thing if you want simplicity). At the time I started, GoldenMotor also only sold front wheel drive hub motors. This is a problem if you can’t find a hub motor of the right size. My front wheel is 18″ and I couldn’t find 18″ wheels. Even 20″ was hard. I definitely cannot go larger than that. Hub motors are made for upright bicycles, not my recumbent with the tiny wheel in the front.

Hub motors are classified with a number, like:

  • 4081, or
  • 405

This number actuallys splits in two: the 40 in 405 is the magnet width in millimeters and the 5 is the number of turns in the copper windings. Increasing the number of windings increases motor efficiency, but reduces its maximum speed.

If you know your wheel size and can decide on the maximum speed you want to go, you can then select a hub motor to fit the requirements.

DC Motors

I did end up buying a DC motor for another project. So I might as well explain those a bit (and actually, as of Fall 2008, I much prefer these to the tempermental BLDC motors with their flakey hall sensors and wires). Most of the DC scooter motors are 24v. There are some 36v motors. Unite seems to be the most popular or well regarded brand. They manufacture the MYxxxx series motors. Some of the DC motors have some really serious output– like 1500Watts (the legal limit in California is 750W). Some DC motors also come with internal gear reduction, which is really handy. The Unite motor I purchased came with a 9:1 gear reducer that made attaching it to a bicycle easier (unfortunately it used a 1/8″ bike chain sprocket I had to grind down to 3/32″).

Kollmorgen motor with a sprocket attached

The innards of the Kollmorgen – the Koll’s controller will inevitably die and you will either have to trash it or open it up to connect an external controller

Here’s what the innards are connected to. Note that some people have the hall wires in the order UVW+- rather than the strange VUW+- I have

First Recumbent Electrification: Planning

Sunday, December 30th, 2007

Now that we understand the pieces we can buy to assemble the whole system, lets evaluate some possible routes.

We have two types of motors to choose from:

  • motor integrated into a wheel hub
  • stand alone motor, connected to a wheel by a chain

Hub motors are more expensive and heavy and give us less control over gearing, but they don’t need a transmission. The added cost might justify the added simplicity. Me? I’m cheap. So bring on the cheap motors.

Just a Motor

A stand alone motor needs to attach to a wheel somehow. The first problem is that they generally spin at 3 to 4 thousand RPM. One mile is 2437 revolutions of a 26″ wheel. So to go about 30 miles an hour, or half a mile, we need to spin at about 1220 rpm. This is almost a 4:1 reduction, which is about the maximum that normal bicycle sprockets will let us accomplish. Typical motor sprockets have about 11 teeth. Then our wheel sprocket needs almost 4 times as many teeth, or 44. Look at the table below; the largest rear sprocket I have is 36 teeth. Ok, well, this bike will go a bit faster than 30mph if the motor has enough power at those RPM.

Below is the number of teeth on three bikes I own:

Ratios
Front Rear Largest Front/Smallest rear Smallest front, largest rear
Burning Man 28t – 48t 14t – 28t 3.4:1 1:1
Recumbent 36t – 50t 14t – 28t 3.5:1 1.29:1
Miyata Road 40t – 52t 13t – 36t 3.8:1 1.11:1

Next problem. We can attach the motor to the rear wheel, but the cranks a bicycle rider pedals are also connected to the wheel. Hmm. We can get a double sided hub, but this is expensive. We can dedicate one sprocket on the rear to the electric motor also. When the rider doesn’t pedal, the cranks will freewheel.

We could also attach the motor to the sprockets on the cranks, but actually this is a problem. It would be better, because then you can have the motor assist your pedaling, which I find superior to using a throttle (but this is a matter of taste). However, a human pedals at up to 200rpm. So, to even be humanly possible, we need to reduce the speed by almost 20 times. Normal gears do not allow this. We must use a $150 planetary gear reducer or some concotion of multiple gears.

Finally, my original idea was just to use front wheel driver. Spread the forks a little and put a sprocket on the front wheel. This allegedly performs worse on wet roads; but it’s cheap and easy. Motor mounting may be a problem though, since the front of the bike is using for steering!

So front wheel drive is how I’m going to do this, unless I’m going to rig up a rear sprocket somehow without a double sided hub.

Serial Hybrid

One other idea that no one seems to think highly of is the series hybrid bicycle. This would have the rider pedal a generator which supplies power to the motor and batteries. The benefits are no chain to rust and wear out and an always optimal pedaling cadence. The down side is that generators are not efficient. Bicycling Science, 3rd Edition has a short section on replacing the chain in bicycles. The book cover several “chainless” ideas: hydraulics, ratchet and cable, steel “tape” with holes, and the serial hybrid, and some other technologies . As the book points out, drawing a diagram with efficiencies of each component, the efficiency of the serial hybrid (50-80% by their reckoning) is not as good as a well designed and maintained bike, but, if well designed itself, does exceed the average rusty crap bike on the street.

IHPVA’s site lists the serial hybrid bicycle as one of the top 10 bad HPV ideas, citing that it can’t possibly approach the efficiency of a chain drive. But the IHPVA people are interested in going really really fast. I’m interested in not having to pedal very hard. So I’m going to investigate this and report back. Several people on the Endless-Sphere forums were kind enough to help me find cheap motors to use as generators. At a cost of roughly $70, I’m going to evaluate two approaches: a geared 250W series DC motor, and a 300W BLDC Kollmorgen with bridge rectifier.

Bicycling Science brings up one more important point: that the efficiency of a good serial hybrid exceeds a crap bike may or may not justify the system; the authors note that additional requirements can make the system more attractive. Examples include recumbents where the chain can be a problem, small folding bikes where the chain can’t fold, limiting portability, or where pedaling cadence can only fall into a small range (perhaps a person with an injury or disability or a strange build).

I would like to point out that you can save on SOME costs if you assemble from scratch. You only need one sprocket on the pedals, rather than three, which is cheaper. You also don’t need as many gears, or maybe any at all, on the rear. If you go with a hub motor as the only propulsion, you don’t need sprockets or a derailleur at all– which, besides the frame, add the most cost to a bike.

So I’ll see if I can work some of these other ideas into the bike to make this idea work.

First Recumbent Electrification: Theory

Sunday, December 30th, 2007

Lets design an electric bicycle.

Our bicycle will have a number of components:

  • the bike
  • an electric motor, linked to the wheels somehow
  • battery pack to provide power
  • motor controller to regulate how much power goes to the motor
  • Charger

Where do we start? We will start by calculating how much energy is needed to propel the bicycle. From there, we will know how much power we need to feed our motor. This will define requirements for our battery pack, which will help us design a battery pack. Because battery cell voltages and sizes are fairly standard, we’ll find that certain voltage motors will decrease the number of batteries we need. They will work better with our battery pack (this makes choosing the motor easier!). Our controller can then be chosen. We need to find one that can link our battery pack to the motor. With all this put together, choosing a charger mostly involves finding a suitably sized quality charger on the market.

Power Required to Propel Our Vehicle

The Power Output (Po) required by our vehicle is made up of four componenets:

  • Power to overcome aerodynamic drag
  • Power to overcome road drag
  • Power to overcome inertia (when accelerating)
  • Power to overcome gravity (when going uphill)

Go read this link, because it covers each part of the equation: link. I really like that page because it actually says what each term means! Can you believe it? If this revolutionary idea made its way into textbooks, maybe people would enjoy science, rather than feeling left behind… but anyway… Here’s another link that’s more theoretical but has a useful picture, and the beginning of this explains power and torque.

Note that the v3 term in the aerodynamic part of the equation grows much faster than any other term as velocity increases. This is why it is so important to have an aerodynamic vehicle. There are two main parts to the drag portion of the formula– coefficient of drag, which describes how aerodynamic the surface of our vehicle is, and frontal area. A Hummer, which has a drag coefficient half as great as a brick wall and a frontal area larger than most other cars, will get terrible mileage because at higher speeds it needs to output a lot of energy to overcome aerodynamic drag (at low speeds, it is heavy and the inertial term is large!). Compare the hummer to a jet airplane to understand the coefficient of drag. The jet is sleek and has nothing jutting out abruptly. Everything is smooth.

Now realize that we will actually need to input more power into this system. Why? Because we lose some energy in the drivetrain, some in the controller, and mostly, a chunk in motor efficiency. A survey of motor data sheets shows that motor efficiency falls between 70% and ~95%, with DC brushed motors being least efficient, brushless DC motors slightly more efficient, and 3 phase AC motors most efficient, though this is a vast simplification (small AC motors can be as inefficient as brushed DC motors). Controllers are roughly ~95% efficient, losing some energy as heat in the transistors that deliver power from the batteries to the motor. Drivetrains vary greatly. A simple chain drive is 98% efficient when clean and well maintained (Bicycle Science, 3rd ed, and one other source available online), whereas an automobile automatic transmission, because it has so many moving parts, can be quite a bit less. There are many other classifications of motors and some other technologies, but they are out of the scope of this work.

Batteries

Now with that worked out, lets talk about batteries.

Let me cover a little theory about batteries first. Batteries store energy. They are rated by their voltage (in volts) and capacity (in amp hours). Motor power is rated in watts, which is Volts x Amps. Note that the motor rating has no time component- there are no volt hours or amp hours in the equation. If you have a 12 volt battery that is rated at 10 Amp hours, it stores 120 Watt hours of energy. Hypothetically we could use 120 Watts of power from this battery for one hour, or 60 watts for two hours. It’s actually not this simple, but I’ll cover that later.

Now, you will probably be unable to find one battery that has both the right voltage and capacity to meet the needs of the vehicle. Luckily, we can link batteries together in two different configurations: series and parallel.

In a series connection, the negative terminal of one battery is connected to the positive terminal of another. The bike motor is then attached to the remaining terminals. In series, voltage adds. Two 12v 10ah batteries become a 24v 10ah battery.

In a parallel connection, the positive terminals are linked together and the negative terminals are linked together. The bike motor can be attached to either battery. In parallel, the capacity adds. Two 12v 10ah batteries become a 12v 20ah battery.

There is a short hand notation for the series-parallel arrangement. A 2p2s pack has 2 sets of batteries in parallel. Each set of batteries is made up of two cells in series. Some people write the shorthand backwards, i.e, 2s2p.

There are a number of battery chemistries out there, but Lead Acid, NiMH and NiCd, and Lithium Ion are the most popular. Lithium Ion describes several similar chemistries. For example there are lithium iron and lithium cobalt chemistries.

Lead acid batteries are used in today’s cars to start batteries, but they are heavy and do not store much energy. They also do not have long shelf life (how long they can be stored before they won’t charge) and cycle lives (the number of times they can be charged and discharged before they wont charge to more than than some percentage of their original capacity). They are, however, relatively cheap. You can find 6 volt, 12 volt, and 24 volt batteries at automotive stores.

NiMH batteries were used in production electric vehicles in the 90s. They have long life spans if not discharged too quickly or too ‘deeply.’ They are more expensive than lead acid batteries, and very expensive except in small sizes (like AA cells, C cells, etc) for numerous reasons, including a patent on ‘large format’ batteries. This means you have to link many batteries in series and parallel to get the desired voltage and capacity. The one difficulty there is that NiMH batteries don’t charge well in parallel. It works, but they need to be balanced periodically. This might be more effort than some people are willing to take.

Nickel Cadmium batteries are used in power tools and watches. They are similar to Nickel Metal Hydride batteries, but contain toxic cadmium. They’re getting a little harder to find these days, so the price for a cell varies widely.

Lithium Ion cells are even more expensive than NiMH, but a cell comparable to a AA NiMH has 3x the voltage of a NiMH cell. I will explain why this is important later. Lithium Ion cells suffer from one other problem– like lead acid cells, they degrade over time. The degredation depends on how hard the cells are used and the environmental conditions under which they are stored and used. Heat is bad, and laptop cells lose about 20% of their capacity per year. Tesla Motor’s water cooled Lithium Ion battery pack is projected to lose 30% capacity over five years. A lithium ion pack needs to be sized appropriately to account for this loss of capacity. Lithium Ion cells hold a lot of promise because of their widespread use in electronics. Many industries would greatly appreciate better lithium ion batteries. Oh, and they charge in parallel just fine. One additional note: the cases of ‘exploding’ lithium cells has to do with ‘abuse’ of the cells. When a battery starts failing, it becomes less a source of energy than a resistor. A resistor with current flowing through it heats up. Lithium cells generally do not like heat, it’s one of those environmental factors that decreases their life span. So when one possibly flakey cell starts to go bad, and a battery pack has no safety measures to shut down if excessively heated, that cell heats up, which heats up the other cells around it, which start to fail too, until a cell gets so hot that it ruptures. Simply adding a thermal cutoff prevents this situation from escalating.

Now that we’ve covered all that, let’s get onto the one nasty detail. Discharge current is measured in amps. Discharge rate is measured as a multiplier of the battery capacity (a number followed by the letter ‘C’). What does that mean? The 10ah battery from above, if discharged at 10 amps, is being discharged at a 1C rate. If it’s being discharged at 20 amps, then the discharge rate is 2C. This also applies for charging. A battery can be charged at 0.5C rate, or 2C, whatever.

Supposedly, an ideal 10 amp hour battery should also be able to provide 1 amp of current for 10 hours, or 10 amps for 1 hour. No. hours x Amps = Capacity then, right? But this is actually an approximation. Real life batteries are not ideal, and their useful capacity decreases with increasing discharge rate.

A German scientist named Peukert in the late 19th century devised an equation to express the actual capacity of a battery based on the discharge rate. You can read about it on Wikipedia. There’s a Peukert number for batteries. This number is an exponent in Peukert’s equation and it describes how far batteries deviate from this ideal when discharged. Go ahead and look up the data sheet for a NiMH AA cell. The manufacturer will state the capacity, and then an ‘apparent’ capacity when discharged at a certain rate. This apparent capacity is always lower. What this means is that when you work your batteries hard, they will discharge faster than you’d think. To minimize this problem, you can add more capacity to the system, use batteries that have a better Peukert number, or increase the voltage of the system. The latter works because remember power = voltage x current. If you keep the power requirement the same but raise the voltage, the amount of current you need drops– so for the same battery, the discharge rate is lower.

Lead acid batteries perform very poorly when discharged quickly. NiMH and NiCd allow higher discharge rates, but they are still not too great. Lithium Ion cells have the best Peukert number and can endure very high discharge rates. Expensive lithium polymer cells do even better.

The consequence of all this is that to make lead acid battery packs, you have to build in a lot of spare capacity. Since the cells are so heavy, this adds additional weight, which requires additional power to move, which means you need more power from the batteries, which means more batteries… the problem escalates.

NiMH and Lithium Ion cells are considerably lighter. Lithium ion cells, however, have almost 3x as much voltage per cell as NiMH. This means you need less of them overall if you build the pack right. However, they also cost more than 3x as much as NiMH cells.

To figure out which batteries to use, we need to consider the following factors:

  • Cost per Amp hour
  • highest practical system voltage
  • Cost/difficulty to charge
  • We can then determine a suitable pack size and its cost

One easy solution to the NiMH parallel charging problem is to charge each series set of cells with a separate charger. If our pack uses 20 cells in parallel, then we would need 20 chargers, which would be too expensive. If we use only four cells in parallel, having four chargers would probably be practical.

It’s tempting to increase the voltage up, up, and away because then Peukert’s Law has less effect. However, practically, 500V would be great, but we’ll never find a bicycle motor or a controller that uses 500v. Common motor ratings are 24v, 36v, and 48v. Some motors can be run over their rating, up to about 72v. So you’ll want to head for higher voltages, but make sure to weigh the cost of these components. If a 24V motor and controller costs $40, and a 48v costs $300, yes, you will have some savings by going to 48v, but could you get the same benefit by spending less than $250 on more batteries?

Controller

The most popular brand of controllers are manufactured by Crystalite. I believe these cost roughly $150. From what I have seen on the bike forums, these do NOT survive going up to 72v. To reach those voltages, you have to open the controller up and replace the transistors (MOSFETs) with models that can survive such voltages.

Kollmorgen 300W to 400W motors have a built in controller, but they must absolutely not exceed 24v.

Another consideration is whether the controller allows regenerative braking. This is when you let off the throttle and apply the brake– the motor is run ‘backwards’ and generates energy which it pumps back into the batteries. One other much simpler variation of this braking scheme does not charge the batteries (as this can be complicated) and instead dumps the energy into a coil of wire. The coil of wire resists the flow of energy, and heats up. In either case, you end up having a brake that doesn’t need to have pads adjusted or maintained. You can always make your own braking setup with a coil of wire, a permanent magnet motor controller, and a relay. The motor controller is wired up backwards– taking its input from the motor, and outputting to the coil of wire. The relay is necessary so that the braking controller and motor controller aren’t on at the same time.

Chargers

I haven’t quite gotten here yet.

First Recumbent Electrification: Overview

Sunday, December 30th, 2007

Designing a vehicle is like any other problem. We need to break it down into a few steps:

  • understand the problem, and determine some key requirements to solve it
  • learn about the tools at our disposal
  • figure out how to put it all together

So I have broken what used to be one page into several.

  1. “Theory” gives an overview of the forces on a vehicle and lets you determine how powerful your motor and batteries will need to be. Don’t worry, I use mathematics sparingly, and the equation is really straightforward.
  2. The next sections ground us in reality. Numbers are great, but the markets only give you a handful of tools to reach those numbers. Motor and battery types, as well as other bicycle parts, only exist in certain configurations. Once you know what’s out there, you can start to formulate how your vehicle will happen.
  3. “Planning” describes how I planned my electric bike once I’d amassed enough knowledge to get started. Actually, I pretty much had it right from the start, but I did have some interesting ideas along the way.
  4. “The Controller” describes the motor controller I built. The stock ebike controllers out there, at the time I started working on this bike, were not very highly regarded. So I built my own. It was not a process for the faint of heart. If you still don’t feel like just buying one, read this and maybe it won’t be as painful for you.
  5. “The Build.” This is empty for now, as I’m currently stripping existing bicycles in preparation for the actual building, which I expect to start in December.
  6. Resources lists some resources I have drawn on.
  7. Contributions lists the people who made a real difference in this project.