Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Electric Motors and Controllers
jeff.page.rides   100 W

100 W
Posts: 241
Joined: Aug 13 2019 10:16am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by jeff.page.rides » Mar 05 2021 11:26am

For the past couple of months, I have been helping test this new version of firmware 20.1C for the 860C!
I have to say it's the best version of firmware I've ever used on the TSDZ2!
Last year mbrusa improved the firmware 20.1 for the LCD3 so it was much safer and better than before!
Then the last few months he was able to add the 860C and 850C displays to the 20.1C firmware and improved it for all the displays!
I want to publicly thank mbrusa for all his work getting his version of 20.1C working on all the displays. And working with me the last two years to make MAJOR improvements to his version 20.1C!
THANKS!
Jeff

cejean   1 mW

1 mW
Posts: 16
Joined: Jul 20 2019 5:41pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by cejean » Mar 06 2021 4:36am

Totally agree, Jeff !
Also want to thank all off you who put a lot of free time in this project to aprove the firmware and possebilities for our TSDZ2 middrive motor. :thumb:

Special thanks from Holland to mr. Mbrusa who gives us this greate new firmware and still keep working on it :bigthumb:


One question about the new firmware for xh18 display. How can i change street to offroad mode for all level modes?
Change parameters startup /go to level one / push 1x light / 1x push to change 1 to 0 / didn`t work out...
Still de motor is running in street mode.. :roll:

Elinx   1 kW

1 kW
Posts: 493
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Elinx » Mar 06 2021 5:33am

cejean wrote:
Mar 06 2021 4:36am
..
One question about the new firmware for xh18 display. How can i change street to offroad mode for all level modes?
.....
I have a XH18 display too and have no problems with it.
Switching from street to offroad is only possible in level 1 (eco), NOT all levels

With 0.20.1B and 0.201C the button sequence is the same.
In level 1 push ON..ON (a bit slow) and wait. (To fast klick again is switching to E03 without change)

0.20.1B/C start up at assist level 1 after switching the power.
So pushing ON ............ON..ON............ does the trick.

With v0.20.1C the display speed info after first push ON must be 10.x km/h (street)
After the second push ON it must be 00.x km/h (offroad)
Wait 5 seconds and the mode should be set.
You can check this by pushing ON just one time, you see 00.x km/h(offroad)
Last edited by Elinx on Mar 06 2021 12:24pm, edited 4 times in total.

cejean   1 mW

1 mW
Posts: 16
Joined: Jul 20 2019 5:41pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by cejean » Mar 06 2021 6:04am

Thank you Elinx for youre explanation and it helped me to understand the parameter changing . :thumb:
It was my own stupid fault to "forgot "changing max speed in offroad mode to 45 kmh :wink:
I did test the new firmware and feld really good!
Great work Embrusa :bigthumb:

Elinx   1 kW

1 kW
Posts: 493
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Elinx » Mar 06 2021 6:20am

cejean wrote:
Mar 06 2021 6:04am
... understand the parameter changing ....
Yes, at first you think that pushing instead of waiting change the parameter.
But if you know that you must wait, handling the settings with the display is a lot easier.

TimV   10 mW

10 mW
Posts: 30
Joined: Jun 02 2013 10:49am
Location: Antwerp in Belgium

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by TimV » Mar 11 2021 9:45am

Question, even with the opensoftware from here, there is no way of setting the 45km/h limit higher?

I aim putting the Tongsheng in a velomobile and when I pull a race, I go over 55km/h. Would be nice to still have support over 45km/h.

w0utje   10 mW

10 mW
Posts: 27
Joined: Jan 12 2020 3:02am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by w0utje » Mar 11 2021 12:07pm

TimV wrote:
Mar 11 2021 9:45am
Question, even with the opensoftware from here, there is no way of setting the 45km/h limit higher?

I aim putting the Tongsheng in a velomobile and when I pull a race, I go over 55km/h. Would be nice to still have support over 45km/h.
U can go as high as u want, mine is maxed out at 60km/u but it depends on the gearing if u reach it.

Elinx   1 kW

1 kW
Posts: 493
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Elinx » Mar 11 2021 2:56pm

TimV wrote:
Mar 11 2021 9:45am
.... there is no way of setting the 45km/h limit higher?...
With OSF the only limit will be the max. current the motor can handle.
For 36V this current must be lower than for 48V motor.
The Voltage is free to choose. (the absolute controller limit is 18A/ 63V)
For 36V motor you can use for example 48V battery without a problem and for 48V motor a 52V battery.

TimV   10 mW

10 mW
Posts: 30
Joined: Jun 02 2013 10:49am
Location: Antwerp in Belgium

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by TimV » Mar 12 2021 2:33am

Elinx wrote:
Mar 11 2021 2:56pm
TimV wrote:
Mar 11 2021 9:45am
.... there is no way of setting the 45km/h limit higher?...
With OSF the only limit will be the max. current the motor can handle.
For 36V this current must be lower than for 48V motor.
The Voltage is free to choose. (the absolute controller limit is 18A/ 63V)
For 36V motor you can use for example 48V battery without a problem and for 48V motor a 52V battery.
I dont need huge power. Just enough to support me. I have bought the 36V 350W version. I have a lot of 36V ebike batteties with a dead bms. So only need to invest in a bms. I want to keep it as simple as posible. And will not buy another screan. I will use the fork and reflash the stock software like described here.
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1/wiki

Tiger_one   1 W

1 W
Posts: 50
Joined: Dec 24 2020 1:44pm
Location: Louisiana
Contact:

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Tiger_one » Mar 15 2021 1:05pm

Ride today, finally after much bad WX and other stuff getting in the way. Really nice, never got above level 2, level 1 mostly running easily 18mph, going through top 4 gears for hills. 62c high temp.

Really great, not sure I want to change anything at this point.

Thanks to all who put in the time to make this a fun and great project! Really good job.
DIYBMSv4 by Stuart Pittaway

TimV   10 mW

10 mW
Posts: 30
Joined: Jun 02 2013 10:49am
Location: Antwerp in Belgium

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by TimV » Mar 15 2021 1:52pm

For making the programming cable. I only find sources in china that have the Tongsheng speed sensor extension cable. 1 to 3 months shipping. It looks like the bafang/8fun pogramming cable is the same connection. Will that work or not? Do I still need to hack that cable up and buy a st link?

(Or what is the name of that extension cable or sources in Europe?)

Thanks

Waynemarlow   10 kW

10 kW
Posts: 601
Joined: Jul 09 2016 7:22am
Location: Bucks, England

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Waynemarlow » Mar 15 2021 2:34pm

TimV wrote:
Mar 15 2021 1:52pm
For making the programming cable. I only find sources in china that have the Tongsheng speed sensor extension cable.
Any of the STLinks from Ebay are fine, just always use a long USB extension cable and keep the ST Link to speed sensor wires no longer than say 200mm.

You don't actually need a speed extension cable as not all are fully wired on each pin and most won't work. Easiest and simplest solution is use the wires that come with the ST Link. Take the black plastic cover off at motor end and just manually push each wire onto the speed sensor male connector pin, its only 3 wires and takes but a few minutes. I cover the exposed connector with heat shrink just to make sure I'm not touching other pins than intended.

https://www.youtube.com/watch?v=S2SRKu6-Qyw

cejean   1 mW

1 mW
Posts: 16
Joined: Jul 20 2019 5:41pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by cejean » Mar 21 2021 12:16pm

My opinion, buy a 4 $ speedsensor cable for example on Ali, cut it and weld it to TSlinks.
No trouble anymore to put the connector on the right pin.
Specially for People who need glasses like i do. :wink:

praskavi   1 µW

1 µW
Posts: 1
Joined: Mar 26 2021 9:41pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by praskavi » Mar 27 2021 2:26am

Hi Ebike Tech Gurus,
Hope you can help,I am fairly new to ebike industry based in Melbourne but keen to learn and experiment.I have some experience fiting bafang kits but wanted to experience with TSDZ2 kits
I bought TSDZ2 programming cables from eco-bike, and I tried to configure stock firmware as per the steps
https://www.eco-ebike.com/blogs/eco-cyc ... rogramming
I connected ST-LINK to USB port on laptop and connected the plug the 6 pin female end into the TSDZ2 Motor Speed Sensor Port ,
The motor is configured 48v from factory, idea is to configure it to 52v to support 52v batteries. I expected it to be straight forward! but getting below issue.
image (1).png
image (1).png (211.25 KiB) Viewed 794 times
image.png
image.png (237.09 KiB) Viewed 794 times
As per the instructions I wouldnt be able to proceed to write 52v files without reading the option byte from the motor right.
Any help or guidance is much appreciated on how to trouble shoot.wondering if the new TSDZ2 are write protected? or is it something to do with the cable ? :( ,, or am I doing something wrong?
Any help or guidance or mentoring is much appreciated and obliged.

Waynemarlow   10 kW

10 kW
Posts: 601
Joined: Jul 09 2016 7:22am
Location: Bucks, England

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Waynemarlow » Mar 27 2021 8:40am

I’ve had a similar problem over the years and never really fully got to the bottom of it. Try the following if you have one of the older controllers. I’m not fully sure how to differentiate between the new and old controllers, perhaps if someone can chime in, I think the German forum knows the secret :D

On the options byte tab at the top is a read out protection tab where you can set it to protected. Toggle that a couple of times and try to read each time. Sometimes it seems to waken things up.

Of late with the communication error I found that programming at 3 volts seems to help. Again not sure why as I’ve used 5 volts forever and then suddenly I started getting a comms error and tried using 3 volts and it seems to work.

Elinx   1 kW

1 kW
Posts: 493
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Elinx » Mar 27 2021 11:40am

Waynemarlow wrote:
Mar 27 2021 8:40am
...... how to differentiate between the new and old controllers,... I think the German forum knows the secret ...
On the German forum they advice to measure between GND and Swim.
With the old controller you should measure 5V
With the new controller you should measure 0V
6pinTSDZ2.jpg
6pinTSDZ2.jpg (6.11 KiB) Viewed 764 times

milanc   1 µW

1 µW
Posts: 1
Joined: Mar 28 2021 6:52pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by milanc » Mar 28 2021 7:18pm

Hi!

Finally got around to installing this firmware yesterday, it has made a nice difference to the performance of my bike (somewhat higher cadence, even with a 48v motor on a 48v battery, and more power - top speed on flats went up by maybe 4km/h); thanks to everyone involved :)

However, I am now trying to address a problem with shifting:
I use integrated gear hubs (previously a Sturmey RX-RK5, now a Rohloff) and find I have to wait too long before the motor stops, and miss some shifts due to this.

It would therefore be nice to be able to instantly cut power when easing off the pedals for a shift (even without having a gear sensor).

1/ Is there some setting which would already achieve this? Activating the coaster brake setting, perhaps? 'cadence fast stop', from the non-stock-display version of the firmware seems promising too; any thoughts on this?

2/ If not, I could work on it; however, I may need a few pointers ( pun half-intended :p ) - is there some... reference regarding the structure of the code?
Regarding how it should work:
- Pedal torque, which decreases to (almost) zero twice per rotation, might not be ideal, though I can imagine a very short delay workaround.
- However, if my understanding is correct, the motor also has a cadence sensor? In which case, a quick decrease in pedalling cadence could be interpreted as an instruction to immediately stop assisting, i.e. as soon as enough decrease is detected, and before the pedals are fully stopped.
- Note to self: will cutting motor power be good enough, or should a very short burst of reverse power be applied, in order to fully cut assist torque?

Cheers!


EDIT:
Found PWM_DUTY_CYCLE_RAMP_DOWN_INVERSE_STEP_* parameters in main.h - I'll try setting them down to 1 tomorrow and see what happens.

EDIT2: Confirmed; simply setting PWM_DUTY_CYCLE_RAMP_DOWN_INVERSE_STEP_DEFAULT to 10 results in much faster ramp down and essentially eliminates mis-shifts for me! Now I just have to improve cooling, increase current limits, and feed battery voltage through a DC boost converter :twisted:

AZUR   100 W

100 W
Posts: 209
Joined: Apr 05 2018 6:52am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by AZUR » Apr 05 2021 4:00pm

Hi,

Does anyone know if the VLCD6 connection cable is the same as VLCD5?

The colors of the image wires, I think are for the VLCD5.

The image has the cable that connects to the controller (6 wires). I think this is the cable that connects to the VLCD5.
Controler 6 wires.jpg
Controler 6 wires.jpg (123.14 KiB) Viewed 558 times
I got this image from Casainho's github.

https://github.com/OpenSourceEBike/TSDZ ... 3-to-TSDZ2

The VLCD6 I have has the cable cut. And the 6 wires in the cable have the same color as the wires in the image.

Thanks

wpenner   100 W

100 W
Posts: 105
Joined: May 10 2018 3:27pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by wpenner » Apr 10 2021 4:01pm

Thanks for this updated firmware. Finally putting my mess of TSDZ2 parts back together with VLCD5 and it seems to work correctly.

On my strange TSDZ2(from an 850c aliexpresss kit) controller i inherited, Temperature sensor has to to go Red(+5) Black(Ground), Blue(Throttle). Not sure if anyone has had to deal with figuring out this strangeness before.

To test the temperature sensor i found I had to connect the motor hall sensor wire and torque sensor connector. I Programmed the controller for 40c max temperature. Then I used a lighter under the temperature sensor to get E06 to display on screen when heated up. If you don't connect the hall sensor/torque sensor the screen will show 1 battery bar, and no response from temperature sensor.

Curious what the max temperature people are running without damage. I think I previously had mine set to 90c.

InanZen   100 µW

100 µW
Posts: 8
Joined: Apr 17 2021 5:48am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by InanZen » Apr 17 2021 5:54am

I've got an 8-pin version of the motor (VLCD5 with throttle) and I've been trying to figure out how to connect the STLinkV2 but I can't find any diagrams for the 8-pin version (all guides show only the 6-pin version).

Does anyone have the information about flashing the 8-pin motor?

TimV   10 mW

10 mW
Posts: 30
Joined: Jun 02 2013 10:49am
Location: Antwerp in Belgium

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by TimV » Apr 17 2021 6:27am

For flashing the motor you need to use the speedsensor cable from the motor. For flashing the vlc5 screen you need to use the connector where you plug in the extra buttonconnector on the screen with power, i button and + and -.

You dont use the cable between motor and screen.

InanZen   100 µW

100 µW
Posts: 8
Joined: Apr 17 2021 5:48am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by InanZen » Apr 17 2021 11:35am

Oh i see, thank you for the information TimV :thumb:

Edit: I've successfully flashed the firmware and already the motor assist is a lot smoother than the default levels. Just need to tweak the settings a bit and it'll be perfect. (It did take me quite a while to decode the instructions from Operating manual of display though :))
Last edited by InanZen on Apr 18 2021 7:06am, edited 1 time in total.

TimV   10 mW

10 mW
Posts: 30
Joined: Jun 02 2013 10:49am
Location: Antwerp in Belgium

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by TimV » Apr 17 2021 12:08pm

Your welcome

Elinx   1 kW

1 kW
Posts: 493
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Elinx » Apr 17 2021 2:22pm

InanZen wrote:
Apr 17 2021 5:54am
I've got an 8-pin version of the motor (VLCD5 with throttle) and I've been trying to figure out how to connect the STLinkV2 but I can't find any diagrams for the 8-pin version (all guides show only the 6-pin version).

Does anyone have the information about flashing the 8-pin motor?
For OSF with vlcd5 you need only to flash the controller. You don't need to flash the vlcd5, so don't use the 8-pin connector.
As TimV said, for controller use the connector of the speedsensor..
Connect 3 wires of the ST V2 link to this connector and go.

InanZen   100 µW

100 µW
Posts: 8
Joined: Apr 17 2021 5:48am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by InanZen » Apr 18 2021 9:28am

kw1980 wrote:
Jan 27 2021 2:29pm
Hi,

I fixed the problem,

the memory got corrupted when disconnected the vlcd while STVP was running and usb connected.

Followed tips about motor no response at wiki and restored original fw. It didnt work until changed voltage pin from 5v to 3.3v in usb. Added the reset pin to connection and rewrited original option bytes tab. After that restored memory and program backups and now all is ok.

I saved my ass, it is my girl's bike. :D

I will try OSF next week with more time and calm instead late night at work day.
Thanks for this info, I had the same problem just now, when I could read the data from the motor (in ST Visual Programmer) but couldn't program the Program Memory (Error : Problem while trying to Reset swim and device. Apply a Power On Reset).

Restoring Data Memory and Option Byte from original backups fixed the problem.

Post Reply