ElectricMotorcycleForum.com

  • March 28, 2024, 09:41:03 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: [1] 2 3

Author Topic: The ZERO CanBus communication protocol  (Read 7678 times)

Doctorbass

  • Battery tech
  • Hero Member
  • *****
  • Posts: 968
    • View Profile
    • Endless-sphere.com
The ZERO CanBus communication protocol
« on: September 10, 2012, 09:51:15 AM »

The communication between diverse parts of the zero electrical system is done with CanBus protocol.

I just wonder if someone ever tried to communicate  and get some data from the zero system like the battery or dashboard or other with these CAN to USB adaptor... or even the OBDII adaptor ?

I have spoke with someone that apparently succeded to change some parameter of his zero with the cable adaptor and a PC... it would be interesting to try!


Doc
Logged
Zero Drag racing bike: 12.2s 1/4 mile and 7.3s 1/8 mile
https://youtu.be/iVMPBnfhukM
T w i t t e r  :     http://twitter.com/DocbassMelancon

Electric Terry

  • Hero Member
  • *****
  • Posts: 705
    • View Profile
Re: The ZERO CanBus communication protocol
« Reply #1 on: September 10, 2012, 06:10:09 PM »

Yes, in fact i would deem this cable as essential to have as the bikes with encoder or controller eeprom drift get higher mileage.  Being able to recalibrate the motor to the controller when out somewhere is absolutely essential.  Zero will probably start selling these cables with the bikes.  Since I have been able to recalibrate anywhere now, the bike runs great!

That is through the OBDII port.  Through the BMS port you can get the battery info.  I had an odd situation where I started to lose power (not a cut out, just a loss of power) the other day with about half the fuel guage remaining.  Then it did cut out and flashed a few codes at me and the pack went from half to empty instantly skipping over all the bars in between.  I pushed it to a house and asked to plug in for a bit to get home.  I was able to pull this data to find a cell that was a lot lower than the others:

"ZERO BMS> balance
  -   Bank  Voltage(mV)  Diff(mV)   Graph
    -   01        3455       192    --------------------------|
    -   02        3451       188    --------------------------|
    -   03        3399       136    -------------------|
    -   04        3410       147    --------------------|
    -   05        3388       125    -----------------|
    -   06        3414       151    ---------------------|
    -   07        3446       183    -------------------------|
    -   08        3434       171    -----------------------|
    -   09        3409       146    --------------------|
    -   10        3424       161    ----------------------|
    -   11        3418       155    ---------------------|
    -   12        3405       142    --------------------|
    -   13        3378       115    ----------------|
    -   14        3263         0    -|
    -   15        3293        30    -----|
    -   16        3334        71    ----------|
    -   17        3373       110    ---------------|
    -   18        3444       181    -------------------------|

  - Highest Bank :  01 (3455 mV)
  - Lowest Bank  :  14 (3263 mV)
  - Imbalance    : 192 mV"

Then I reviewed the log to see if I could find what happened:

"ZERO BMS> eventlogdump

*************************************************************
*                        Event Log                          *
*************************************************************
Printing 5806 of 5806 log entries..

 Entry    Time of Log            Event                      Conditions
...
...
...
05686     09/08/2012 17:38:50   Discharge level            065 AH, SOC: 46%, I:  0A, L:3424, l:3424, H:3483, B:059, PT:031C, BT:034C, PV:62373, M:Idle
 05687     09/08/2012 17:42:26   Bike Turned On
 05688     09/08/2012 17:42:28   Discharge level            065 AH, SOC: 46%, I:-13A, L:3426, l:3383, H:3485, B:059, PT:032C, BT:032C, PV:62418, M:Bike On
 05689     09/08/2012 17:43:28   Discharge level            065 AH, SOC: 46%, I:-12A, L:3399, l:3359, H:3472, B:073, PT:032C, BT:034C, PV:62107, M:Bike On
 05690     09/08/2012 17:44:28   Discharge level            065 AH, SOC: 46%, I:186A, L:3118, l:3712, H:3294, B:176, PT:031C, BT:035C, PV:58326, M:Bike On
 05691     09/08/2012 17:45:28   Discharge level            067 AH, SOC: 44%, I: 60A, L:3003, l:3214, H:3324, B:321, PT:031C, BT:033C, PV:58193, M:Bike On
 05692     09/08/2012 17:46:28   Discharge level            067 AH, SOC: 44%, I:-13A, L:3260, l:3215, H:3435, B:175, PT:031C, BT:034C, PV:60920, M:Bike On
 05693     09/08/2012 17:47:18   Discharged To Empty        068 AH, SOC: 44%,         L:2763,         H:3284, B:521, PT:032C, BT:033C, PV:56694
 05694     09/08/2012 17:47:28   Discharge level            120 AH, SOC:  0%, I: 53A, L:2715, l:3065, H:3287, B:572, PT:032C, BT:034C, PV:56636, M:Bike On
 05695     09/08/2012 17:47:53   Bike Turned Off
 05696     09/08/2012 17:47:54   Discharge level            120 AH, SOC:  0%, I:  0A, L:3018, l:3018, H:3384, B:366, PT:032C, BT:033C, PV:59196, M:Idle
 05697     09/08/2012 17:48:24   Bike Turned On
 05698     09/08/2012 17:48:25   Discharge level            120 AH, SOC:  0%, I:-12A, L:3093, l:3013, H:3401, B:308, PT:032C, BT:033C, PV:59707, M:Bike On
 05699     09/08/2012 17:48:39   Bike Turned Off
 05700     09/08/2012 17:48:40   Discharge level            120 AH, SOC:  0%, I:  0A, L:3112, l:3112, H:3406, B:294, PT:032C, BT:033C, PV:59843, M:Idle"

This was very useful as it looks like at 5:47 PM after riding for 5 minutes the cells in bank 14 went from 3.4 volt to 2.7 volts.  But that can't be possible so i am going to try to balance the pack and keep checking to see if there is a short, the volt sensor is faulty, or there is a shorted or bad cell.  But without diagnostics when relying on bleeding edge technology that isn't quite bulletproof yet, you are helpless.  I'd recommend a small laptop and serial to USB cable for everyone to carry with you every where you go just in case.  I'm between 9,000 and 10,000 miles on the 2012 ZF9 now and the past 1,000 miles would have been impossible without it.
Logged
100,000+ all electric miles on Zero Motorcycles - 75,000+ on a 2012 Zero S and 35,000+ miles on a 2015 Zero SR
http://www.facebook.com/electricterry
http://instagram.com/electricterry
https://twitter.com/electricterry

Electric Terry

  • Hero Member
  • *****
  • Posts: 705
    • View Profile
Re: The ZERO CanBus communication protocol
« Reply #2 on: September 10, 2012, 06:41:05 PM »

Was able to snap a shot crossing the 9000 mile mark the other day.   the 134 is not the miles on the fuel guage, its the miles since my last recalibration.  I'm trying to keep a running log to see if there is a pattern to how long it goes before the sin_min values need recalibrating.  It really helps to be able to do this where ever you are when it happens.  Another reason to keep a communication cable with you at all times!  Anyone know if there is a serial terminal communication app for the iphone?  How cool would that be??  Being able to do all the diagnstics, check the battery banks any time, any where right from your phone.  Somehow i see this happening soon as it just makes sense.
Logged
100,000+ all electric miles on Zero Motorcycles - 75,000+ on a 2012 Zero S and 35,000+ miles on a 2015 Zero SR
http://www.facebook.com/electricterry
http://instagram.com/electricterry
https://twitter.com/electricterry

protomech

  • Hero Member
  • *****
  • Posts: 1996
    • View Profile
    • ProtoBlog
Re: The ZERO CanBus communication protocol
« Reply #3 on: September 10, 2012, 07:23:23 PM »

I haven't tried this, but you should be able to do it on Android, see Serial Terminal:
http://www.thepowerbase.com/2012/06/getting-work-done-on-android/

The Zero USB to RS232 serial console cable uses an FTDI chip so it should work with that app. Alternatively, Android supports Bluetooth serial profile.

iOS devices that support Bluetooth 4 may also work. iPhone 4S, iPad 3. See here
http://diydrones.com/forum/topics/who-wants-a-iphone-app-used-as-a-ground-station-with-mavlink
http://blog.makezine.com/2012/03/19/bluetooth-4-0-from-arduino-to-iphone-no-jailbreaking-no-mfi/
Logged
1999 Honda VFR800i | 2014 Zero SR
Check out who's near you on frodus's EV owner map!
http://protomech.wordpress.com/

Doctorbass

  • Battery tech
  • Hero Member
  • *****
  • Posts: 968
    • View Profile
    • Endless-sphere.com
Re: The ZERO CanBus communication protocol
« Reply #4 on: September 10, 2012, 10:14:46 PM »

I haven't tried this, but you should be able to do it on Android, see Serial Terminal:
http://www.thepowerbase.com/2012/06/getting-work-done-on-android/

The Zero USB to RS232 serial console cable uses an FTDI chip so it should work with that app. Alternatively, Android supports Bluetooth serial profile.

iOS devices that support Bluetooth 4 may also work. iPhone 4S, iPad 3. See here
http://diydrones.com/forum/topics/who-wants-a-iphone-app-used-as-a-ground-station-with-mavlink
http://blog.makezine.com/2012/03/19/bluetooth-4-0-from-arduino-to-iphone-no-jailbreaking-no-mfi/

Ok but whi talking about RS232 when the comm protocol is CANBUS ? I mean canbus is working with 2.5V to 0 and 5V and  the RS232 is between 0 and 5V... :-\
Logged
Zero Drag racing bike: 12.2s 1/4 mile and 7.3s 1/8 mile
https://youtu.be/iVMPBnfhukM
T w i t t e r  :     http://twitter.com/DocbassMelancon

protomech

  • Hero Member
  • *****
  • Posts: 1996
    • View Profile
    • ProtoBlog
Re: The ZERO CanBus communication protocol
« Reply #5 on: September 10, 2012, 10:39:53 PM »

Yeah, we're really talking about two different things. offthegrid is talking about the Zero serial console which talks RS232. Zero's dealer support kit has a CAN interface cable, but as far as I know that software is unavailable to mere customers.
Logged
1999 Honda VFR800i | 2014 Zero SR
Check out who's near you on frodus's EV owner map!
http://protomech.wordpress.com/

protomech

  • Hero Member
  • *****
  • Posts: 1996
    • View Profile
    • ProtoBlog
Re: The ZERO CanBus communication protocol
« Reply #6 on: September 10, 2012, 10:54:40 PM »

Also, regarding the pack balance issue - there's a command to forcibly rebalance the pack. Normally the pack should stay in balance when charged overnight - but if it isn't allowed to balance or isn't balancing for some reason, you could have one cell or a group of cells that's being drawn down much farther than the others. You could also have a cell that is starting to fail - which would be very early, you're probably around 150 100% cycles on the pack - so I'd see if you can get it to balance and then monitor it over time to see if it quickly unbalances again.
Logged
1999 Honda VFR800i | 2014 Zero SR
Check out who's near you on frodus's EV owner map!
http://protomech.wordpress.com/

Electric Terry

  • Hero Member
  • *****
  • Posts: 705
    • View Profile
Re: The ZERO CanBus communication protocol
« Reply #7 on: September 11, 2012, 03:22:44 AM »

Great idea protomech! I forgot about the command to rebalance! But how does it work? I mean what type of BMS does the zero have? I always used 24 individual 3.65 volt chargers on the headways to balance, and I know the delta q just charges cc to 74.7 then CV and so doesn't account for a cell that reaches peak voltage sooner.  Is it a resistor BMS on each cell that bleeds power over 4.15v?  How does the command balance the pack if the charger isn't charging?  But I should start doing this as I can't charge overnight. There is no sun (solar) my house is off the grid.  So as soon as the green lights start flashing on the Quiq I usually unplug as I'm usually waiting.  Probably why my pack is out of balance. But the sudden drop from 3.4v to 2.7v? Lol never seen that before!
Logged
100,000+ all electric miles on Zero Motorcycles - 75,000+ on a 2012 Zero S and 35,000+ miles on a 2015 Zero SR
http://www.facebook.com/electricterry
http://instagram.com/electricterry
https://twitter.com/electricterry

protomech

  • Hero Member
  • *****
  • Posts: 1996
    • View Profile
    • ProtoBlog
Re: The ZERO CanBus communication protocol
« Reply #8 on: September 11, 2012, 04:33:25 AM »

I don't know the details of how Zero's BMS works - it may only balance while the charger input is hot.

Quote
05686     09/08/2012 17:38:50   Discharge level            065 AH, SOC: 46%, I:  0A, L:3424, l:3424, H:3483, B:059, PT:031C, BT:034C, PV:62373, M:Idle
 05687     09/08/2012 17:42:26   Bike Turned On
 05688     09/08/2012 17:42:28   Discharge level            065 AH, SOC: 46%, I:-13A, L:3426, l:3383, H:3485, B:059, PT:032C, BT:032C, PV:62418, M:Bike On
 05689     09/08/2012 17:43:28   Discharge level            065 AH, SOC: 46%, I:-12A, L:3399, l:3359, H:3472, B:073, PT:032C, BT:034C, PV:62107, M:Bike On
 05690     09/08/2012 17:44:28   Discharge level            065 AH, SOC: 46%, I:186A, L:3118, l:3712, H:3294, B:176, PT:031C, BT:035C, PV:58326, M:Bike On
 05691     09/08/2012 17:45:28   Discharge level            067 AH, SOC: 44%, I: 60A, L:3003, l:3214, H:3324, B:321, PT:031C, BT:033C, PV:58193, M:Bike On
 05692     09/08/2012 17:46:28   Discharge level            067 AH, SOC: 44%, I:-13A, L:3260, l:3215, H:3435, B:175, PT:031C, BT:034C, PV:60920, M:Bike On
 05693     09/08/2012 17:47:18   Discharged To Empty        068 AH, SOC: 44%,         L:2763,         H:3284, B:521, PT:032C, BT:033C, PV:56694
 05694     09/08/2012 17:47:28   Discharge level            120 AH, SOC:  0%, I: 53A, L:2715, l:3065, H:3287, B:572, PT:032C, BT:034C, PV:56636, M:Bike On
 05695     09/08/2012 17:47:53   Bike Turned Off

You've probably deciphered this, but here's my take:

05686 // log number
09/08/2012 17:38:50 // datetime, may or may not be set to proper local time
Discharge level 065 Ah // pack capacity consumed
SOC: 46% // (55 Ah / 120 Ah = 45.8% SOC)
I: 0A // pack current, no present discharge
L:3424 // low bank millivolt
l:3424 // other millivolt? not sure what's going on here - you see it jump from 3.383 to 3.359 then 3.712 under moderate discharge. sometimes l is lower than L or higher than H.
H:3483 // high bank millivolt
B:059 // no clue
PT:031C // pack temp
BT:034C // BMS temp
PV:62373 // pack voltage in millivolt
M:Idle // bike mode

The first couple of log entries 1/minute show the low bank dropping from 3.426V to 3.399V to 3.118V (186A, 1.5C discharge) to 3.003V (60A, 0.5C discharge). Low bank voltage springs back up to 3.260V under the -13A discharge (slight regen?) .. then drops down to 2.763V under small discharge (0.5C). The bike then flags the battery SOC at 0%, even when the voltage level rises after being turned off.

Take a look at the following. Average 16 is the average voltage of the mid 16 banks (excluding high, low). Average 18 is the average voltage of all banks.
Code: [Select]
Current Low High Pack Avg 16 Avg 18
0 3424 3483 62373 3467 3465
-13 3426 3485 62418 3469 3468
-12 3399 3472 62107 3452 3450
186 3118 3294 58326 3245 3240
60 3003 3324 58193 3242 3233
-13 3260 3435 60920 3389 3384
2763 3284 56694 3165 3150
53 2715 3287 56636 3165 3146
0 3018 3384 59196 3300 3289

Under a 53A discharge where the low bank hits 2.715v, high bank 3.287V, the rest of the pack is averaging 3.164v. This is lower than the 186A discharge 3 minutes earlier @ 3.118V, 3.294V, 3.240V earlier. With the 1 minute resolution it's impossible to know whether the bike had just been hit hard at step 05694 and had sagged pretty low, and was just then coming back up.. or whether the entire pack was nearly fully discharged.

I wonder if perhaps the SOC meter got confused and thought the bike was fully charged when it was only 55% charged. 3.16V for the pack average excluding high/low with a 0.5C discharge is pretty close to the end, EIG recommends a 3.0V limit for discharge and a lower cutoff voltage of 2.5V.

Maybe arrange alternate transport and leave the bike plugged in for a day, verify that it has balanced then ride it for a couple of days and see if the bike is discharging unusually quickly, the SOC display bars are being removed at an uneven or unusual pace, or the range is unusual. If any of these is true you might want to give Zero a call.

Logged
1999 Honda VFR800i | 2014 Zero SR
Check out who's near you on frodus's EV owner map!
http://protomech.wordpress.com/

Electric Terry

  • Hero Member
  • *****
  • Posts: 705
    • View Profile
Re: The ZERO CanBus communication protocol
« Reply #9 on: September 11, 2012, 07:45:15 PM »

It seems B = H - L or the difference between the highest cell and lowest.  

ex.
 05688     09/08/2012 17:42:28   Discharge level            065 AH, SOC: 46%, I:-13A, L:3426, l:3383, H:3485, B:059, PT:032C, BT:032C, PV:62418, M:Bike On

H:3485 - L:3426 = B:059

05694     09/08/2012 17:47:28   Discharge level            120 AH, SOC:  0%, I: 53A, L:2715, l:3065, H:3287, B:572, PT:032C, BT:034C, PV:56636, M:Bike On

H:3287 - L:2715 = B:572

I'm guessing "B" stands for "balance"

I agree with the rest of your analysis on the data though. I was thinking the same.  And you're right I need to do a full pack balance and keep a close eye on the low bank.

I think the command is "dobalance" but I don't know how it works or what the conditions are to use it.  Anyone out there know?  I definitely don't want to do anything before I understand exactly how it works. 

We need the company Haynes or Chilton to print a service manual for the bike, or a factory service manual like Ive had for every motorcycle I've ever owned.  This is the weak link right now until there is a wide spread dealer network in every city, which might take a very long time.
« Last Edit: September 11, 2012, 07:52:15 PM by offthegrid »
Logged
100,000+ all electric miles on Zero Motorcycles - 75,000+ on a 2012 Zero S and 35,000+ miles on a 2015 Zero SR
http://www.facebook.com/electricterry
http://instagram.com/electricterry
https://twitter.com/electricterry

ColoPaul

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: The ZERO CanBus communication protocol
« Reply #10 on: September 16, 2012, 08:23:41 PM »

The Zero USB to RS232 serial console cable uses an FTDI chip so it should work with that app. Alternatively, Android supports Bluetooth serial profile.

Hi Protomech, Offthegrid.
   Where did you get this "Zero USB to RS232 serial console cable"?
   Where are you plugging in?  Is there a standard RS232 port or USB port somewhere on the bike?

   
   
Logged
2012 S ZF6    03 BMW K1200GT

Electric Terry

  • Hero Member
  • *****
  • Posts: 705
    • View Profile
Re: The ZERO CanBus communication protocol
« Reply #11 on: September 17, 2012, 06:22:52 PM »

Colopaul, it is part of their diagnostic kit.  There is a port for the bms near the sight glass behind the rubber plug and one for the main bike board which looks like an OBDII port but only uses 4 pins.  Your dealer can pull this information for you.

Well I went from 576 mv out of balance, to 192 mv out of balance, to after working on it hard for a few days, I am now only 4 mv out of balance!!! 

"  -   Bank  Voltage(mV)  Diff(mV)   Graph
    -   01        4108         4    -----------------------------|
    -   02        4107         3    ---------------------------|
    -   03        4106         2    --------------------------|
    -   04        4104         0    -----------------------|
    -   05        4106         2    --------------------------|
    -   06        4106         2    --------------------------|
    -   07        4106         2    --------------------------|
    -   08        4106         2    --------------------------|
    -   09        4107         3    ---------------------------|
    -   10        4107         3    ---------------------------|
    -   11        4106         2    --------------------------|
    -   12        4106         2    --------------------------|
    -   13        4107         3    ---------------------------|
    -   14        4105         1    ------------------------|
    -   15        4107         3    ---------------------------|
    -   16        4106         2    --------------------------|
    -   17        4106         2    --------------------------|
    -   18        4107         3    ---------------------------|

  - Highest Bank :  01 (4108 mV)
  - Lowest Bank  :  04 (4104 mV)
  - Imbalance    :   4 mV

  - Load Resistor States
  - Cell: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18
  - Res :  1  1  0  0  0  0  0  0  1  1  0  0  1  0  1  0  0  1 "
Logged
100,000+ all electric miles on Zero Motorcycles - 75,000+ on a 2012 Zero S and 35,000+ miles on a 2015 Zero SR
http://www.facebook.com/electricterry
http://instagram.com/electricterry
https://twitter.com/electricterry

protomech

  • Hero Member
  • *****
  • Posts: 1996
    • View Profile
    • ProtoBlog
Re: The ZERO CanBus communication protocol
« Reply #12 on: September 17, 2012, 09:07:46 PM »

offthegrid,

After balancing have you found that the range has returned to normal? Has it eliminated the sudden drop from 50% to 0% indicated charge?
Logged
1999 Honda VFR800i | 2014 Zero SR
Check out who's near you on frodus's EV owner map!
http://protomech.wordpress.com/

Electric Terry

  • Hero Member
  • *****
  • Posts: 705
    • View Profile
Re: The ZERO CanBus communication protocol
« Reply #13 on: September 18, 2012, 01:40:18 PM »

offthegrid,

After balancing have you found that the range has returned to normal? Has it eliminated the sudden drop from 50% to 0% indicated charge?

Yes, the bar's don't seem to last any longer (still 5-10 miles per bar depending on the riding I'm doing) although the first bar used to go away a lot faster 2-3 miles, yesterday I went 13 miles before the first bar disappeared (when ever i first ride I always ride as conservative as possible to see how far I can go, but somehow that philosophy always goes out the window as soon as im in a hurry or something and I become a throttle abuser).  And I haven't checked the range yet as I'm always topping off and balancing lol, I've become almost obsessed with this and wish i had known about how bad the pack can get out of balance sooner.

If you can leave your bike plugged in overnight, you shouldn't have anything to worry about.  But after almost 10,000 miles of basically never plugging in over night my pack had really gotten out of wack.  The difference between my highest cell and my lowest cell at one point was 576 mv or almost 0.6 volts.  It is now 0.004 volts.   Big difference!
Logged
100,000+ all electric miles on Zero Motorcycles - 75,000+ on a 2012 Zero S and 35,000+ miles on a 2015 Zero SR
http://www.facebook.com/electricterry
http://instagram.com/electricterry
https://twitter.com/electricterry

Doctorbass

  • Battery tech
  • Hero Member
  • *****
  • Posts: 968
    • View Profile
    • Endless-sphere.com
Re: The ZERO CanBus communication protocol
« Reply #14 on: September 19, 2012, 09:45:30 AM »

All my 11 bar dissapear at 50% Ah consumed ( i have 59.8 real usable Ah before a cell bank goes to 3.00V) and at 30Ah used all the bar are dissapeard... but the bike run anyway... for the rest of the 59.8Ah... it's just the bar that dont match the real capacity?
Btw i measure 3.00 kWh for 59.8Ah 100% DOD

how to recalibrate the bars? is it thru the MBB or the same way than to recalibrate the speedo by pressing some button following precise steps?

Doc

Logged
Zero Drag racing bike: 12.2s 1/4 mile and 7.3s 1/8 mile
https://youtu.be/iVMPBnfhukM
T w i t t e r  :     http://twitter.com/DocbassMelancon
Pages: [1] 2 3