(Twizy) Fun With Nikki And OVMS

As some of you may know, I own not one, but two electric cars. In addition to our daily driver (a 2011 Nissan Leaf used by my wife to travel a ~80 mile trip every day to work,) I tootle round the local area in a 2013 Renault Twizy. It’s cheaper to run than our other car: the ‘long-distance only’ 2008 Toyota Prius, which now costs £65 a tank to fill up.

It’s a fun little vehicle. Technically a quadricycle under european law rather than a car, the Twizy has a top speed of 52 mph, a battery capacity of 7 kilowatt hours (6.1 kWh useable) and two seats.

Devoid of all the usual accoutrement you’ll find in a modern electric car, the Twizy is decidedly basic. But its central driving position, RenaultSport-designed chassis and awesome handling characteristics make it arguably the best all-electric quadricycle on the market today.

Better still, it’s available from just £6,795, plus a monthly battery rental dependent on your expected mileage.

While such luxuries as doors, windows and bluetooth will cost you extra, the Twizy does come with several must-haves for any modern vehicle: airbags, a crumple-zone, and an onboard-diagnostics port.

Here’s where it gets interesting.

Unlike the Nissan Leaf or Renault Zoe, the Renault Twizy has no factory-options available to allow you to remotely monitor your car’s state of charge, predicted range, or location.

Thankfully, there is an aftermarket option courtesy of the Open Vehicle Monitoring System.

Open Vehicle Monitoring System Hardware

Originally designed for the Tesla Roadster, but now available for other non-connected plug-in cars like the Vauxhall Ampera, Tazzari Zero and Think City, the OVMS system hardware enables you to remotely monitor and control aspects of your car.

There’s even a branch of the project working to add the Nissan Leaf support, giving Leaf owners an alternative to Nissan’s OEM Carwings system should they want something other than the £99 yearly subscription after three years of ownership have passed.

A few months ago, I got my own OVMS system and recently put it in my Renault Twizy. I extensively documented the OVMS kit and how to install it in a Twizy on behalf of Zero Carbon World, so go and read this article if you’re curious on how to do it yourself.

While I’ve enjoyed being able to check on my Twizy’s state of charge and location using the OVMS iPhone app (and find local charging stations in range thanks to beta-testing the next-gen OVMS app with open charge map integration) , the OVMS system offers so much more with a little extra work.

Twizy OVMS on the iPhone

In its most basic setup, the OVMS module talks to the free-t0-use server ran by the open-source OVMS community. The iPhone or Android app then polls the server for the latest status report from the module.

When set up correctly however, the OVMS server keeps a log of the car’s movements for the past 24 hours, including GPS logs, battery health reports, and usage stats.

With the correct perl modules running on your computer, you can connect to the sever using a client perl script and retrieve these logs.

From there, you can look deep into your car’s health, your trip status, and even plot the route on a map.

Since the process of installing the perl software is a little in-depth, I’m not going to go into details in this post (although if other folks need help I may do one in the future). Instead, I’m going to assume you’re already familiar with perl and point you at this how-to, which should explain everything.

So I’ll skip forward now, and assume you’ve installed your sever software (I did mine on an Ubuntu 13.04 box). I’ll also assume you’re familiar with utilisation of the ./cmd.pl script within the OVMS server implementation.

Using the command below…

./cmd.pl 32 "RT-GPS-Log" >gpslog.csv

….you can retrieve the GPS log and put it on your server. Then comes the fun, putting it in your favourite spreadsheet to analyse the data. (You can repeat this with the other time-stamped logs too)

The raw logs need some tweaking. In addition to needing the odometer reading converting from 10ths of a mile to miles, and voltage from millivolts to volts, I was able to pull out some interesting data from a trip I made yesterday.

With myself and my son on board, I headed out on a 33.6 mile jaunt with a fully-charged battery pack. Being a Saturday afternoon, the roads weren’t particularly busy, so I was able to keep just at or below the speed limit appropriate for the road type I was on. (I did a lot of single-track roads too.)

When I got home, the car reported it had 7 miles estimated range remaining.

The Fun Little Maps

Here are the logs, cleaned up, and turned into some nice graphs, and here’s a nice little GPS map made by GPSVisualizer.com and everytrail.com from the cleaned-up GPS Log from my OVMS system.

OVMS Twizy Test Trip.


If you prefer the information in a slightly different format, the following analysis, prepared by utrack.crempa.net adds extra detail, including speed versus elevation, average speed etc.

Like the everytrail.com map above however, the utrack analysis relies on the GPS integrity of the data collected by the OVMS server. If the car moves out of GPS or GPRS range, it doesn’t always accurately report location. And that can lead to some tracks not exactly replicating the route I took.

In fact, the lat-long logs come out about 3 miles short of the total trip distance recorded by the car’s odometer. Given where I was has known cell-phone signal issues in the area, that’s hardly surprising.

SOC, Battery Voltage, Temperature

If we turn back to my own cleaned-up spreadsheet of the pertinent data, you’ll see that the battery pack’s State of Charge (SOC) drops steadily throughout my trip, from a peak of 98.3% down to a 27.08%. This equates to a usage on my trip of 71.22% of the Twizy’s battery capacity.

Odometer, SOC, Voltages, Battery Temperatures

(Although I haven’t plotted it, you can see from the data where in my trip power consumption was at its highest by the rate at which SOC was dropping. Cross-reference this with speed and altitude, and it should be possible to figure out where the most demanding parts of my trip were. Should I make this trip in the future, it could help me make better choices about route planning and driving styles.)

Now onto voltage. While overall pack voltage and average cell voltage does follow a downward trend throughout the trip, you’ll notice there are a few places on my trip where voltage drops and then rises again.

This can be explained by looking at the speed and altitude data. Voltage generally drops climbing hills or accelerating, while it recovers on downward stretches or under constant speed.

Given I ended the trip well before the battery ran out, you can see the voltage drop is consistent with a healthy lithium-ion battery pack. With modern chemistries, it’s unusual to see a major drop in voltage until the battery is almost empty.

(It’s also worth noticing that the overall battery voltage is plotted on the lefthand Y axis, while cell voltage is plotted on the righthand Y axis. Because the scales are different, it makes them look out of sync with one another.)

Had I ran the battery until it was 10 percent full, I would have expected to see a much larger voltage drop towards the end of the trip.

The really interesting bit however, is how the battery temperature increased with every mile driven.

At the start of the trip, the Twizy’s battery pack was at a fairly cool 6 degrees Celsius average temperature. By the end, and after a few hours of use, it has risen to 19 degrees. For reference, the outside ambient temperature during our trip yesterday started at 6 degrees C, and had fallen to just 4 degrees C by the time we finished.

Speed vs Altitude Vs Mileage

My prediction is that it would have exceeded 20 degrees C had I driven the car till empty.

What now?

The data I’ve collected from the OVMS system so far gives me a great insight into how my Twizy is operating. In addition, the raw logs (you can find them here in zip format) give you a little more information about the car, including the battery health, and any strange variants in the battery voltage between cells.

On a geeky front, that gives me an excellent way of checking how healthy my Twizy is. But it also can be used as a tool to make me a better driver.

Moving forward, my plan is to implement SmartThings technology in my Twizy to give me absolute control over how and when my car charges. The idea? To get my Twizy to charge at night-time when electricity is cheaper, and for it to cut off charging before reaching 100 percent.

This is a recommended practice in all larger electric cars if you know that you’re not going to need an entire full charge to do your day’s driving. It helps keep the battery pack healthier, and saves you a little time when charging too.

The work there has already started, thanks to Pieter in the Netherlands has already written a neat script which enables him to switch a power outlet on and off at the right time.

I’m also going to try and write a cron job on my server, so that the logs are retrieved automatically every day and converted to the required .CSV format.

Anything else? Yeah. As a freelancer, I sometimes drive the Twizy for work. Which means I can claim mileage expenses back.

By using a little careful planning, I think I can get my Twizy to automagically submit my mileage reports. How about that for coolness?

And of course, the ultimate hack for any self-respecting Mac Geek: Using SiriProxy to parse data from OVMS using my voice.

“Siri, Charge my car” 😉

“Siri, Is my car plugged in?”

“Siri, how full is my car?”

The possibilities are truly endless, but I fear beyond my meagre hacking abilities.