jaypikay / mc3000

Python interface to use the SKYRC MC3000 Charger USB interface.
27 stars 11 forks source link

Cycling not working and no reading for the capacity #2

Closed man199930 closed 3 years ago

man199930 commented 3 years ago

Hi, I tried using your code for battery cycling and collect information, but the batteries only charge once and there is no data when the batteries should discharge. Also, the reading for the capacity does not seem to work.

Here is an example of the issue I have with the cycling: unknown

Normally, the cycle is charge>discharge>charge and it is programmed to do 3 cycles, but as you can see only the first charging phase works.

jaypikay commented 3 years ago

Thank you for the report. I will try to reproduce it.

What Settings did you use? What is your resting duration?

man199930 commented 3 years ago

I use: Batt type: LiIon Mode: cycle capacity: 5300mAh c.current: 0.98A d.current: -0.98A C.resting: 20 minutes D.resting: 20 minutes Cycle count: 3 Cycle mode: C>D>C Target volt: 4.2V Termination: 0.10A Restart volt: Off d.reduce: off cut voltage: 3V cut temp: 45C cut time: off save to: 05

with the latest firmware on their website

man199930 commented 3 years ago

After switching my device, I think the code for the capacity works well as it is and for the cycling, I found a solution. The problem is with the while loop around line 91 in mc3k.py (the one with slot.work==1). Instead of doing this I wrote

while any(slot.work != 4 for slot in batteries):

And modified get_charging_progress() in mc3000.py by adding at the end of the function (after line 288)

if pinfo.work==0:
            pinfo=pinfo._replace(work=4)

I hope it completely resolves the problem, but for now everything seems to work.

jaypikay commented 3 years ago

Thank you, I did not have much time to look into it. So I appreciate your help!

man199930 commented 3 years ago

No problem :) . I have just two more questions. Do you think it is possible to launch a new mode without touching the device (change with the code only)? I would like to put my batteries at 3.7V for storing purposes but my cycles end at 4V (change from cycling to discharging when the charging is done). Also how did you find the information like the Structs and the packets taht you send to the device?

jaypikay commented 3 years ago

I have documented my work here: https://goatpr0n.farm/2019/03/reverse-engineering-of-the-skyrc-mc3000-battery-charger-usb-protocol/

It is possible to create and/or switch profiles for each slot, but it is not implemented. I only did the read stats and start/stop (kind of a proof of concept and the code is a mess). Thats all I have written so far for this project, it would require more work to implement all the features the Windows GUI or the Android App offers.