Friday, March 13, 2015

2013 Ford Focus Electric

As you could tell from my very first post, I'm really into electric cars. I enjoy doing basic mechanical work on my own cars (oil changes, spark plugs, etc), but it's even better if the car doesn't ever need it!

The Spitfire is a fun good-weather car to cruise with the top down to the local store. It's however not practical for a commute. I've been looking at production electric vehicles for years, but they're either too costly for me or too difficult to find. The Nissan Leaf is probably the best notable exception, and my wife and I did take one for a test drive. I don't want to convince anyone to not buy that car, but for us it lacked a little too much in space, power, and looks appeal. In terms of electric cars it is a solid option if you can't afford a Model S.

I searched for the Ford Focus Electric on and off for years but could never find one for sale anywhere in the state of Texas. That is, until this past week. A Ford dealership in Austin had a 2013 Focus Electric for sale, so the wife and I tried it out. It looks good, has just enough room for our monster stroller in the back, and feels good on power. We bought it.

I tried to find detailed numbers on range (and how it varies based on A/C, driving conditions, etc), but I didn't have any luck. So I'll do it here! I've only had the car for a week, but I'll update the numbers here as I get more experience with the car.

From what I can tell, the car's reported maximum range takes into account driving history (aggressiveness) and climate control. Ford advertises a range of 76 miles. When I picked the car up from the dealership the driving history showed quite a few lead foots had been test driving it. That's understandable as test drivers want to see what the car can do (including myself). At the dealership, even fully charged, the car only reported 63 miles. It wasn't until I drove the car for an hour to clear off that aggressive driving history that the range finally reported >70.

Range Statistics

All of the following data points are from my very initial experience with the car. I'll refine / expand them more as I get more time with it.

The car reports the driving history on a scale of 0 to 6 (Wh/mi x 100):
Coasting - 0
Level 65 MPH - 3
Heavy acceleration - 6

Rules of thumb from full charge:
- Climate control reduces range 12 miles
- Fairly aggressive driving reduces range 12 miles

Since Ford says 76 miles, that's about a 15% reduction on range for either condition. Those are additive - turn on your A/C and drive aggressively and there goes more than a quarter of your range. I haven't figured out the climate control yet. Having the A/C on doesn't automatically cut the range; it's heavily dependent upon the temperature you set inside the car. (Also I've had the A/C blowing cold air without any drop in range, but other times I've seen significant drops.) More experimentation will have to be done.

So some data points to help others interested in the car... (I bet these numbers would apply well to the Leaf / similar electric vehicles.)

Outside temperature cool (50 F to 60 F).
Interstate Highway Driving.
Light on the pedals.
Power consumption history averaging about 3.
No climate control.
Range: 63 to 74 miles

Outside temperature cool (60 F).
Country Highways.
Fairly aggressive driving.
Power consumption history averaging between 3 and 6.
With climate control set to 67 F.
Range: 57 to 59 miles

Outside temperature cool (60 F).
Mostly Interstate Highway, some lower speeds.
Light on the pedals.
Power consumption history averaging just under 3.
No climate control.
Range: 72 to 81 miles

Outside temperature warm (75 F).
Mostly Interstate Highway.
Light on the pedals.
Climate control on (A/C blowing cold air).
Range: 80 miles
(While driving, the range did make a sudden drop of several miles. I assume that was caused by the climate control.)

Outside temperature cold (32 F).
Country Highways / Interstate.
Climate control off.
Range: 60 to 65 miles

Outside temperature cold (32 F).
Country Highways / Interstate.
Heater on.
Range: 42 to 46 miles

Highest reported range: 83 miles
!! UPDATE in August 2016 !!
Highest reported range: 95 miles (Prior trip involved a lot of stop and go driving in heavy traffic.)
!! UPDATE in January 2017 !!
Lowest reported range: 42 miles (Freezing temperatures and heater on.)

I feel the car has a reliable 60 miles range - that's the maximum distance I would plan a trip for that didn't have charging along the way. That 60 miles includes highway driving with gentle hills, easy on the accelerator, and limited climate control.

How accurate is the range?

I've seen the car's estimated range from a full charge to be anywhere from 57 to 81 miles. So how accurate was it?

I've noticed the initial / full-charge range it gives is heavily dependent upon the driving history (maybe the last hour of history).

I've had a full charge report 64 miles, made a long trip, recharged, then had it report 74 miles.

Similarly, I've had a full charge report 74 miles, made a long trip, recharged, then had it report 64 miles.

So is it accurate? It seems to be if you're driving similar conditions to your previous trip.

What about when you're almost out of power? Does it suddenly drop from 5 miles range to 0? When we test drove the car, it only had 6 miles range on it. We made a 5-6 mile test drive and pulled back into the dealership with either 0 or 1 mile range remaining. So I'd say the range is accurate even at very lower values.

When you're driving, the car reports 3 distances: Range, Budget, and Status

At the start of the trip, both range and budget are identical; status is 0. The budget miles decrement based on actual distance traveled. The range miles vary based on your battery charge remaining, climate control settings, and driving history (Wh/mi). The status is just the difference between the budget and range.

Positive status mean you're doing better than your budget (good job!). Negative status mean you're doing worse than your budget (uh oh!). If you had planned a trip that really pushed to the limit of your range and you start seeing negative status, then you know you need to make adjustments (slower driving, turn off climate control, etc).

If your current drive is exactly like your previous drive (accelerations/braking, hills, cruising speeds, etc all the same), then budget generally equals range (status stays near 0). Taking climate control out of this, I've seen the status on drives easily range from +8 to -8!

Cost of Electricity

My electric costs $0.0962/kWh. The car's battery holds 23 kWh of charge. Rough calculation of $0.0962 x 23 = $2.21 to "fill up".

Two big assumptions with that cost:
- As least for LiFePO4 batteries, you don't want to discharge them beyond 80%. I wouldn't be surprised if Lithium-Ion can do better, but I still doubt Ford allows the batteries to discharge to 0%. (Meaning even if the car reports 0% battery, I really only need to charge 18.4 kWh, not 23 kWh, to reach 100%.)
- There are going to be losses with the charger; I just don't know how bad they are.

So if we assume a typical daily drive of 40 miles; that is a rough cost of $2. It will be interesting to see the next electric bill - will it only be up $60?

!!! UPDATE !!!
I got my electric bill! I purchased the car within a day of my billing cycle so the difference between the bills is a good indication of the effect of the car.
March bill: $163.83
April bill: $129.08
So even with doing the majority of driving with the electric car, the bill went down! Apparently electricity for the car is minor compared to the air conditioner / heater.


At this point we are VERY happy with the car. It's not for everyone, but it could be for a lot of people. I'd say it's contingent on the following conditions:
#1 Have a second gas car to drive for longer trips.
#2 Majority of trips are under 60 miles.
#3 Don't have frequent detours that could push you over 60 miles.
#4 Have a place to charge at home.

Sunday, March 8, 2015

Arduino Retro Computer: Program Memory (FRAM)

Arduinos have a very limited amount of internal RAM. Between the code for my video output, sound output, joystick input, keyboard input, and BASIC interpreter, I am running out of memory for the user's programs. FRAM is this very nice memory I found on Adafruit's website. It is very fast, non-volatile (does not lose memory when unpowered), and comes in large enough sizes for decent sized BASIC programs.

Adafruit has 2 types of interfaces for their FRAMs: I2C and SPI. I went with I2C to make it easy to expand the computer with additional FRAM chips if I want to in the future.

I soldered leads onto the FRAM chip.

I'm connecting pins as follows:
FRAM SDA to Arduino SDA (Digital Pin 20)
FRAM SCL to Arduino SCL (Digital Pin 21)
FRAM VCC to Arduino 5V
FRAM GND to Arudino GND
Uses I2C address 0x50 - Default

FRAM A0/A1/A2 control the I2C address so you can have multiples connected at once.

(I know my little computer is turning into a mess of wires; I'll work on a case for it soon.)

The FRAM library is available via the Adafruit website, I included it in my OS sketch:

// FRAM Library
#include <Wire.h>
#include <Adafruit_FRAM_I2C.h>

However at compile time it threw an error of not being able to find Wire.

It turns out my version of the Arduino IDE (1.0.5) is so old it didn't contain new standard libraries that the FRAM uses. I downloaded / installed the new IDE (1.6.0), but then I got a different error:
'prog_ucar' has not been declared

A type definition that Gameduino was using was deprecated and removed in the latest IDE.

To solve this problem, I modified my Gameduino library's GD.h file; at the top I added:

typedef const unsigned char prog_uchar;

Now that the upgrade errors have been resolved, I was able to create a global FRAM object:

Adafruit_FRAM_I2C fram = Adafruit_FRAM_I2C();

Initialize the object in setup():

void setup()

And finally make a simple test to make sure it was reading and writing.

  fram.write8(0, 'a');
  fram.write8(1, 'b');
  fram.write8(2, 'c');
  char test0 = (char)fram.readu(0);
  char test1 = (char)fram.readu(1);
  char test2 = (char)fram.readu(2);

The output was "bac", perfect!

That's all for now. Up next for the computer will either be a case or the start of the BASIC interpreter. The interpreter will store the user's BASIC code into the FRAM so I can keep the Arduino's SRAM available for operating system expansion.