Intelligent Nav System

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
walterbays said:
This article from CES is the first indication I've seen that the Leaf NAV system actually takes account of elevation. http://venturebeat.com/2011/01/05/cars-connected-to-the-cloud-the-all-electric-nissan-leaf/
Nissan’s system allows drivers to search for charging stations and plot routes that will use less of the electric car’s battery (avoiding slopes, for instance),

I've just scoured the service manuals and can't find anything that says the car has terrain info or uses it for the map's 'range ring'. The owners manual says the best info on using the nav system can be found in the Navigation System Owners Manual, which I haven't seen.
 
AndyH said:
walterbays said:
This article from CES is the first indication I've seen that the Leaf NAV system actually takes account of elevation. http://venturebeat.com/2011/01/05/cars-connected-to-the-cloud-the-all-electric-nissan-leaf/
Nissan’s system allows drivers to search for charging stations and plot routes that will use less of the electric car’s battery (avoiding slopes, for instance),

I've just scoured the service manuals and can't find anything that says the car has terrain info or uses it for the map's 'range ring'. The owners manual says the best info on using the nav system can be found in the Navigation System Owners Manual, which I haven't seen.


That would be quite a bit of data to store because GPS gives real-time elevation, not stored and it varies. The calculations would be very complex and very useless based on driver pedal behavior which really impacts range on a hill. This would be a costly and advanced undertaking and is likely not there.
 
EVDRIVER said:
That would be quite a bit of data to store because GPS gives real-time elevation, not stored and it varies. The calculations would be very complex and very useless based on driver pedal behavior which really impacts range on a hill. This would be a costly and advanced undertaking and is likely not there.

The elevation data is not that large. At ten meter spacing and 2 bytes per point there's less than 20GB of raw data to cover the entire surface of the US. The paved surface is a tiny fraction of that, let's assume 1%, so 200MB uncompressed. My two car GPS devices have speed limit data for most roads, so that's available. They don't have traffic signals and stop signs but that information is available in GIS databases. Add the specs on the car it is trivial to calculate a good estimate of the energy required to cover a given route. That estimate can be refined based on the driver's past behavior, weather, current traffic (which is available on one of my car GPS devices), and most importantly past experience driving various parts of the route. And lots of other info. The programming task would be at the level of a senior project for an undergraduate.

Building a savy nav is just not that hard (read "costly") when compared to the rest of the effort to develop the Leaf and the infrastructure to support it.
 
dsurber said:
The programming task would be at the level of a senior project for an undergraduate.
Yes - what they need is continous improvement to make it better. This is not rocket science.

They can even calculate likely car speeds, knowing road speed limits and traffic.
 
dsurber said:
The value of a vehicle is its ability to take me from A to B. The more limited the range the less valuable the vehicle. A 100 mile range (that might be 60 in the hills of the Bay Area in summer) is not a lot to start with. If I have to lop another 20 or so off for insurance, that really cuts into the value of the vehicle. Maybe Car Wings has some magic fairy dust to make these concerns go away, but the nav system in the car does not and that's all I've seen.

I'm not an EV zealot, but if the Leaf is supposed to be a mass market EV, then I am for sure the target consumer. Range anxiety is a real issue. I do not want to get stuck on the side of the freeway with a dead car. Nor at the bottom of the steep hill leading to my house. A savvy nav would go a long way toward addressing this issue. Compared to the overall cost of the Leaf program the development cost of savvy nav would be minuscule. It is simply unfathomable to me that the Leaf will not have savvy nav.


was gonna read all this, but i see you have made up your mind so what is your role here?

to show us the error of our ways? show us how you have figured it all out? well, we dont need the information you have provided and for several reasons.

everything you have brought up has been discussed several times. you, like the rest of us has to determine the usefulness of the Leaf as it pertains you your life and needs as must we.

i dont need you to help me decide on what to do and i doubt that many others here do. sure there are some lurkers, fence-sitters, etc. here but they have already read the TONS of negative literature that is available.

hope you find a transportation option that works for you

as far as smart Nav or whatever else you want, what about smartphones? then again, what is so smart about them anyway? they really dont do anything unless i tell it to or train it to, or update it to do so.

kinda like a car. let me ask you something; if you bought a car, it got 500 miles and you drove it to work 5 days a week and at the end of the week you found that you needed to get gas once a week. this means you have learned how the car can fit into your transportation needs.

so, knowing this; would you decide to take a trip out of town on thursday knowing that you should get gas, but since you normally do it on Friday, you will wait?

now, all these questions are really a waste of time because you are a human being and you dont need "smart" devices because we simply don t have them. iow, we dont have machines that can think for us. you might think you do, but you dont.

granted, determining how far a Leaf will go in meeting your personal needs will be tough before you get one, but is it really? what can you glean from the waste of time aka the "EPA mileage estimates?"

granted, not a whole lot i agree. i guess some research is necessary. like what kind of car do you drive, whats its EPA rating and how well do you do on that rating? and how well could you do if you tried to meet or beat the EPA?

but all those questions go right back to the very basic question most of us here have already investigated; what is my transportation needs?

now, it would be great if Carwings analyzed every trip we made and used that to give us an estimate of an expected range which would only happen when we plug our destinations in. then the only thing we would have to worry about is the other factors that affect range. but i guess we can expect Carwings to download the weather report so we can know which way the wind is blowing and that brings up a question; for a given wind speed, how much of a tailwind would we need to overcome a 5 mile detour or a rise of 100 feet of elevation?
 
dsurber said:
EVDRIVER said:
That would be quite a bit of data to store because GPS gives real-time elevation, not stored and it varies. The calculations would be very complex and very useless based on driver pedal behavior which really impacts range on a hill. This would be a costly and advanced undertaking and is likely not there.

The elevation data is not that large. At ten meter spacing and 2 bytes per point there's less than 20GB of raw data to cover the entire surface of the US. The paved surface is a tiny fraction of that, let's assume 1%, so 200MB uncompressed. My two car GPS devices have speed limit data for most roads, so that's available. They don't have traffic signals and stop signs but that information is available in GIS databases. Add the specs on the car it is trivial to calculate a good estimate of the energy required to cover a given route. That estimate can be refined based on the driver's past behavior, weather, current traffic (which is available on one of my car GPS devices), and most importantly past experience driving various parts of the route. And lots of other info. The programming task would be at the level of a senior project for an undergraduate.

Building a savy nav is just not that hard (read "costly") when compared to the rest of the effort to develop the Leaf and the infrastructure to support it.

Regardless of space for only that data it is costly to develop and it will not be very accurate as the car can't predict driver habits on hills, sure it will give better real time but that does not forecast range form the start. Having more accurate SOC data will make this easier, I have never had difficulty quickly estimating range that way. Yes, in the future the systems will be more accurate but it still depends on the driver. l
 
garygid said:
Karen's range estimator used detailed car performance parameters, route, and elevation. She also included estimates of speeds, but not traffic, since it was not a real-time calculator, but a trip planner.
Bringing this topic back to life.

Where is Karen's software ?
 
I'm calling BS on this one...

>>> This article from CES is the first indication I've seen that the Leaf NAV system actually takes account of elevation.[/quote]
 
evnow said:
garygid said:
Karen's range estimator used detailed car performance parameters, route, and elevation. She also included estimates of speeds, but not traffic, since it was not a real-time calculator, but a trip planner.
Bringing this topic back to life.

Where is Karen's software ?
Found the Python Script. Did Karen ever get to making this a proper app ?

Code:
#!/usr/bin/python2

import math

# Customize me!
all_electric = False		# Whether or not this is a Typ-1e (True) or a Typ-1h (false)
initial_charge = None		# If you'd rather specify the initial charge by a number of watt-hours, enter it here.  Otherwise, set it to "None".
initial_charge_percent = 1.00	# If you'd rather specify by a %, enter it here (50% = 0.50, 100% = 1.00, etc).  If not, set this to "None".
target_speed = 80.0		# Miles per hour
vehicle_weight = 2000.0		# Pounds, loaded
route = "LA Reservoir to Grapevine, CA"		# Name of route to take; see "routes" list below.

# Vehicle constants -- adjust as more info comes out
min_generator_charge = 1000.0	# Watt hours; generator starts up if charge drops below here
max_generator_charge = 1200.0	# Watt hours; generator shuts off if charge increases beyond here
max_typ1h_capacity = 6000.0	# Watt hours; Typ-1h battery pack can't hold more than this.
max_typ1e_capacity = 10000.0	# Watt hours; Typ-1e battery pack can't hold more than this.
regen_efficiency = 0.8		# Decimal percentage (0.8 = 80%)
generator_power = 12000.0	# Watts

# Vehicle power consumption curve
consumption_at_speed = [		# mph, Wh/mi
  (55.0, 83.333),
  (80.0, 142.857)
]

# Automatic speed limitation (turtling) at various SOCs
max_speed = [		#Wh, mph
  (30.0, 45.0),
  (60.0, 50.0),
  (90.0, 55.0),
  (120.0, 60.0),
  (180.0, 65.0),
  (880.0, 70.0),
  (910.0, 75.0),
  (940.0, 80.0),
  (970.0, 85.0),
  (1000.0, 90.0)
]

# Pre-defined routes
routes = {	# Format: lat, lon, feet_alt
  "LA Reservoir to Grapevine, CA": [
    (34.2348, -118.4119, 865.0),
    (34.2548, -118.4332, 944.0),
    (34.2774, -118.4539, 1016.0),
    (34.3003, -118.4771, 1173.0),
    (34.3141, -118.4888, 1268.0),
    (34.3269, -118.5032, 1366.0),
    (34.3411, -118.5206, 1782.0),
    (34.3494, -118.5399, 1500.0),
    (34.3576, -118.5528, 1402.0),
    (34.3945, -118.5712, 1399.0),
    (34.4311, -118.5883, 1057.0),
    (34.4604, -118.6152, 1059.0),
    (34.4898, -118.6191, 1174.0),
    (34.5155, -118.6353, 1456.0),
    (34.5365, -118.6470, 1895.0),
    (34.5574, -118.6759, 2290.0),
    (34.5712, -118.6892, 2591.0),
    (34.5897, -118.7115, 2841.0),
    (34.6088, -118.7117, 2806.0),
    (34.6313, -118.7271, 2663.0),
    (34.6419, -118.7498, 2666.0),
    (34.6699, -118.7651, 2774.0),
    (34.6833, -118.7823, 2815.0),
    (34.7040, -118.7943, 2864.0),
    (34.7296, -118.7985, 3017.0),
    (34.7594, -118.7959, 3252.0),
    (34.7862, -118.8264, 3611.0),
    (34.7957, -118.8569, 3882.0),
    (34.8070, -118.8821, 4050.0),
    (34.8476, -118.8688, 3422.0),
    (34.8749, -118.8923, 3177.0),
    (34.9038, -118.9232, 2351.0),
    (34.9421, -118.9313, 1495.0)
  ],
  "Grapevine, CA to LA Reservoir": [	# lat, lon, feet_alt
    (34.9421, -118.9313, 1495.0),
    (34.9038, -118.9232, 2351.0),
    (34.8749, -118.8923, 3177.0),
    (34.8476, -118.8688, 3422.0),
    (34.8070, -118.8821, 4050.0),
    (34.7957, -118.8569, 3882.0),
    (34.7862, -118.8264, 3611.0),
    (34.7594, -118.7959, 3252.0),
    (34.7296, -118.7985, 3017.0),
    (34.7040, -118.7943, 2864.0),
    (34.6833, -118.7823, 2815.0),
    (34.6699, -118.7651, 2774.0),
    (34.6419, -118.7498, 2666.0),
    (34.6313, -118.7271, 2663.0),
    (34.6088, -118.7117, 2806.0),
    (34.5897, -118.7115, 2841.0),
    (34.5712, -118.6892, 2591.0),
    (34.5574, -118.6759, 2290.0),
    (34.5365, -118.6470, 1895.0),
    (34.5155, -118.6353, 1456.0),
    (34.4898, -118.6191, 1174.0),
    (34.4604, -118.6152, 1059.0),
    (34.4311, -118.5883, 1057.0),
    (34.3945, -118.5712, 1399.0),
    (34.3576, -118.5528, 1402.0),
    (34.3494, -118.5399, 1500.0),
    (34.3411, -118.5206, 1782.0),
    (34.3269, -118.5032, 1366.0),
    (34.3141, -118.4888, 1268.0),
    (34.3003, -118.4771, 1173.0),
    (34.2774, -118.4539, 1016.0),
    (34.2548, -118.4332, 944.0),
    (34.2348, -118.4119, 865.0)
  ]
}

max_capacity = max_typ1h_capacity
# If electric...
if all_electric == True:
  generator_power = 0.0
  max_capacity = max_typ1e_capacity
  max_speed = [ (0.0, 90.0) ]

# If they want to set initial charge by a percentage
if initial_charge_percent != None:
  initial_charge = max_capacity * initial_charge_percent

# Other constants
miles_to_meters_multiplier = 1609.334
feet_to_meters_multiplier = 0.3048
hours_to_seconds_multiplier = 3600.0
pounds_to_kilograms_multiplier = 0.45359237
watt_hours_to_joules_multiplier = 3600.0
earth_gravity_constant = 9.81

# Calculated constants
vehicle_mass = vehicle_weight * pounds_to_kilograms_multiplier

# Functions 
def WhPerMi_at_speed(mph):	# Slope-intercept
  last_speed = 0
  last_wh = 0
  for entry in consumption_at_speed:
    speed = entry[0]
    wh = entry[1]
    if mph < speed:
      percent = (mph - last_speed) / (speed - last_speed)
      return percent * wh + (1.0 - percent) * last_wh
    last_speed = speed
    last_wh = wh

  #Fallthrough
  last_speed = consumption_at_speed[-2][0]
  last_wh = consumption_at_speed[-2][1]
  speed = consumption_at_speed[-1][0]
  wh = consumption_at_speed[-1][1]
  percent = (mph - last_speed) / (speed - last_speed)
  return percent * wh + (1.0 - percent) * last_wh


def max_speed_at_SOC(cur_charge):
  last_charge = 0
  last_mph = 0
  for entry in max_speed:
    charge = entry[0]
    mph = entry[1]
    if cur_charge < charge:
      percent = (cur_charge - last_charge) / (charge - last_charge)
      return percent * mph + (1.0 - percent) * last_mph
    last_charge = charge
    last_mph = mph

  #Fallthrough
  return max_speed[-1][1]
  


def coords_to_ground_distance(lat1, lon1, lat2, lon2):
  R = 6371000.0
  dLat = math.radians(lat2 - lat1)
  dLon = math.radians(lon2 - lon1)
  a = math.sin(dLat / 2) * math.sin(dLat / 2) + \
      math.cos(math.radians(lat1)) * math.cos(math.radians(lat2)) * \
      math.sin(dLon / 2) * math.sin(dLon / 2)
  c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a))
  d = R * c
  return d

def energy_to_climb(meters):
  return meters * vehicle_mass * earth_gravity_constant / watt_hours_to_joules_multiplier
  

def translate_route(route):
  translated_route = []
  last_lat = route[0][0]
  last_lon = route[0][1]
  cumulative_dist = 0
  for entry in route:
    lat = entry[0]
    lon = entry[1]
    alt = entry[2] * feet_to_meters_multiplier
    dist = coords_to_ground_distance(last_lat, last_lon, lat, lon)
    cumulative_dist += dist
    translated_route.append( (cumulative_dist, alt) )
    last_lat = lat
    last_lon = lon
  return translated_route


def simulate(route, starting_charge, target_speed, feet_per_cycle):
  route = translate_route(route)
  meters_per_cycle = feet_per_cycle * feet_to_meters_multiplier
  dist = 0
  generator_on = False
  charge = starting_charge
  last_alt = route[0][1]
  route_last = 0
  route_next = 1

  while True:
    dist += meters_per_cycle
    if dist > route[-1][0]:
      break
    if dist > route[route_next][0]:
      route_last += 1
      route_next += 1
    percent = (dist - route[route_last][0]) / (route[route_next][0] - route[route_last][0])
    alt = percent * route[route_next][1] + (1.0 - percent) * route[route_last][1]
    alt_change = alt - last_alt
    last_alt = alt

    #Try to find a speed that won't go negative in terms of charge.
    speed = target_speed
    max_speed = max_speed_at_SOC(charge)
    if speed > max_speed:
      speed = max_speed
    while True:
      temp_charge = charge
      if alt_change >= 0:
        temp_charge -= energy_to_climb(alt_change)
      else:
        temp_charge -= energy_to_climb(alt_change) * regen_efficiency
      travel_dist = math.sqrt(alt_change * alt_change + meters_per_cycle * meters_per_cycle)
      temp_charge -= (travel_dist / miles_to_meters_multiplier) * WhPerMi_at_speed(speed)
      if temp_charge < min_generator_charge:
        generator_on = True
      elif temp_charge > max_generator_charge:
        generator_on = False
      if generator_on:
        hours_passed = (travel_dist / miles_to_meters_multiplier) / speed
        temp_charge += generator_power * hours_passed
      if temp_charge > max_capacity:
        temp_charge = max_capacity
      if temp_charge < 0:
        speed -= 1.0	#If we go below zero, try again, a touch slower.
        continue
      else:
        break
    charge = temp_charge

    if all_electric == True:
      print "Mile %.3f: Charge=%d Wh, Speed=%d mph" % (dist / miles_to_meters_multiplier, charge, speed)
    else:
      print "Mile %.3f: Charge=%d Wh, Speed=%d mph; Generator running: %s" % (dist / miles_to_meters_multiplier, charge, speed, generator_on)


# Runme
simulate(routes[route], initial_charge, target_speed, 100.0)
 
Back
Top