Aftermarket iMiEV battery upgrade project

Mitsubishi EV Interest Group
francisco.shi
Senior Member
Posts: 826
Joined: Mon, 17 Sep 2018, 16:30
Real Name: Francisco
Location: Brisbane, Strathpine

Re: Aftermarket iMiEV battery upgrade project

Post by francisco.shi »

I have the addresses on the computer at work. I can send you something on Monday. Alternatively there is a website that has a list. I think if you Google "decoding Imev CAN bus" or something like that.
As for the hardware I am using something I built but you can use an Arduino with a can bus shield. Use something like a due that has native USB because the standard serial is too slow.
fifurnio
Groupie
Posts: 36
Joined: Thu, 25 Mar 2021, 06:54
Real Name: franco vaccari

Re: Aftermarket iMiEV battery upgrade project

Post by fifurnio »

thnk's Francisco
I really appreciate

After Google searching some links works, some not, but I found this:

374 B8 BC 00 00 43 3F 4E 00
the SoC is in the second data byte BC
BC converted to dec = 188
formula to apply:
SoC= (X- 10) / 2
SoC= 89% (188- 10) / 2
374 B8 BC 00 00 43 3F 4E 00
the SoC is in the second data byte BC
BC converted to dec = 188
formula to apply:
SoC= (X- 10) / 2
SoC= 89% (188- 10) / 2

here: http://myimiev.com/forum/viewtopic.php? ... &start=120


this week I am very busy: I have to upgrade the battery of a bmw c-evolution, but fortunately this vehicle increases its range without counting only the energy output (as my car...).
So the indication of the SOC is real and adapts to the new cells (double capacity) by mainly reading the voltage, but I would like to get the correct indication of the expected range which seems to remain the same, for this I am studying the CAN protocol of this scooter


PCAN-view screenshot
262f3037-095f-4ecd-a5f9-71eaa423a7b9.jpg
262f3037-095f-4ecd-a5f9-71eaa423a7b9.jpg (306.26 KiB) Viewed 14312 times
francisco.shi
Senior Member
Posts: 826
Joined: Mon, 17 Sep 2018, 16:30
Real Name: Francisco
Location: Brisbane, Strathpine

Re: Aftermarket iMiEV battery upgrade project

Post by francisco.shi »

They seem to be the right addresses. All you need to do is use a CAN bridge and to replace the SOC info and you should be right.
It is possible to estimate the SOC based on voltage but it is a bit more difficult. The reason coulomb counting is used is because the SOC vs voltage relationship changes with too many other factors. The way i would do it is set some voltage limits and learn the battery capacity and use coulomb counting. My guess is that Mitsubishi didn't think it was worth the extra effort.
fifurnio
Groupie
Posts: 36
Joined: Thu, 25 Mar 2021, 06:54
Real Name: franco vaccari

Re: Aftermarket iMiEV battery upgrade project

Post by fifurnio »

francisco.shi wrote: Mon, 29 Mar 2021, 07:13 They seem to be the right addresses. All you need to do is use a CAN bridge and to replace the SOC info and you should be right.
It is possible to estimate the SOC based on voltage but it is a bit more difficult. The reason coulomb counting is used is because the SOC vs voltage relationship changes with too many other factors. The way i would do it is set some voltage limits and learn the battery capacity and use coulomb counting. My guess is that Mitsubishi didn't think it was worth the extra effort.
I agree, the reading of the voltage alone leads to a reading that is too imprecise in the SOC 50% area where there is a strong variation of capacity on a modest variation of voltage.
24198-31518-Li-ion-Discharge-Voltage-Curve-Typical-l.jpg
24198-31518-Li-ion-Discharge-Voltage-Curve-Typical-l.jpg (27.71 KiB) Viewed 14291 times
As I had already written, it could be done as long as you compensate both the current and internal resistance values (which varies with the temperature)
So it is understandable that Mitsubishi has taken a certain direction, but with the knowledge that it has it could have done better, keeping all parameters under control
fifurnio
Groupie
Posts: 36
Joined: Thu, 25 Mar 2021, 06:54
Real Name: franco vaccari

Re: Aftermarket iMiEV battery upgrade project

Post by fifurnio »

FOUND SOME INTERESTING BYTES

unfortunately on my machine the addresses are different, the 374 does not exist.
But this morning I tried to identify some values anyway and I think I have found something: on ID 508 I found that the first two bytes control the range indication, sending a copy of the recorded message with heating off I got to keep the same indication of the range with heating on at maximum.
They are not the bytes of the soc, does anyone have any idea if these can affect the actual autonomy of the vehicle?

The message with 100 km range is : 19 00 B4 41 3F 39 (6 bytes)
The message with 62 km range is : 0F 80 B4 41 3F 39 (heating at maximum)

I tried to send a message with faster cadence, 20 ms instead of 100 and it work without errors (till now...)
francisco.shi
Senior Member
Posts: 826
Joined: Mon, 17 Sep 2018, 16:30
Real Name: Francisco
Location: Brisbane, Strathpine

Re: Aftermarket iMiEV battery upgrade project

Post by francisco.shi »

You can not send messages in the hope you will overwhelm the other messages. The CAN format has buffering so the dash will be getting your messages as well as the ones from the car controller. What you need to do is split the bus and insert your own messages.
fifurnio
Groupie
Posts: 36
Joined: Thu, 25 Mar 2021, 06:54
Real Name: franco vaccari

Re: Aftermarket iMiEV battery upgrade project

Post by fifurnio »

francisco.shi wrote: Tue, 30 Mar 2021, 07:13 You can not send messages in the hope you will overwhelm the other messages. The CAN format has buffering so the dash will be getting your messages as well as the ones from the car controller. What you need to do is split the bus and insert your own messages.
This time I not agree: in some cases if you send a message with a higher frequency (20 ms instead of 100 for example) your message prevails on the other on the device that reads it
I know well that it is not the correct way to do it but as I wrote it is a quick method to do a test on the meaning of a byte, once identified then the correct solution is the CAN bridge
As tool I use a PEAK CAN adapter with his supplied program, very simple to use
francisco.shi
Senior Member
Posts: 826
Joined: Mon, 17 Sep 2018, 16:30
Real Name: Francisco
Location: Brisbane, Strathpine

Re: Aftermarket iMiEV battery upgrade project

Post by francisco.shi »

You should read the datasheet of the CAN ICs. There are a few problems with trying to send messages too fast. The first problem is there is a limit to how many messages you can send (to do with bandwidth).
The CAN protocol gives priority to the lower address so if you send messages too fast then anything with a higher address to what you are sending may not be able to get thru.
When a message manages to get onto the bus it will be received by the receiver. Every single message will arrive. The CAN IC has a buffer (I can not remember how many messages it can store but I think it is about 8 or 16 messages) the receiver will get an interrupt request every time a message is received. You could potentially overflow the CAN message buffer if the processor doesn't attend to the messages fast enough in which case the processor will get an overflow flag.
It is possible that the dash is displaying both readings quick enough that you can not see the other value.
The bus that runs the dash and the BMS also runs the ABS and the motor.
So yes you could do it by brute force but I am not sure if that is a good idea. Sooner or later you will need to use the CAN bridge so it may be better to use the CAN bridge from the start.
Another benefit of the using the bridge is that you can stop retransmitting certain addresses and see what stops. That is how I found what some addresses did.
You can also disconnect certain modules (like the inverter or BMS or dash) and see what addresses disappear.
fifurnio
Groupie
Posts: 36
Joined: Thu, 25 Mar 2021, 06:54
Real Name: franco vaccari

Re: Aftermarket iMiEV battery upgrade project

Post by fifurnio »

ok Francisco, I know, I only told the method are faster than others, but not the "better"..
I effects until now I found some dates as (probably...) high and low current values, ABS ID's, light control unit, clima unit, clima heating control and some bytes that has direct interference with range indication, but until now no one that values we have tried to change had effects on SOC indicator in the instrument panel.
I have two questions: what is the device that calculate the SOC in iMiev ? (i suppose is not in the BMS, it seems the BMS read the current sensor and send in two bytes the values of the high and low outputs) where is located ?
francisco.shi
Senior Member
Posts: 826
Joined: Mon, 17 Sep 2018, 16:30
Real Name: Francisco
Location: Brisbane, Strathpine

Re: Aftermarket iMiEV battery upgrade project

Post by francisco.shi »

The BMS is the one that calculates the SOC.
In the Imiev and minicab the SOC is on address 0x374. On the first byte.
SOC = ([byte value] - 10)/2
I am sure it works on the Imiev because I have managed to convince the car to drive or go into turtle mode just by changing this value.
francisco.shi
Senior Member
Posts: 826
Joined: Mon, 17 Sep 2018, 16:30
Real Name: Francisco
Location: Brisbane, Strathpine

Re: Aftermarket iMiEV battery upgrade project

Post by francisco.shi »

What I do is I use the current and voltage readings from the BMS to do the SOC calculation.
User avatar
coulomb
Site Admin
Posts: 6340
Joined: Thu, 22 Jan 2009, 20:32
Real Name: Mike Van Emmerik
Location: Brisbane
Contact:

Re: Aftermarket iMiEV battery upgrade project

Post by coulomb »

francisco.shi wrote: Wed, 31 Mar 2021, 14:07 What I do is I use the current and voltage readings from the BMS to do the SOC calculation.
Do you plan to do a SOH (State Of Health) calculation? It would appear to be rather more complex, and yet important (to the user) to get right. Difficult to test, too.

It might have to be a best guess for now, with updates in the future. Will it be possible to update the firmware in the CAN bridge? From the OBD port using a Bluetooth or WiFi adapter or similar would be ideal.
MG ZS EV 2021 April 2021. Nissan Leaf 2012 with new battery May 2019.
5650 W solar, 2xPIP-4048MS inverters, 16 kWh battery.
Patching PIP-4048/5048 inverter-chargers.
If you appreciate my work, you can buy me a coffee.
francisco.shi
Senior Member
Posts: 826
Joined: Mon, 17 Sep 2018, 16:30
Real Name: Francisco
Location: Brisbane, Strathpine

Re: Aftermarket iMiEV battery upgrade project

Post by francisco.shi »

I will add a state of health at some point. As you said it is a bit more complicated.
I will have updates. But not over ODB2. That is too low tech. It will be over the air update. :lol:
I have another project I gave been working on that can update over WiFi.
fifurnio
Groupie
Posts: 36
Joined: Thu, 25 Mar 2021, 06:54
Real Name: franco vaccari

Re: Aftermarket iMiEV battery upgrade project

Post by fifurnio »

SOC BYTE FOUND !

ID 508 third byte (2)
the formula is the same you wrote Francisco: (value-10)/2=SOC

so now I have to decide how to intervene: whether to manipulate the original data with a simple mathematical formula that considers my added battery or whether to reconstruct the SOC value using the correct battery voltage according to the typical Li-Ion graph and compensated with the value of the current read by the high band sensor, present on ID 588 in my car.

P.S. Francisco: you were right: sending the modified value on the same ID I had no change on the indicated level, I had to compare the data stored with two SOCs, but I did it thanks to your formula, thanks !
francisco.shi
Senior Member
Posts: 826
Joined: Mon, 17 Sep 2018, 16:30
Real Name: Francisco
Location: Brisbane, Strathpine

Re: Aftermarket iMiEV battery upgrade project

Post by francisco.shi »

For it to work properly you need to have a CAN bridge.
You can not use the original value unless the new capacity is less than what the BMS thinks it has. If your new capacity is higher than original then the BMS will eventually get to zero and stay there.
If you want to use battery voltage (not a good idea) you can take samples only when the current is low so you get as close as possible to the OC voltage of the battery. But you will find that using the voltage will give you a value that changes too much.
The best way is to use the battery voltage to estimate an SOC when you first power up. Then use coulomb counting and use the limits of battery voltage to reset your counter.
That is why some cars will ask you to do a slow charge to full every now and then. It is the only reliable way to reset the coulomb counter.
fifurnio
Groupie
Posts: 36
Joined: Thu, 25 Mar 2021, 06:54
Real Name: franco vaccari

Re: Aftermarket iMiEV battery upgrade project

Post by fifurnio »

yes Francisco, it's a pleasure tu exchange ideas with you, you are well prepared in this materia
I've maked a EV retrofit in a diesel car with Tesla S modules and Orion BMS, I well know the effects of high currents in the battery voltage, I programmed my BMS to send messages for current reduction to the inverter, but probably cause of a response delay the BMS was in error often, then I realized an analogic comparator that intervene limiting the tension in the throttle and in the brake inverter pins, problem was solved.

Below the board: I did not used analogic comparators to avoid too much gain in the reaction loop, then the comparison is from base and emitter pins of pair of transistors, it work well

20200927_113533.jpg
20200927_113533.jpg (1.47 MiB) Viewed 14143 times
Your idea about SOC measuring is good, but since I have to use a can bridge and this have a processor inside I think to set the SOC at 100 % with cells at 4,1 v, and to use the same method of the car to calculate the SOC (current values are available in the BMS ID's) but I think to update the value of the soc with the real battery voltage each time the current drops even for an instant within 10 A, then the value would automatically update every time I release the throttle.
What you think about ?
francisco.shi
Senior Member
Posts: 826
Joined: Mon, 17 Sep 2018, 16:30
Real Name: Francisco
Location: Brisbane, Strathpine

Re: Aftermarket iMiEV battery upgrade project

Post by francisco.shi »

I did try using the voltage reading as you describe and it works but it is not very linear unless you use a table and it is not as stable as the coulomb counting.
I do reset the coulomb count when the voltage gets to 4.05v and when the voltage gets to 3.2v I start to interpolate between coulom count and voltage SOC this way you get to 0 SOC smoothly if the coulomb count is a bit off on the high side.
The ideal would be to use the coulomb counter to map the voltage. Then from that you can also work out state of health.
fifurnio
Groupie
Posts: 36
Joined: Thu, 25 Mar 2021, 06:54
Real Name: franco vaccari

Re: Aftermarket iMiEV battery upgrade project

Post by fifurnio »

If you think to use the voltage value you must to refer to a table


Li-ion Discharge Voltage Curve Typical.jpg
Li-ion Discharge Voltage Curve Typical.jpg (25.99 KiB) Viewed 14112 times
it seems not linear at all
Rusdy
Groupie
Posts: 320
Joined: Mon, 09 Jun 2014, 16:45
Real Name: Rusdy
Location: Australia
Contact:

Re: Aftermarket iMiEV battery upgrade project

Post by Rusdy »

fifurnio wrote: Fri, 02 Apr 2021, 02:35

Below the board: I did not used analogic comparators to avoid too much gain in the reaction loop, then the comparison is from base and emitter pins of pair of transistors, ...
I haven't seen hand made board with through-hole components (and good 'ol BJT) for a long time! Kudos!
nuggetgalore
Groupie
Posts: 365
Joined: Sun, 11 Dec 2016, 18:02
Real Name: Andreas Tobler
Location: Rowville 3178 V
Contact:

Re: Aftermarket iMiEV battery upgrade project

Post by nuggetgalore »

fifurnio wrote: Fri, 02 Apr 2021, 20:24 If you think to use the voltage value you must to refer to a table



Li-ion Discharge Voltage Curve Typical.jpg

it seems not linear at all
I think the discharge curve is more like this in real life and therefore voltage becomes more meaningful in determining SoC. Still not the alpha and omega but as a good enough guide to how much further one can travel I would be happy. There are many more variables involved in guessing RR ,GoM (Guess'o Meter) is probably a more accurate description than RR (Range Remaining).
Image
borrowed discharge overlay done by Coulomb,page 21, thanks.
richi
Groupie
Posts: 45
Joined: Thu, 09 Jan 2020, 21:06
Real Name: Richi Jennings

Re: Aftermarket iMiEV battery upgrade project

Post by richi »

It's even more complicated than that, because the curves vary by temperature, current, phase of the moon, etc. Here are the "official" curves, taken from a Yuasa research paper:

Image
nuggetgalore
Groupie
Posts: 365
Joined: Sun, 11 Dec 2016, 18:02
Real Name: Andreas Tobler
Location: Rowville 3178 V
Contact:

Re: Aftermarket iMiEV battery upgrade project

Post by nuggetgalore »

richi wrote: Sat, 03 Apr 2021, 18:52 It's even more complicated than that, because the curves vary by temperature, current, phase of the moon, etc. Here are the "official" curves, taken from a Yuasa research paper:
Yes , fair enough, but I was commenting for drivers in Australia who rarely encounter prolonged temperatures of minus 10°C or sustained loads of more than 3C. 180A (resp.~3C) is as far as I know the max that an iMiEV is pulling at full throttle and it would only be for very short moments.
So I stick to my argument that voltage based SoC is a good enough *guess* for normal everyday driving if that would be all that could be achieved.
I nevertheless applaud the efforts of all the smart contributors who try to figure out how the *iMiEV brain* gets the relevant information to make it more accurate.
Well done all round and lots of thanks.
PS.: I am actually surprised how well the iMiEV's BMS looks after the cells. Since I removed the aftermarket cells and reinstalled the LEV50s, I found that one of the aftermarket cells is a lot worse than when it was managed by the BMS. As a matter of fact it basically died, similar to one that I found faulty when balancing the 90 new LIYUAN 60A cells before assembling the modules. The good news is though that it raced to more than 25 Voc, it did not get hot or explode, even after taking it out of the module it shows no physical signs of a problem (bloating or whatever) except it adopts the voltage of a paralled cell with no current drawn and has no energy stored.
Now I have no spare left, I might be looking for a few second hand LEV50s if more of the LIYUAN 60A cells fall over as I still want to test out the paralleling of two half degraded sets with unaltered iMiEV settings.
User avatar
coulomb
Site Admin
Posts: 6340
Joined: Thu, 22 Jan 2009, 20:32
Real Name: Mike Van Emmerik
Location: Brisbane
Contact:

Re: Aftermarket iMiEV battery upgrade project

Post by coulomb »

I wonder if that one bad cell invalidates all or most of the knowledge we have from your experiment. It might have been holding back your whole pack. But I guess if that was the case you would have noticed its voltage being different to the others.

I don't think that it was the BMS management that kept it in reasonable shape, I think it was just coincidence that it died soon after you took it out.

Or maybe it suffered some damage when removed. It seems basically open circuit now, or if it holds a non-zero voltage, very high internal resistance.
MG ZS EV 2021 April 2021. Nissan Leaf 2012 with new battery May 2019.
5650 W solar, 2xPIP-4048MS inverters, 16 kWh battery.
Patching PIP-4048/5048 inverter-chargers.
If you appreciate my work, you can buy me a coffee.
nuggetgalore
Groupie
Posts: 365
Joined: Sun, 11 Dec 2016, 18:02
Real Name: Andreas Tobler
Location: Rowville 3178 V
Contact:

Re: Aftermarket iMiEV battery upgrade project

Post by nuggetgalore »

coulomb wrote: Sun, 04 Apr 2021, 07:46 I wonder if that one bad cell invalidates all or most of the knowledge we have from your experiment. It might have been holding back your whole pack.
Yes that is he most sad part of the story.
coulomb wrote: Sun, 04 Apr 2021, 07:46 But I guess if that was the case you would have noticed its voltage being different to the others.
Both scanners I have and the EvBatMon app have dedicated items for high and low volt cells.
Nothing out of the ordinary was showing while I was still driving with the aftermarket pack.Or even now with the old cells back in.
coulomb wrote: Sun, 04 Apr 2021, 07:46 I don't think that it was the BMS management that kept it in reasonable shape, I think it was just coincidence that it died soon after you took it out.
I hope this is the case.
coulomb wrote: Sun, 04 Apr 2021, 07:46 Or maybe it suffered some damage when removed. It seems basically open circuit now, or if it holds a non-zero voltage, very high internal resistance.
I probably need to explain how I found the bad cell. As previously indicated , I reassembled the aftermarket modules into a series pack behind the front seats. The pack was 328 V. With hindsight I should have wondered why so low. Then I drove with the heater on until the main pack was 330 V under no load (car stopped,heater off) about 4 or 5 bars on the fuel gauge.
At that point I closed the relay connecting the packs and wondered why the ampmeter between the packs did not move. It also showed practically no current flowing while driving, the voltage of both packs stayed equal all the time. I have yet no BMS on the second pack, I just kept a close watch on pack, module and cell volts.
I can not think of any particular thing that could have damaged this cell while removing and storing the modules.
I doubt that the shock from connecting two packs with 2 or 3 volt difference could kill a cell, but maybe I am wrong again?
User avatar
coulomb
Site Admin
Posts: 6340
Joined: Thu, 22 Jan 2009, 20:32
Real Name: Mike Van Emmerik
Location: Brisbane
Contact:

Re: Aftermarket iMiEV battery upgrade project

Post by coulomb »

nuggetgalore wrote: Sun, 04 Apr 2021, 16:46 I doubt that the shock from connecting two packs with 2 or 3 volt difference could kill a cell, but maybe I am wrong again?
I agree, paralleling the packs with such a small voltage difference would not have caused much current to flow, much less killed a cell.

I thought you measured the 25 V on the bench, with a power supply limited to 25 V. If it's still buried in the pack, by guess is that a link has gone open circuit or high resistance. I can imagine about a 25 V drop (7.5%) of the main pack under load; if there was an open circuit link, most of that 25 V would appear to be that cell's voltage. Actually, I would expect it to appear to reverse in voltage. Luckily the main pack was there to limit the reversal.

So maybe the cell is OK after all.
MG ZS EV 2021 April 2021. Nissan Leaf 2012 with new battery May 2019.
5650 W solar, 2xPIP-4048MS inverters, 16 kWh battery.
Patching PIP-4048/5048 inverter-chargers.
If you appreciate my work, you can buy me a coffee.
Post Reply