Cycle Analyst

The Cycle Analyst (CA for short) from Grin Technologies is a useful research tool and an amazing value at $105 USD.  It is intended for use on electric bicycles.  The company appears to be technology-driven and staffed by enthusiasts.

Although the CA has extensive capabilities, I plan to use it as a monitor only and not allow it to control anything.  It is remarkably configurable and can display amps, volts, instantaneous watts, and accumulated watt-hours somewhat like the DROK coulomb meter I tried, but much more readable.  It also has an input for road speed, so it will show miles per hour and miles traveled.  It can then compute watt-hours per mile.  There are also separate accumulators for regeneration versus drive energy, so you can see regen as a percentage of the total.

Credit: Grin Technologies     Installation of Cycle Analyst using a current shunt

The only complication is that for high-current applications, it's intended to be used with a current shunt.  That may be fine for an electric bicycle, but the problem of positioning the shunt on a trials bike is not trivial.

I made an inquiry into Grin Tech to see if I can use a current transducer instead of a shunt.  Seems likely based on their setup software.  There was no immediate reply but, worst case, I would have to build some analog electronics as a go-between.  

The adjacent photo is from Grin Technologies' website.  It shows how their product connects to a shunt for high-current measurements.

But it gets better!  Grin offers an auxiliary datalogger for $99 that writes to a MicroSD card. And, even a datalogger with built-in GPS that's only $150.  This is something I had actually considered building (without GPS), as it would be nice to record the instantaneous power consumption and such for an entire ride.

Here you can see the unit attached to my bike.  The back has a 1/4-20 threaded insert to mount the device to a separately-available bicycle clamp.  Instead, I made a very simple (read crude) mount with a 3/16" rod (5 mm would have been better) and two hose clamps.

The unit is fairly large and they seem apologetic about theirretro-looking display, but that's one of the many things that attracted me to it.

Its 2-button interface is logical and intuitive to use.

Cycle Analyst mounted on ePure Race showing default boot-up screen 

Slow Pre-Purchase Inquiry Becomes Outstanding Customer Service

My pre-purchase inquiry to Grin about using a current transducer went unanswered.  After a week and another inquiry, they said my question would have to be passed up to the engineering staff.  I decided to just order a Cycle Analyst and figure it out for myself.

Three weeks after my initial contact, Grin still has not responded so I sent another email stating that I had purchased a unit and my testing was progressing.  This resulted in an immediate reply from a principal in the company.  Justin was kind enough to offer suggestions as to how I could modify the CA's analog front end to accommodate a current transducer and even included a schematic of that portion of the circuitry (which I had requested).  Although I have gotten this type of information from suppliers of industrial equipment, it's pretty unusual for a consumer-level product.  So, I give my highest recommendation for both the company and this product.

My Cheater Shunt

I loathed the idea of adding a current shunt to the bike.  While waiting for a reply from Grin, I had an idea to try.

The negative battery cable from the Anderson connector to the controller is about 45 cm of 25 mm² cable.  This calculates to around 0.55 milliohms – a perfect resistance for a shunt that would allow the CA to measure +/- 440 amps.

All I needed to do was add two “voltage sense connections” to that battery cable.  Of course, the temperature coefficient of copper wire is much worse than that of the alloy Manganin used for shunts.  Thus, the resistance will change as the cable heats up – about 0.4% per degree C.  But I don't think that will be a problem, at least for the initial testing.

The next photos show both ends of my battery cable/shunt.  The most difficult part of using the battery cable as a current shut is soldering the sense wire to the Anderson pin.  It takes a lot of heat.  My method was to use flux and get in / get out quickly.

The other end of the cable came completely prepared for me.  It's a bolted connection covered by heat-shrink tubing.  I guessed (correctly) what was under the heat shrink and did not even have to uncover it.  The bolted connection has two separate battery negative (“ground”) wires – one for the DC-DC lighting converter and one for the state-of-charge display (both of which I had removed).  One of these ground wires was routed to the CA's blue wire and the other to its black.  The state-of-charge indicator's connector also provided direct access to the positive side of the battery (which goes to the CA's red wire).

Soldered end of battery cable shunt

Bolted end of battery cable shunt

June 2023, Cheater Shunt Errata

The resistance I initially calculated above for my cheater shunt is high by a factor of 1.31.  This makes all my previous current readings low by the same factor.

I found the datasheet for the exact wire EM is using for the battery cable (La Triveneta FS17).  This turns out to have a much lower resistance than the generic AliExperss stuff on which I based my original calculation.

The La Triveneta FS17 1 x 25 mm² cable has a maximum resistance of 0.78 ohms per kilometer at 20° C.  Thus, a section 450mm long (measured exactly) equates to a resistance of 0.35 milliohms.

Unfortunately, I no longer have an instrument capable of making resistance measurements that low.  So, to verify the value, I passed a known current through the cheater shunt and measured the voltage developed across it. Its resistance turned out to be 0.407 milliohms at 19.5 ° C. This agrees pretty well with my new computation after accounting for a bit of contact resistance where the connectors are crimped.

In the end, I decided to use 0.423 milliohms because that would be the resistance at 30° C.  This is probably a reasonable value for the ambient temperatures at which I ride, allowing for a bit of temperature rise due to self-heating in the cable.

The bottom line is that the initial testing I reported below is low by a factor of 1.31 regarding current and energy numbers.   I will eventually replace it with more accurate numbers.

Inside the Cycle Analyst

This next photo shows the CA's main PCB.  It measures 69 x 38 mm with components mounted on one side only.  (The LCD is a separate assembly.) 

I'm really impressed with the design.  It would be quite economical to manufacture.  The highest compliment I can give is that it's something I would have been proud to have created.

As you can see, some oval holes provide strain relief for the external wiring.  The open holes indicate places where I removed unnecessary wires to make a cleaner installation for my application.

Notice a pair of black wires near the top leading out of the frame.  The CA can use a thermsitor mounted inside the motor to monitor temperature and reduce power as necessary.  The thermsitor is 10k ohms at 25 degrees C.  It only costs $3 from Grin.  I bought one and soldered it directly inside the display unit so I could measure ambient temperate.  Unfortunately, the display only shows degrees C, so it's a bit inconvenient for an American.  It's also not terribly accurate at temperatures where I will be using it.  It indicated about 19 degrees C when the ambient was more like 13 degrees C.  But there is a simple fix for that - it's possible to use an LM35 (semiconductor) temperature sensor instead of a thermsitor with a bit of circuitry modification.

Cycle Analyst's main PCB

Connectors unnecessary for my use

The adjacent photo shows the wiring I removed.  As mentioned previously, the CA is intended for a bicycle application in which it can perform a motor-control function.  I now think I will be putting one of those wires back.  It would go to the throttle potentiometer's wiper and allow me to datalog the throttle position along with all the other values being recorded.  This would be extremely useful to gain an understanding of how much throttle I use for various obstacles and riding conditions.

Grin also sells a special USB cable to program the CA via a computer.  (I think it's possible to program most of the functionality via the two push buttons, but that would be pretty tedious.)

The cable only costs $14, but I had plenty of USB to TTL converters laying around.  I just needed to attach a 3.5 mm stereo plug to one of them.   The adjacent photo is shown for reference as to which wire colors go where.  Black goes to the sleeve and the red wire (+5VDC out of the computer) is not used.

3.5mm audio plug wired for TTL communications

 Initial Testing

After running the bike on a stand to verify operation, I ran the instrumented EM down the road in front of my house.  I knew the bike was fast on the loop trail, but I hit a surprising 39.7 mph in Green mode!  Although the speed may not be 100% accurate because the loaded rolling tire circumference is slightly smaller than it is static (although I did fudge it down a bit in an effort to compensate).  I think it would be difficult to get the tire circumference perfect as I expect different riding surfaces will change the contact patch (and thus the rolling radius) of such a low-pressure tire.  Electric Motion claims it will do 43.5 mph (and I assume that's in the maximum power mode).  I was initially a bit skeptical of that road speed as it would have the motor spinning well in excess of the motor manufacturer's performance graphs.  Therefore, I think the controller must be performing field weakening to achieve that speed.

Here are some other maximums recorded from that run: 164.7 A driving and -26.1 A at full regen from high speed.  Again, this may not be 100% accurate because of my crude shunt - but certainly is reasonable, and the driving/regen proportion should be correct.

The minimum battery voltage recorded was 45.2 V.  I started at about half-charge (about 53 volts, unloaded).  I'm not sure if the CA records peak power (this may be a setup thing I need to do?) but, 164.7 A * 45.2 V = 7.4 kW.  (I assumed peak power occurred at the maximum current and minimum battery voltage).  This seems reasonable for a motor rated 5 kW continuous / 11 kW peak.

Below is a table of results from various tests.  Some descriptive text follows.

Test Discussion

TEST 1: As mentioned, the first test was a very brief speed run on the asphalt road in front of my house.

All the following tests were conducted at my neighbor's horse ranch.  Although most of the tests were short, they are representative of how I ride there.  The terrain is typical of trials competitions in my area.  Some of the time is spent riding mock sections / practicing obstacles and the remainder would be equivalent to riding a loop trail.  The average speed is quite low.

TEST 2: This test had a fairly high maximum speed (21.7 mph) as I was trying to measure some extremes.  I used the CA's Aux Pot as a regen control.  (This is discussed in another section.)  Mostly, I just kept the Aux Pot's knob at the maximum regen that would not diminish the throttle response.  This caused some “automatic” regen on closed-throttle and provided a reasonable amount of “engine braking.”  My friend who rides in mountainous terrain finds the Aux Pot the perfect adjustment mechanism for energy recovery on long downhills.  I'm not really one to use much engine braking, but Cindy loves it.  Next season, I'll install the Cycle Analyst on her 5.7 for comparison.

I was pleased with the 74 Wh/mile figure.  This makes it seem reasonable that I could actually use the EM as a trail bike (as opposed to its intended purpose as a trials bike).  EM specifies the ePure Race has a range of 26.5 miles.  But in my discharge testing of the battery (rated 1875 Wh) I was only able to extract 1610 Wh.  Using a conservative rate of 74 Wh/mile, this equates to a range of under 22 miles (and that assumes full utilization of the battery). 

Regen versus driving Wh was a disappointing 0.8% average for the whole ride.  I think that speaks more to the terrain than anything else.  Most of the areas for regen are very short.  A few times I spun the knob to full regen on a downhill, and I'd see in excess of 1.4% at the start of the ride (it does not report a peak, just an average).  But -9.5 A versus 125 A is about 7.6%

TEST 3: Very similar to Test 2 but without working to achieve extreme speeds or regeneration.

TEST 4: Testing of my electric bicycle “finger throttle” as a regen control.  Although I initially found using this to be uncomfortable, it is better for me than the rotary potentiometer and I was therefore able to make more use of it.  Unfortunately, I can either have one finger on the clutch lever (trials mode) or a thumb positioned on the regen lever (trail riding mode).  The two don't really mix.  I am far more comfortable in trials mode even riding it as a trail bike.  I do have an idea for integrating variable regen braking into the rear brake pedal that I will be exploring.

TEST 5: Bad Data.  The wheel-speed sensor slipped out of position and did not register speed/distance for some portion of the ride.

TEST 6: Max speed prior to flinging “organic matter” off the tires was about 16 mph.  The 28.7 mph reading is as fast as it will go when the battery is at about 15% remaining capacity – the controller is obviously doing some limiting.

I noticed that the time and mileage do not record until moving at some minimum speed (maybe 2 mph?).  Occasionally, I expect I'm not exceeding the minimum speed while practicing trials.

Front-wheel speed sensor and magnet

Wheel Speed Sensor

The adjacent photo shows my mounting of the wheel-speed sensor. (Remember, it's intended for an electric bicycle.)  It's just a 5/8" aluminum rod with some machining.  I hot-melt glued and zip-tied it to the front brake caliper hose.  The air gap to the spoke-mounted trigger magnet was about 3.5mm.  This appears to be marginal.  

As a quick fix, I slid the magnet towards the hub which decreased the air gap but also moved the magnet away from the center of the sensor (which apparently does not matter).  A better installation may be warranted.  Also, perhaps more magnets would help decrease the minimum speed needed to begin recording.  There is a CA firmware setting for the number of trigger events per wheel revolution.

 LM35 Temperature Sensor

After receiving two batches of counterfeit LM35DZ sensors out of China, I gave up.   When the part was once again available in the US through normal electronics distribution channels, I bought several.

In order to use an LM35 sensor in place of the thermistor, the CA's unOffical documentation (found on Endless-Sphere.com) says to remove R17, a 5k resistor.  This resistor is actually a precision 4.99 k-ohm unit that appears to be marked “R1” because the silk-screened legend is obscured by a via on the “7.”

Furthermore, the unOffical documentation says to put a 470-ohm resistor between Vout and GND.   Although this does quash oscillation in long cable runs, it also alters the temperature reading by about 2° C at room temperature.

TI's datasheet for the LM35 says that long cable runs may require an R-C damper (75 ohms in series with 1 uF) between output and ground.   My six feet of shielded cable measured about 320 pF and this definitely caused oscillations.

The R-C damper works well, but noise actually diminished when the 75-ohm resistor was removed (at least when the capacitor is located at the far end of the cable run).   It does not seem to matter where the 1uF cap is then located, so I placed it at the far end for convenience.  The suggested 0.01 uF bypass cap across the power rails was unnecessary, probably due to the distributed capacitance of the long cable. 

See the ePure Race Controller section for more information on the application of this sensor.

LM35DZ sensor and mounting clamp