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

Electric Motors and Controllers
andyme   100 W

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

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

Post by andyme » Nov 28 2018 2:20pm

spiked wrote:
Nov 28 2018 2:06pm
spiked wrote:
Nov 27 2018 10:18am
. My lights, which worked fine under the stock setup with VLCD5, no longer light up when I turn them on from the LCD3 (LCD3 backlight comes on, but front and rear lights, wired through the standard Y cable, do not). These are standard, low wattage lights supplied with the motor.
Can anyone confirm their lights work in 0.16.0? Any suggestions as to why mine stopped working when I installed LCD3 and the 0.16 firmware?
i think i read somewhere that there is maybe a light option under certain circumstances...i don't remember where and what exactly...i think straight out of the box it does not work.

Rafe   10 W

10 W
Posts: 83
Joined: Oct 16 2018 5:56pm

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

Post by Rafe » Nov 28 2018 3:49pm

yes light works fine in firmware 16.0

spiked   1 mW

1 mW
Posts: 15
Joined: Sep 07 2018 10:20am

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

Post by spiked » Nov 28 2018 4:51pm

Rafe wrote:
Nov 28 2018 3:49pm
yes light works fine in firmware 16.0
Thanks. Guess I'll have to go to work on the wiring...

User avatar
jbalat   10 kW

10 kW
Posts: 555
Joined: Nov 10 2012 11:50pm
Location: Melbourne, Australia

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

Post by jbalat » Nov 28 2018 6:02pm

Hey guys I've just been involved in testing and helping with suggestions. Appreciate your offer for but I'm getting just as much out of this as you guys, all kudos to the programmers casainho and endless cadence :bigthumb:

So the lights do work but if they are pulling any kind of current the controller freaks out. The recommendation back a few pages was to hook them up with a relay.

the drag in reverse is there because motor is always energised.
Stancecoke posted how to turn this on and off but the programmers are concerned if the field is turned off while the motor is still spinning it could cause damage to the controller.. I don't think its a big issue because you should be able to do a quick check of motor speed ERPS before turning off the field. The question is when to turn it off ? Is it once the wheel speed goes to zero ??
Please subscribe to my Youtube home page for Quadcopters, FPV and Bike Rides http://www.youtube.com/jbalatutube
My build log here http://endless-sphere.com/forums/viewto ... =6&t=55352
For some cool ebike talk join us on The Best ebike https://www.facebook.com/groups/193581737807033/
Tech talk TSDZ2 Opensource firmware https://endless-sphere.com/forums/viewt ... &start=150
Opensource TSDZ2 Wiki https://github.com/OpenSource-EBike-fir ... _wiki/wiki

andyme   100 W

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

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

Post by andyme » Nov 28 2018 6:44pm

jbalat wrote:
Nov 28 2018 6:02pm
Hey guys I've just been involved in testing and helping with suggestions. Appreciate your offer for but I'm getting just as much out of this as you guys, all kudos to the programmers casainho and endless cadence :bigthumb:

let's be honest...those who actually create it are getting just the same out of it (the use) and more (the satisfaction) so that is absolutely no argument in your favor :lol: I understand it is difficult to differentiate at some point in time because at the end of the day a question can also be a contribution.

but nonetheless: i think it is absolutely normal to donate to programmers and leading contributors, so whoever has an idea on how to show our gratitude to you 3 guys: i am in.

spiked   1 mW

1 mW
Posts: 15
Joined: Sep 07 2018 10:20am

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

Post by spiked » Nov 28 2018 9:05pm

spiked wrote:
Nov 28 2018 4:51pm
Rafe wrote:
Nov 28 2018 3:49pm
yes light works fine in firmware 16.0
Thanks. Guess I'll have to go to work on the wiring...
Lights wiring is fine. There is no voltage on the lighting wire at the plug coming out of the controller, so it appears the 6v converter circuit on the controller board has failed. No big deal - I've got a buck converter I can use to run the lights directly off the battery.

Still haven't ridden the bike yet with the open firmware/LCD3, as it's been too cold here for my old bones...

BrisneyLand   10 µW

10 µW
Posts: 6
Joined: Nov 05 2018 4:30am
Location: Brisbane, Australia

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

Post by BrisneyLand » Nov 29 2018 6:36am

Well my ride to work and home today was awesome. A lot better than the stock firmware. I adjusted the levels as per jbalat's recommendations and if anything they still seemed too strong. I was easily able to push 30km/h in L1 on the flat and effortlessly power up hills in L5, so I might drop it as follows:

L1 0.2
L2 0.4
L3 0.7
L4 1.0
L5 1.5

I did enable battery state of charge and set it to display from 100-1, but the reading stays at 100 and does not drop. Any know issues with this?

casainho   1 GW

1 GW
Posts: 3361
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Nov 29 2018 7:38am

My paypal account for donations casainhoATgmail.com. I plan to use donations to keep buying hardware that is needed for development.
jbalat wrote:
Nov 28 2018 6:02pm
the drag in reverse is there because motor is always energised.
Stancecoke posted how to turn this on and off but the programmers are concerned if the field is turned off while the motor is still spinning it could cause damage to the controller.. I don't think its a big issue because you should be able to do a quick check of motor speed ERPS before turning off the field. The question is when to turn it off ? Is it once the wheel speed goes to zero ??
I also found that my pedals rotate backward and that will make pedal cadence value > 0 and also torque sensor value > 0, and this will start to energize the motor... the solution may be to detect backwards pedal rotation and then keep motor off on this situation.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

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.

andyme   100 W

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

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

Post by andyme » Nov 29 2018 9:45am

casainho wrote:
Nov 29 2018 7:38am
My paypal account for donations casainhoATgmail.com. I plan to use donations to keep buying hardware that is needed for development.
USD 50 from me.

andyme   100 W

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

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

Post by andyme » Nov 29 2018 9:49am

andyme wrote:
Nov 29 2018 9:45am
casainho wrote:
Nov 29 2018 7:38am
My paypal account for donations casainhoATgmail.com. I plan to use donations to keep buying hardware that is needed for development.
USD 50 from me.
Anmerkung 2018-11-29 154822.jpg

casainho   1 GW

1 GW
Posts: 3361
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Nov 29 2018 11:27am

Status of the OpenSource firmware for Bafang 850C color LCD

The configuration menu is now fully implemented and I like a lot the result:

Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

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.

thineight   100 W

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

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

Post by thineight » Nov 29 2018 11:35am

casainho wrote:
Nov 29 2018 7:38am
I also found that my pedals rotate backward and that will make pedal cadence value > 0 and also torque sensor value > 0, and this will start to energize the motor... the solution may be to detect backwards pedal rotation and then keep motor off on this situation.
Casainho, could you please list the sensors "triggered by the cyclist" present in the motor? I understand from the discussion that there is:
- torque sensor
- speed sensor
- cadence sensor
Anything else?

This may help anyone without deep knowledge in programming or electronic (but with common sense) to spot a possible solution to the issue.

Just my 2 cents on the backward drag.
I anticipate that I am still on stock firmware as i I am waiting for the brake sensors to finish off the wirings. I realize from the stock firmware that there is a kind of "low cut/min value" in the torque input. In fact, when I am not moving, if I just rest my foot on the pedal I do not feel any assist, but if I press a little more the motor starts.
I assume that the torque input from the sensor while moving backwards is much less than a foot on the pedal, and that's why the motor does not contribute (in the stock firmware which is OK when the bike is pushed backwards).

What if we implement in the open source firmware the following checks (pseudo code).
Given the raw input from the torque sensor (say 0-100), we set a set_min_torque variable (e.g. 5) to be used like this:

If (speed < 6 km/h) and (actual_torque < set_min_torque) then
// Bike is almost stopped and Torque is minimal which can be backwards movement or foot resting on the pedal //

MOTOR_DISABLED

end if


The set_min_torque could be fixed in the code or user variable from the LCD3 setup.

Looks quite easy to me (I'm not an electronic engineer.. I'm civil with some coding experience) so I presume it is much more complicated than this.. what is your thoughts on it?

Thanks
Thineight
MTB KTM Ultra 29" - City bike DAYTONA 28"

casainho   1 GW

1 GW
Posts: 3361
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Nov 30 2018 2:16am

We have a new option for LCD to control TSDZ2!!

I finish the development of a working version of OpenSource firmware for Bafang 850C color LCD. This is the very first time I got it controlling the TSDZ2 motor. Both the LCD and the TSDZ2 are running our OpenSource firmwares!!

I have an special ride on Saturday, and I decide to take the risk and use this fresh firmware that may have bugs and be a problem while I will be on the mountains...

The firmware is on github. I wrote on wiki the wirings for this new LCD, they way to install the firmware and wire to TSDZ2 is very similar: https://github.com/OpenSource-EBike-fir ... 3-to-TSDZ2

Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

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.

andyme   100 W

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

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

Post by andyme » Nov 30 2018 4:12am

casainho wrote:
Nov 30 2018 2:16am
We have a new option for LCD to control TSDZ2!!

I finish the development of a working version of OpenSource firmware for Bafang 850C color LCD. This is the very first time I got it controlling the TSDZ2 motor. Both the LCD and the TSDZ2 are running our OpenSource firmwares!!

so: no brake control? not important enough? i was so proud of my brake sensor...it was "highly recommended"...

firmware on github: where?

thineight   100 W

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

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

Post by thineight » Nov 30 2018 4:38am

andyme wrote:
Nov 30 2018 4:12am
so: no brake control? not important enough? i was so proud of my brake sensor...it was "highly recommended"...

firmware on github: where?
I guess it is just matter of shorting the BRAKE and GND cables along the wire to the controller. The firmware itself already handles the cut-off.. maybe the display does not show the brake symbol yet (also the VLCD5 does not show the symbol but it works anyway)

Any idea about the backward resistance possible solution I wrote 2 posts ago?
MTB KTM Ultra 29" - City bike DAYTONA 28"

casainho   1 GW

1 GW
Posts: 3361
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Nov 30 2018 5:14am

thineight wrote:
Nov 30 2018 4:38am
andyme wrote:
Nov 30 2018 4:12am
so: no brake control? not important enough? i was so proud of my brake sensor...it was "highly recommended"...

firmware on github: where?
I guess it is just matter of shorting the BRAKE and GND cables along the wire to the controller. The firmware itself already handles the cut-off.. maybe the display does not show the brake symbol yet (also the VLCD5 does not show the symbol but it works anyway)

Any idea about the backward resistance possible solution I wrote 2 posts ago?
Yes, brakes connections to TSDZ2 is just the same installation as for KT-LCD3.
And LCD shows the word "brake" when I push the brakes.

Firmware is here: https://github.com/OpenSource-EBike-fir ... C_firmware

Wiki with technical documentation is here: https://github.com/OpenSource-EBike-fir ... afang-850C

For backward resistance, I would implement detection of pedals rotating backwards.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

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.

andyme   100 W

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

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

Post by andyme » Nov 30 2018 6:01am

casainho wrote:
Nov 30 2018 5:14am
thineight wrote:
Nov 30 2018 4:38am
andyme wrote:
Nov 30 2018 4:12am
so: no brake control? not important enough? i was so proud of my brake sensor...it was "highly recommended"...

firmware on github: where?
I guess it is just matter of shorting the BRAKE and GND cables along the wire to the controller. The firmware itself already handles the cut-off.. maybe the display does not show the brake symbol yet (also the VLCD5 does not show the symbol but it works anyway)

Any idea about the backward resistance possible solution I wrote 2 posts ago?
Yes, brakes connections to TSDZ2 is just the same installation as for KT-LCD3.
And LCD shows the word "brake" when I push the brakes.

Firmware is here: https://github.com/OpenSource-EBike-fir ... C_firmware

Wiki with technical documentation is here: https://github.com/OpenSource-EBike-fir ... afang-850C

For backward resistance, I would implement detection of pedals rotating backwards.
Oh....so this needs EC intervention...but I haven't heard from him in a long time...I am afraid we lost him...
WhatsApp Image 2018-11-30 at 12.28.59.jpeg
as of 5 minutes ago: i am ready.... :D very cute..it is smaller than i expected it to be

thineight   100 W

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

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

Post by thineight » Nov 30 2018 8:04am

casainho wrote:
Nov 30 2018 5:14am

For backward resistance, I would implement detection of pedals rotating backwards.
So are the available sensors capable to detect backwards movement of pedals?

With my suggestion above I assumed that it was not possible to detect the direction of pedaling..

And by the way.. any news from EC? Hope he's enjoying his bike somewhere around...
MTB KTM Ultra 29" - City bike DAYTONA 28"

casainho   1 GW

1 GW
Posts: 3361
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Nov 30 2018 8:11am

thineight wrote:
Nov 30 2018 8:04am
So are the available sensors capable to detect backwards movement of pedals?
I think so, the hall sensor for the cadence but must be developed and tested. If you are ready to do it?? please say if so, other way I will be losing my precious time talking here.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

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.

thineight   100 W

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

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

Post by thineight » Nov 30 2018 8:18am

casainho wrote:
Nov 30 2018 8:11am
thineight wrote:
Nov 30 2018 8:04am
So are the available sensors capable to detect backwards movement of pedals?
I think so, the hall sensor for the cadence but must be developed and tested. If you are ready to do it?? please say if so, other way I will be losing my precious time talking here.
No, it is definitely beyond my knowledge of civil engineer..
My suggested workaround of a torque cut-off (if feasible) sounded a bit easier to implement without developing additional functions.
MTB KTM Ultra 29" - City bike DAYTONA 28"

marinbiker   1 µW

1 µW
Posts: 2
Joined: Nov 30 2018 7:24am

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

Post by marinbiker » Nov 30 2018 8:44am

I wonder if anyone can help with my little problem

i bought the TSDZ2 approx. 2 months ago, Installed it but couldn't get the screen to power up. After some dialogue with elifebike2010 (ebay) They sent a new screen.

I have power, I then adjusted the speed sensor so I got a reading
This is where the issues started
The screen responds and records the speed and when slowing down to approx. 8-10mph I get random spedd figures 64mph, 37mph which immediately cuts the assistance. So when approaching a hill the motor cuts, just when you really need it.
The motor worked fine when the the speed sensor wasn't fully adjusted, last weekend it rode it up the Old Kilpatrick Hill. Very steep long climb, and it assisted me all the way up at differing speeds.
elifebike have accepted my ebay return but i'm sad to have to send it back

Can anyone help

Bartman   10 W

10 W
Posts: 67
Joined: Feb 11 2018 2:38pm

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

Post by Bartman » Nov 30 2018 1:17pm

marinbiker wrote:I wonder if anyone can help with my little problem

i bought the TSDZ2 approx. 2 months ago, Installed it but couldn't get the screen to power up. After some dialogue with elifebike2010 (ebay) They sent a new screen.

I have power, I then adjusted the speed sensor so I got a reading
This is where the issues started
The screen responds and records the speed and when slowing down to approx. 8-10mph I get random spedd figures 64mph, 37mph which immediately cuts the assistance. So when approaching a hill the motor cuts, just when you really need it.
The motor worked fine when the the speed sensor wasn't fully adjusted, last weekend it rode it up the Old Kilpatrick Hill. Very steep long climb, and it assisted me all the way up at differing speeds.
elifebike have accepted my ebay return but i'm sad to have to send it back

Can anyone help
Your magnet is too close the the speed sensor. Try moving it it further away. Strange how it’s always 64mph. Mine did that too.


Sent from my iPad using Tapatalk

vreppeto   1 mW

1 mW
Posts: 12
Joined: Oct 03 2018 6:07pm

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

Post by vreppeto » Nov 30 2018 6:32pm

jbalat wrote:
Oct 16 2018 1:57am
Spiked, would be great if we could conduct some heat between the motor and motor casing ? Any ideas ?
Submersibles fill these brushless motors with mineral oil to compensate for high pressure. For us this would make cooling much more efficient. Encoders might need to be replaced with something more tolerant of oil such as this https://www.digikey.com/product-detail/ ... ND/4864246. The video shows a bldc being submerged in oil and the loss of rpm is minimal.

vreppeto   1 mW

1 mW
Posts: 12
Joined: Oct 03 2018 6:07pm

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

Post by vreppeto » Nov 30 2018 6:52pm

Stator insulation is classified by temperature. Does anyone know what class of insulation the 48v 750w motor uses?

What about the other motors?

ifishtoo

Rafe   10 W

10 W
Posts: 83
Joined: Oct 16 2018 5:56pm

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

Post by Rafe » Nov 30 2018 7:02pm

vreppeto wrote:
Nov 30 2018 6:32pm
jbalat wrote:
Oct 16 2018 1:57am
Spiked, would be great if we could conduct some heat between the motor and motor casing ? Any ideas ?
Submersibles fill these brushless motors with mineral oil to compensate for high pressure. For us this would make cooling much more efficient. Encoders might need to be replaced with something more tolerant of oil such as this https://www.digikey.com/product-detail/ ... ND/4864246. The video shows a bldc being submerged in oil and the loss of rpm is minimal.

Cheapest way to have your mid drive run cool, silent, with strong gearing, walk assist that works, proper throttle control, easy to program and no need to re-program the display is to fit a BBS HD.


I've been running the TSDZ2 52 v version for a year now over some of the steepest terrain and and have never found overheating to be a problem and it's even cooler with Casainho's brilliant FOC firmware. There is already a relatively large surface area of metal to metal contact where the motor inserts into the motor housing to transfer heat away. The major problem with this drive is the noise it makes and the blue gear which can fail without warning, fitting the metal gear ensures you are going to complete the journey without gear failure but it's at least twice as noisy. Now if someone could source a decent hard wearing plastic gear that will last as in the bafang that would be the biggest improvement after Casainho's firmware for this drive possible.

Post Reply