ElectricMotorcycleForum.com

  • November 24, 2024, 09:30:10 AM
  • 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: Cable to access BMS Diagnostic Port  (Read 7398 times)

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Cable to access BMS Diagnostic Port
« on: November 24, 2017, 11:54:02 PM »

I have successfully connected to the BMS using a modified version of the ODB serial cable described in this thread http://electricmotorcycleforum.com/boards/index.php?topic=4296.0

EDIT: New drawing to clearly show the pinout. PDF version has links.

The BMS connector is tiny. I found this part that mates with it and was able to solder wires to it. http://www.mouser.com/ds/2/276/0791077003_PCB_RECEPTACLES-175725.pdf

I then used a multimeter to find the right pins for a serial connection. I found the ground pin is connected to the B- with 10 ohms. Connecting green TX to the RX pin and white RX to the TX pin got me this:

Code: [Select]
ZERO BMS> help


*************************************************************
*                      BMS Main Menu                        *
*************************************************************

  help            - Display this Help screen
  login           - Show login level, or login with password
  logout          - Log out of BMS
  version         - Display Version Information

  stats           - Display All statistics
  balstats        - Display balance statistics
  capstats        - Display capacity statistics
  set             - Show all settings, or edit a specific setting

  eventlogdump    - Display the contents of the event log
  errorlogdump    - Display the contents of the error log

  status          - Show pack status summary
  balance         - Show pack balance
  config          - Show pack configuration
  inputs          - Show all inputs
  outputs         - Show all outputs
  errors          - List all present warnings and errors

  dumpall         - Dump all data (stats, inputs, settings, and logs



ZERO BMS>

WOW!!! 8) So no more waiting for the app to maybe get bms logs. I will add this to the unofficial manual of course. This is not an easy thing to do, but yes, it can be done. Same serial setup as the OBD, 38400 8 N 1 N, no power connection.
« Last Edit: December 05, 2017, 08:30:17 PM by Keith »
Logged
2016 Zero FX, 2014 KTM 1190

Burton

  • Hero Member
  • *****
  • Posts: 1059
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #1 on: November 25, 2017, 12:05:51 AM »

This looks like the same screen you get with the reaper dongle in the ODBII port :)

I am sure i don't have to tell you to be careful when setting things in there and I would suggest doing a dumpall before changing anything so you can refer back to it if something goes wrong ;)
Logged
All content I have created here http://bit.ly/1NX4KP9

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #2 on: November 25, 2017, 12:32:47 AM »

Yes, this is very similar to the MBB login prompt but direct to the BMS, all of the same login details. I don't think I want to change anything, but it is nice to ask it how it's doing. I may get the right parts to make a real cable. That would be just 50394-8200 pins in a 51014-0008 housing. The other four pins have 8k pullups to 3.3v, no idea what they are for, some kind of inputs I guess. And yes, caution is important, this gets very expensive fast if you do something dumb.
« Last Edit: November 25, 2017, 12:49:09 AM by Keith »
Logged
2016 Zero FX, 2014 KTM 1190

rayivers

  • Hero Member
  • *****
  • Posts: 502
  • electric feels so right
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #3 on: November 25, 2017, 06:12:26 AM »

It would be great to know what the BMS 'set' submenu consists of.  If/when a 4.0 single FX brick becomes available I plan to get one if possible (it will need a reprogrammed 2014 BMS) and it'd be nice to have some idea in advance exactly what's going on, especially if someone at Zero tells my dealer it can't be done.

Ray
« Last Edit: November 25, 2017, 07:47:54 AM by rayivers »
Logged
'14 Zero FX 5.7 (now 2.8, MX), '14 Zero FX 2.8 (street), '19 Alta MXR, '18 Alta MXR, various '74 - '08 ICE dirt bikes

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #4 on: November 25, 2017, 08:26:53 AM »

I've learned that the menus change with the login level and that there are commands that work but are not on the menus. So only Zero know exactly what's going on.
Logged
2016 Zero FX, 2014 KTM 1190

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #5 on: November 25, 2017, 07:59:13 PM »

Here's what the Quiq charger does when changing from constant current to constant voltage at 100% SOC. Nice data from the BMS serial port although it took some work to filter out all of the DEBUG lines complaining about no CAN traffic.
Logged
2016 Zero FX, 2014 KTM 1190

Shadow

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1085
  • 130,000mi electric since 2016
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #6 on: November 25, 2017, 09:45:56 PM »

Here's what the Quiq charger does when changing from constant current to constant voltage at 100% SOC. Nice data from the BMS serial port although it took some work to filter out all of the DEBUG lines complaining about no CAN traffic.
Nice! Can we infer a charging profile from this?
Logged

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #7 on: November 25, 2017, 10:31:26 PM »

Looks like we can. Interesting how the current is low resolution and noisy while the voltage data is clean. I'll do the same for the on board charger next, if I can figure out how to hook up the cable while the pack is on the bike.
Logged
2016 Zero FX, 2014 KTM 1190

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1638
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #8 on: November 27, 2017, 03:08:43 AM »

K
K> > > Here's what the Quiq charger does when changing from constant current to constant voltage...

This is the Zero Quick Charger version of the Quiq charger, right?  The one sold by Zero? 

S> > Nice! Can we infer a charging profile from this?

I would think this is a good profile, but I'd also compare it to what the onboard does.

K> Looks like we can. Interesting how the current is low resolution and noisy while the voltage data is clean. I'll do the same for the on board charger next, if I can figure out how to hook up the cable while the pack is on the bike.

Yeah.  I'd de-noise the current a bit, maybe a rolling average, if building a charging control circuit. 

Logged
our knowledge about Zeros collects here: https://zeromanual.com/

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #9 on: November 27, 2017, 04:08:05 AM »

I've ordered a proper connector and if I'm careful, I think I can make it low profile so it can work on the bike. There is very little clearance to the pack diagnostic cover when the packs are on the bike so a small right angle wire routing to the connector may work. Some time next week...
Logged
2016 Zero FX, 2014 KTM 1190

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #10 on: December 05, 2017, 04:10:10 AM »

Made a nice BMS cable with the proper connector. It works great but my plan to use it on the bike did not. Onboard charger will not close the contactor when the BMS is connected. The dash gives the 2-3 flashes CAN error. Can't use the OBD while charging either, more CAN trouble. So I will get the charge current versus time data for the onboard charger, but it will have to be done on the AC side, oh well.
Logged
2016 Zero FX, 2014 KTM 1190

Lenny

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #11 on: March 25, 2018, 02:38:03 AM »

I can confirm that Keiths solution works perfectly fine. I have used it a few times and played around with the BMS or pulled logs.
Logged
Zero FXS 6.5 MY16

clockfort

  • Newbie
  • *
  • Posts: 41
  • 2015 Zero SR; Silicon Valley USA
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #12 on: May 07, 2018, 01:21:36 PM »

It would be great to know what the BMS 'set' submenu consists of.  If/when a 4.0 single FX brick becomes available I plan to get one if possible (it will need a reprogrammed 2014 BMS) and it'd be nice to have some idea in advance exactly what's going on, especially if someone at Zero tells my dealer it can't be done.

Ray

(sorry for replying to an old thread)

It's easy to see all of the possible commands from any login level if you just dump the firmware banks and look at it on your computer  ;) (...and it's also easy to see the passwords for the login levels...)

This is what it the main help command prints out if you're logged in at max login level:
Code: [Select]
*                      BMS Main Menu                        *
*************************************************************
   help            - Display this Help screen
  login           - Show login level, or login with password
  logout          - Log out of BMS
  version         - Display Version Information
  stats           - Display All statistics
  balstats        - Display balance statistics
  capstats        - Display capacity statistics
  statsrst        - Reset All statistics
  settingsrst     - Reset System Settings To Defaults
  eventlogdump    - Display the contents of the event log
  eventlogadd     - Adds an arbitrary string to the Event Log
  eventlogfill b  - Fills Event log with <b> bytes
  errorlogdump    - Display the contents of the error log
  errorlogadd     - Adds an arbitrary string to the Error Log
  status          - Show pack status summary
  balance         - Show pack balance
  config          - Show pack configuration
  inputs          - Show all inputs
  meas            - Show most recent measurements
  outputs         - Show all outputs
  errors          - List all present warnings and errors
  reset           - Reset CPU with SW reset
  eeprom          - Show EEPROM usage
  eeprom set x y  - Set a byte in Eeprom at address x to y
  erase eeprom    - Erase entire EEPROM
      bin         - Dump as a binary stream of eeprom
      hex         - Dump as an ascii file of eeprom
  timing          - Display system timing
  mbb             - Display MBB Interface INfo
  timerrst        - Reset All clocks to zero
  dobal           - Balance Pack to Tolerance
  stopbal         - Stop all menu-related balancing
  wdt reset       - Force Watchdog Timeout
  exit_to_bl      - Exit main app and start bootloader
  test            - Run a specific test, or show the test menu
  can             - Display CANbus statistics
  pl536           - Displays contents of all PL536 registers.

However, there appear to be some hidden commands that even the max login level help screen won't tell you about, like: (there are also some other commands that are just aliases / old names for existing commands; I haven't listed them here because who cares)
Code: [Select]
errorlogdumpraw
eventlogdumpraw
override_monolith_charge
cancel_monolith_charge
reset_quick

The full list of 'set' command completions:
Code: [Select]
*                       BMS Settings                        *
*************************************************************
  To change settings, type:
    "set <setting name> <value1> <value2> ..."
 ************
 Psudo Settings
  Variable        Description              Value
   time            Current Time (RTC)    %s
  time utc        Current UTC Time (RTC)          %10lu
  systime         System Clock Time (test only)   %10lu
  dut_mode        DUT mode                                 %u
  soc             Present State Of Charge               %3u %%
  correctsoc      Correct State Of Charge for Voltage   %3u %%
  addfulldis      Add full discharge to history in uAh
  addestdis       Add estimated discharge to history in uAh
  config none     Reset config to uninitialized
  vref_auto_cal   Auto-calibrate ADC VREF
 **************
« Last Edit: May 07, 2018, 01:28:26 PM by clockfort »
Logged

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #13 on: May 07, 2018, 05:31:54 PM »

Don't be sorry! I'm glad to see others get into this deeper understanding of our machines. I see some commands listed under help that are not in your list, maybe different firmware, or perhaps a different login, for example
Code: [Select]
 
  timerrst        - Reset All clocks to zero
  dobal           - Balance Pack to Tolerance
  dobackgroundbal - Continually Balance Pack In Background Until Balanced
  stopbal         - Stop all menu-related balancing

There are also hardware differences in the BMS versions. I tried and failed to calibrate the dual current sensors in a replacement BMS with these commands
Code: [Select]
cur_sense_offset_0   Current sensor 0 zero-offset                     -27 mV
 cur_sense_offset_1   Current sensor 1 zero-offset                       0 mV
 cur_sense_cal_0      Current sensor 0 slope calibration            0x8000
 cur_sense_cal_1      Current sensor 1 slope calibration            0x8000
 cur_sense_blend      Current sensor blending voltage                    1 mV

The settings would not stick, don't know why and the measurement error was small enough to ignore. Older BMS has only one current sensor. Maybe someday we'll have open source firmware!
Logged
2016 Zero FX, 2014 KTM 1190

clockfort

  • Newbie
  • *
  • Posts: 41
  • 2015 Zero SR; Silicon Valley USA
    • View Profile
Re: Cable to access BMS Diagnostic Port
« Reply #14 on: May 07, 2018, 06:30:40 PM »

I see some commands listed under help that are not in your list, maybe different firmware, or perhaps a different login, for example... <snip>

Those are in the list, you just need to scroll the my text box down separately. (code blocks in this forum software kind of suck)
Though, I mistakenly omitted dobackgroundbal (which also goes by 'dbgb' in the code) because I hadn't realized they were a different function from the foreground balance command.

The version of the BMS firmware I happen to be referencing is this one from 2016-10-26, intended for a 2017 S if I recall
Code: [Select]
         "part_name" : "bms",
         "firmware" : "75-08037",
         "firmware-revision" : "21",
         "build_number" : "320"


... agreed, an open source version would be lovely.
« Last Edit: May 07, 2018, 06:40:45 PM by clockfort »
Logged
Pages: [1] 2 3