New "TSDZ2 Torque Sensor Central Motor"

Discussions related to motors other than hub motors.
This includes R/C motors, botttom bracket, roller and geared drives.
aja   10 W

10 W
Posts: 69
Joined: May 06 2014 2:05pm

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by aja » Oct 15 2018 3:38am

jbalat wrote:
Oct 14 2018 10:37pm
See if you can still read the LCD ? Just checking that your drivers are still working..
Yep, read the LCD3 fine.

maximusdm   100 mW

100 mW
Posts: 48
Joined: Sep 08 2018 12:51pm

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by maximusdm » Oct 15 2018 7:46am

I have same problem as Aja. Check SWIM cable connection.

aja   10 W

10 W
Posts: 69
Joined: May 06 2014 2:05pm

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by aja » Oct 15 2018 9:43am

I’ve made another short cable but this time using the speed sensor cable end; identical problem; this is a total waste of time ☹️. As lots of people have done this successfully there’s something I’m not doing right; what can it be?
I soldered connections onto the speed sensor cable so that it could be connected to the ST LINK V2. My cable is about 10-11cm long. I also made a 9cm then cut it down to 5cm home made cable before I bastardised the speed sensor cable. 4 wires including 5V for power are connected.

I have Windows VM running.
I open up the ST Visual programmer application.
I plug in the ST LINK V2 to the USB already plugged in to the TSDZ2. A blue light shines on the ST LINK V2.
I click on the USB bar in Windows and select the ST LINK V2
I select STM8S105x6 (I have also tried the x4 variant; makes no difference).
Port: USB; Programming mode SWIM.
I then try to read the controller by pressing Read all tabs: I then get the following error:
Cannot communicate with device!
Check Swim cable connection and check all the needed pin connections on the Swim connector.
If the application code uses Swim Disable and Reset pin as output or has disabled SEIM clock divider. Try now to Switch off and on the application power supply while NRST reset pin is forced low.
The light alternates from blue to red a couple of after the error pops up then goes red.
Where am I going wrong?

casainho   1 GW

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

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by casainho » Oct 15 2018 9:49am

aja wrote:
Oct 15 2018 9:43am
I’ve made another short cable but this time using the speed sensor cable end; identical problem; this is a total waste of time ☹️. As lots of people have done this successfully there’s something I’m not doing right; what can it be?
I soldered connections onto the speed sensor cable so that it could be connected to the ST LINK V2. My cable is about 10-11cm long. I also made a 9cm then cut it down to 5cm home made cable before I bastardised the speed sensor cable. 4 wires including 5V for power are connected.

I have Windows VM running.
I open up the ST Visual programmer application.
I plug in the ST LINK V2 to the USB already plugged in to the TSDZ2. A blue light shines on the ST LINK V2.
I click on the USB bar in Windows and select the ST LINK V2
I select STM8S105x6 (I have also tried the x4 variant; makes no difference).
Port: USB; Programming mode SWIM.
I then try to read the controller by pressing Read all tabs: I then get the following error:
Cannot communicate with device!
Check Swim cable connection and check all the needed pin connections on the Swim connector.
If the application code uses Swim Disable and Reset pin as output or has disabled SEIM clock divider. Try now to Switch off and on the application power supply while NRST reset pin is forced low.
The light alternates from blue to red a couple of after the error pops up then goes red.
Where am I going wrong?
Don't know. Can you read things like the OPT or EEPROM? Try to erase, unlock, etc the STM8.
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.

aja   10 W

10 W
Posts: 69
Joined: May 06 2014 2:05pm

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by aja » Oct 15 2018 10:08am

casainho wrote:
Oct 15 2018 9:49am
aja wrote:
Oct 15 2018 9:43am
I’ve made another short cable but this time using the speed sensor cable end; identical problem; this is a total waste of time ☹️. As lots of people have done this successfully there’s something I’m not doing right; what can it be?
I soldered connections onto the speed sensor cable so that it could be connected to the ST LINK V2. My cable is about 10-11cm long. I also made a 9cm then cut it down to 5cm home made cable before I bastardised the speed sensor cable. 4 wires including 5V for power are connected.

I have Windows VM running.
I open up the ST Visual programmer application.
I plug in the ST LINK V2 to the USB already plugged in to the TSDZ2. A blue light shines on the ST LINK V2.
I click on the USB bar in Windows and select the ST LINK V2
I select STM8S105x6 (I have also tried the x4 variant; makes no difference).
Port: USB; Programming mode SWIM.
I then try to read the controller by pressing Read all tabs: I then get the following error:
Cannot communicate with device!
Check Swim cable connection and check all the needed pin connections on the Swim connector.
If the application code uses Swim Disable and Reset pin as output or has disabled SEIM clock divider. Try now to Switch off and on the application power supply while NRST reset pin is forced low.
The light alternates from blue to red a couple of after the error pops up then goes red.
Where am I going wrong?
Don't know. Can you read things like the OPT or EEPROM? Try to erase, unlock, etc the STM8.
How do I read OPT or EEPROM? and indeed how do I erase or unlock the STM8? Is OPT, option byte?

Thanks

Bartman   1 W

1 W
Posts: 54
Joined: Feb 11 2018 2:38pm

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by Bartman » Oct 15 2018 11:48am

aja wrote:
Oct 15 2018 9:43am
I’ve made another short cable but this time using the speed sensor cable end; identical problem; this is a total waste of time ☹️. As lots of people have done this successfully there’s something I’m not doing right; what can it be?
I soldered connections onto the speed sensor cable so that it could be connected to the ST LINK V2. My cable is about 10-11cm long. I also made a 9cm then cut it down to 5cm home made cable before I bastardised the speed sensor cable. 4 wires including 5V for power are connected.

I have Windows VM running.
I open up the ST Visual programmer application.
I plug in the ST LINK V2 to the USB already plugged in to the TSDZ2. A blue light shines on the ST LINK V2.
I click on the USB bar in Windows and select the ST LINK V2
I select STM8S105x6 (I have also tried the x4 variant; makes no difference).
Port: USB; Programming mode SWIM.
I then try to read the controller by pressing Read all tabs: I then get the following error:
Cannot communicate with device!
Check Swim cable connection and check all the needed pin connections on the Swim connector.
If the application code uses Swim Disable and Reset pin as output or has disabled SEIM clock divider. Try now to Switch off and on the application power supply while NRST reset pin is forced low.
The light alternates from blue to red a couple of after the error pops up then goes red.
Where am I going wrong?
What are you running the windows vm on ? I run on a MacBook Pro and sometimes get these error. I use st visual programmer, And when I get these errors I shut the program down and then restart it. I make sure I'm on the program tab and then use the writer current tab option from the program menu. I had loads of issues at the start, but since adopting this method it seem to be fine.

aja   10 W

10 W
Posts: 69
Joined: May 06 2014 2:05pm

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by aja » Oct 15 2018 12:52pm

Hi,
Using a Macbook Air 2011
When you say ‘write’ I take it you mean ‘program’ as I don’t see a ‘write’ anywhere.
Did you try to read the current tab or all tabs before trying to program/write to the motor controller?
I haven’t tried to program the ST Link yet as JB suggested ensuring that it could read first; I take it that if it can’t read then it can’t write/program?
I’ve lost count of the times that I quit STVP and started it again!
Are you using STM8S105x4 as JB mentioned that x6 is now used for both screen and motor?

maximusdm   100 mW

100 mW
Posts: 48
Joined: Sep 08 2018 12:51pm

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by maximusdm » Oct 15 2018 2:20pm

To make cables even shorter I connected directly into the board! Same result. Please see picture.
I made swim on black wire pin, reset on purple, ground on LCD black wire. Please see picture.
I have the LCD cables cut out. Is this a problem?
https://imgur.com/a/jHlqWDS
https://imgur.com/a/K7M5iK9

EDit: i have no idea how to attach picture. How do you do it?

casainho   1 GW

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

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by casainho » Oct 15 2018 2:24pm

maximusdm wrote:
Oct 15 2018 2:20pm
To make cables even shorter I connected directly into the board! Same result. Please see picture.
I made swim on black wire pin, reset on purple, ground on LCD black wire. Please see picture.
I have the LCD cables cut out. Is this a problem?
https://imgur.com/a/jHlqWDS
https://imgur.com/a/K7M5iK9

EDit: i have no idea how to attach picture. How do you do it?
I program with the motor controller powered on and for that, the LCD must be powered on and enable power to the motor controller........
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.

Waynemarlow   100 W

100 W
Posts: 230
Joined: Jul 09 2016 7:22am
Location: Bucks, England

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by Waynemarlow » Oct 15 2018 2:25pm

OK so no takers on the springs beneath the non reciprocating part of the Torque Sensor. Does anyone have a photo of that area so that I could reference them against something.

I have heard that there was a service manual for this engine somewhere on the internet, I can't seem to locate it, any ideas.

Thanks.

Bartman   1 W

1 W
Posts: 54
Joined: Feb 11 2018 2:38pm

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by Bartman » Oct 15 2018 2:30pm

aja wrote:
Oct 15 2018 12:52pm
Hi,
Using a Macbook Air 2011
When you say ‘write’ I take it you mean ‘program’ as I don’t see a ‘write’ anywhere.
Did you try to read the current tab or all tabs before trying to program/write to the motor controller?
I haven’t tried to program the ST Link yet as JB suggested ensuring that it could read first; I take it that if it can’t read then it can’t write/program?
I’ve lost count of the times that I quit STVP and started it again!
Are you using STM8S105x4 as JB mentioned that x6 is now used for both screen and motor?

Sorry yeah I meant program current tab, I'm not in front of the computer just now. I use x6. If you can read then you should be abld to write as it's the same protocol. As to reading all tabs before programming, I don't do this now as I doscovered the process works better starting visual programmer, loading hex file and programming it without first reading. And I use a USB extension cable. Wifi and Bluetooth turned off as well.

Waynemarlow   100 W

100 W
Posts: 230
Joined: Jul 09 2016 7:22am
Location: Bucks, England

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by Waynemarlow » Oct 15 2018 2:42pm

OK found

Manual is at https://drive.google.com/file/d/114t0UJ ... MH7aC/view

And the springs are. But its not too clear, anybody have one they can measure ?

Thanks
Attachments
Springs.JPG
Springs.JPG (57.95 KiB) Viewed 1383 times

maximusdm   100 mW

100 mW
Posts: 48
Joined: Sep 08 2018 12:51pm

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by maximusdm » Oct 16 2018 2:04am

casainho wrote:
Oct 15 2018 2:24pm
maximusdm wrote:
Oct 15 2018 2:20pm
To make cables even shorter I connected directly into the board! Same result. Please see picture.
I made swim on black wire pin, reset on purple, ground on LCD black wire. Please see picture.
I have the LCD cables cut out. Is this a problem?
https://imgur.com/a/jHlqWDS
https://imgur.com/a/K7M5iK9

EDit: i have no idea how to attach picture. How do you do it?
I program with the motor controller powered on and for that, the LCD must be powered on and enable power to the motor controller........
That is an important detail. Thank you!

andyme   100 W

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

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by andyme » Oct 16 2018 4:25pm

aja wrote:
Oct 14 2018 1:41pm
Can someone please help me; I've tried connecting the ST Link to the Speed sensor on the TSDZ2 to flash the firmware to the motor but whatever I do, I get the same Swim comms error; started with cables inc connectors at 9cm and cut them down to 5cm...still doesn't work; spent the whole weekend creating cables then soldering and re-soldering t different lengths; nothings worked. I do have a speed sensor cable but don't want to cut it up if I get the same result as I've followed JB's and Casainho and indeed Eco ebikes instructions but to no avail. :(
I've flashed the 0.14 hex file to the LCD3 without a problem.
I am not sure if this will help you, but i want to relate 2 things re. the motor flash cable with 6 pin connector .
pls refer to the pic. this is what the connections should be looking from the front. also: you can make your own female plug by using e.g. short pieces of tiny brass tubes that will fit over the motor connector pins. this way you do not have to use sensor cables etc... i tried to use a speed sensor cable from another bike..there were only 2 wires in it...these tubes are used in modelling, RC toys etc
the length of my cable is about 15 cm, it works perfectly well. i am using a tube with 0,9 mm inner diameter and 0,2mm wall thickness, 0,8mm would be even better if available
connector made from tube.jpeg
tsdz2flashconnector.png

aja   10 W

10 W
Posts: 69
Joined: May 06 2014 2:05pm

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by aja » Oct 16 2018 6:25pm

andyme wrote:
Oct 16 2018 4:25pm

I am not sure if this will help you, but i want to relate 2 things re. the motor flash cable with 6 pin connector .
pls refer to the pic. this is what the connections should be looking from the front. also: you can make your own female plug by using e.g. short pieces of tiny brass tubes that will fit over the motor connector pins. this way you do not have to use sensor cables etc... i tried to use a speed sensor cable from another bike..there were only 2 wires in it...these tubes are used in modelling, RC toys etc
the length of my cable is about 15 cm, it works perfectly well. i am using a tube with 0,9 mm inner diameter and 0,2mm wall thickness, 0,8mm would be even better if available connector made from tube.jpegtsdz2flashconnector.png
I made my own connectors in the formation you have shown; didn’t work. I had a speed sensor with 6 wires which corresponded with casainho’s installation guidelines. When I try to read the motor controller, the battery pack is not plugged in and the LCD is not switched on but I note that casainho just mentioned doing so; is it necessary? I didn’t see that instruction anywhere.

andyme   100 W

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

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by andyme » Oct 16 2018 6:37pm

i can only say that i have the motor connected to the battery, but i did not turn the lcd on...on the other hand: it will not harm either...

User avatar
jbalat   10 kW

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

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by jbalat » Oct 16 2018 10:50pm

if you have the 5v wire connected to the flash tool then you don't need any other external power.
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

aja   10 W

10 W
Posts: 69
Joined: May 06 2014 2:05pm

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by aja » Oct 17 2018 3:01am

andyme wrote:
Oct 16 2018 6:37pm
i can only say that i have the motor connected to the battery, but i did not turn the lcd on...on the other hand: it will not harm either...
I've also tried your method, nothing.

andyme   100 W

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

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by andyme » Oct 17 2018 3:13am

I really feel for you...this is so frustrating...

kortina   10 mW

10 mW
Posts: 34
Joined: Feb 19 2017 9:24pm

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by kortina » Oct 17 2018 5:00am

I have similar issues.

I can program the LCD just fine. Motor is very flaky.

I ended up turning OFF the verification. Then I run the flash around 5-10 times until I don't get an error.

Not exactly a great solution.
(52v - 750w with throttle version).

casainho   1 GW

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

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by casainho » Oct 17 2018 6:36am

About getting Bafang 850C color LCD working with TSDZ2

I am being trying to develop knowledge and firmware for Bafang 850C color LCD, to make it working with TSDZ2 and our OpenSource firmware. I think this LCD model has good potential because uses standard/popular technology (the same used on Arduino world) and I can easily develop firmware for it, using just the same tools as for LCD3.

Over LCD3, it is obvious that it has much more flexibility because of the color display. I also think it has 3 big advantages: 1. huge memory space of 512kbytes; 2. internal clock that means I will not need anymore to check the hours on my watch while riding; 3. fast communication from the microcontroller to LCD that should permit fast drawing of real time graphs with data like motor current, motor temperature, etc.

BUT I am blocked, because I can't drive the LCD, because I do not know which driver IC it uses... I got the help from the work of hurzhurz that developed a change to UTFT LCD library (for TSDZ2 XH18 LCD) and I used it.
I also got the help from another user that sent me a new TSDZ2 + 1x Bafang 850C color LCD.

My next step is to try using a logic analyzer to read the 19 signals that goes to LCD and find what data is needed to drive it. I never done this!! Always learning and trying :-)

Right now I used 3x Bafang 850C color LCD. The first one I burned by mistake, the 2nd do not has the original firmware firmware and the 3rd one is waiting for me to received the logic analyzer.

Image
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.

EndlessScream   100 µW

100 µW
Posts: 7
Joined: Aug 28 2018 12:59am

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by EndlessScream » Oct 17 2018 3:06pm

I have bought a new TSDZ2, but infortunately it is not working. I would like to test it without LCD display. I have 8 pin cable, so I need to short blue and red wire, but I don't know which pins are these on my connector. Pin 1 is battery +. How to find a second one?

Image

casainho   1 GW

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

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by casainho » Oct 18 2018 11:42am

feketehegyi wrote:
Oct 12 2018 3:06pm
fyi, I've made a TSDZ2 Display from scratch
I am more and more interested on this type of DIY. I would prefer to go with an already existing LCD for ebikes but seems very hard to make the LCD working when we have no datasheet of it -- I also saw a lot of forum messages of people with this type of problems for cheap LCDs to Arduino, where chinese guys sell them saying they use a specific LCD driver but in fact use some different....

I had one idea: why not recycle ours TSDZ2 VLCD6 and use the enclose to put inside the Arduino + the LCD??

I think a color LCD of 3.2 inches takes the area of the original LCD of VLCD6. And even we could reuse the original UP, DOWN and POWER buttons of VLCD6!!

What I think we need (this is the hardware of Bafang Color LCDs):
- 1x Arduino (I would go with 32bits STM32 Bluepill board, because is small, cheap, powerful and we can use the same flash/development tools for TSDZ2)
- 1x 3.2 inches color LCD (there are some versions already of IPS TFT that should give a better reading outside light) -- connection by SPI
- 1x Arduino RTC (real time clock, so the system can have tie/clock) -- connection by SPI
- 1x 60V to 5V DC-DC (to power the system)
- 1x some switch to power on/of the motor controller

Optional:
- 1x Bluetooth module
- 1x other hardware for bicycle sensors

Doing DIY is not good as most users will simple not do it. The probability for errors are much higher...

What is your plan??
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.

User avatar
gaber   10 W

10 W
Posts: 69
Joined: Sep 22 2017 8:56am
Location: Grand Rapids, MI

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by gaber » Oct 18 2018 12:50pm

casainho wrote:
Oct 18 2018 11:42am
I am more and more interested on this type of DIY. I would prefer to go with an already existing LCD for ebikes but seems very hard to make the LCD working when we have no datasheet of it -- I also saw a lot of forum messages of people with this type of problems for cheap LCDs to Arduino, where chinese guys sell them saying they use a specific LCD driver but in fact use some different....

I had one idea: why not recycle ours TSDZ2 VLCD6 and use the enclose to put inside the Arduino + the LCD??

I think a color LCD of 3.2 inches takes the area of the original LCD of VLCD6. And even we could reuse the original UP, DOWN and POWER buttons of VLCD6!!

What I think we need (this is the hardware of Bafang Color LCDs):
- 1x Arduino (I would go with 32bits STM32 Bluepill board, because is small, cheap, powerful and we can use the same flash/development tools for TSDZ2)
- 1x 3.2 inches color LCD (there are some versions already of IPS TFT that should give a better reading outside light) -- connection by SPI
- 1x Arduino RTC (real time clock, so the system can have tie/clock) -- connection by SPI
- 1x 60V to 5V DC-DC (to power the system)
- 1x some switch to power on/of the motor controller

Optional:
- 1x Bluetooth module
- 1x other hardware for bicycle sensors

Doing DIY is not good as most users will simple not do it. The probability for errors are much higher...

What is your plan??
Being a beginning arduino user, this really interests me! Agreed that I'm sure it wouldn't get mainstream adoption so it might not be the best idea to abandoned support for the LCD3. That said, I would imagine at some point a fully stable release will be settled on that implements most of the desired functions and some more fringe-diy off shoots can be pursued without leaving the LCD3 dev in a lurch.

Would be super awesome to have reliable bluetooth, color display - and would be a fun project to build.
sometimes you eat the bear, and sometimes, well, he eats you.

User avatar
feketehegyi   1 W

1 W
Posts: 59
Joined: Jul 11 2018 6:18am

Re: New "TSDZ2 Torque Sensor Central Motor"

Post by feketehegyi » Oct 18 2018 3:49pm

casainho wrote:
Oct 18 2018 11:42am
What is your plan??
My Arduino and SPI TFT setup is a proof of concept only. A mobile phone connected to TSDZ2 via bluetooth is the best display imho.
If someone has not seen my bluetooth module:
https://www.youtube.com/watch?v=CiTuFZmhYbA
Or a live demo with my VOAMCA firmware:
https://www.youtube.com/watch?v=MRNlK_30TOA

Post Reply