TSDZ2 OSF for all displays, VLCD5-VLCD6-XH18, LCD3, 860C-850C-SW102.

.....

So I figured maybe the torque sensor calibration is out of whack and the firmware isn't getting much demand for power from the pedals.....
There are 3 types of torque calibration,
1. The easiest and most important is the torque range calibration. zero and max. value
2. The less important one is human torque calibration with a weight of 24kg
3. The hardest to do calibration is hardware calibration, by moving the hall sensor till you find the lowest value. In that case the range of the torque sensor will be optimal.

You can find how to do 1. and 2. on page 5 of the display manual.
How to do 3. you can find in the wiki
 
Is there a way to do torque sensor calibration using a VLCD5 that's already running the OSF? Presumably by reading off the te or te1 values from the 'ser' menu with different weights on the pedals?
With VLCD5 display it is possible to view the torque sensor values using TE and TE1.
To access these two parameters, see the VLCD5 manual.
With OSF, TE is the value of "Pedal torque adc offset", TE1 is the delta.
So the value of "Pedal torque adc max" is TE + TE1.
 
Sorry to dredge up an old issue, but I finally screwed up the courage to re-flash my TSDZ2 (non-B) and 860C (original version) from the bike-shop-installed version v20.1c to the latest v20.1c.5 to try to fix my issue with the display hanging whenever I try to set the clock. To refresh your memory, both are zero at power-up, and if I set either to a non-zero value, as soon as I hit the "M" button to confirm the setting, the display freezes and only a battery disconnect/reconnect will allow it to function again. As a result of this issue, no function that makes use of clock time works (such as auto-trip-reset after X hours).

I'm now wondering whether the memory holding the hour and minute values may have somehow gotten corrupted and the firmware can't handle whatever value is there now, causing the hang. Is there any way to forcibly clear those memory locations, or somehow set them to a known good value?

P.S. Per the other comments, I've tried leaving the display on for hours at a time in hopes that it would charge the on-board backup battery in case that was the issue, but it hasn't helped. Any/all suggestions welcome at this point...
 
I see you haven't done the torque sensor calibration.
If you use hybrid mode, I recommend doing it.
In hybrid mode "Startup boost" is not used.
Instead, the "Smooth start" function has been added, which wasn't there before.
So to have the same conditions as the previous version you should disable it, but I don't recommend it.
If you want to have more responsiveness when starting in hybrid mode, try increasing the "Smooth start" %, in addition to carrying out the torque calibration.
Hello mbrusa,
I turned off the "Startup boost" and the "Smooth start" completely and now the e-bike seems to be as agile as before, even without torque sensor calibration. The motor is pretty quiet and seems even sufficiently "Smooth" in Hybrid mode, which I use, so I'll probably leave those options off. So far I feel like the motor is heat up more with the new firmware, but I'll keep an eye on that.
 

Attachments

  • 20240626-163959CEST.ini
    794 bytes · Views: 7
"Startup boost" is only used in Power mode.
In Hybrid mode "Smooth start" is used, it is important to enable it to soften the shock at the start.
In Hybrid mode, you can have a strong impact starting uphill with maximum push on the pedals and in TURBO.
While testing in these conditions, I broke the rear wheel axle!

Regarding heating, under equal conditions, it should be lower than the previous version.
Keep in mind that the cadence also affects the best efficiency is obtained at 80 rpm.
 
Sorry to dredge up an old issue, but I finally screwed up the courage to re-flash my TSDZ2 (non-B) and 860C (original version) from the bike-shop-installed version v20.1c to the latest v20.1c.5 to try to fix my issue with the display hanging whenever I try to set the clock. To refresh your memory, both are zero at power-up, and if I set either to a non-zero value, as soon as I hit the "M" button to confirm the setting, the display freezes and only a battery disconnect/reconnect will allow it to function again. As a result of this issue, no function that makes use of clock time works (such as auto-trip-reset after X hours).

I'm now wondering whether the memory holding the hour and minute values may have somehow gotten corrupted and the firmware can't handle whatever value is there now, causing the hang. Is there any way to forcibly clear those memory locations, or somehow set them to a known good value?

P.S. Per the other comments, I've tried leaving the display on for hours at a time in hopes that it would charge the on-board backup battery in case that was the issue, but it hasn't helped. Any/all suggestions welcome at this point...
Unfortunately I have no idea what the problem could be.
When you turn on the display, the value of the clock counter is read, if it displays zero it is because the value of the counter is zero.

The "Reset default" function sets the parameters to default values and the clock to zero.

With the display turned on, even without updating the time, the clock should increment starting from zero. It does not do it? There is something broken in RTC.
 
Unfortunately I have no idea what the problem could be.
When you turn on the display, the value of the clock counter is read, if it displays zero it is because the value of the counter is zero.

The "Reset default" function sets the parameters to default values and the clock to zero.

With the display turned on, even without updating the time, the clock should increment starting from zero. It does not do it? There is something broken in RTC.
Thank you for your assessment. You are correct, when the display is turned on, the clock displays "00:00" and never increments. So I guess you must be correct that there's something broken in the RTC.

In your opinion, would there be any value in tearing open the 860C and replacing the backup battery inside? Is there any chance that it could be the culprit?
 
Question: Is "Weight on pedal" (in the Torque Sensor menu) entered in kg or lbs?

The documentation says "Use a weight of 25 Kg. or 55 lb.", but it doesn't say whether the actual value that should be entered is in kg or lb.

Thanks!
 
In your opinion, would there be any value in tearing open the 860C and replacing the backup battery inside? Is there any chance that it could be the culprit?
I don't know, I wouldn't be able to do it, it's also difficult to open the 860C.
If you really want to try, here's some help.
Bafang 860C display dead - SOLVED!

Question: Is "Weight on pedal" (in the Torque Sensor menu) entered in kg or lbs?

The documentation says "Use a weight of 25 Kg. or 55 lb.", but it doesn't say whether the actual value that should be entered is in kg or lb.

Thanks!
The weight value displayed is in Kg.

errata corrige
In the versions for 860C the weight must be set in Kg with Units=SI, in lb with Units=Imperial.
I got confused with the stock display version.
 
Last edited:
Release Open source firmware TSDZ2-v20.1C.6-beta-0 VLCD5-VLCD6-XH18 · emmebrusa/TSDZ2-Smart-EBike-1
I thought, if there are no messages it means everything is fine...
Or maybe it's because no one is using it?
Glad to hear someone has tried it, Thanks for the feedback.
Let's wait some more.
Using the latest software (TSDZ2-v20.1C.6-beta-0) with two motors—one at 36V and the other at 48V (on different bikes). The battery operates at 48 volts.
The motors are quieter than in the previous version, and less responsive at the start, which I consider a valuable feature. After approximately 500km on both setups, I encountered E07 errors. It appears these errors are linked to the speed limit, as discussed at E07 overcurrent shows up often · Issue #99 · emmebrusa/TSDZ2-Smart-EBike-1 (a potential fix is available). I plan to raise the speed limit temporarily and observe if the errors reoccur.

Great job on your work. Many thanks!
 
Hy guys, since 1 week i try the C6Beta release... and with "default_settings_36v" i encounter the E07 error as says krulcm and with "torque sensor calibrated" i encounter E02 error when starting the VLCD5.
So i try this change
False errors occur E07.
You can try the changes, it shouldn't happen again.
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1/archive/refs/heads/master.zip
but this time i can't flash the controler with:
"make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)
Cleaning failed!!"
Any idea ?
aniway, thank's for your great job !
 

Attachments

  • Capture.PNG
    Capture.PNG
    72.2 KB · Views: 11
Hy guys, since 1 week i try the C6Beta release... and with "default_settings_36v" i encounter the E07 error as says krulcm and with "torque sensor calibrated" i encounter E02 error when starting the VLCD5.
So i try this change

but this time i can't flash the controler with:
"make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)
Cleaning failed!!"
Any idea ?
aniway, thank's for your great job !
I get E02 error if standing on pedals during starup, even gentle pressure is enough to trigger that error. If it ocurs only when you use "torque sensor calibrated" option, i would recheck calibration values (or increase no weight value - i have it 140 on both motors). It is good to keep some margin due to measurement error.
Flashing problem might be programing cable/dongle related.
 
I get E02 error if standing on pedals during starup, even gentle pressure is enough to trigger that error. If it ocurs only when you use "torque sensor calibrated" option, i would recheck calibration values (or increase no weight value - i have it 140 on both motors). It is good to keep some margin due to measurement error.
Flashing problem might be programing cable/dongle related.
thank's for your anser.
Until yesterday, i had 87 on TE, 190 on TE1 and if i was puting something under 140 on "pedal torque ADC Offset" i had E02 error as startup (with no load on cranks).So i check this morning and surprise, TE was 166 and TE1 145 !! I don't understand this change. But now with 166 and 301 on calibration, there is no more E02 error...
for "make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3) Cleaning failed!!", ii writed a mistake as it was not when flashing but compilling... as soon i click on "complil and flash" buton...
 
Hi everybody, and thank you to mbrusa and all the contributors of this wonderful OSFirmware.
I am new to this forum and just installed 2 bikes with 36V TSDZ2B motors, 8 pins VLCD5 and 36V 25Ah batteries. I managed to flash (after some cable and STLink dongle-related tribulations...) the 1.20.1C.2-update-3 version of mbrusa firmware.
So far, so good and we appreciate a lot riding with this configuration, in Hybrid Mode for now.
My concern is now a thermal one : I understood that cooling the motor is almost necessary, and I plan to buy this cooling kit for that purpose, a little test showing the benefits of it.
I know that I should also add a temperature sensor, but i want to keep the throttle for now, and i know I cannot have both...
So my idea is to keep the throttle (as suggested inside this video) and to add a "thermal security switch" to the motor, (like this one, the KSD9700) connected to the brake sensor line.
When the switch becomes ON, at 85°C, it will ground the Brake sensor line (which is active low) and that should stop the motor.
So my question is : does anyone here have some experience with this technique ? Is there any better thermal switch that I should consider for that ?
And finally, putting the brake sensor line directly to ground through this switch, seems to me a little risky, because some TTL outputs may already be connected to it, making their current flow directly to ground ! Should I better use an 1K resistor to do that ?

By advance thank for your remarks and comments !
 
Hi everybody, and thank you to mbrusa and all the contributors of this wonderful OSFirmware.
I am new to this forum and just installed 2 bikes with 36V TSDZ2B motors, 8 pins VLCD5 and 36V 25Ah batteries. I managed to flash (after some cable and STLink dongle-related tribulations...) the 1.20.1C.2-update-3 version of mbrusa firmware.
So far, so good and we appreciate a lot riding with this configuration, in Hybrid Mode for now.
My concern is now a thermal one : I understood that cooling the motor is almost necessary, and I plan to buy this cooling kit for that purpose, a little test showing the benefits of it.
I know that I should also add a temperature sensor, but i want to keep the throttle for now, and i know I cannot have both...
So my idea is to keep the throttle (as suggested inside this video) and to add a "thermal security switch" to the motor, (like this one, the KSD9700) connected to the brake sensor line.
When the switch becomes ON, at 85°C, it will ground the Brake sensor line (which is active low) and that should stop the motor.
So my question is : does anyone here have some experience with this technique ? Is there any better thermal switch that I should consider for that ?
And finally, putting the brake sensor line directly to ground through this switch, seems to me a little risky, because some TTL outputs may already be connected to it, making their current flow directly to ground ! Should I better use an 1K resistor to do that ?

By advance thank for your remarks and comments !
I was given a TSDZ2 motor where the casing broke in half. I bought a new casing and swapped the guts over last winter. and been riding it since spring. I did buy a piece of copper to make a motor cooling plate but did not make it since my main objective was to get the motor to run first and not make the project more complicated than necessary. I did install a thermocouple on the motor lamination. 500 miles later, temperature data in the hottest weather (90 F so far) indicates motor never got above 57C 135F. I will not install the cooling plate unless something breaks in the motor and I have to open it up.

I have a throttle also and do not want to give it up. I bought from ebay 5 KSD9700 75 C normally open thermo switches. I plan to install it in place of the thermocouple when the motor needs servicing. Right now I feel pretty confident I do not have a thermal issue. The motor casing never get beyond luke warm to the touch.

edit: You may want to check your motor temperature to see if you need the cooling kit. $110 is a lot of money!
 
Last edited:
I was given a TSDZ2 motor where the casing broke in half. I bought a new casing and swapped the guts over last winter. and been riding it since spring. I did buy a piece of copper to make a motor cooling plate but did not make it since my main objective was to get the motor to run first and not make the project more complicated than necessary. I did install a thermocouple on the motor lamination. 500 miles later, temperature data in the hottest weather (90 F so far) indicates motor never got above 57C 135F. I will not install the cooling plate unless something breaks in the motor and I have to open it up.

I have a throttle also and do not want to give it up. I bought from ebay 5 KSD9700 75 C normally open thermo switches. I plan to install it in place of the thermocouple when the motor needs servicing. Right now I feel pretty confident I do not have a thermal issue. The motor casing never get beyond luke warm to the touch.

edit: You may want to check your motor temperature to see if you need the cooling kit. $110 is a lot of money!
Thanks for your answer ! As you tell, i certainly need to investigate more to measure the real temperature of the motor during my ordinary use cases. I will begin some experiments with the KSD9700 also (with a 80°C and an 85 °C) and the motor.
About the cooling kit i mentioned, i plan to use the "basic one", which cost only about 30 Euros...
 
Thanks for your answer ! As you tell, i certainly need to investigate more to measure the real temperature of the motor during my ordinary use cases. I will begin some experiments with the KSD9700 also (with a 80°C and an 85 °C) and the motor.
About the cooling kit i mentioned, i plan to use the "basic one", which cost only about 30 Euros...
The package of 5 KSD9700 from ebay were rated 75 C normally open. I tested them in boiling water. 2 closed at 82C, 3 closed at 88C. They took around 10 seconds to close from immersion in hot water.

Just to make sure it works I wired a KSD9700 thermo switch to a brake cutout cable and tested it on the motor. You can see the brake cutout symbol at the top/ middle of the display when I pull the brake lever (I have only one brake cutout sensor installed). The other brake cutout input is wired to the KSD9700 thermo switch. As I short the input, you see the brake cutout symbol on the display, which cuts power to the motor.

30 euro is more reasonable for the basic. I thought the TSDZ2B is a new motor which fixes thermal issues with the TSDZ2? Make sure you ask the seller that the basic cooling plate will fit your TSDZ2B.

 
The package of 5 KSD9700 from ebay were rated 75 C normally open. I tested them in boiling water. 2 closed at 82C, 3 closed at 88C. They took around 10 seconds to close from immersion in hot water.

Just to make sure it works I wired a KSD9700 thermo switch to a brake cutout cable and tested it on the motor. You can see the brake cutout symbol at the top/ middle of the display when I pull the brake lever (I have only one brake cutout sensor installed). The other brake cutout input is wired to the KSD9700 thermo switch. As I short the input, you see the brake cutout symbol on the display, which cuts power to the motor.

30 euro is more reasonable for the basic. I thought the TSDZ2B is a new motor which fixes thermal issues with the TSDZ2? Make sure you ask the seller that the basic cooling plate will fit your TSDZ2B.

Thanks again for your answer !
I just ordered 75°C, 80°C and 85 °C KSD9700 (5 of each, they are very cheap), of the 'normally open' version. From your test with hot water, it seems that advertised closing temperature is very imprecise... I will need to test what i will receive, and select the correct one.
I plan to install the KSD9700 selected while installing the cooling kit in the motor. I will connect it directly to the brake sensor line and GND on the controller wiring. It seems no resistor is needed, because no logic output seems to be connected to this 'brake sensor' line.
Regarding the TSDZ2 vs TSDZ2B here is a quick comparison, and no thermal improvement was made. The 'basic cooling kit' that i plan to buy is advertised as compatible with TSDZ2B. So far, so good, i just need to wait a little bit to receive all that. Thanks for your help !
 
Thanks for the TSDZ2 vs TSDZ2B comparison link. Very informative.

The increased fillet size of the TSDZ2B casing is exactly where my TSDZ2 broke! I wonder what percentage of TSDZ2s broke like that and what caused them to break?

No resistor is needed. I think there's a pull-up resistor on the brake signal (to 5V) inside the controller. Shorting it directing to ground will not damage anything. I cut off the cable/connector from my un-used brake cutout Amazon.com to wire up the KSD9700 so as not to hack into the wiring of the motor.
 
Last edited:
So far I have used the TSDZ2 drives on four full suspension bikes and a TSDZ2B drive on a hard-tail. I have modified the TSDZ2's with the extra axle bearing. To stop the drives turning in the BB I have formed and fitted an aluminum reinforced epoxy putty wedge piece between the front of the drive casing and the down-tube, I main sure the wedges are bigger than needed and squeezed them into shape by rotating the drive up into the down-tube. Have fitted the TSDZ2 drives with the TSDZ2B embossed fixing plates. Three have the TSDZ2 OSF, the other two need a controller change. Haven't broke any casings so far, main problem is the paint coming off on the underside of them, so gorilla taped the underside and trying a 3D printed sump guard which I need to extend.
 
So far I have used the TSDZ2 drives on four full suspension bikes and a TSDZ2B drive on a hard-tail. I have modified the TSDZ2's with the extra axle bearing. To stop the drives turning in the BB I have formed and fitted an aluminum reinforced epoxy putty wedge piece between the front of the drive casing and the down-tube, I main sure the wedges are bigger than needed and squeezed them into shape by rotating the drive up into the down-tube. Have fitted the TSDZ2 drives with the TSDZ2B embossed fixing plates. Three have the TSDZ2 OSF, the other two need a controller change. Haven't broke any casings so far, main problem is the paint coming off on the underside of them, so gorilla taped the underside and trying a 3D printed sump guard which I need to extend.
Do you have the fixing block installed (the one that bolts to the chain stay) on all your bikes? Do you think the fixing block is needed if the motor BB nut is tight and does not ever loosen? I assume the motor moves toward the down tube as power is applied to the motor?
 
Last edited:
No, the only bike with the fixing block is the hard-tail which has the TSDZ2B 48v mid-drive, the others with the TSDZ2 36v mid-drives being full suspension have the epoxy putty wedge pieces and theTSDZ2B embossed fixing plates, could 3D print the wedge pieces but a bit of a faff as the epoxy putty just forms to the right shape. Zoom in on the first photo with the under-slung battery and you see the grey wedge piece. Yes the motor pivots to the down tube. I have used Loctite red pipe thread sealant which not a high strength thread lock to stop the nut coming loose.
Zambam, In the early days I have had the TSDZ2 BB nut's come loose hence the reason for the epoxy putty, Loctite red and change to TSDZ2B embossed fixing plates. I am 90% sure that I have seen a Tongsheng comment saying that you can get away with just using the TSDZ2B embossed fixing plate only to stop the drive rotating, after all I did have a AKM mid-drive that used the Bafang BB twin nut system which I guess Tongsheng has copied on the B version embossed fixing plate.


Look at Step 4
Tip:

If the fixing block doesn't work with your frame, you can mount the motor without it. If the motor rotates over time, don't overtighten the lockring. Instead, rotate it snugly against the bottom bracket housing (in the direction of pedaling), hand tighten for now.

But I would myself still use an epoxy putty wedge, have not tried it on the high power rated mid-drives.
 

Attachments

  • IMG_20230620_105640736.jpg
    IMG_20230620_105640736.jpg
    5.1 MB · Views: 14
  • IMG20220730111052.jpg
    IMG20220730111052.jpg
    5.3 MB · Views: 14
  • IMG_20230731_172222001_HDR.jpg
    IMG_20230731_172222001_HDR.jpg
    4.3 MB · Views: 13
Last edited:
thank's for your anser.
Until yesterday, i had 87 on TE, 190 on TE1 and if i was puting something under 140 on "pedal torque ADC Offset" i had E02 error as startup (with no load on cranks).So i check this morning and surprise, TE was 166 and TE1 145 !! I don't understand this change. But now with 166 and 301 on calibration, there is no more E02 error...
for "make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3) Cleaning failed!!", ii writed a mistake as it was not when flashing but compilling... as soon i click on "complil and flash" buton...
I reply to me. and i must do all my apologies to you as SDCC was not install on C:\
So "10 time you 've to read the README file..."
One more request: As i'm riding in EMTB mode, previously (v20.1C.2 update 3), EMTB assiste level parameters have to be between 0 and 20. Now (v20.1C.6-beta-0), it's between 21 and 254. so i've try a rule of 3 with a bad result and i could't find equivalents parameters.
So what's the differences on EMTB assiste level parameters ? Thank's
 
Back
Top