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

casainho said:
izeman said:
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:
 
izeman said:
HughF said:
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
 
izeman said:
casainho said:
izeman said:
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...
 
izeman said:
casainho said:
izeman said:
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.
 
casainho said:
izeman said:
casainho said:
izeman said:
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-firmware/TSDZ2_wiki/wiki/Features-and-configurations-on-display#Configurations_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:
 
izeman said:
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
 
casainho said:
izeman said:
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.
 
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:
 
izeman said:
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 said:
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.png


Did you find there configurations for SOC, if so, what configurations values do you use and why?
 
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.
 
AZUR said:
vshitikov said:
AZUR said:
vshitikov said:
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.
 
vshitikov said:
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.
 
izeman said:
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?
 
casainho said:
vshitikov said:
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
 
izeman said:
izeman said:
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
 
HughF said:
izeman said:
HughF said:
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.
 
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
 
HughF said:
andyme said:
HughF said:
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!!
 
vshitikov said:
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?
 
izeman said:
vshitikov said:
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.
 
casainho said:
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?!
 
izeman said:
casainho said:
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.
 
izeman said:
casainho said:
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
 
vshitikov said:
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)
 
izeman said:
vshitikov said:
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.
 
Back
Top