NiZn mode

478 views
Skip to first unread message

mars

unread,
Aug 9, 2013, 5:34:57 AM8/9/13
to cheali-...@googlegroups.com
Hi, Stawel!
Thank you very much for your job! It is very interesting and very usefull project.
I tryed cheali-charger firmware on my IMAX B6 clone. Calibration procedure works perfectly. I liked very much that screen voltage format with 3 digits after coma shows millivolts.
I change some code for my own purpose (charging NiZn battery). I changed LiIo mode by NiZn mode. I never use Lilo batteries. So it is no problem of missing Lilo mode in my charger.
I changed Voltage vector (NiZn nominal voltage is 1.6V, maximum NiZn voltage is 1.9V and so on for storage and discharge)  in Programmdata.cpp
Also I change screen name NiZn instead Lilo. I built project and flashed my charger. It works now!!!
I found, that cheali-charger firmware does not charge and balance battery at the same time. It charges and balances it separately. It is very bad, because it increases process.   I found your coment in the source code, that it is a problem to charge and balance at the same time.  But factory IMAX B6 charger version do it!  It charges and balances battery faster than cheali-charger version. Is it possible to do charging and balancing at the same time?

Paweł Stawicki

unread,
Aug 9, 2013, 9:35:41 AM8/9/13
to mars, cheali-...@googlegroups.com
>Hi, Stawel!
>Thank you very much for your job! It is very interesting and very usefull project.
>I tryed cheali-charger firmware on my IMAX B6 clone. Calibration procedure works perfectly. I liked very much that screen voltage format with 3 digits after coma shows millivolts.

This requires some explanation:
The ADC on ATMEGA32 is a 10bit one, so the resolution, 
assuming You are measuring ~30V (Vbat) is ~30mV,
and for the balance port (~5V) is ~5mV, but the charging method I'm using
requires a greater one, so cheali-charger makes 100 measurements pro input,
and calculates an average value from that, so in theory the "error" (or resolution)
should be smaller by a factor of 10 (assuming, the ADC behaves like a "normal distribution")
So cheali-charger makes only 2 "full measurements" (from any input) in a second. 


>I change some code for my own purpose (charging NiZn battery). I changed LiIo mode by NiZn mode. I never use Lilo batteries. So it is no problem of missing Lilo mode in my charger. 
>I changed Voltage vector (NiZn nominal voltage is 1.6V, maximum NiZn voltage is 1.9V and so on for storage and discharge)  in Programmdata.cpp
>Also I change screen name NiZn instead Lilo. I built project and flashed my charger. It works now!!!

That great, I'm hoping You could add the NiZn support to the project.
But, You can add it, instead replacing it with the Lilo.
Just add a new type to ProgramData::BatteryType, and modify ProgramData::isLiXX().
(also add a new raw to voltsPerCell, defaultProgram and batteryString)

hm.. are You sure that the NiZn should be charged like a Lipo?
(with constant current and after a point with constant voltage) 
  

>I found, that cheali-charger firmware does not charge and balance battery at the same time. It charges >and balances it separately. It is very bad, because it increases process.   I found your coment in the >source code, that it is a problem to charge and balance at the same time.  But factory IMAX B6 charger >version do it!  It charges and balances battery faster than cheali-charger version. Is it possible to do charging and balancing at the same time?

Yes, You've got me there :)
so far, I thought that this method is used on the Imax B6,
unfortunately, I did not check this, because I've lost my original firmware.
>It charges and balances battery faster than cheali-charger version
This does not mean that it is the case,
You can check it by measuring the PINS 25,26,32,9,11,16 if there are switched 
on-off in the middle of the charge process or only at the end.

The main problem with balancing and charging at the same time
is that:
1. the voltages seen by atmega32 on the balance port are strongly affected,
 by the discharge resistors
(this is why there is a method called Balancer::getPresumedV, the
voltages are in fact "guessed" during balancing)
2. (I don't fully understand this) when you discharge one cell on a lipo,
the voltages on the nearby cells rises.

Of course everything can be overcome, maybe balancing in the middle
of the charge process when the voltage <<4.20V (the accuracy is not so impotent)
can be easy achieved.
But from my side this has to wait a little bit. 

Regards,
stawel

mars

unread,
Aug 9, 2013, 1:29:31 PM8/9/13
to cheali-...@googlegroups.com, mars
Hi, Stawel!
1) Concerning ADC mV measurment algorithm you are right.  I understand, that 1mV resolution not possible with 10bit ADC, but averaging method you implemented realy increases voltage resolution (I think 2-3 mV actualy). In cheali-charger it realy works!
2) Concerning NiZn charging. I  found manufacturers recomendations for NiZn charging process. Recomended strategy is constant current and constant voltage like for LiPo, but maximum voltage for NiZn is 1.9V instead of 4.2V for LiPo .
I used this type of battery about 2 years and found, that balancer is also nessesary for them, like for LiPo. It is no factory chargers  for NiZn packs with series schems. All NiZn chargers charges cells individualy or in parallel. It is not suitable for me to disassemble battery pack every time. So I am interested in your open source project.
3) About factory  IMAX B6 charge+balance mode. I soldered LEDs with 2kOhm resisters to each pin 25,26,32,9,11,16. LEDs flashes periodically  during ALL charging process! So factory firmware version balancer works allways when LiPo battery is charging (not only at the end). Balancer periodically makes pauses for several seconds. I think during this pauses ADC measures real cells voltages on a balance port and knows voltage drops on balancing wires and plug.
4) Concerning charging+balancing at the same time problems.
1. ...............the voltages seen by atmega32 on the balance port are strongly affected .......VOLTAGE DROP on balancing wires and plug, causing by current throw  balancing resistors (120Ohm/6=20Ohm). For LiPo this current is about 200mA. For NiZN it is about 80mA. This effect could be considered using 2 measurements 1-when each balancing resistor ON and 2-when it OFF. It will give us voltage error (voltage drop). We can use this information in programm and it won't "blindly" charging.
2. ..............when you discharge one cell on a lipo, the voltages on the nearby cells rises.......As I understand, It is not absolutely correct statement. Voltage rises on LOWER NOT SHUNTED nearby cell and decreases on UPPER SHUNTED cell. VOLTAGE drop subtracts from UPPER SHUNTED cell voltage and adds with LOWER NOT SHUNTED cell voltage. All middle shunted cell voltages are changing neglectable (only small residual current flows throw their balancing wires (If 1 shunted cell voltage is 4.2V and 2 shunted cell is 4.1V residual current is Ir=( 4.2V-4.1V)/20Ohm=5mA). But it also can be considered by 2 ADC measurement method (discribed above).
Thanks for hint about adding extra type NiZn battery to programm without changing Lilo mode!
 I'll try to do this.

Regards, mars.


пятница, 9 августа 2013 г., 16:35:41 UTC+3 пользователь cheali-charger написал:

Paweł Stawicki

unread,
Aug 9, 2013, 8:29:58 PM8/9/13
to mars, cheali-...@googlegroups.com
2013/8/9 mars <buav...@gmail.com>
Hi, Stawel!
1) Concerning ADC mV measurment algorithm you are right.  I understand, that 1mV resolution not possible with 10bit ADC, but averaging method you implemented realy increases voltage resolution (I think 2-3 mV actualy). In cheali-charger it realy works!
2) Concerning NiZn charging. I  found manufacturers recomendations for NiZn charging process. Recomended strategy is constant current and constant voltage like for LiPo, but maximum voltage for NiZn is 1.9V instead of 4.2V for LiPo .

great!
 
I used this type of battery about 2 years and found, that balancer is also nessesary for them, like for LiPo. It is no factory chargers  for NiZn packs with series schems. All NiZn chargers charges cells individualy or in parallel. It is not suitable for me to disassemble battery pack every time. So I am interested in your open source project.
3) About factory  IMAX B6 charge+balance mode. I soldered LEDs with 2kOhm resisters to each pin 25,26,32,9,11,16. LEDs flashes periodically  during ALL charging process! So factory firmware version balancer works allways when LiPo battery is charging (not only at the end). Balancer periodically makes pauses for several seconds. I think during this pauses ADC measures real cells voltages on a balance port and knows voltage drops on balancing wires and plug.

You spared me a lot of work, thanks
 
4) Concerning charging+balancing at the same time problems.
1. ...............the voltages seen by atmega32 on the balance port are strongly affected .......VOLTAGE DROP on balancing wires and plug, causing by current throw  balancing resistors (120Ohm/6=20Ohm). For LiPo this current is about 200mA. For NiZN it is about 80mA. This effect could be considered using 2 measurements 1-when each balancing resistor ON and 2-when it OFF. It will give us voltage error (voltage drop). We can use this information in programm and it won't "blindly" charging.

basically this is how it is implemented in cheali-charger:
Balancer::getPresumedV(uint8_t cell) {
....
return (getV(cell) + Voff_[cell]) - Von_[cell] ;
....

2. ..............when you discharge one cell on a lipo, the voltages on the nearby cells rises.......As I understand, It is not absolutely correct statement. Voltage rises on LOWER NOT SHUNTED nearby cell and decreases on UPPER SHUNTED cell. VOLTAGE drop subtracts from UPPER SHUNTED cell voltage and adds with LOWER NOT SHUNTED cell voltage. All middle shunted cell voltages are changing neglectable (only small residual current flows throw their balancing wires (If 1 shunted cell voltage is 4.2V and 2 shunted cell is 4.1V residual current is Ir=( 4.2V-4.1V)/20Ohm=5mA). But it also can be considered by 2 ADC measurement method (discribed above).
Thanks for hint about adding extra type NiZn battery to programm without changing Lilo mode!
 I'll try to do this.

no no, It's like I said: "when you discharge one cell on a lipo, the voltages on the nearby cells rises",
connect a 20 Ohm resistor to a cell and measure the voltage on the nearby cells,
You will see a voltage rise in the mV range.
(I even asked a chemist by email what's going on, but never got an answer)
But I'm not sure if it's really a problem.

Regards,
stawel

ps.
if you succeed with the NiZn battery it would be nice if we could merge it into the project.

Paweł Stawicki

unread,
Aug 10, 2013, 9:31:47 AM8/10/13
to mars, cheali-...@googlegroups.com
2. ..............when you discharge one cell on a lipo, the voltages on the nearby cells rises.......As I understand, It is not absolutely correct statement. Voltage rises on LOWER NOT SHUNTED nearby cell and decreases on UPPER SHUNTED cell. VOLTAGE drop subtracts from UPPER SHUNTED cell voltage and adds with LOWER NOT SHUNTED cell voltage. All middle shunted cell voltages are changing neglectable (only small residual current flows throw their balancing wires (If 1 shunted cell voltage is 4.2V and 2 shunted cell is 4.1V residual current is Ir=( 4.2V-4.1V)/20Ohm=5mA). But it also can be considered by 2 ADC measurement method (discribed above).
Thanks for hint about adding extra type NiZn battery to programm without changing Lilo mode!
 I'll try to do this.

no no, It's like I said: "when you discharge one cell on a lipo, the voltages on the nearby cells rises",
connect a 20 Ohm resistor to a cell and measure the voltage on the nearby cells,
You will see a voltage rise in the mV range.
(I even asked a chemist by email what's going on, but never got an answer)
But I'm not sure if it's really a problem.
 
Today I learned something new ;) (I made some tests)
the voltage rise is probably caused by the  wires internal resistance,
that I previously ignored.

Best regards,
stawel


MuR

unread,
Aug 11, 2013, 7:50:10 AM8/11/13
to cheali-...@googlegroups.com, mars


And one effect can be the mux 4051 itself. Cross talk between channels are only -50dB. That means pow(-50/20)=0.00316 or 1/316.
For 4.200V you will have ~13.3mV cross talk from the other channels. No averanging will helps...
For 8 Bit 4051 is suitable but more. There exist max4051 witht -90dB cross talk. I use it on a 16Bit System and lose only 1 Bit.
B6 design is crap - board and circuit. It is cheap that's it. We don't have to expect to much in precision.

anyway your project is what we need.
Maybe a OpenCharger incl. hardware will we born.

MuR



 

mars

unread,
Aug 12, 2013, 5:39:29 AM8/12/13
to cheali-...@googlegroups.com, mars
Hi, Stawel!
I think, that all errors in cell voltage measurements in general caused by voltage drops on balance wires and plug. It also can caused by changing voltage drop on internal battery resistance when balancing resistor swithes on  and cross talk between ADC chanels through 4051 multiplexer (MuR described. Thanks MuR!). I think that other LiPo phenomen which rises voltage on nearby cells during discharging other cells does not exist.
If synchronous charge balance mode (like in factory IMAX B6 firmware) is implemented, this significant errors (tens of mV) will take place only at first stage of process (balance resistors will be switched frequently). By the end of charging with balancing (when LIPo cell voltages will be close to 4.2V, or NiZn cell voltages will ~1.9V)  this errors will be very small, because cells voltage unbalance overcome at first stage and balancing resistors will be switch on rarely. High precision cell voltage control at the first stage of charging when cell voltage is low( 3.7...3.9V(LiPo), or 1.6...1.7V(NiZn) is not very important at all.
Today I found one strange bug in my cheali-charger. I used LiPo storage mode whith 6S 5Ah battery. The first cell voltage was indicated "unknow" all the time. Other 5 cells voltages were indicated correct. It is interesting, that before and at first second I switched on the button "Start" it displayed  correct voltage of first cell, but then disappeared and appeared "unknow". It's a permanent bug. It appears in other modes "discharge" and "storage+balance" .In other LiPo modes "charge" ,"fast charge" and "balance" it's ok.
Regards, mars.
суббота, 10 августа 2013 г., 3:29:58 UTC+3 пользователь cheali-charger написал:

Paweł Stawicki

unread,
Sep 15, 2013, 12:30:14 PM9/15/13
to mars, cheali-...@googlegroups.com

I've added the NiZi battery type to the charger,but haven't tested it, unfortunately I don't have any NiZi batteries.

2013/8/12 mars <buav...@gmail.com>
Hi, Stawel!
I think, that all errors in cell voltage measurements in general caused by voltage drops on balance wires and plug. It also can caused by changing voltage drop on internal battery resistance when balancing resistor swithes on  and cross talk between ADC chanels through 4051 multiplexer (MuR described. Thanks MuR!). I think that other LiPo phenomen which rises voltage on nearby cells during discharging other cells does not exist.
If synchronous charge balance mode (like in factory IMAX B6 firmware) is implemented, this significant errors (tens of mV) will take place only at first stage of process (balance resistors will be switched frequently). By the end of charging with balancing (when LIPo cell voltages will be close to 4.2V, or NiZn cell voltages will ~1.9V)  this errors will be very small, because cells voltage unbalance overcome at first stage and balancing resistors will be switch on rarely. High precision cell voltage control at the first stage of charging when cell voltage is low( 3.7...3.9V(LiPo), or 1.6...1.7V(NiZn) is not very important at all.

After implementing communication with the monitoring software (probably LogView)
I'll rewrite the balance-charge procedure.
 
Today I found one strange bug in my cheali-charger. I used LiPo storage mode whith 6S 5Ah battery. The first cell voltage was indicated "unknow" all the time. Other 5 cells voltages were indicated correct. It is interesting, that before and at first second I switched on the button "Start" it displayed  correct voltage of first cell, but then disappeared and appeared "unknow". It's a permanent bug. It appears in other modes "discharge" and "storage+balance" .In other LiPo modes "charge" ,"fast charge" and "balance" it's ok.
Regards, mars.

This is actualy not a bug, the voltage during discharge falls below 0V (on the first pin) 
so the ADC can't see it, the measured voltage has a big error, so it's not dispayed.
But it's not a big problem when discharging.
I'm changing: "unknown" to "n.a."

mars

unread,
Sep 24, 2013, 5:31:37 AM9/24/13
to cheali-...@googlegroups.com, mars

Thank you very much!
воскресенье, 15 сентября 2013 г., 19:30:14 UTC+3 пользователь cheali-charger написал:

I've added the NiZi battery type to the charger,but haven't tested it, unfortunately I don't have any NiZi batteries.

2013/8/12 mars <buav...@gmail.com>
Hi, Stawel!
I think, that all errors in cell voltage measurements in general caused by voltage drops on balance wires and plug. It also can caused by changing voltage drop on internal battery resistance when balancing resistor swithes on  and cross talk between ADC chanels through 4051 multiplexer (MuR described. Thanks MuR!). I think that other LiPo phenomen which rises voltage on nearby cells during discharging other cells does not exist.
If synchronous charge balance mode (like in factory IMAX B6 firmware) is implemented, this significant errors (tens of mV) will take place only at first stage of process (balance resistors will be switched frequently). By the end of charging with balancing (when LIPo cell voltages will be close to 4.2V, or NiZn cell voltages will ~1.9V)  this errors will be very small, because cells voltage unbalance overcome at first stage and balancing resistors will be switch on rarely. High precision cell voltage control at the first stage of charging when cell voltage is low( 3.7...3.9V(LiPo), or 1.6...1.7V(NiZn) is not very important at all.

After implementing communication with the monitoring software (probably LogView)
I'll rewrite the balance-charge procedure.
It's a good news! I am ready to test communication and NiZn mode. Now I use NiZn mode  cheali-charger without balancing. But I'm not shure that all 5 series  NiZn cells in my pack take identical capacity.
 
Today I found one strange bug in my cheali-charger. I used LiPo storage mode whith 6S 5Ah battery. The first cell voltage was indicated "unknow" all the time. Other 5 cells voltages were indicated correct. It is interesting, that before and at first second I switched on the button "Start" it displayed  correct voltage of first cell, but then disappeared and appeared "unknow". It's a permanent bug. It appears in other modes "discharge" and "storage+balance" .In other LiPo modes "charge" ,"fast charge" and "balance" it's ok.
Regards, mars.

This is actualy not a bug, the voltage during discharge falls below 0V (on the first pin) 
 
You say about voltage on minus power point (BAT-) ? it can be negative. I didn't measure it, but  I suppose it can be calculated in programm. We know discharge current and values of shunt resistors. So the cell voltage  can be calculated.

so the ADC can't see it, the measured voltage has a big error, so it's not dispayed.
But it's not a big problem when discharging.
I'm changing: "unknown" to "n.a."
 
I agree that it's not a big problem. But it doesn't look nice.
Reply all
Reply to author
Forward
0 new messages