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

Electric Motors and Controllers
casainho   10 GW

10 GW
Posts: 4120
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Jan 03 2020 6:26am

diagonti wrote:
Jan 03 2020 5:43am
Rydon wrote:
Jan 02 2020 10:20pm
It is probably not the display. The display stays on the splash screen when it can't communicate with the motor controller. Check rx and tx to be sure they are not reversed. Also, check simple things like brake sensors.
Thank you for your reply. The display successfully determines the firmware version of the controller - tx/rx do not appear to be switched. Brake sensors are not currently connected for simplicity - do I need to pull this to +5v or GND for the display/controller to init? Obviously the 850C does not directly connect to the brake sensors.
On last version of firmwares, the system is a bit more complex and yes, it reads first the firmware version from the motor controller so if it shows the version "0.50.0" that means it is communicating with the motor controller.

The firmware on display is done in a way it will not advance to main screen while you keep on/off button pressed and you keep it pressed otherwise the power will be gone.

For testing, I think you can disconnect the wire that power up the motor controller from the display, then, connect directly that wire to the battery voltage. That way the system will work but you will need to cut off the battery power to turn off the system.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

diagonti   100 µW

100 µW
Posts: 7
Joined: Jan 01 2020 2:17am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by diagonti » Jan 03 2020 9:28pm

casainho wrote:
Jan 03 2020 6:26am
For testing, I think you can disconnect the wire that power up the motor controller from the display, then, connect directly that wire to the battery voltage. That way the system will work but you will need to cut off the battery power to turn off the system.
Good thought - I disconnected the orange (LCD) and red (motor) leads from each other, and joined the red (motor) end to the brown (LCD)/blue (motor) cable join. I left the now free orange (LCD) lead disconnected.

I still need to hold the power button down (so it does not progress to the next screen - at least I now know this is by design) but the negotiation of firmware versions happens much quicker (presumably because the motor controller is already running and waiting for a signal).

The motor however gives a small kick - this did not happen before. Is the bootup sequence reaching a slightly further state?

FWIW, I have also tested continuity between the cable joints and the 8-pin HIGO-B8 socket, so I am confident the joins are good and that the cable insulation color scheme is as expected.

Thanks again for your help!

dameri   100 W

100 W
Posts: 147
Joined: Sep 20 2018 10:57am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by dameri » Jan 04 2020 9:22am

What could be the reason, when I configure 850C display, and when I close it and start again, there is default values? Versions: 850C_v0.6.1 and tsdz2 v0.50.0.

casainho   10 GW

10 GW
Posts: 4120
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Jan 04 2020 9:43am

dameri wrote:
Jan 04 2020 9:22am
What could be the reason, when I configure 850C display, and when I close it and start again, there is default values? Versions: 850C_v0.6.1 and tsdz2 v0.50.0.
I am having the same issue... I can't understand why... it is very annoying. I want to solve it and make a new release Monday, I have a great improvement on the motor firmware that is a must, specifically after the last big improvement on the torque sensor resolution / sensitivity and linearization.

My solution for the config is changing the defaults and program the firmware, but this is for developers like me.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

dameri   100 W

100 W
Posts: 147
Joined: Sep 20 2018 10:57am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by dameri » Jan 04 2020 11:48am

casainho wrote:
Jan 04 2020 9:43am
dameri wrote:
Jan 04 2020 9:22am
What could be the reason, when I configure 850C display, and when I close it and start again, there is default values? Versions: 850C_v0.6.1 and tsdz2 v0.50.0.
I am having the same issue... I can't understand why... it is very annoying. I want to solve it and make a new release Monday, I have a great improvement on the motor firmware that is a must, specifically after the last big improvement on the torque sensor resolution / sensitivity and linearization.

My solution for the config is changing the defaults and program the firmware, but this is for developers like me.
Ok, thanks. I'll be waiting.

casainho   10 GW

10 GW
Posts: 4120
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Jan 06 2020 11:39am

TSDZ2 firmware: motor control resolution increased 4 times!!

New good improvement to the motor firmware, now the assistance is smoother and it is easily noticeable at low power values like bellow 100W.

Previous I improved the torque sensor sensitivity also by 4 times as also implemented full linearization / full calibration. Now, with a so nice sensitivity torque sensor, there is the need to also have a more sensitivity motor control!!

Changelog:
- motor control resolution increased 4 times, meaning a smoother assistance and it is very important at power values like bellow 100W. Previous min power assistance value was 30W, then 60W, then 90W (on a 52V battery) and so on, now it is 8W, 15W, 24W and so on
- added configuration on display for min current value (in ADC steps) while pedaling, even if not presing the pedals. This is nice to keep motor engaged and ready even if rotating pedals with minimal force that it is not even detected by the torque sensor
- corrected issue where the motor had resistance when rotating bicycle backwards
- other small improvements

Download here: https://github.com/OpenSource-EBike-fir ... 50C_v0.6.2
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

btslo   10 W

10 W
Posts: 65
Joined: Apr 17 2019 8:55am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by btslo » Jan 06 2020 4:19pm

Nice work. Is engagement faster too? What's the minimum assist, about 10W?

casainho   10 GW

10 GW
Posts: 4120
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Jan 06 2020 5:14pm

btslo wrote:
Jan 06 2020 4:19pm
Nice work. Is engagement faster too? What's the minimum assist, about 10W?
Engagement is dependent on the current ramp step that you can configure on the display. I didn't changed that.

Min assist is battery current of 0.156 amps * battery voltage, in increased steps of 0.156 amps.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

echew   100 mW

100 mW
Posts: 46
Joined: May 19 2018 8:56pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by echew » Jan 06 2020 8:57pm

Hi all, I've just finished my 2nd TSDZ2 build.

This 2nd bike is for my girlfriend, but I mucked up. She wanted the same as I had, and I have the 8-pin unit and a throttle, but I never use the throttle. So I just ordered the 6-pin version for her.

Big mistake! Turns out that was the function she was most looking forward to... you live and learn!

Anyway, the kit has all been fitted to the bike and returning it isn't really an option. Also my TSDZ2 has done 3000km so she's not super keen to swap mine for hers.

SO, bit of a longshot but I was wondering if anyone had figured out a way to program a throttle function by pressing a button on the VLCD6 display using the open source firmware?

Cheers!

Elinx   100 W

100 W
Posts: 188
Joined: Aug 09 2019 6:58am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by Elinx » Jan 07 2020 1:58am

echew wrote:
Jan 06 2020 8:57pm
.......
to program a throttle function by pressing a button on the VLCD6 display using the open source firmware?...
If you flash the OSF for default displays with the java GUI, it is possible to set support values for walk assist on every support level.
With these values it is possible to speed up the motor from low to the highest level.
I have read somewhere (but don't know when) that someone has programmed this for that purpose.
If this isn't dangerous or handy I don't know.
Other solution could be, is to enlarge the values of the normal support levels, so there the most support with the least effort.

Chewy   10 mW

10 mW
Posts: 29
Joined: Jun 03 2015 6:58am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by Chewy » Jan 07 2020 3:04am

What is the simple way to change my low voltage cut off?

I have 36v 350w tsdz2

Motor cuts off at 35.5v now

I want to cut off at 28v. How do I change this simply?

Thanks

casainho   10 GW

10 GW
Posts: 4120
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Jan 07 2020 3:33am

Chewy wrote:
Jan 07 2020 3:04am
What is the simple way to change my low voltage cut off?

I have 36v 350w tsdz2

Motor cuts off at 35.5v now

I want to cut off at 28v. How do I change this simply?

Thanks
Go to configurations, on battery section. Ready the wiki configurations instructions to understand.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

xlxc34   1 mW

1 mW
Posts: 10
Joined: Aug 14 2019 3:22pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by xlxc34 » Jan 07 2020 3:53am

Hi,

I have a very tempermental TSDZ2 which sometimes seems to turn on and run no problem, and other times I get no response unless I REALLY crank down on the pedals, in which case I might get a few 10s of Watts. I thought this might be a dodgy torque sensor, so I bought a new one and it seems to work just fine (checking the raw values on the 9 -> 2 menu it responds really well to changes in torque and has a baseline value of 35). However, I still have this problem where one in maybe every 2 or 3 times I use the bike I get no response, and turning it on and off again doesn't help. Any help with this will be VERY, VERY much appreciated as I am growing tired of starting off my 13 mile ride home with a bike that's 10kg heavier and has a load more resistance on a random basis!

Thanks!

Chewy   10 mW

10 mW
Posts: 29
Joined: Jun 03 2015 6:58am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by Chewy » Jan 07 2020 4:36am

casainho wrote:
Jan 07 2020 3:33am
Chewy wrote:
Jan 07 2020 3:04am
What is the simple way to change my low voltage cut off?

I have 36v 350w tsdz2

Motor cuts off at 35.5v now

I want to cut off at 28v. How do I change this simply?

Thanks
Go to configurations, on battery section. Ready the wiki configurations instructions to understand.

Do you have a link?

casainho   10 GW

10 GW
Posts: 4120
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by casainho » Jan 07 2020 5:05am

xlxc34 wrote:
Jan 07 2020 3:53am
Hi,

I have a very tempermental TSDZ2 which sometimes seems to turn on and run no problem, and other times I get no response unless I REALLY crank down on the pedals, in which case I might get a few 10s of Watts. I thought this might be a dodgy torque sensor, so I bought a new one and it seems to work just fine (checking the raw values on the 9 -> 2 menu it responds really well to changes in torque and has a baseline value of 35). However, I still have this problem where one in maybe every 2 or 3 times I use the bike I get no response, and turning it on and off again doesn't help. Any help with this will be VERY, VERY much appreciated as I am growing tired of starting off my 13 mile ride home with a bike that's 10kg heavier and has a load more resistance on a random basis!

Thanks!
I advice you to use latest firmware version as it has a few improvements to torque sensor. It also can help you better understand the values, at least see the calculated weight on the pedals.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

xlxc34   1 mW

1 mW
Posts: 10
Joined: Aug 14 2019 3:22pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by xlxc34 » Jan 07 2020 7:38am

casainho wrote:
Jan 07 2020 5:05am
xlxc34 wrote:
Jan 07 2020 3:53am
Hi,

I have a very tempermental TSDZ2 which sometimes seems to turn on and run no problem, and other times I get no response unless I REALLY crank down on the pedals, in which case I might get a few 10s of Watts. I thought this might be a dodgy torque sensor, so I bought a new one and it seems to work just fine (checking the raw values on the 9 -> 2 menu it responds really well to changes in torque and has a baseline value of 35). However, I still have this problem where one in maybe every 2 or 3 times I use the bike I get no response, and turning it on and off again doesn't help. Any help with this will be VERY, VERY much appreciated as I am growing tired of starting off my 13 mile ride home with a bike that's 10kg heavier and has a load more resistance on a random basis!

Thanks!
I advice you to use latest firmware version as it has a few improvements to torque sensor. It also can help you better understand the values, at least see the calculated weight on the pedals.
Thanks, I'll give it a try with version 20. If cadence and torque are both working OK, can you think of any other reasons why it would not be giving any power? Do I need a new motor controller?

Powerhour   100 mW

100 mW
Posts: 39
Joined: Sep 08 2019 11:33am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by Powerhour » Jan 07 2020 9:04am

I’m confused about these updated versions, is V0.50 the motor firmware and its newer than .20? Also, unsure what I do with the boot loader file for the 850c. Last time I flashed one I just used an rs232 adapter and I don’t remember doing anything with this boot loader file
Thanks

casainho   10 GW

10 GW
Posts: 4120
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by casainho » Jan 07 2020 10:33am

xlxc34 wrote:
Jan 07 2020 7:38am
Thanks, I'll give it a try with version 20. If cadence and torque are both working OK, can you think of any other reasons why it would not be giving any power? Do I need a new motor controller?
As I told, newest firmware version has improvements on the torque sensor code, you should first try it.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

casainho   10 GW

10 GW
Posts: 4120
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by casainho » Jan 07 2020 10:34am

Powerhour wrote:
Jan 07 2020 9:04am
I’m confused about these updated versions, is V0.50 the motor firmware and its newer than .20? Also, unsure what I do with the boot loader file for the 850c. Last time I flashed one I just used an rs232 adapter and I don’t remember doing anything with this boot loader file
Thanks
Yes. And the for installing with RS232 adapter you need to use the bootloader file version.

I will try to make wiki more clear on this.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

User avatar
stancecoke   100 kW

100 kW
Posts: 1170
Joined: Aug 02 2017 2:56pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by stancecoke » Jan 07 2020 11:23am

casainho wrote:
Jan 07 2020 10:33am
As I told, newest firmware version has improvements on the torque sensor code
I wonder on which branch you are working actually for the controller firmware, as the Master branch wasn't updated since September 2019?! I see a branch 0.50.0 but your recent release is 0.51.0?!

regards
stancecoke

echew   100 mW

100 mW
Posts: 46
Joined: May 19 2018 8:56pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by echew » Jan 07 2020 3:22pm

Elinx wrote:
Jan 07 2020 1:58am
echew wrote:
Jan 06 2020 8:57pm
.......
to program a throttle function by pressing a button on the VLCD6 display using the open source firmware?...
If you flash the OSF for default displays with the java GUI, it is possible to set support values for walk assist on every support level.
With these values it is possible to speed up the motor from low to the highest level.
I have read somewhere (but don't know when) that someone has programmed this for that purpose.
If this isn't dangerous or handy I don't know.
Other solution could be, is to enlarge the values of the normal support levels, so there the most support with the least effort.
Awesome, thanks for this! Will have a look into it.

thineight   100 W

100 W
Posts: 228
Joined: Oct 05 2018 3:53am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by thineight » Jan 07 2020 5:35pm

casainho wrote:
Jan 07 2020 10:33am
xlxc34 wrote:
Jan 07 2020 7:38am
Thanks, I'll give it a try with version 20. If cadence and torque are both working OK, can you think of any other reasons why it would not be giving any power? Do I need a new motor controller?
As I told, newest firmware version has improvements on the torque sensor code, you should first try it.
Casainho, I see in the Italian forum that one guy made the hardware calibration of the torque sensor and he experienced a slow drift of the rest value back to higher values over time.
Did you check the "zero" value again after some time? Did you find it stable over time?
I understand this is a fundamental data to check in order to validate your new "linearization concept".
If not, you need perhaps to repeat the software calibration from time to time..?
Thanks
MTB KTM Ultra 29" - City bike DAYTONA 28"

casainho   10 GW

10 GW
Posts: 4120
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by casainho » Jan 07 2020 6:32pm

thineight wrote:
Jan 07 2020 5:35pm
casainho wrote:
Jan 07 2020 10:33am
xlxc34 wrote:
Jan 07 2020 7:38am
Thanks, I'll give it a try with version 20. If cadence and torque are both working OK, can you think of any other reasons why it would not be giving any power? Do I need a new motor controller?
As I told, newest firmware version has improvements on the torque sensor code, you should first try it.
Casainho, I see in the Italian forum that one guy made the hardware calibration of the torque sensor and he experienced a slow drift of the rest value back to higher values over time.
Did you check the "zero" value again after some time? Did you find it stable over time?
I understand this is a fundamental data to check in order to validate your new "linearization concept".
If not, you need perhaps to repeat the software calibration from time to time..?
Thanks
I am still learning and testing. I hope others can share results so we all can learn.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

casainho   10 GW

10 GW
Posts: 4120
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by casainho » Jan 08 2020 5:47am

stancecoke wrote:
Jan 07 2020 11:23am
casainho wrote:
Jan 07 2020 10:33am
As I told, newest firmware version has improvements on the torque sensor code
I wonder on which branch you are working actually for the controller firmware, as the Master branch wasn't updated since September 2019?! I see a branch 0.50.0 but your recent release is 0.51.0?!
I was working on another branch, the branch 0.51.0. But I just merged to master but first did a backup of master to branch to 0.20.0-beta.1. So master is now updated.

I have a question to you, since you are experienced with the torque sensors, etc.

I am being testing to control the motor current instead of the battery current. I like the result. The question is that we measure the pedal human power and then we apply a motor power, if the assist level is 1.0, then both energies are equal and it is easy for user to see both energy values on display and understand the assist level. Controlling instead the motor current, I am thinking in applying the pedal human power to motor current, so, the more energy the user does, the more torque the motor does but that is not the energy as before!! Even looking at the motor energy when controlling the motor current, the energy does not scale as previous when controlling the battery current, so I think is hard for user to understand....

Do you have any ideas about this?
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

Elinx   100 W

100 W
Posts: 188
Joined: Aug 09 2019 6:58am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware (Casainho code only) for TongSheng TSDZ2 mid drive motor

Post by Elinx » Jan 08 2020 6:30am

casainho wrote:
Jan 08 2020 5:47am
.....
I am being testing to control the motor current instead of the battery current. I like the result. ...
In that case it is maybe interesting for you that ackmaniac this conversion to motorcurrent already did too for the default display version based on v.019.

Post Reply