SegwayChat
Home . Old Gallery

Go Back   SegwayChat > Segway Forums > Segway General Discussion

Notices

Segway General Discussion General discussion related to any model of Segways, miniPROs, or Ninebots. Please do not post non-Segway technology posts here; use the technology forum instead.

Old 01-26-2019, 03:10 PM   #41
dorrington
Member
dorrington is on a distinguished road
 
Join Date: Jan 2016
Location: uk
Posts: 127
5 yr Member
Default

Nice work,......the stls would be nice....

Good stuff.
dorrington is offline   Reply With Quote
Old 01-26-2019, 05:28 PM   #42
Retro_Rich
New Member
Retro_Rich is on a distinguished road
 
Join Date: Jan 2019
Location: 🇬🇧
Posts: 7
5 yr Member
Default

Nice, have you done anything with the Ninebot plus battery?
Retro_Rich is offline   Reply With Quote
Old 01-27-2019, 01:02 PM   #43
felix_fetche
Member
felix_fetche is on a distinguished road
 
felix_fetche's Avatar
 
Join Date: Mar 2010
Location: Baia Mare, Romania.
Posts: 166
5 yr Member
Default

Maybe a good oportunity to go forward with Ninebot plus battery tester ?
Now my segway battery tester project is finalized 99,99%, only customizing or diferent hardware versions could be subject of change, communication and registers meaning is close to finish, maybe there are some statistical data or errors registers, calibration registers, but not important sofar for common diagnostics.

What kind of BCM is in Ninebot plus battery? Photos?
felix_fetche is offline   Reply With Quote
Old 01-28-2019, 03:28 PM   #44
martinbogo
Junior Member
martinbogo is on a distinguished road
 
Join Date: Mar 2007
Posts: 53
5 yr Member
Default

Quote:
Originally Posted by dorrington View Post
Nice work,......the stls would be nice....

Good stuff.
Thank you... I'm testing the connector now. It just uses some pretty common connectors, and I've printed it out in PETG and ABS so far. The design I'm using now is a little delicate, but at least it puts all the pins in the right place.

I don't recommend PLA due to the low temp and relative brittleness... ( I found that out the hard way )

Github repository is at:

https://github.com/martinbogo/i2-battery-diagnostics
martinbogo is offline   Reply With Quote
Old 01-28-2019, 10:11 PM   #45
martinbogo
Junior Member
martinbogo is on a distinguished road
 
Join Date: Mar 2007
Posts: 53
5 yr Member
Default

The Segway battery exposes interesting data on the following registers on i2c when read in the same way as the battery voltage values ( 3 bytes read, discard first byte, data encoded on 2nd and 3rd byte )

Register 12 ( 0xC ) reads 31 triplets. Byte 0 ( unknown ) , Byte 2 counts from Hex 0 -> 1E, Byte 3 ( unknown )
Register 204 ( 0xCC ) reads 31 triplets. Byte 0 ( unknown ), Bute 2 counts from Hex 0 -> 1E, Byte 3 ( unknown )
1st and 3rd values repeat after 31 reads, both registers show the same data

Register 198 ( 0xC6 ) reads 37 triplets. Byte 0 ( unknown ), Byte 2 counts from Hex 0 -> 25, Byte 3 ( unknown )
1st and 3rd values repeat after 37 reads

Example of the data - register number in <>, values in hex

<12> [C3:0:B0] [F1:1:1] [BE:2:33] [3F:3:31] [37:4:38] [3A:5:34] [C:6:61] [34:7:38] [A8:8:43] [27:9:43] [A6:A:43] [25:B:43] [37:C:30] [33:33] [A3:E:42] [A2:F:42] [21:10:42] [20:11:42] [31:12:30] [2D:13:33] [3F:14:20] [3E:15:20] [3D:16:20] [3C:17:20] [BB:18:20] [BA:19:20] [B9:1A:20] [83:1B:55] [82:1C:55] [D5:1D:81] [DC:1E:F9]
<204> [C:6:61] [34:7:38] [A8:8:43] [27:9:43] [A6:A:43] [25:B:43] [37:C:30] [33:33] [A3:E:42] [A2:F:42] [21:10:42] [20:11:42] [31:12:30] [2D:13:33] [3F:14:20] [3E:15:20] [3D:16:20] [3C:17:20] [BB:18:20] [BA:19:20] [B9:1A:20] [83:1B:55] [82:1C:55] [D5:1D:81] [DC:1E:F9] [C3:0:B0] [F1:1:1] [BE:2:33] [3F:3:31] [37:4:38] [3A:5:34]

<198> [AA:0:4F] [F7:1:1] [45:2:32] [46:3:30] [3C:4:39] [3E:5:36] [3C:6:37] [42:7:30] [41:8:30] [40:9:30] [BF:A:30] [3D:B:31] [2C:C:41] [24:48] [BA:E:31] [BA:F:30] [38:10:31] [38:11:30] [AE:12:39] [32:13:34] [2E:14:37] [A1:15:43] [33:16:30] [B1:17:31] [31:18:30] [AA:19:36] [AE:1A:31] [AA:1B:34] [2D:1C:30] [2C:1D:30] [AB:1E:30] [21:1F:39] [A1:20:38] [83:21:55] [2:22:55] [5E:23:F8] [27:24:AE] [D4:25:0]


Register 23 ( 0x17 ) reads 4 triplets. Byte 0 ( unknown ), Byte 2 increments 0x1,0x11,0x21,0x31, byte 3 ( unknown )
Register 215 ( 0xD7 ) reads 4 triplets. Byte 0 ( unknown ), Byte 2 increments 0x1,0x11,0x21,0x31, byte 3 ( unknown )
1st and 3rd values repeat after four reads - these are likely the temperature readings on two registers

<23> [7F:1:68] [F3:11:64] [4E:21:79] [4A:31:6D]
<215> [7F:1:68] [F3:11:64] [4D:21:7A] [4A:31:6D]

This data parses to the following binary:

Code:
0001 0001 0110 0100
0010 0001 0111 1010
0011 0001 0110 1101
---- Measurement index nibble
     -------------- Possible A/D conversion of the temperature ( 12 bit, or 10 bit? )
If this is the case, this looks similar to a Texas Instrument 12 bit ADC converter, and you take the 12-bit value and multiply it by 0.0625 to get the temperature in Centigrade.

Taking the example data :

0b000101101101 = 365
365*0.0625 = 22.81 centigrade -- which is plausible for the temp in my lab

And of course, registers 150 (0x96) and 86 (0x56) contain the battery voltage data encoded as:

Byte 0 (checksum) : Byte 1, Byte 2 are the MSB and LSB of a 16 bit integer. Top 3 bits are the battery index. Lower 10 bits are A/D converted battery voltage data, where each tick represents 8 volts / 1023 steps.

Last edited by martinbogo; 01-28-2019 at 11:03 PM.. Reason: Adding example data
martinbogo is offline   Reply With Quote
Old 01-30-2019, 06:07 PM   #46
martinbogo
Junior Member
martinbogo is on a distinguished road
 
Join Date: Mar 2007
Posts: 53
5 yr Member
Default

I have uploaded the STL file for a quick and simple to use battery connector. You will need a set of standard breadboard leads ( the ones with the square ends, about 1.6mm square ) which you will use as the pins.

Cut a long lead in half ( or remove the cable from the pin connector ) and thread the lead up through the connector. Seat the square pin holder into the square holes provided on the bottom.. you should be able to press fit them.

https://github.com/marti.nbogo/i2-battery-diagnostics/blob/master/battery_connector.stl

For the + and - connectors, use nails that are slightly under 2mm in diameter and at least 30mm long. Epoxy or superglue them into place.

Print settings that worked for me are:

200 micron layers
25% infill ( grid infill is fine )

Screen Shot 2019-01-30 at 4.04.54 PM.jpg
MVIMG_20190130_160746.jpg
MVIMG_20190130_160800.jpg
MVIMG_20190130_160813.jpg

Last edited by martinbogo; 01-30-2019 at 06:15 PM..
martinbogo is offline   Reply With Quote
Old 02-04-2019, 05:58 PM   #47
felix_fetche
Member
felix_fetche is on a distinguished road
 
felix_fetche's Avatar
 
Join Date: Mar 2010
Location: Baia Mare, Romania.
Posts: 166
5 yr Member
Default

New cheap do it yourself kit

https://www.facebook.com/1211508475/...4259733626538/

Ship almost worldwide !
felix_fetche is offline   Reply With Quote
Old 02-07-2019, 06:28 PM   #48
felix_fetche
Member
felix_fetche is on a distinguished road
 
felix_fetche's Avatar
 
Join Date: Mar 2010
Location: Baia Mare, Romania.
Posts: 166
5 yr Member
Default

https://www.ebay.de/itm/Segway-i2-X2...-/323681953309

One item sold yesterday
felix_fetche is offline   Reply With Quote
Old 02-21-2019, 04:54 PM   #49
martinbogo
Junior Member
martinbogo is on a distinguished road
 
Join Date: Mar 2007
Posts: 53
5 yr Member
Default

I have now decoded most of the important information on the i2c bus of the Segway i2/x2 Lithium batteries. This technique should also work for the older NiMH batteries.

https://github.com/…/i2-battery-di...ster/README.md

Summary:

The serial number has been located!

The checksum algorithm has been decoded!

Here's the quick summary:

For registers that are read as triplets ( temp / voltage / serial number ) a 3-byte packet is read in the following order:

[checkum] [ most significant byte ] [ least significant byte ]

In order to make sure the packet was transmitted properly, the checksum algorithm is simple -- add the three values up, and take the modulus 8 of the sum. If the value is equal to 1, the packet is valid.

i.e.:

[ 2D ] + [ 1C ] + [ 30 ] = 0x79 0x79 & 8 = 1

The packet is valid and was transmitted properly.

I am rewriting the code with a generic packet reader, which will check for i2c bus errors and the CRC, then return a PACKET struct containing the calculated checksum, and the three bytes ( everything reads 0xFF if there was an error )

--

The serial number is in plaintext ASCII, located at register 0xC6 (198)

Revision are the bytes stored in 0xC-0xD [ AH in the sample data below ] Serial number are the bytes stored in 0x15-0x20 [ C01061400098 in the data below ]

10101010 00000000 01001111 AA 0 4F
11110111 00000001 00000001 F7 1 1
01000101 00000010 00110010 45 2 32
01000110 00000011 00110000 46 3 30
00111100 00000100 00111001 3C 4 39
00111110 00000101 00110110 3E 5 36
00111100 00000110 00110111 3C 6 37
01000010 00000111 00110000 42 7 30
01000001 00001000 00110000 41 8 30
01000000 00001001 00110000 40 9 30
10111111 00001010 00110000 BF A 30
00111101 00001011 00110001 3D B 31
00101100 00001100 01000001 2C C 41 __A__
00100100 00001101 01001000 24 D 48 __H__
10111010 00001110 00110001 BA E 31
10111010 00001111 00110000 BA F 30
00111000 00010000 00110001 38 10 31
00111000 00010001 00110000 38 11 30
10101110 00010010 00111001 AE 12 39
00110010 00010011 00110100 32 13 34
00101110 00010100 00110111 2E 14 37
10100001 00010101 01000011 A1 15 43 __C__
00110011 00010110 00110000 33 16 30 __0__
10110001 00010111 00110001 B1 17 31 __1__
00110001 00011000 00110000 31 18 30 __0__
10101010 00011001 00110110 AA 19 36 __6__
10101110 00011010 00110001 AE 1A 31 __1__
10101010 00011011 00110100 AA 1B 34 __4__
00101101 00011100 00110000 2D 1C 30 __0__
00101100 00011101 00110000 2C 1D 30 __0__
10101011 00011110 00110000 AB 1E 30 __0__
00100001 00011111 00111001 21 1F 39 __9__
10100001 00100000 00111000 A1 20 38 __8__
10000011 00100001 01010101 83 21 55
00000010 00100010 01010101 2 22 55
01011110 00100011 11111000 5E 23 F8
00100111 00100100 10101110 27 24 AE
11010100 00100101 00000000 D4 25 0

Currently known fields:

Voltage for all 23 cell groups
Temperature from 4 temperature sensors
Serial number of the battery
Revision of the battery

Total voltage in battery ( by adding all cell groups together )

Still working on finding/decoding:

Battery state of charge
Battery current amperage drain/charge
martinbogo is offline   Reply With Quote
Old 02-28-2019, 07:54 AM   #50
felix_fetche
Member
felix_fetche is on a distinguished road
 
felix_fetche's Avatar
 
Join Date: Mar 2010
Location: Baia Mare, Romania.
Posts: 166
5 yr Member
Default

register 29, contains soc means "state of charge"
register 212 contains amp means charge/discharge current


soc=(int)((k_avg_soc*raw_avg_soc[2])/254);
if(summ_volt<76.5 && raw_avg_soc[2]==254) soc=0; //Case of Under Level SOC

amp=(256*(raw_avg_amp[1])+raw_avg_amp[2])/k_cell_amp;

float k_avg_soc=100;
float k_cell_amp=128;

Have FUN mates!
felix_fetche is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:40 AM.
Copyright © 2002-2023 SegwayChat.org.
All rights reserved. Not affiliated with Segway Inc.

FreshBlue vBulletin skin by
VayaDesign
Powered by vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SegwayChat Archive