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

I am asking for help from SW102 users with OSF 0.6.5. I am skipping the problem of not remembering the settings after turning it off again. How to set the temperature on the display is best step by step. I have read the 850c guide but for me the key combination does not work.
 
In the german forum is reported, that Tongsheng has completely reengineered the motor in 2020:
https://www.pedelecforum.de/forum/index.php?threads/tongsheng-tsdz2-36v-neues-design-2020.73872/post-1379882

almost changed compare to the old version, shell, chip, accessaries inside, firmware

I'm afraid that the open firmware will not work with this any longer. :-(

regards
stancecoke
 
stancecoke said:
In the german forum is reported, that Tongsheng has completely reengineered the motor in 2020:
https://www.pedelecforum.de/forum/index.php?threads/tongsheng-tsdz2-36v-neues-design-2020.73872/post-1379882

almost changed compare to the old version, shell, chip, accessaries inside, firmware

I'm afraid that the open firmware will not work with this any longer. :-(

regards
stancecoke

This is a good news if the new design is better (tougher components, better protection against water and dust, better heat dissipation, etc...)
The exact model of the chip will be different but I think it will be a STM32 again, so maybe not so much firmware modifications needed ?
 
Maybe they saw the light and have implemented simplified foc in their firmware as well.
With a bit of luck, they still use the same microcontroller.
Or it could be that the old controller still works with the new motor.
If it's mechanical more robust, that's a bonus. For the rest, we can only wait and see.
 
stancecoke said:
In the german forum is reported, that Tongsheng has completely reengineered the motor in 2020:
https://www.pedelecforum.de/forum/index.php?threads/tongsheng-tsdz2-36v-neues-design-2020.73872/post-1379882

almost changed compare to the old version, shell, chip, accessaries inside, firmware

I'm afraid that the open firmware will not work with this any longer. :-(
I think the most important thing is to be a good motor, with a good torque sensor AND keep selling all parts at unit and at very cheap prices (and in many online shops). If that happen, then, I will want to make OpenSource firmware for it :)

I am really happy because I thought the DIY motors would not have any more any improvement...

I just hope the microcontroller is something like and STM8 or STM32 and not a Chinese one without an available compiler and datasheet, impossible to develop firmware for, like on the Bafang DIY mid drive motors.
 
hetm4n said:
I am asking for help from SW102 users with OSF 0.6.5. I am skipping the problem of not remembering the settings after turning it off again. How to set the temperature on the display is best step by step. I have read the 850c guide but for me the key combination does not work.
I just released a new firmware version with the solution for saving the settings. See the wiki, I updated with the information on how to change the variables, like showing the motor temperature.
 
lvx_xvl said:
skestans said:
Man that sucks. Are you using a speed sensor connector, or DuPont wires with heat shrink tube at the ends? If DuPont, maybe you’re not getting a good connection and should try with a speed sensor extension cable so you get the proper connector and good contact.

If your speed sensing works correctly (ie displays the right speed on the display) and you’ve tried so many computers and dongles, the only option left is a bad connection at the plug.

You could try with a Linux live disc and see if stm8flash works there but if it didn’t work on OS X...

I'm using the speedsensor connector with the Dupont wires (4cm long) and heat shrink tubes. And you are right that might be the issue, but they really snuck in tight. So I'm assuming (very bad I know) they work. If I connect the GND, 5V and SWIM and boot the bike via the VLCD5 display then my ST Link V2 boots, so I'm fairly confident (I know very bad) that the connection is working.

I used a speed sensor extension cable at first, but a lot of people point out to the long leads being the problem.

regards,
LVX

You could shorten the cable between the connector and your dongle. Then use a USB extension to make it long enough.
 
I just released a new firmware version with the solution for saving the settings. See the wiki, I updated with the information on how to change the variables, like showing the motor temperature.
[/quote]
Casainho,
I flashed motor en sw102 with that new firmware.
But how to enter the confiuration mene ?
On/off quick click + long press is for me shutting off the display
 
Improvement to Battery SOC

On current version of firmware, there are 2 different ways for calculating the battery SOC: 1. based on battery voltage and 2. based on Coulomb counting (counting the used watts from the battery).

Method 1. is not very precise and 2. is very good for my experience as also from the feedback from users, so, I decided to remove the 1.
2. has the disadvantage that user needs to configure the right value for his battery Wh, but nowadays it is the most well know technical characteristics of ebike batteries because of range. Also the user can very easily use the display to measure the real value of his own battery.

Also, I decided to improve the 2., by considering the power loss on the battery internal resistance (this includes the cables), here an example how this power loss on the battery is relevant:

1. my battery has 350Wh (3.6V each cell * 3.5 amps/h each cell * 14 series (52V) * 2 paralel = 3.6*3.5*14*2 = 350Wh
2. my battery has internal resistance of 250 milli ohms (I did adjusted this value on the display until the voltage keep mostly stable while riding with motor pulling max current)

Let's say I am driving with motor pulling like 15 amps from the battery, the power loss is: P = R * I * I = 0.25 * 15 * 15 = 56 watts.
Since my battery has 350Wh, 56 watts of power means a 16% loss on the battery internals!! This means this value should be considered so the SOC can be more accurate.

Also, I decied to show on the battery configuration screen the battery power loss value, this is important for debug but mainly to educate the users that want to learn more about all this and maybe optimize their battery builds and/or the amount assistance power asked from the motor.

I also changed the battery icon on SW102 to be similar to the one on the 850C.

Here some pictures, in this case on SW102 but the 850C is similar:

2020-02-20-17-52-16-1.jpg
2020-02-20-17-46-48-1.jpg
 
Hi. Is it possible to make units on the display?

Like this :
 
Hi, where can I buy SW102 because PSWPower inform me that they don't know when shipment can be resumed.
 
I just received a 850C display from PSWPower today. I ordered it 1 week ago. You should be good to order.
 
Dear All,
Need some help with the sw102 0.6.7 firmware.

I was able to install succesfully the sw102-otaupdate-0.6.7.zip & TSDZ2-v0.54.0.hex (long ON/OFF press at startup is showing 0.6.7 + 0.54.0).

But I don't find the way how to enter the configuration menus :( .
According to the wiki it was changed with this release to "Enter configurations screen: ON/OFF quick click + long press"

I assume this is after a succesfull startup of the sw102 pressing once shortly on the ON/OFF (=> going to the second screen) and pressing for a longer period (1-2sec) again the ON/OFF.
But for me this is powering off the sw102.

Anybody a suggestion on what I'm doing wrong ?

2e issue :
I tried also to downgrade to sw102-otaupdate-0.6.5.zip, but this doesn't seem to work for me
After starting the upload the DFU disconnects ...

I (re)uploaded already multiple time succesfully the sw102-otaupdate-0.6.7.zip, but all downgrade attemps to 0.6.5 are failing
PS I never installed the 0.6.5 before as my previous installed version was sw102-otaupdate-0.19.11
 
some suggestions on the button usage on the sw102.

The extra [M] button ont the sw102 is easier accessible during the riding than the [ON/OFF] button
=> could we use the shortClick [M] to switch to the second screen (or even next screens) ?
+ (if a 2e mode would become available) longClick [M] to switch between street & offroad mode.
 
Zelenaar said:
Dear All,
Need some help with the sw102 0.6.7 firmware.

... I don't find the way how to enter the configuration menus :( . ... ON/OFF quick click + long press[/i]" ... But for me this is powering off the sw102.

My first 15 tries also turned the power off!!!! After some muscle memory learning I finally got it. The key is, when it works on the quick click, the main1 screen does not change to main2, but remains there. If you see the panel change, it is going to power off with the long press. Believe me, I know your frustration. (But, I find that it is a very good thing that you now only go to the config menu with a different key sequence.)

Also, as I understand it, the version number can only be updated higher. If a new release is unusable, the only outs are 1) a quick fix or 2) a re-release of the prior workable version under a higher version number.
 
windburner said:
Zelenaar said:
Dear All,
Need some help with the sw102 0.6.7 firmware.

... I don't find the way how to enter the configuration menus :( . ... ON/OFF quick click + long press[/i]" ... But for me this is powering off the sw102.

My first 15 tries also turned the power off!!!! After some muscle memory learning I finally got it. The key is, when it works on the quick click, the main1 screen does not change to main2, but remains there. If you see the panel change, it is going to power off with the long press. Believe me, I know your frustration. (But, I find that it is a very good thing that you now only go to the config menu with a different key sequence.)

Also, as I understand it, the version number can only be updated higher. If a new release is unusable, the only outs are 1) a quick fix or 2) a re-release of the prior workable version under a higher version number.


Tnx a lot windburner, it works indeed with a very, very quick click :wink:
 
shodr said:
skestans said:
I flashed mine with a CH340 after accidentally frying my CP2102. I left the jumper open so I don’t know if my vcc was 3.3V or 5V on the CH340. BIT it worked without damage.

Your error has to do with windows not able to grab the com port to the serial adapter. I have a 850c with shot serial lines and the error is different in that case: you can grab the com port but it never detects the display turning on for flashing. And if you plug it back into the motor with stock firmware, the watt meter below the speed goes nuts, and the walk assist doesn’t do anything. These are the symptoms for shot serial on the 850c.

In your case it looks like a shitdows issue.

Hi,

did you use separate power for display or like in wiki.

I think I also shot my 850c serial line. Tried in win7, got same result.

In putty if I try to connect to it like in APT, it connects to it, then when I short press the power button I get "error reading from serial device", windows makes sound like I plugged in/out usb dongle, and putty freezes, with putty "inactive" on the status.

If I turn on 850c there is an error code 30h - which is related to serial connection.

Is there a way to test serial connection on 850c with computer.Don't have bafang motor to test it.

Should the RX led (on ttl dongle) be lit on when in flashing mode, voltage is only 1V (white RX line), on tx line (on ttl dongle) it is 3.3V (green line) and led is not on. There is also difference in resistance btw tx and rx line (15k ohm TX to GND vs 8k ohm on RX).

tnx.

Did you manage after all? I received a new 850C and with the same cable that worked for my other one, I can't flash this one. It won't power on while the flashing software is open and waiting, but it turns on fine when connected to power.

It also shows crazy numbers with the stock firmware when connected to the stock TSDZ2, like over 6200W power usage when the motor is idle sitting on the table on my bench.

What are the numbers engraved behind your display?

That's what it looks like: https://streamable.com/wafxa

EDIT: Nevermind, I'm an idiot... The GND wire got disconnected again and I didn't notice. When I plugged it back, it was able to flash. The 6200W usage was because the firmware loaded from the factory was for Bafang, not the TSDZ2. With the appropriate firmware image, it works properly.
 
casainho said:
Improvement to Battery SOC

On current version of firmware, there are 2 different ways for calculating the battery SOC: 1. based on battery voltage and 2. based on Coulomb counting (counting the used watts from the battery).

Method 1. is not very precise and 2. is very good for my experience as also from the feedback from users, so, I decided to remove the 1.
2. has the disadvantage that user needs to configure the right value for his battery Wh, but nowadays it is the most well know technical characteristics of ebike batteries because of range. Also the user can very easily use the display to measure the real value of his own battery.

Also, I decided to improve the 2., by considering the power loss on the battery internal resistance (this includes the cables), here an example how this power loss on the battery is relevant:

1. my battery has 350Wh (3.6V each cell * 3.5 amps/h each cell * 14 series (52V) * 2 paralel = 3.6*3.5*14*2 = 350Wh
2. my battery has internal resistance of 250 milli ohms (I did adjusted this value on the display until the voltage keep mostly stable while riding with motor pulling max current)

Let's say I am driving with motor pulling like 15 amps from the battery, the power loss is: P = R * I * I = 0.25 * 15 * 15 = 56 watts.
Since my battery has 350Wh, 56 watts of power means a 16% loss on the battery internals!! This means this value should be considered so the SOC can be more accurate.

Also, I decied to show on the battery configuration screen the battery power loss value, this is important for debug but mainly to educate the users that want to learn more about all this and maybe optimize their battery builds and/or the amount assistance power asked from the motor.

I also changed the battery icon on SW102 to be similar to the one on the 850C.

Here some pictures, in this case on SW102 but the 850C is similar:

2020-02-20-17-52-16-1.jpg
2020-02-20-17-46-48-1.jpg

I have issues with the Coulomb method. I set the reset voltage to the voltage the BMS indicates after charging 90%, but the voltage varies while using the battery and it reset the counter constantly for a while because the battery voltage osciallates above and below the voltage threshold.

Am I the only one? What did I misconfigure? If not, would it make sense for the software to keep track of the last seen voltage and unless there is a big difference with the voltage measured at next power on (i.e. the user most likely charged the battery inbetween), then don't reset the counter?
 
Today finally installed and tried 0.54 version with sw102 0.6.7.
I'm not sure how the whole thing with assist levels should work but it looks like I lost a lot of power on climbing. When I'm pushing hard up the hill no matter what assist level I'm using it's not going over 450-500w. I couldn't hit 750w mark. Max current is set at 16A.
 
hetm4n said:
Hi. Is it possible to make units on the display?

Like this :
I'd like to have this as well. Instead of showing human power I'd rather like to see motor temperature. I'm really interested how well my heatsink fix is working but it looks like temperature cant be seen at all on 0.6.7 sw102.
 
hefest said:
but it looks like temperature cant be seen at all on 0.6.7 sw102.
Or you don't know how to read the instructions on the wiki.
 
casainho said:
hefest said:
but it looks like temperature cant be seen at all on 0.6.7 sw102.
Or you don't know how to read the instructions on the wiki.
That could be the case, going straight to wiki to try to decipher how to change the display on sw102.
 
casainho said:
hefest said:
but it looks like temperature cant be seen at all on 0.6.7 sw102.
Or you don't know how to read the instructions on the wiki.
I just went through wiki again and can't find anything that points to the way to set sw102 display so I can see current temperature. Am I reading wrong wiki?

https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Features-and-configurations-on-display

PS: found it!
 
If I’m looking to buy a tsdz2 motor is there a recommended hardware setup that would allow the most freedom when running the open source software? I’d like to have a 750W, 48V mid-drive that will accommodate a rear coaster brake.

I’ve seen someone state that one of the 36v versions Converted to 48v may be better than buying a 48v motor? I’m also having trouble finding a 48v version with the coaster brake option. Does the coaster brake version have a power limit that’s lower than the standard version?
 
Jmauld said:
If I’m looking to buy a tsdz2 motor is there a recommended hardware setup that would allow the most freedom when running the open source software? I’d like to have a 750W, 48V mid-drive that will accommodate a rear coaster brake.

I’ve seen someone state that one of the 36v versions Converted to 48v may be better than buying a 48v motor? I’m also having trouble finding a 48v version with the coaster brake option. Does the coaster brake version have a power limit that’s lower than the standard version?

Don’t know about coaster brakes (why would you want one anyway?)

There are only two version of this motor: 36V or 48V. The watts are meaningless but sellers will put more watts because it looks better.
 
Back
Top