Not quite superman "Thinking Outside the Four-Wheeled Box"
ebikes.ca

Home   Store   FAQ   Contact Us   Simulator  Cycle Analyst Info   Lights Info  Spoke Calculator  Tech Info  Troubleshooting   Projects   Events  

Cycle Analyst (formerly DrainBrain) History

This is a peek back at the roots of the Cycle Analyst. For the current version of this page, go here.

Naming Contest, we may have a Winner!

Well thank you to the dozens and dozens of people who offered name suggestions over email and in public forums, altogether there are nearly 250 entries on the name spreadsheet. For pairing down to a short list there were a few criteria that eventually came into play. Names with an 'e' this or an 'i' that were mostly out of the question, as were plays on the word 'watt', some of which were cute but I think there is only room for so many 'what watt' products in the world. Quite a few of the really good names like "Juice Goose" or "MeterMaid" were already in use by other companies for electronics equipment. And of those that initially stood out there weren't a whole lot remaining. Those that were near the top and still in contention included:

But then on June 13th a casual lunch with my girlfriend's parents led to an unexpected name brainstorming session, and the words "Cycle Analyst" got blurted out. It rolled well off the tonge, sounded smart, professional, and was descriptive with double meanings. So, today on June 22nd I'm putting it out as a tentative possiblity. I'm also giving the opportunity for a last call of ideas you may have that could top this. If you think you have an even more killer idea, or just comments, send them this way to drainbrainname@ebikes.ca . Unless something better stands out by midnight next monday (June 25th), we'll call it the Cycle Analyst and Joseph Reichlin will get the prize.


Version2 Units Production Update Schedule

After 3 weeks of beta testing, a few bugs and glitches have been caught and resolved and the meters are very soon going to be ready for general release. There are 3 models that will be produced to suite different vehicle applications.
DB2_Direct (50K) Direct Plug In: This model is terminated with a 6-pin connector that can plug in directly to our motor controllers, or it can be used with 3rd party motor controllers that have been modified to bring out the relevant signals. If you have access to the motor controller's shunt resistor, hall effect signal, and throttle over-ride signal, and a little electronic know-how, then you should be able to wire this version into your vehicle and take advantage of all the new features. Here is a wiring diagram showing the tap point locations for the 20A Crystalyte controllers. Projected price is $120
DB2_StandAlone (67K) Stand Alone Model: This version is like the original DrainBrain units, with a supplied external shunt and speedometer sensor cable. It can be readily connected to just about any small electric vehicle by wiring the molded shunt between the battery pack and controller, and attaching a magnet to one of the wheels. The shunt looks the same as before, but it is now capable of 45 Amps continuous current and well over 100A peak. The resolution has also been increased to the nearest 0.01 Amps, so it can more accurately track small trickle currents. Projected price is $150
DB2_HighAmps (60K) High Current Model: The last option is for vehicles that have even higher current requirements or those that already have an accessable current shunt. These units have an unterminated 4-conductor cable that needs to be wired to the user-supplied shunt resistor and V+ of the battery pack. These also have a speedometer sensor cable for sensing the vehicle's speed via a magnet on one of the wheels. Projected price is $145, which does NOT include a shunt.


Summary of the New Features:

Here is a complete list of all the changes, both visible and not, between the original DrainBrains no® ™ :-(, and the 2007 meters:

Throttle Output Line:

The circuit now has an analog voltage output line that can deliver a signal between 0 to 5V in increments of 0.005V. When properly wired to a throttle signal, this will allow the meter to over-ride the users throttle setting and let the Brain take charge of your controller so that certain limits aren't exceeded. There are three ebike parameters that can be simultaneously set up to regulate this output: max speed, max current, and cutoff voltage.

Speed Regulation:

DB2_Speed_Limit (5K) The most obvious use of the throttle feature is to set a maximum speed limit beyond which the controller ceases to assist. This has the utility of providing legal compliance to the speed cap imposed on ebikes in most jurisdictions. When used with a full throttle, it serves as a cruise control on the electric bicycle. It can also be beneficial to riders who have a setup that goes faster than desired on the flat, but that needs to be wired that way to have adequate hill climbing torque.

Current Limit:

DB2_Current_Limit (5K) It is often desirable to have a current limit that is lower than the inherent limit provided by the controllers. This can be done to prevent damage to the batteries, to increase the range that you'll get on a charge, to protect the motor controller and motor in a setup that draws too many amps, and to condition NiMH/NiCd batteries that have been on the shelf for a while.

Voltage Cutout:

DB2_Voltage_Limit (5K) A low voltage cutout is used to protect a battery pack from being discharged too deeply, which can cause cell reversals in NiMH/NiCad packs, permanent cell damage in Lithium packs, and sulfation in Lead Acid batteries. Most motor controllers have a hard-wired low voltage point that is not readily adjustable without opening and resoldering components on the circuitboard. The programmable low voltage rollback in the new meters allows you to set an appropriate low voltage point tailored to your pack, and can be readily changed when you swap to a new battery.

Each mode is implemented as a PI (proportional/integral) controller, and both the proportional and integral gain values can be adjusted to the electric vehicle to provide fast regulation without oscillations about the set point. The meter does not simply cut out the controller when one of the set points is exceeded, rather it rolls back and continuously adjusts the throttle signal so that the limit point smoothly maintained but not exceeded.

Throttle Clamp:

DB2_Thrott_Limit (4K) Finally, it is possible to simply put an upper limit on the output, so that the controller never sees the equivalent of a full throttle. This has the effect of simulating a lower speed motor, or how your system would operate with a lower voltage battery.

Two Range Modes, now up to 2000 amps:

DB2_Range (15K)

The meter can be setup either in a high range mode for electric cars and motorbikes that draw hundreds of amps with peaks up to 2000A, or a low range mode for electric bikes and PEVs that draw in the 10's of amps with peaks of up to 200A. The high range mode shows kWatts instead of watts, and has one digit less display resolution, but is otherwise identical.

Dual Gain Amplifiers, higher precision:

There is is now a dual gain amplifier for sensing the current, so that small currents can be detected an measured with higher accuracy. In the default low range mode, the display resolution goes down to 0.01 Amps, over the original 0.1 Amps. In the high range mode, the current sensing shows to the nearest 0.1A, compared to the original 1A resolution.

Better Shunt:

The molded epoxy shunts on the stand-alone model look identical from the outside, but internally they have been fully redesigned. The new shunts have a significantly lower temperature coefficient of resistance and a 4-wire Kelvin connector, so they maintain accuracy at high currents much better than the original design. As well, the new shunts are just 1.5 mOhm, less than 1/2 the resistance of the original model, and are therefore able to handle 45 Amps continuous and over 120 Amps peak.

Speed via Hall Sensors or Wheel Magnet:

DB2_Poles (6K)

There is allowance now to detect the wheel speed from the hall effect signal in the motor controller, which eliminates the need to install a spoke magnet and sensor wire to one of the wheels. The code supports hub motors with up to 14 hall effect transitions per revolution. Of course, for mid-drive setups or systems that don't provide access to a hall signal, then the conventional spoke magnet and sensor can still be used as well, setting the "# poles" variable to 1.

Wider Voltage Ranges:

By setting a few jumpers and cutting a trace or two, it is possible to reconfigure the circuit to operate from 9V-60V, allowing for use with 12V systems. Most electric vehicles are 24V or higher, but a number of people have expressed interest in this meter for other applications running off a 12V bus. When configured for low voltage, the current draw of the meter increases from 7mA up to 12mA, as the LCD backlight now runs in parallel rather than in series with the circuit.

As well, experiments are under way to offer a high voltage option, allowing the meter to be used on a wide range of small electric cars and motorcycles that tend to operate between 100 to 200V.

More Intuitive Setup Interface:

DB2_Input_Units (11K)

Some thought was required to add all these features while still using just one button to access and navigate everything. The setup menu (accessed by holding the button while the meter is powered up) now lets you skip through all the variables until finding the one you want to modify, and then change just that one. The parameters have also been scaled into easy to understand units, for instance you can program the shunt resistance directly in mOhms, and the gains in actual engineering units. So 0.11 V/kph means that for each km/hr that the speed limit is exceeded, the throttle output will decrease by 0.11 Volts.

Customize Main Screen for Amps or Watts

DB2_Amps_Watts (17K)

It was a tough decision initially between showing amps or watts on the main display screen, as there was only space for one or the other. In the V1 device, watts was ultimately chosen because it is a more universal quantity. But there are valid arguments why amps would be prefered here, so now you can select between amps or watts being displayed on the first screen. The second screen, without the speed and distance information, continues to show both.

User Set Display Averaging

DB2_Averaging (5K)

The displays can now be set to update the current, voltage, and power readings every 0.05, 0.1, 0.2, 0.4, 0.8, or 1.6 seconds. Some people like a fast changing display so they always see the most recent data, whereas others find the frequent flicker annoying and prefer to have the time to see and read a stable value. Your choice, and you can select it.

That's It?

All of the above additions were implemented without sacrificing any features from the previous release, so you still get a backlit LCD display, max and min current readings, life cycle statistics, auto-saving on power down, watt-hour/distance, km or mi unit selection, %regen, and all the other stuff you've come to expect from this handy device.

Now, there are a few more additions that are planned down the road, including the ability to select which display screens are displayed or hidden while riding, the option to add an RS-232 data ouput port, as well as the option to get a large format LCD screen with characters that are over twice the side for better legibility.

DB2_LCD_Size (12K)


End of Name Announcement, April 2007:

So what could be more exciting than receiving three registered letters from a law firm on the same day? Hard to say. But it turns out that another company had registered the trademark "Brain Drain" for a power/amp-hour meter in the summer of 2005. That's not DrainBrain, but "Brain Drain", which isn't even a cute play on words, although fair enough that there would be confusion between the two. I didn't register any trademark. So, we're going to have to come up with a new name, and I'm going to tap into the community of users and ebikers once again to help find it. Stay tuned for an announcement of a new naming contest for the V2 DB device, and let the creative juices start flowing.

And for the record, if you got here looking for the "Brain Drain" smart cable from Lentequip which was apparently just released, that can be found from this link.

Update on the V2 Release Schedule

There was an unfortunate error at the factory that produces the LCD screens for this device, and the entire batch of display modules I had ordered was made with an incorrect geometry. The replacement batch of LCD displays is scheduled to arrive in early May, and the V2 units will be available shortly after that.

Clarification as a Stand Alone Device

There has been some concern raised that the V2 model will only work with our Crystalyte controllers. This is not the case. The inital beta release will only have the 6-pin connector option because the features I want beta tested are all related to the speed and current limitting which are most easily accessed this way. The general release will also be available with a remote shunt and speedometer sensor cable for use in any vehicle.


End of Life Announcement, March 2007:

The DrainBrain V1 series both with and without speedometers is now a fully discontinued product. Many thanks go out to the loyal customers who have given excellent feedback and enabled this experiment in cottage manufacturing to be the success that it was.

Is that the end? What next?

It's been no secret that I've been working on a Version2 unit that plugs directly into the special 6-pin connector that's we've had added to the modified Crystalyte controllers sold at ebikes.ca for the past 9 months. This V2 DrainBrain has the ability to read the speed from hall effect signals rather than a spoke magnet, it implements programmable maximum speed control, offers user customization of the screen displays, and has the added capability of taking upgrade modules for such things as data logging and battery charge control. The V2 will have a beta release in early April 2007, and more information will be put up at that time.

Clearance Sale:

I've finally had a chance to clear out and sort through the original DrainBrain inventory and put together quite a few units for discounted sale. So if you've been eyeing a Brain for your latest project but have been a bit tight no cash here is a chance. Use the buttons and paypal for checkout, shipping anywhere in the world with regular airmail is $8 for one item, or $14 for two, or $18 for three.
DB_NonSpeedo (68K) These are original non-speedometer DrainBrains available for just $65 each. Most of these have some minor cosmetic defects, from scratches on the box to slightly misaligned display windows, but are otherwise fully functional. All have the 30A inline wire shunts, a few have shorter than usual leads between the shunt and the display (approx 36"). The LCD screen is grey rather than STN, so slightly lower contrast but still quite visible. Total of 8 units available at the time of this writing. UPDATE: 5, 2 remaining, SOLD OUT.
DB_NonBacklit (64K) Non Backlit speedometer DrainBrains for $95. These are speedometer DrainBrains V1.0.4, or backlit versions 1.0.5 in which the backlighting LED was damaged and then bypassed. Five are available, all with inline wire shunts, and are new or good-as-new and in pristine condition. UPDATE - 2, 1, SOLD OUT.
DB_Black_Scratched (61K) Backlit DrainBrain V1.0.6 with minor cosmetic damage. There is one new DrainBrain with the backlit LCD screen that unfortunately had some solvent glue spill on the casing. It wiped off, nothing got on the display window, though some smudge mark is visible on the top left edge of the enclosure. $115 SOLD
DB_Clear (63K) Backlit DrainBrain V1.0.6 in special clear casing. I have exactly ONE of these units made up in a high quality transparent polycarbonate enclosure. If you've got a sweet project that would be complemented by a snazzy display, here's your chance. $145 SOLD.

Introduction:

The DrainBrain is the first dashboard and battery monitor designed around the particular requirements of personal electric vehicles. It consolidates into a single display all the information you would want to collect regarding the state of charge in your battery pack, the energy and power used while riding, and the travel distance and speed statistics for each trip. And for people who aren't tech geeks, it serves that one crucial function of telling you exactly how much of the battery charge has been used, so you'll never again be caught surprised at the bottom of a hill with a flat battery pack.

AHMeterAll (17K)

Unlike battery meters designed for R/C applications, the DrainBrain uses a remote shunt so that battery power does not need to be routed to and from the handlebars. It comes with a clamping bracket for convenient mounting to a bicycle and is designed with a sealed window and wire grommets to handle rain and wet conditions. The LCD screen is backlit so you can read the information while night riding. It saves the data whenever the power is shut off. The DrainBrain also accumulates information on the life of the battery pack, such as total cycles and total amp-hours that were used. The unit can handle batteries up to 100V, current peaks of +- 60 amps, and it keeps track of forwards and negative amp-hours separately so you can quantify any regenerative braking performance. Finally, the integrated speedometer shows your actual energy use in watt-hours / km and can be customized to display in either kilometers of miles.

Specifications and Users Manual:

The basic specs are summarized as follows:
For more information and specifications on the DrainBrain, please read the online version of the Users Manual here.

History

Early Days

The precursor to the DrainBrain is a hand soldered circuitboard and LCD display that was squeezed into a busy schedule during feb-march of 2005. It was a project that had been on the agenda since first getting into ebikes and PEVs in late 2003. At the time I was too cheap to purchase one of the R/C watt-meters, and I thought it would be worthwhile to make a custom unit with a remote shunt and data saving on powerdown to be more ebike friendly.

Early_Shunt (24K) Early_Circuit (30K) Early_LCD (29K) Early_Box (29K)
The shunt design was later imporved. First circuit wired on breadboard. Only one display screen. First enclosure was a blastic parts box with a piece of packing tape as the display window

This was a fairly straightforward electronics project, and if anyone wants to try and make their own ebike battery meter I have made available the schematic and source code for this prototype.

Summer Plans

Since there wasn't anything quite like this on the market, I assumed that there were other ebike enthusiasts who would be interested to buy such a device and began musing about how to make these efficiently in some kind of volume. With a mild leap in faith, the parts for a total of 50 boards were ordered and a summer plan was hatched.

My friend Matt Chudleigh became involved and we spent several months figuring out the tooling and equipment to manufacture the display boxes and remote current sensing shunts so that they looked professional. This involved lots of experimentation with vacuum casting techniques, thermally conductive potting compounds, and mold making. Around this time we also received advanced payment for a large number of units from both DLM Energy in Australia and JVBike in Vancouver, and with both of us being broke from 5 years of university life this is how the whole thing was funded.

Chud_Working (57K) Vacuum_Potting (76K)
Matt doing final assembly on first DB batch Early vacuum chamber for potting shunts  

Naming Contest

Partly to elicit interest and partly because we couldn't come up with a clever name, a call was made on the Power Assist yahoo group to host a naming contest and give a free and unique meter to the winner. In no time the submissions and suggestions came flooding in, over 150 in all. The prize for submitting the best idea was a special translucent blue DrainBrain pictured below.

AHBlue (36K)

The winner Mick had met me at the VEVA show and came up with the term DrainBrain, a cute play on words that is both descriptive and has a nice ring, and didn't have 'E-' something in it.

No, not BrainDrain, but DrainBrain

It seems over half the references to this unit get the name wrong, so lets just set that straight. The DrainBrain is a battery monitoring circuit designed by Justin Lemire-Elmore. It's an intelligent device that measures the current drain of a battery pack. Some people shortened it to simply 'Brain', and I approve of that. A Brain Drain is the emigration of smart people from their homeland to another country in pursuit of higher pay or better living conditions, and is not something I necessarily endorse.

Shunt Styles

The goal was to make the DrainBrain as easy to use and install as possible. We had our shunts molded around the 2-prong trailer connectors used in both Crystalyte and Wilderness Energy conversion kits so that it would be plug-and-play with no additional wiring. This type used a 5mOhm sense resistor, and it wasn't expected to see over 20 Amps since that's all the controllers were rated for. However, some people were using these with different kits or for other applications, and so we modified the molds handle a higher current (3mOhm) shunt with straight wire leads as well.

ShuntConnected (10K) InlineWires (32K)

In the end, the trailer connectors themselves didn't make a sound enough connection and in some cases began to melt apart, so these were more or less discontinued when we switched all our ebike components to Anderson Powerpoles.

Speedometer Upgrade

By October 2005 the first versions with speedometer functionality were released in Beta, and then through various revisions from version 1.0 to 1.0.3. Around this time Matt was lured away by the offer of a real programming job, and I started getting more involved with the business of importing and dealing hub motors and advanced battery packs. Still the interest in DrainBrain's was pretty strong, and they continued to be made and sold in small batches throughout the winter.

Alas, Injury and a Bug

In late Feb 2006 I had the unfortunate circumstance of getting hit by a vehicle on my bike and fracturing my wrist. This was right around the time that a bug was found in the speedometer DrainBrains which could cause the eeprom data to get corrupted if the reset button was held while the bicycle was moving. The result is that you would see messages like "A-" when the unit was powered up. The bug was an easy firmware fix, but it meant that a lot of customers had to send their units back to be reprogrammed.

A good friend Alison was kind enough to help out with the DrainBrain manufacturing at this time because I couldn't do much with the cast on, and the orders were pouring in faster than I could easily keep up.

Speed Cutout

One feature that was clearly on the agenda was the ability to use the DrainBrain as a speed limiter in order to make conversion kit ebikes meet federal regulations in all the different countries. In late spring of 2006 some preliminary testing was done using the DrainBrain to engage the ebrake cutout of the Crystalyte controllers. It worked, but the simple ON/OFF control scheme with the ebrakes meant that the assist would abruptly stop, and then start again, and did not feel very elegant. At this point we started discussion with Crystalyte to see if it would be possible to have a special 'drainbrain' connector included with their controllers, which would allow access to the actual throttle signal on the controller circuit.

Backlighting

Right from the start the plan was to use backlit LCD modules so that the display was suitable for night riding. But all the off-the-shelf displays required at least 20mA of current to be adequately bright, and this was considerably more current than was available. Luckily I found an LCD manufacturer who was willing to customize their module to use ultra-bright LEDs in the backlight so that it was even bright enough at 5mA, and do so in reasonably small quantities.

By summer of 2006 the custom LCDs arrived and the DrainBrain circuit board was revised to included backlit LCD headers. V1.0.5 with backlight display was quietly released. It was tested up to the rated 100V, but the testing was done with a lab power supply which has a nice ramp to to 100V. Unfortunately, when the units were plugged into a supply over 80V suddenly, the inrush current was enough to possibly damage the backlighting LED. This was caught after a few weeks of sales and fortunately the fix was quite easy, simply replacing the resistor R7 on the LCD module with a 300-400 ohm resistor instead.

Local Manufacturing

Small scale cottage manufacturing has been a fun experience. Except for the speedometer magnet sensor and handlebar mounting bracket which are imported from China, all of the parts are made or sourced here in Canada. The enclosure boxes are produced by Hammond Manufacturing on Ontario, the printed circuit boards from from Richmond or Calgary, and everything else happens in my Vancouver shop.

Alison_Drilling (30K) This is Alison drilling holes for the buttons and grommets
Justin_Gluing_Windows (76K) I received a special request for a Blue DrainBrain from a member of the V is for Voltage forum. So I obliged and made a small custom batch using these translucent enclosures. This is me gluing the clear display window in place.
Segue_Epoxying (84K) Spooning the potting compound into the shunt molds was a bit messy and tedius, so we found that blank caulking tubes made short work of it. It's winter and the garage is cold, but Segue is dressed for the occasion.
Segue_Grommetting (76K) Forcing small grommets into even smaller holes is the kind of job you can do sitting on a bed or watching TV. That doesn't necessarily make it fun though.
Soldering_PCBs2 (89K) My favorite job is certainly populating the circuit boards. One by one you pick up small parts with tweazers, orient them over the board and then gently press them into place on the solder paste. This might sound sarcastic, but I'm serious, it's a single minded tasks that's almost like meditation.

Version History

1.0.6 has resistor upgrade for operation right to 100V, lower voltage increased to 15V from 14V
1.0.5 first backlit module, had some issues with 72V setups, new processor
1.0.4 Resolved bug that could cause data corruption of RESET held while riding
1.0.3 Minor change in offset
1.0.2 Improved the Vmin sensing algorithm for correct display even after powerdown
1.0.1 Resolved possible hang on start screen during powerup until button press
1.0 Added km/mi selection, and gain selection

© 2007 Justin Lemire-Elmore