WattsLeft™ Monitor (Parallax SX28AC/DP SOC/CAN Project)

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.
Here are the five new cases made today plus the one from yesterday surrounded by the OBDII connectors that were also modified today.

newcases.jpg


Jim
 
Tony Williams needs to borrow some GID-Meters to instrument the
Leafs as they drive the range test this next Saturday in Phoenix.

Jim, I sent you a PM.

Thanks to anybody who can help.
 
The last couple days I have been working on making the DTE range user selectable on first power up or reset.

I finished the first version with user control last night. But not 10 minutes later I get a PM from LeafSwe with details about the Leaf energy display format Nissan uses in Europe. Which to my surprise is very different then what I get when I put a US Leaf into KM display mode.

Here is what the European Leaf display looks like.

energyeu.jpg


They use kwh/km which is the inverse of US Leafs so their energy scale moves in the opposite direction (lower is better).

What I have coded is km/kwh with a default range of “5 6 7 8 9” which corresponds to a EU range of “0.2 0.167 0.143 0.125 0.111”.

The simple solution is to just have a printed table the driver uses mapping km/kwh numbers to kwh/km numbers like in the sentence above. Displaying in kwh/km seems very difficult given my display space limits and the complexity of conversion.

Jim
 
UK owners seem to be unhappy with LEAF reporting and they often wondered if US style of miles per kWh could be displayed - so I think those would be happy with US meter.
 
DTE energy range selection coding is complete. You are now able to change the default DTE format (English/Metric) and starting energy usage value (2.5 thru 7.5) upon first plugging in the cable or after pressing the Reset Button located on the back. Selection is made by cycling through the 22 choices (11 for each format) starting at the default value which will be 3.5 for English format and 5.0 for Metric format. When you reach the end of one table you switch to the other table.

Here are the complete tables for both English in miles/kWh and Metric in km/kWh plus a “for reference only” kWh/km table. The default selections are highlighted.

dtetable.jpg


Now back to assembly of the units.

Jim
 
Turbo3 said:
... A side benefit was four new screens for real time data. I just needed to come up with what to display on them. Just as I was finishing this code up Steve Lemke emailed me for a status update and a suggestion he came up with after seeing the new RAV4 EV maximum distance to empty screen. He suggested I add a screen where I calculated the maximum miles remaining based on current gids and a user selectable mile/kwh number. This sounded like something that could be added since it did not require any additional register space just some calculations and a screen to display it.

Rather than have the user select a miles/kwh number I decided to display a range of five values (4.0, 4.5, 5.0, 5.5, 6.0). With two digits for miles below each number so the driver can see the effect of different driving styles on the remain miles. The final format used the letter scheme for numbers above 99 which is not so important for miles but when I created a kilometer version seemed more useful. Also below 1 mile or km of range the display switches to “.x” to show the last few tenths available.

There are actually three of these “Distance to Event” screens as I am calling them (not to empty). The events are Low Battery warning, Very Low Battery warning and Turtle identified by the letters ‘L’, ‘V’ or ‘T’ in the left most position (at the 49,24,4 gids level).

Here is what it looks like:
dtturtle.jpg
I have to say the DTE screens are awesome, just as I expected they would be. I leave mine on "T", showing my distance to turtle from 3.5 to 5.5 (though I might change that to 3.0 to 5.0 since that's a better match for my range of driving styles). I no longer care what the dashboard guess-o-meter says, though it is amusing to compare it to the WattsLeft numbers to see what the car projects my future energy economy will be. I can easily reset my dash Energy Economy indicator to get an idea what my current consumption average is, and (on the rare chance where it is warranted) I can adjust my driving style as needed. I even confirmed that the "L" values are exact, in that the car's Low Battery warning occurred at the exact same instant when the WattsLeft "distance to L" changed from 0.1 to 0. The best part is that I can now just stop worrying about range, since at any time I know (precisely) WattsLeft. :)

After the 49.7 mile drive from Sunnyvale to Crissy Field last Sunday for National Plug-in Day, it was great to know that (after a brief session on the Nissan QC at the event) I did not need to drive conservatively on the way home. Instead, I was able to simply enjoy a long, beautiful, and fast (never mind how fast) drive back home on Highway 280 without any worries about the GOM or any battery warnings, let alone turtle. :D
 
surfingslovak said:
TonyWilliams said:
Is this product available?
We had a prototype in Phoenix, it came straight from Turbo3 (thanks again).

Crap, that obviously slipped me checking it out. I would like to buy one, when available.

Thanks, Turbo3, for lending us your stuff. It was a pretty awesome group effort.
 
I have finally completed building up 12 sets of cables which was the missing item I needed before I could sell the units.

I will be at the Union City Bayleaf meeting tomorrow with seven units for sale (three Basic and four with Bluetooth).

Price is $199 for the Basic and $20 more for the Bluetooth option.

Please email me at [email protected] if you are interested in getting one tomorrow and having it installed. I can also email you back a one page Quick Guide with the current set of screens. Please use this email address for ordering and to request the Quick Guide.

Thanks to Steve my beta tester for his suggested improvements.

Regards, Jim
 
Purchased a WattLeft Monitor from Turbo3 at the SF BayLEAFs meeting on 10/13. Now I can see the Gid reading on my LEAF. Left meeting in Union City with reading of 68.7%, 193 gids and arrived in SF with 24.5%, 69 gids (2 bars and 13 GOM miles) - distance of 39 miles. Overnight charged on L1 to a reading of 98.2%, 276 gids, which suggests my battery is still not showing degradation problems. The ODO on my LEAF is 7981 miles, with no QC, infrequent 100% charge, highest battery bars observed is 6, and LEAF is mainly driven on surface streets.

This morning where I was in SF, the temp is now bout 57F, and the car was outside covered with condensation from the fog. Looking at the dashboard, the readings were 12 bars and GOM of 89 miles. Yesterday morning in Cupertino with LEAF charged to 100%, readings were 12 bars and GOM of 116 miles.

Now I can add more data to my spreadsheet.
 
Jim,
Really Great work!
Do we get soe more pictures, of the finished
proguct, inside, with and without BlueTooth, and outside.

Does this only Log with BlueTooth?

Does the Bluetooth receiver in the PC present a
virtual Comm Port that CAN-Do could conect to?

How would one set that connection up, and
what BT dongle do you recommend for the PC?

Is the Logging data stream compatible with CAN-Do?

If not, what data format did you finally decide to use?
Or, is there an option for the data stream contents?

I look forward to seeing, and trying to Log with,
your nifty device.

Again, Splendid Work!
Thanks, Gary
 
I too would love to see the final product prior to purchase. Some questions: How long is the cable, where does the unitfit? What lcd did you use (sunlight compatible yellow, or blue?).

Thanks!
 
Here is a little more detail about the current product and installation.

A complete WattsLeft™ consists of the Display/Electronics unit, the rotary Selector and OBCII right angle connector with one long cable going to the Display and a shorter cable going to the selector. The long cable is about 6’ 10” and the short cable is about 3’ 1”. Starting raw cable lengths are 7’ and 3.5’ before being attached at both ends.
completeunit.jpg


If necessary for installation (advanced type) the Display/Electronics unit can be disconnected from the cable by removing the cable clamp screw and carefully removing the eight pin connector. The orange Power wire is always closest to the side edge. Don’t get that wrong or you will drive +12 volts into the CAN transceiver and load the Car EV CAN down trying to run the electronics/display!

In this backside shot you can see the reset button just below the black 8 pin connector. When you have the Bluetooth module the outer plastic ring will pulse pink when looking for a connection and will stay solid pink when a connection is made. This will happen independent of whether any EV data is being sent.
backnq.jpg



Here are some pictures of the first customer install. The simplest install is to put the unit in the center of the dash above the Navigation screen and angled towards the driver. The wire runs down the left side of the center black control panel.

Here is an overview shot.
dashmount.jpg


Close-up of display unit.
dashclose.jpg


Close-up of selector unit. Note cable still needs to be moved to the right and should follow the seam on down.
selector.jpg


Close-up of underside of dash. Note that the cables from the OBDII connector are routed inside the removable panel to keep them clear of the driver’s feet. There is also sufficient slack in the OBDII cable to allow it to be unplugged without the need to remove the lower panel again. Nissan will need access to the OBDII connector to do any service so it is a good idea to unplug it before going in. Note unplugging the connector will power down WattsLeft™ and all History data will be LOST! So write it down before unplugging.
underdash.jpg


A more advanced installation would pull the center dash unit out (with Nav screen) so the cable can be route directly down so it does not show. A small amount of filing may be needed on the gray plastic lip so the cable does not get pinched or block the center dash unit from being pushed back in place.

Here is a close-up of the top side of the electronics board. Note that this board has two CAN transceivers for testing but the shipped board will only have one installed (EV CAN). There is currently no firmware to support the Car CAN bus.
rev11componentside.jpg


Now the back side without the Bluetooth module installed.
rev11backside.jpg


Here it is with the Bluetooth module installed.
rev11backsidebt.jpg


Set of completed boards with display units attached ready to be install in cases.
rev11btboards.jpg


Here are the eight completed assemblies. Note that only three have LEDs installed the other five will get LEDs when they are installed in the cases.
readyforbox.jpg


Now for Gary’s questions:

The current product only supports logging EV activity over Bluetooth. However when Bluetooth is not installed different firmware is install to support a hardwired serial port. If you look closely at the back of the board just below the top left corner hex plastic standoff and above the black Bluetooth connector you can see two pins. Top one is ground and lower one is serial data. Just connect it to a DB9 to get a hardwired serial port. But I recommend spending the extra $20 and getting Bluetooth as you avoid the cables and connectors. The polarity of the serial data is opposite between hardwire and Bluetooth so different firmware is needed.

Yes the Bluetooth shows up as a virtual Comm Port on the PC. I have used it with the CAN-DO program to log EV data. Baud rate is 57,600. I send two extra bytes at the end which are the original CRC data and ignored by CAN-DO. It would be nice if CAN-DO had an option to accept only CRC validated data. But the first few bytes of the CAN-DO format need to be rearranged inside the PC to match the original CAN format for the CRC to match.

The format I send is 13 bytes (CAN-DO is 11 bytes). First 11 bytes are the same as CAN-DO so you can use Gary’s program. Format is: SYNC, MM, NH, Data 0 thru Data 7 followed by two bytes of original CRC. For the CRC to match the MM, NH bytes need to be rearranged back into the original three bytes send from the EV CAN bus (0H, MM, 0N). The ID data is represented as HMM and N refers to the data count. Note that only eight byte data frames are passed thru so N always equals 8. SYNC= 0x53 xor MM xor NH.

My PC has Bluetooth installed so no dongle. I would think any dongle should work as this is basic serial.

As shown in earlier pictures the LCD is Blue with White characters. I have found that if I leave the protective film they ship with it ON it acts as a ¼ retarder and allows the display to be view with polarized glasses. Since this was not the intended purpose of the film the manufacturer just slapped it on so small bubbles are unavoidable in the finished product. I don’t see them when the display is ON but if they bother you you can always remove the film.

I think that takes care of all the current questions.

I am currently working on a small firmware updated to allow better control of the LED by disabling it on certain screens. The change will allow it to function only on the 1st screen (SOC) and the 5th screen (DTE-V) and 6th screen (DTE-T).

Jim
 
If you tell me how to check the crc data, I could add in CAN-Do
a CRC Mode (2 additional bytes), and a Check CRC option
to discard messages that do not have a good CRC check.

As it is, CAN-Do has to try to re-sync twice after each of your
Messages (that have the CRC bytes appended).
 
Use the following procedure to verify the received data is good.

The received frame consists of 13 bytes:
SYNC, MM, NH, D0, D1, D2, D3, D4, D5, D6, D7, CRCH, CRCL

First these bytes need to be rearranged to match the order used to generate the appended CRC. SYNC is not used so it is dropped. Two bytes contain less than 8 bits so the notation “(n)” following the byte indicates the number of actual bits used right justified.

H(4), MM, N(7), D0, D1, D2, D3, D4, D5, D6, D7, CRCH, CRCL (total of 99 bits)

Technically H(4) could be H(3) since H ranges 0 to 7 but for this calculation the fourth bit represents the SOF bit which is always 0. However starting zeros before H do not affect the CRC calculation.

N(7) recreates the RTR,IDE,RB0 & DLC bits. We actually only have the DLC (Data Length Code) bits but the other three bits are always zero so loading a byte with N works for this recreation. Only the low order seven bits of this byte are used in the CRC calculation.

Now that we have our 99 bits in the correct order each bit is processed in MSB to LSB order (keeping in mind that two bytes have less than 8 bits) through the CRC generator polynomial.

The generator-polynomial is: X15 + X14 + X10 + X8 +X7 + X4 + X3 +1

For this I use a 16 bit unsigned integer variable cleared to zero at the start. At the end of processing all 99 bits this variable should contain the value 0x4599. (Ok, you think it should be zero at the end but the 99th bit is not really part of CRCL. CRC is really only 15 bits. The LSB of CRCL is actually the “Delimiter” bit which is always a 1. If you stopped at the 98 bit this variable’s low order 15 bits would be zero with the 16th MSB bit either 1 or 0. I just run the delimiter bit through which results in 0x4599 being the final ‘good’ value. If you stop one bit earlier you need to mask off the MSB bit to get zero.)

On the PC I use the following Turbo Pascal 3 code (Turbo3) to process each bit. The procedure is passed the bit to process as the LSB of newbit. CRC is the 16 bit variable.

Procedure GENCRC (newbit:integer);
Begin
crc:= crc shl 1;
If (crc and $8000)<>0 then newbit:=newbit XOR 1;
If newbit<>0 then crc:=crc XOR $4599;
End

First crc is shifted left one bit then the MSB is tested and if a one the bit being processed is inverted. Lastly original or inverted newbit is tested to see if it is a one. If the newbit is now a one the current value in the crc variable is XORed with 0x4599 (the generator-polynomial).

Here is an example of a frame with good crc attached.

CAN-DO format (Plus 2 extra bytes of CRC)

SYNC, 0xBC, 0x85, 0x39, 0x83, 0x2C, 0x3B, 0xC9, 0x06, 0x40, 0x0A, 0xAC, 0x45

Rearranged for CRC processing

0x05, 0xBC, 0x08, 0x39, 0x83, 0x2C, 0x3B, 0xC9, 0x06, 0x40, 0x0A, 0xAC, 0x45

Processing the above 99 bits in13 bytes (remember that two bytes have less than 8 bits) should result in the CRC variable containing 0x4599.

Jim
 
Back
Top