TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Electric Motors and Controllers
User avatar
izeman   100 GW

100 GW
Posts: 5107
Joined: Jun 21 2011 8:25am
Location: Vienna, Austria

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by izeman » Jun 01 2020 10:53am

casainho wrote:
Jun 01 2020 10:50am
izeman wrote:
Jun 01 2020 10:44am
Since I upgraded to 1.0 there are "slight" differences between what my BMS knows about SOC and what 850C THINKS about the battery.
I don't know where this comes from.
I haven't found anything about battery calibration.
You need to do your work and read the configurations page.
I would have bet a month' salary on that reply 8) :lol:
Last edited by izeman on Jun 01 2020 11:07am, edited 2 times in total.

HughF   100 W

100 W
Posts: 219
Joined: Jan 23 2020 6:13pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by HughF » Jun 01 2020 11:04am

izeman wrote:
Jun 01 2020 10:52am
HughF wrote:
Jun 01 2020 10:43am
People say you must have brake sensors, personally I think it's fine to just hold the bike on the brakes and rest a little pressure on the pedal*, no different to a hill start in a manual transmission car. You soon get used to the behaviour. I'll go on record and say I don't have brake sensors installed.

*not a lawyer, you might want brake sensors if it makes you feel happier on the bike
Brake sensors are not a legal thing. Never heard of an obligation to have them anywhere around the world.
Brake sensors are RECOMMENDED to save your motor, especially the blue gear. If you break hard and the motor doesn't "realize" that (hence brake sensor read out) then it could still run full power into a non moving bike and this puts a lot of stress on the motor components.
Especially for the "awop" mode: Imagine waiting at the red light with your foot on one pedal to start off and you hold the bike with the breaks (without brake sensors): The motor will engage all the time trying to push the bike forward - very bad idea
I know they're not a legal requirement, but I was just pointing out that some people might feel a bit safer riding if they can kill the motor by pulling on the brake levers at any time.

As for awop mode killing the blue gear, the most motor power I have ever seen when resting my foot on the pedal and holding the motor on the brake is about 30w according to the motor power display on the SW102. If you hold it for too long it errors out with a torque sensor error anyway, so I don't think there is a problem with possible blue gear destruction. Besides, everyone should expect to be running a brass gear after a while anyway :P
Genesis iOiD Alfine8 Hard tail MTB, 36v TSDZ2, 13s battery, SW102 display
Raleigh reynolds road frame from the 80's, TSDZ2, SW102 display, 1x10 drivetrain, gravel tyres

HughF   100 W

100 W
Posts: 219
Joined: Jan 23 2020 6:13pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by HughF » Jun 01 2020 11:04am

izeman wrote:
Jun 01 2020 10:53am
casainho wrote:
Jun 01 2020 10:50am
izeman wrote:
Jun 01 2020 10:44am
Since I upgraded to 1.0 there are "slight" differences between what my BMS knows about SOC and what 850C THINKS about the battery.
I don't know where this comes from.
I haven't found anything about battery calibration.
You need to do your work and read the configurations page.
I would have bet a month' salary on that reply 8) :lol:
lol...
Genesis iOiD Alfine8 Hard tail MTB, 36v TSDZ2, 13s battery, SW102 display
Raleigh reynolds road frame from the 80's, TSDZ2, SW102 display, 1x10 drivetrain, gravel tyres

casainho   100 GW

100 GW
Posts: 5028
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by casainho » Jun 01 2020 11:05am

izeman wrote:
Jun 01 2020 10:53am
casainho wrote:
Jun 01 2020 10:50am
izeman wrote:
Jun 01 2020 10:44am
Since I upgraded to 1.0 there are "slight" differences between what my BMS knows about SOC and what 850C THINKS about the battery.
I don't know where this comes from.
I haven't found anything about battery calibration.
You need to do your work and read the configurations page.
I would have bet a month' salary on that reply 8) :lol:
First read it and then post your questions about the battery configurations. Let's try to improve the wiki for new users.
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

Please consider a donation to help developments: paypal.me/jorgecasa

User avatar
izeman   100 GW

100 GW
Posts: 5107
Joined: Jun 21 2011 8:25am
Location: Vienna, Austria

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by izeman » Jun 01 2020 11:08am

casainho wrote:
Jun 01 2020 11:05am
izeman wrote:
Jun 01 2020 10:53am
casainho wrote:
Jun 01 2020 10:50am
izeman wrote:
Jun 01 2020 10:44am
Since I upgraded to 1.0 there are "slight" differences between what my BMS knows about SOC and what 850C THINKS about the battery.
I don't know where this comes from.
I haven't found anything about battery calibration.
You need to do your work and read the configurations page.
I would have bet a month' salary on that reply 8) :lol:
First read it and then post your questions about the battery configurations. Let's try to improve the wiki for new users.
If you mean by "configuration page" this page https://github.com/OpenSource-EBike-fir ... ons_screen, it says NOTHING about the issue I see. And if it may hide inside the SOC menu, then, well, it's broken as others have stated before.

PS: A little more help where to look in that wiki mess, and sorry to say that, it's a mess, would be highly appreciated. I know how hard it is to write a manual/wiki, but the TSDZ2 wiki has information spread all over the place. It's all a long chain of links and links from links until you find the information needed. So yes it may really be possible that I didn't find that one link that holds the information for my problem.
I thought it could be a bug of 1.0 as I didn't have that before and wanted to let you know ... :roll:

casainho   100 GW

100 GW
Posts: 5028
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by casainho » Jun 01 2020 11:16am

izeman wrote:
Jun 01 2020 11:08am
PS: A little more help where to look in that wiki mess, and sorry to say that, it's a mess, would be highly appreciated. I know how hard it is to write a manual/wiki, but the TSDZ2 wiki has information spread all over the place.
To find what you are looking for, you can:
- read the Table of Contents at the beginning
- use the search
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

Please consider a donation to help developments: paypal.me/jorgecasa

User avatar
izeman   100 GW

100 GW
Posts: 5107
Joined: Jun 21 2011 8:25am
Location: Vienna, Austria

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by izeman » Jun 01 2020 11:26am

casainho wrote:
Jun 01 2020 11:16am
izeman wrote:
Jun 01 2020 11:08am
PS: A little more help where to look in that wiki mess, and sorry to say that, it's a mess, would be highly appreciated. I know how hard it is to write a manual/wiki, but the TSDZ2 wiki has information spread all over the place.
To find what you are looking for, you can:
- read the Table of Contents
- use the search
Casainho, I don't want to rude, but this still isn't helpful. Believe me, I am quite sure I know 99.5% of all pages on github/wiki, but I don't find anything about my issue. It may be easy for you as you wrote that stuff, but RTFM is NOT the answer to all support questions.

TOC doesn't give a hint, and ah yes: NOW i see it: Under support there is link to this forum!! And now I'm here ;)

No really, just let me know if I should stop posting here, and stop reporting issues and feedback, or tell me where my issue and the solution is decribed.

andyme   100 W

100 W
Posts: 218
Joined: Oct 04 2017 1:40pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by andyme » Jun 01 2020 11:40am

Just back from 2 hrs of riding in various conditions.
I am so delighted! A smooth pleasure, really.

I would love boost to work for starting on hills, but besides that: WOW

It feels great to be part of this and I admire and envy those who were able to make major programming contributions here! :bigthumb:

casainho   100 GW

100 GW
Posts: 5028
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by casainho » Jun 01 2020 12:05pm

izeman wrote:
Jun 01 2020 10:44am
Since I upgraded to 1.0 there are "slight" differences between what my BMS knows about SOC and what 850C THINKS about the battery.
I don't know where this comes from. The battery is set to 14S, but even at 16S it shows 90%+ which obviously is completely wrong. The LVC is set to 42V (3.0V per cell) . I haven't found anything about battery calibration.
izeman wrote:
Jun 01 2020 11:26am
Casainho, I don't want to rude, but this still isn't helpful. Believe me, I am quite sure I know 99.5% of all pages on github/wiki, but I don't find anything about my issue. It may be easy for you as you wrote that stuff, but RTFM is NOT the answer to all support questions.

TOC doesn't give a hint, and ah yes: NOW i see it: Under support there is link to this forum!! And now I'm here ;)

No really, just let me know if I should stop posting here, and stop reporting issues and feedback, or tell me where my issue and the solution is decribed.
The TOC has 2 entries for topics about the battery and battery SOC configuration:

Image

Did you find there configurations for SOC, if so, what configurations values do you use and why?
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

Please consider a donation to help developments: paypal.me/jorgecasa

User avatar
izeman   100 GW

100 GW
Posts: 5107
Joined: Jun 21 2011 8:25am
Location: Vienna, Austria

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by izeman » Jun 01 2020 1:01pm

Did you read my whole post and other's? Opening SOC sub menu leads to a crash. And still i don't see what needs to be setup to avoid my problem.
I can set Wh used and reset voltage. And those values have been set before.
So the only thing i can imagine (as it's not described elsewhere) is that you need to fully charge the battery to get a valid SOC reading??? I would have thought it also takes Voltage into the calculation. At 3V/cell i would have considered any Lithium battery empty.

vshitikov   10 W

10 W
Posts: 94
Joined: Mar 05 2020 7:24am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by vshitikov » Jun 01 2020 2:56pm

AZUR wrote:
May 31 2020 12:02pm
vshitikov wrote:
May 17 2020 1:35pm
AZUR wrote:
May 17 2020 9:13am
vshitikov wrote:
May 17 2020 7:36am


Did you try to reconnect via SWD/JTAG and flash the firmware again. It is most likely that you just corrupted your firmware when your MCU was undersupplied. Is your MCU detected via JTAG by ST link?
Hi,

The first thing I did was to re-install FW through STLink. It was difficult to download from FW, it gave an error many times, but after several attempts I managed to download. But it did not work. The display did not communicate with the controller. I replaced the controller and everything was ok.
Try to reflash option bytes that most probably also got corrupted you can download them from eco cycles for your motor. Then reflash casainho firmware again.


Hi Vshitikov


You were right. The problem was not with the controller.
Therefore, the fact of having a battery with 15S and 63 V did not affect the capacitors of the controller.
I am using ST Link.
In fact the Option Bytes were corrupted in the Controller and the FW of the Casainho does not contain the Option Bytes.
That is why the controller did not work, even with the FW ok.

I went to a controller that had the correct Option bytes and loaded them into the ST Virtual Programmer.
Then, first I loaded the correct Option Bytes in the Controller and then I loaded the FW from Casainho.

Everything was working perfectly.

Thank you.
Hi
I'm glad that it worked for you.
In fact I have seen the issue of random corruption of internal flash memory with some other ARM microcontrollers. We should probably upload this troubleshooting in wiki so it may help other people. And also tell people not to set the battery cutoff voltage to low.

casainho   100 GW

100 GW
Posts: 5028
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by casainho » Jun 01 2020 3:06pm

vshitikov wrote:
Jun 01 2020 2:56pm
We should probably upload this troubleshooting in wiki so it may help other people. And also tell people not to set the battery cutoff voltage to low.
Maybe a specific page with explanation of the sysptoms, why that happens and the solution. That page could be linked both from configurations battery cut off voltage and FAQ.
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

Please consider a donation to help developments: paypal.me/jorgecasa

User avatar
izeman   100 GW

100 GW
Posts: 5107
Joined: Jun 21 2011 8:25am
Location: Vienna, Austria

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by izeman » Jun 01 2020 3:30pm

izeman wrote:
Jun 01 2020 1:01pm
Did you read my whole post and other's? Opening SOC sub menu leads to a crash. And still i don't see what needs to be setup to avoid my problem.
I can set Wh used and reset voltage. And those values have been set before.
So the only thing i can imagine (as it's not described elsewhere) is that you need to fully charge the battery to get a valid SOC reading??? I would have thought it also takes Voltage into the calculation. At 3V/cell i would have considered any Lithium battery empty.
So can someone confirm that what I suspect is true? Am I just too stupid to understand how this works? Or have I really not read every single wiki's article?
Will the SOC be reset to 100% at a full charge only, and does not take voltage into calculation at all?
So after every upgrade of the software you first need to do a full recharge to "re-calibrate" SOC?

vshitikov   10 W

10 W
Posts: 94
Joined: Mar 05 2020 7:24am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by vshitikov » Jun 01 2020 3:30pm

casainho wrote:
Jun 01 2020 3:06pm
vshitikov wrote:
Jun 01 2020 2:56pm
We should probably upload this troubleshooting in wiki so it may help other people. And also tell people not to set the battery cutoff voltage to low.
Maybe a specific page with explanation of the sysptoms, why that happens and the solution. That page could be linked both from configurations battery cut off voltage and FAQ.
I will do. I first need to understand how to do it properly. Do I fork the wiki and create a pull request for wiki just like for a code?
Thank you

vshitikov   10 W

10 W
Posts: 94
Joined: Mar 05 2020 7:24am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by vshitikov » Jun 01 2020 3:36pm

izeman wrote:
Jun 01 2020 3:30pm
izeman wrote:
Jun 01 2020 1:01pm
Did you read my whole post and other's? Opening SOC sub menu leads to a crash. And still i don't see what needs to be setup to avoid my problem.
I can set Wh used and reset voltage. And those values have been set before.
So the only thing i can imagine (as it's not described elsewhere) is that you need to fully charge the battery to get a valid SOC reading??? I would have thought it also takes Voltage into the calculation. At 3V/cell i would have considered any Lithium battery empty.
So can someone confirm that what I suspect is true? Am I just too stupid to understand how this works? Or have I really not read every single wiki's article?
Will the SOC be reset to 100% at a full charge only, and does not take voltage into calculation at all?
So after every upgrade of the software you first need to do a full recharge to "re-calibrate" SOC?
you need to find a sweet spot to reset the battery state to 100%. For example fo my 36V battery it is around 42.5V. It is approximate and really depends on the battery configuration,age of the battery (internal resistance) and the temperature.
Once battery is reset to 100% the FW starts to calculate the amount of Wh that you consumed based on the voltage and measured battery current. If you upgrade your diplay firmware it wipes out all the stored information in EEPROM so you have to charge it fully again to make it work. and you have to set battery OCV again for your exact battery model

vshitikov   10 W

10 W
Posts: 94
Joined: Mar 05 2020 7:24am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by vshitikov » Jun 01 2020 5:32pm

HughF wrote:
Jun 01 2020 11:04am
izeman wrote:
Jun 01 2020 10:52am
HughF wrote:
Jun 01 2020 10:43am
People say you must have brake sensors, personally I think it's fine to just hold the bike on the brakes and rest a little pressure on the pedal*, no different to a hill start in a manual transmission car. You soon get used to the behaviour. I'll go on record and say I don't have brake sensors installed.

*not a lawyer, you might want brake sensors if it makes you feel happier on the bike
Brake sensors are not a legal thing. Never heard of an obligation to have them anywhere around the world.
Brake sensors are RECOMMENDED to save your motor, especially the blue gear. If you break hard and the motor doesn't "realize" that (hence brake sensor read out) then it could still run full power into a non moving bike and this puts a lot of stress on the motor components.
Especially for the "awop" mode: Imagine waiting at the red light with your foot on one pedal to start off and you hold the bike with the breaks (without brake sensors): The motor will engage all the time trying to push the bike forward - very bad idea
I know they're not a legal requirement, but I was just pointing out that some people might feel a bit safer riding if they can kill the motor by pulling on the brake levers at any time.

As for awop mode killing the blue gear, the most motor power I have ever seen when resting my foot on the pedal and holding the motor on the brake is about 30w according to the motor power display on the SW102. If you hold it for too long it errors out with a torque sensor error anyway, so I don't think there is a problem with possible blue gear destruction. Besides, everyone should expect to be running a brass gear after a while anyway :P
Well, a brass gear is not that of a great idea. Blue gear is not a problem but a feature. If you disassemble expensive Bosch CX motors you will still find a nylon gear inside. If you change your blue gear by brass, you might destroy something more expensive inside of the motor, like a clutch bearing or things that are harder to replace.

cavi   10 W

10 W
Posts: 79
Joined: Jan 20 2020 7:00pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by cavi » Jun 01 2020 5:36pm

yeah, the blue gear will break saving the rest of your motor, the brass one might not break but will take out other important stuff. I 'll keep the blue one

cavi   10 W

10 W
Posts: 79
Joined: Jan 20 2020 7:00pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by cavi » Jun 01 2020 8:24pm

HughF wrote:
Jun 01 2020 10:43am
andyme wrote:
Jun 01 2020 8:14am
HughF wrote:
Jun 01 2020 2:16am

I can however just rest my foot on the pedal and the motor will take off, which is exactly what I want.
isn't that in contradiction to the statement that one needs pedalling in order for the motor to engage?

Maybe you can explain because i could need any kind of assistance when starting on a slope.

Assist without pedal rotation - exactly that. You just rest your foot on the pedal and the motor starts you moving. This is exactly what 90% of people are expecting from a pedelec style eBike (my guess) but it must be enabled on a tsdz2 because of the cadence sensor lower rpm limit. Without it, and with motor current control set to 'power' mode, you will need 2-3 or perhaps more pedal rotations before the assist cuts in (which I wager is not what people are expecting from a pedelec eBike)

People say you must have brake sensors, personally I think it's fine to just hold the bike on the brakes and rest a little pressure on the pedal*, no different to a hill start in a manual transmission car. You soon get used to the behaviour. I'll go on record and say I don't have brake sensors installed.

*not a lawyer, you might want brake sensors if it makes you feel happier on the bike

For the best hill start performance I would setup as the following:

Motor current control = torque
Assist w/o pedal = enable
Startup BOOST = disable
Startup BOOST duration = 5
Startup BOOST fade = 6.5
Motor current ramp = 10a (maximum)
Calibrate your torque sensor then enable calibrations
Motor current max = 20a
Thank you, I swapped to these settings tonight. I also found out that I have the alpha version, but i have the firmware install cables on the way so hopefully I can get it done this weekend!!

User avatar
izeman   100 GW

100 GW
Posts: 5107
Joined: Jun 21 2011 8:25am
Location: Vienna, Austria

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by izeman » Jun 02 2020 2:19am

vshitikov wrote:
Jun 01 2020 3:36pm
you need to find a sweet spot to reset the battery state to 100%. For example fo my 36V battery it is around 42.5V. It is approximate and really depends on the battery configuration,age of the battery (internal resistance) and the temperature.
Once battery is reset to 100% the FW starts to calculate the amount of Wh that you consumed based on the voltage and measured battery current. If you upgrade your diplay firmware it wipes out all the stored information in EEPROM so you have to charge it fully again to make it work. and you have to set battery OCV again for your exact battery model
Thanks vshitikov, this was the reply i was hoping for. No words about that in the wiki. But it makes sense once you know it.
Maybe this should be added to the configuration wiki as well?

casainho   100 GW

100 GW
Posts: 5028
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by casainho » Jun 02 2020 2:21am

izeman wrote:
Jun 02 2020 2:19am
vshitikov wrote:
Jun 01 2020 3:36pm
you need to find a sweet spot to reset the battery state to 100%. For example fo my 36V battery it is around 42.5V. It is approximate and really depends on the battery configuration,age of the battery (internal resistance) and the temperature.
Once battery is reset to 100% the FW starts to calculate the amount of Wh that you consumed based on the voltage and measured battery current. If you upgrade your diplay firmware it wipes out all the stored information in EEPROM so you have to charge it fully again to make it work. and you have to set battery OCV again for your exact battery model
Thanks vshitikov, this was the reply i was hoping for. No words about that in the wiki. But it makes sense once you know it.
Maybe this should be added to the configuration wiki as well?
Yes, go ahead and improve the information that could help you and then it will help the next ones.
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

Please consider a donation to help developments: paypal.me/jorgecasa

User avatar
izeman   100 GW

100 GW
Posts: 5107
Joined: Jun 21 2011 8:25am
Location: Vienna, Austria

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by izeman » Jun 02 2020 2:33am

casainho wrote:
Jun 02 2020 2:21am
Yes, go ahead and improve the information that could help you and then it will help the next ones.
I'm just doing it. One more question: Does the firmware build an internal table to compare voltage and SOC once it's done one full cycle? Or do you need to always recharge it to reset to counter and set SOC to 100%? What I mean: Will the SOC% be accurate even if i only charge, let's say from 20% to 70% (after the initial charge/discharge)? I guess so?!

vshitikov   10 W

10 W
Posts: 94
Joined: Mar 05 2020 7:24am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by vshitikov » Jun 02 2020 2:43am

izeman wrote:
Jun 02 2020 2:33am
casainho wrote:
Jun 02 2020 2:21am
Yes, go ahead and improve the information that could help you and then it will help the next ones.
I'm just doing it. One more question: Does the firmware build an internal table to compare voltage and SOC once it's done one full cycle? Or do you need to always recharge it to reset to counter and set SOC to 100%? What I mean: Will the SOC% be accurate even if i only charge, let's say from 20% to 70% (after the initial charge/discharge)? I guess so?!
I don't think it will be accurate. The firmware waits till the voltage crosses the threshold, that you have configured, to reset the gauge to 100%. If you didn't reach the threshold while charging the firmware will keep substracting Watt hours and will show 0%. So you must recharge it fully to reset the counter. If you don't want to fully recharge the battery - say 90%, you may set your threshold lower so it resets while charged to 90%.

This handling is not ideal but I guess it's the only one possible if you don't have a smart BMS that communicates with your display.

casainho   100 GW

100 GW
Posts: 5028
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by casainho » Jun 02 2020 2:44am

izeman wrote:
Jun 02 2020 2:33am
casainho wrote:
Jun 02 2020 2:21am
Yes, go ahead and improve the information that could help you and then it will help the next ones.
I'm just doing it. One more question: Does the firmware build an internal table to compare voltage and SOC once it's done one full cycle? Or do you need to always recharge it to reset to counter and set SOC to 100%? What I mean: Will the SOC% be accurate even if i only charge, let's say from 20% to 70% (after the initial charge/discharge)? I guess so?!
There is only one SOC counter, that get´s reset only when you fully charge the battery - this is the concept. You can see the value of that counter on configurations and set any value if you prefer, like 0 effectively reset it.

For correct configuration of SOC:
1. set battery Wh value
2. set battery voltage to reset the SOC counter
3. set the battery internal resistance
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

Please consider a donation to help developments: paypal.me/jorgecasa

User avatar
izeman   100 GW

100 GW
Posts: 5107
Joined: Jun 21 2011 8:25am
Location: Vienna, Austria

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by izeman » Jun 02 2020 2:54am

vshitikov wrote:
Jun 02 2020 2:43am
This handling is not ideal but I guess it's the only one possible if you don't have a smart BMS that communicates with your display.
If that really is the case, then i'd call it useless (for my application). For battery life, I very seldemly charge to 100% (or even 90%). I try to keep my SOC at 50% and then top up a little and only fully charge if i'm unsure about the needed capacity.
Building an internal table that relates every (loaded) voltage to a specific SOC would at least give a very good estimate, that would need recalibration every now and then.
Let's say you have entered a 1000Wh battery, and 60V 100% SOC, with a LVC of 42V. And as you count Wh, note the voltage at 100Wh used (90%), then 200Wh (80%) used etc.
I know this is very simplified and getting the exact voltage is difficult, but you would get at least a rough guess. Showing a 80% charged battery as EMPTY, just because you didn't charge over the threshold??
Or if nothing else you could use predefined discharge curves for li-ion, li-fepo4, li-mn etc and rely on unloaded voltage only (still for a rought guess)

vshitikov   10 W

10 W
Posts: 94
Joined: Mar 05 2020 7:24am

Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Post by vshitikov » Jun 02 2020 3:43am

izeman wrote:
Jun 02 2020 2:54am
vshitikov wrote:
Jun 02 2020 2:43am
This handling is not ideal but I guess it's the only one possible if you don't have a smart BMS that communicates with your display.
If that really is the case, then i'd call it useless (for my application). For battery life, I very seldemly charge to 100% (or even 90%). I try to keep my SOC at 50% and then top up a little and only fully charge if i'm unsure about the needed capacity.
Building an internal table that relates every (loaded) voltage to a specific SOC would at least give a very good estimate, that would need recalibration every now and then.
Let's say you have entered a 1000Wh battery, and 60V 100% SOC, with a LVC of 42V. And as you count Wh, note the voltage at 100Wh used (90%), then 200Wh (80%) used etc.
I know this is very simplified and getting the exact voltage is difficult, but you would get at least a rough guess. Showing a 80% charged battery as EMPTY, just because you didn't charge over the threshold??
Or if nothing else you could use predefined discharge curves for li-ion, li-fepo4, li-mn etc and rely on unloaded voltage only (still for a rought guess)
Yes for you the current implementation will be inaccurate. As you said the best for you is to keep eye on the battery voltage and have a rough estimate. This is what your internal BMS is doing anyways. There is no way to estimate state of charge without putting sophisticated BMS inside of the battery with Microcontroller and EEPROM and allways keep track of charges discharges. This is not possible in current implementation where people using their own batteries.

Post Reply