Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Hi,

I started a wiki page entitled "OS X and Linux installation" but my scripts (compile_20.sh and edit_advanced.sh) and my java patch are still on my computer. Stancecoke could I send them to you or to anyone by mail, in order to test them?

Regards,
revher
 
revher said:
my scripts (compile_20.sh and edit_advanced.sh) and my java patch are still on my computer.
Just fork my repo, upload your changes and send a pull request!

regards
stancecoke
 
I am not well aware of git (but know very well CVS, yes I am old) and github. And for me it is still a waste of disk space to fork an entire repository for just adding two files and a java patch, but I will do it. Not right now but probably during the WE.
Regards,

revher
 
Hi,

I'm hoping someone can help me with some issues I've been having with my tsdz2 build.
I bought the 750w 48v motor, planning to get a 48v battery in NZ. This proved impossible for me so I had to settle for a 36v battery. I flashed the 36v files from the eco-bike tutorial which was easy enough. Only problem is I'm not getting assist at any level. All the VLCD5 settings seem fine. I posted on Reddit and was directed to Stancecoke's VLCD5 repo. Went through all of that, but I'm still not getting assist at any level. Thanks for your time helping me, in advance.
 
tannertasman said:
I flashed the 36v files from the eco-bike tutorial which was easy enough.
Sorry please explain exactly, what you have done! Have you still the stock firmware and just edited the EEPROM for voltage setting (as described at eco-bike), or have you flashed the OpenSource firmware?!
If you have flashed the OpenSource firmware, please ask mbrusa at the italian forum.

regards
stancecoke
 
tannertasman said:
....
I'm hoping someone can help me with some issues I've been having with my tsdz2 build.....
If I understand you well, you try to use the 48V TSDZ2 motor with 36V battery.
Please explain more details what you have done with Open Source firmware. Which version, use of java gui or other, your (voltage)settings etc.
 
stancecoke said:
tannertasman said:
I flashed the 36v files from the eco-bike tutorial which was easy enough.
Sorry please explain exactly, what you have done! Have you still the stock firmware and just edited the EEPROM for voltage setting (as described at eco-bike), or have you flashed the OpenSource firmware?!

regards
stancecoke


Thanks for getting back to me.
I'm not sure what the EEPROM is, I just followed this tutorial.

https://www.eco-ebike.com/blogs/eco-cycles-instructionals/tsdz2-motor-firmware-programming

I downloaded the 36v program and data memory s19 files, and uploaded them per the instructions. Everything looked fine at this stage but I got no assist when I went to try the bike.

Next I was referred to your stock VLCD5 repo. I followed the wiki closely and it was easy enough to set the settings and then flash, but again I got no assist.
https://github.com/stancecoke/TSDZ2-Smart-EBike/wiki

Thanks again
 
The tutorial describes both stock firmware reprogramming and osf firmware programming. It's still unclear what you did.
The eeprom (electrical erasable memory) is a piece of memory used to store parameters that don't need to be changed frequently.
Those parameters remain in the memory when the power is removed.

So basically, you have flash memory that is used to store program code (firmware) and eeprom memory that is used for the parameters (settings)

In older designes, the eeprom used to be a separate chip. Nowadays it's usually part of the microcontroller.
flash memory needs to be erased before it can be reprogrammed.

eeprom memory locations can simply be rewritten one byte at a time.

So, on the stock firmware, rewriting the eeprom means changing some of the firmware settings. This could be maximum speed or minimum battery voltage (as examples)
 
Is there any way to limit the "time out" duration...the time until motor quits after you stop pedalling... with this compiler? I'd like to turn it way down.
 
Isn't that what ebrakes are for? The brake lever closes a contact that turns off the motor.
 
obcd said:
The tutorial describes both stock firmware reprogramming and osf firmware programming. It's still unclear what you did.
The eeprom (electrical erasable memory) is a piece of memory used to store parameters that don't need to be changed frequently.
Those parameters remain in the memory when the power is removed.

So basically, you have flash memory that is used to store program code (firmware) and eeprom memory that is used for the parameters (settings)

In older designes, the eeprom used to be a separate chip. Nowadays it's usually part of the microcontroller.
flash memory needs to be erased before it can be reprogrammed.

eeprom memory locations can simply be rewritten one byte at a time.

So, on the stock firmware, rewriting the eeprom means changing some of the firmware settings. This could be maximum speed or minimum battery voltage (as examples)

Here's a screen grab of my settings and the error message Untitled.png
 
tannertasman said:
and the error message

'STVP_cmdline' is not...
So STVP is not installed or not in the right directory. The file STVP_cmdline.exe has to be in 'C:\STMicroelectronics\st_toolset\stvp', or the path has to be adapted in the .bat file.

https://github.com/stancecoke/TSDZ2-Smart-EBike/blob/master/src/controller/flash.bat

regards
stancecoke
 
Just tried the last firmware, works like a charm. Have to get used the learn the settings and adjust the powerlevels.
Got an 11.6ah battery and it seems to drain quicker then with the stock firmware. Got it set in the settings of the ihx file on 14Ah, should I try a different setting to get less battery drain?
 
To get power from the motor, you need to feed it current.
The osf firmware might be driving the motor a bit more efficient due to it using simplified foc, but the biggest boost likely comes from the fact that the motor current is less restricted and the software allows the motor to produce peaks of 500 - 750W.

So, you can turn the current down to get a longer battery life, but it will reduce motor power (and riding pleasure) as well.

Obvious, the more efficient your system is, the more miles (or km's) you are able to press out of your battery.
 
Rydon and I are trying to use this firmware with a VLCD5 for the first time. It is on my hand-cycle with a coaster brake motor. I would like to know how to change from Power Assist mode to E-MTB mode and how to know what one it is in at that time. I am not interested in Street mode, Torque Assist mode, Cadence mode or the Cruise mode. As they didn't work well for me with the TSDZ3 display. I can get it to change from E02, E03, EO4 but it always goes back to E02. Is that what it is designed to do?

It would be nice if the double push on the light button didn't turn the light on and off each time. If it would just stay on or stay off in less you pushed it a single time then it would turn it on or off. With the light constantly turning on and off it's hard to see the changes.

OK, I've been playing with it a little more and I think I understand it?

I turn the display on and then I go to level 2 Tour and push the light switch twice then toggle through until it says E02 and push it one more time E02 flashes and that puts it in Power Assist for all 4 levels is this correct?

Then If I go to Level 3 Sport push the light switch twice then toggle through till it says E02 and push it one more time it flashes and that puts it in E-MTB for all 4 levels is this correct?

I haven't taken it for a ride yet because I've been trying to figure out what I need to do when I'm out on the ride.

Please help and explain!
Thanks!
 
stancecoke said:
tannertasman said:
and the error message

'STVP_cmdline' is not...
So STVP is not installed or not in the right directory. The file STVP_cmdline.exe has to be in 'C:\STMicroelectronics\st_toolset\stvp', or the path has to be adapted in the .bat file.

https://github.com/stancecoke/TSDZ2-Smart-EBike/blob/master/src/controller/flash.bat

regards
stancecoke

well that was an oversight on my part... I moved the file to C:\ and flashed, now it's working! There should be a minimum IQ requirement on these things.

Stancecoke - you're awesome, man. Thank you so much for your help. I was worried my bike was bricked. Can I buy you a 6-pack or some bud for your time?
 
jeff.page.rides said:
OK, I've been playing with it a little more and I think I understand it?

I turn the display on and then I go to level 2 Tour and push the light switch twice then toggle through until it says E02 and push it one more time E02 flashes and that puts it in Power Assist for all 4 levels is this correct?

Then If I go to Level 3 Sport push the light switch twice then toggle through till it says E02 and push it one more time it flashes and that puts it in E-MTB for all 4 levels is this correct?

I haven't taken it for a ride yet because I've been trying to figure out what I need to do when I'm out on the ride.

Please help and explain!
Thanks!
Yes, to set "power assist" and "e-MTB", what you wrote is correct.
Four assistance levels are available for each mode.

jeff.page.rides said:
It would be nice if the double push on the light button didn't turn the light on and off each time. If it would just stay on or stay off in less you pushed it a single time then it would turn it on or off. With the light constantly turning on and off it's hard to see the changes.
I do not understand what you mean. Can you explain yourself better?
Keep in mind that the display is not programmable and from the motor controller I can only know the number of the level and whether the light is on or off.

Sorry, I use the translator.
Regards
 
twiersum said:
Is there any way to limit the "time out" duration...the time until motor quits after you stop pedalling... with this compiler? I'd like to turn it way down.

obcd said:
Isn't that what ebrakes are for? The brake lever closes a contact that turns off the motor.

Yes, but I have no ebrake. The TSDZ2 is sold without any and I am not willing to have theses wires.
But I have a gear shift sensor which is currently useless; it was on my bike when it was equipped with a Bafang and I did not remove it. I am quite sure that if I was able to connect it to the TSDZ2 controller I could keep the Open Source firmware. It is really a huge improvement but it is dangerous in town; the "time out" duration is too long before the motor quits and you can hardly change gear or even brake.

Therefore I looked back at the wiring of the Bafang gear speed sensor (most common) which has a yellow 3 pin male connector (similar to e-brake Bafang connectors):
  • 8 black ground;
  • 4 blue (brake signal or speed sensor or gear shift sensor);
  • 6 red 5V;
and it could (I am not sure) be connected, respectively, to the TSDZ2 speed sensor male 6 pins:
  • 1 orange ground;
  • 2 white (speed sensor). 5V or nothing;
  • 4 green (+ 5V for light);

(TSDZ2 wires are described for example here and Bafang there)

I have on one side a useless (illegal in the EU) Bafang throttle which has a yellow 3 pins female connector and on the other side a TSDZ2 extension cable with a useless female 6 pins connector. It could therefore be easy to make an adhoc short connection cable, but I have two questions:
  • Is my above wiring plausible? (I don't fully understand the wiring but I need this gear speed sensor...)
  • As I don't need the lights, one of the Y branch is free to be connected with this new cable (if the answer to my first question is yes, of course) but how would the gear shift sensor interact with the speed sensor? I mean that when shifting gear, the 8 and 4 will be connected (or, here, the white speed sensor will be connected to the ground) for half a second to stop the motor, but will it damage the controller? will the speed sensor work again after shifting?
I would appreciate if someone has an idea on this important point. With the stock firmware, the gear shift sensor was useless, but with the Open Source software, I think that it is mandatory in town, with red lights, high traffic etc.

Regards,
Revher
 
Aren't you making life awkward for yourself, both the OS and the V20 have a brake wire, its a simple fit and already at the VLCD5 display. The gear shifter is another set of wires which you are going to have to wire in and doesn't really do anything other than what the brake wire will do ?

Both the Bafung and the OS TSDZ2 have a slight over run, the V20 is almost negligible and I think if you rotate the peddle backwards slightly will disable any drive, but like all chain drive systems under load the chain will not like to be displaced sideways, have you thought about just as you change to back off and either rotate the peddle backwards slightly or tap the brake lever slightly.

On my Shimano XT 10spd with a newish chain and good gears under full load it will still change up and down almost faultlessly, as soon as the chain gets to about 1/2 worn I start to get less reliable changes.
 
Waynemarlow said:
Aren't you making life awkward for yourself, both the OS and the V20 have a brake wire, its a simple fit and already at the VLCD5 display. The gear shifter is another set of wires which you are going to have to wire in and doesn't really do anything other than what the brake wire will do ?

Both the Bafung and the OS TSDZ2 have a slight over run, the V20 is almost negligible and I think if you rotate the peddle backwards slightly will disable any drive, but like all chain drive systems under load the chain will not like to be displaced sideways, have you thought about just as you change to back off and either rotate the peddle backwards slightly or tap the brake lever slightly.

On my Shimano XT 10spd with a newish chain and good gears under full load it will still change up and down almost faultlessly, as soon as the chain gets to about 1/2 worn I start to get less reliable changes.
Thank you for your kind reply even if you did not answer to my two questions.
  • I am trying to make my life easier :p
  • I don't have a VLCD5 but a XH18 display; also my gear shifter cable is at the rear and the open end of this cable (which is currently not connected) is located close to the end of the speed sensor cable;
  • you are underestimating the duration and strength of the over run. But there is probably a parameter which could be reduced. Please tell me. I am using the reduced config.h and did not changed the advanced.h
  • also, I have an internal 8 speed gear hub Nexus with coaster brake. And that is the reason why I changed my BBS01 for a coaster brake TSDZ2: to be able to use again the coaster brake.
  • I already asked on this list if there is a coaster brake version of the mbrusa/stancecoke Open source software because there are two different versions of the original Open source of casainho https://drive.google.com/drive/folders/1eGcBtTj8GrGQ4tDJAECr6ejMrpW2ZqvH . But no one answered yet.
  • I made a YouTube video of my transformation from a Bafang to a TSDZ2 at https://youtu.be/V7BcizF8LV8 if you want to see the shift sensor in place (at the minute 1:08).
  • I have used this shift sensor on the Bafang and it changed my life. In town, you have to change gears every 10 to 30 seconds (?), and it is really a good option. Recent Bafang motors have a special cable for the gear shift sensor. Therefore, I am sure that having a shift sensor for the TSDZ2 and the current OpenSource V20 would be a solution, probably not for mountain bike, but for a pedelec under heavy traffic in a city like Paris.

I am please to read your advices (even if I do not agree with them...)

Regards,
revher

PS: I was in Rome last week (but did not meet mbrusa nor casainho) and haven't had time to upload on github my changes to the Java navigator (in order to make it working on OS/X and Linux), but may be during the next WE.
 
mbrusa said:
jeff.page.rides said:
OK, I've been playing with it a little more and I think I understand it?

I turn the display on and then I go to level 2 Tour and push the light switch twice then toggle through until it says E02 and push it one more time E02 flashes and that puts it in Power Assist for all 4 levels is this correct?

Then If I go to Level 3 Sport push the light switch twice then toggle through till it says E02 and push it one more time it flashes and that puts it in E-MTB for all 4 levels is this correct?

I haven't taken it for a ride yet because I've been trying to figure out what I need to do when I'm out on the ride.

Please help and explain!
Thanks!
Yes, to set "power assist" and "e-MTB", what you wrote is correct.
Four assistance levels are available for each mode.

jeff.page.rides said:
It would be nice if the double push on the light button didn't turn the light on and off each time. If it would just stay on or stay off in less you pushed it a single time then it would turn it on or off. With the light constantly turning on and off it's hard to see the changes.
I do not understand what you mean. Can you explain yourself better?
Keep in mind that the display is not programmable and from the motor controller I can only know the number of the level and whether the light is on or off.

Sorry, I use the translator.
Regards

When I double or single click the light button to go through the programming it works but also each time it turns the display light on or off.
 
revher said:
  • I am trying to make my life easier :p
  • I don't have a VLCD5 but a XH18 display; also my gear shifter cable is at the rear and the open end of this cable (which is currently not connected) is located close to the end of the speed sensor cable;
  • you are underestimating the duration and strength of the over run. But there is probably a parameter which could be reduced. Please tell me. I am using the reduced config.h and did not changed the advanced.h
  • also, I have an internal 8 speed gear hub Nexus with coaster brake. And that is the reason why I changed my BBS01 for a coaster brake TSDZ2: to be able to use again the coaster brake.
  • I already asked on this list if there is a coaster brake version of the mbrusa/stancecoke Open source software because there are two different versions of the original Open source of casainho https://drive.google.com/drive/folders/1eGcBtTj8GrGQ4tDJAECr6ejMrpW2ZqvH . But no one answered yet.
  • I made a YouTube video of my transformation from a Bafang to a TSDZ2 at https://youtu.be/V7BcizF8LV8 if you want to see the shift sensor in place (at the minute 1:08).
  • I have used this shift sensor on the Bafang and it changed my life. In town, you have to change gears every 10 to 30 seconds (?), and it is really a good option. Recent Bafang motors have a special cable for the gear shift sensor. Therefore, I am sure that having a shift sensor for the TSDZ2 and the current OpenSource V20 would be a solution, probably not for mountain bike, but for a pedelec under heavy traffic in a city like Paris.

Which display and firmware version are you using? I have no idea if you can connect the gear shift sensor to the speed sensor wiring, but it should be possible to connect it straight to the controller.

https://github.com/OpenSource-EBike...l-brake-sensors#HWB_hidden_wire_brakes_sensor
This page explains the general idea with brake sensors, and apparently the gear shift sensor works as the HWB sensor.

From the pictures below you should be able to determine which wire conects where, at least if the pinouts are the same as on a non-coaster-brake controller. Ignore the throttle (THR) pin as you'll only need 5V, GND and brake.

6-pin display cable
TSDZ2_motor_controller_without_throttle_wires.jpeg

8-pin display cable
file.php
 
jeff.page.rides said:
When I double or single click the light button to go through the programming it works but also each time it turns the display light on or off.
I understand, but it cannot be done differently.
The control of the lights button is in the display software, it cannot be changed, it always turns the light on or off.
It is only the state of the lights that is used for programming, on or off.
At the first click when the lights come on I cannot know what the operator's intention is, for this reason programming with E02 always starts, if within 5 seconds the second click does not arrive it is clear that the intention is only to turn on the lights, programming is interrupted.
Another clarification, the need for a double click in programming is to not leave the lights on.
Regards
 
obcd said:
To get power from the motor, you need to feed it current.
The osf firmware might be driving the motor a bit more efficient due to it using simplified foc, but the biggest boost likely comes from the fact that the motor current is less restricted and the software allows the motor to produce peaks of 500 - 750W.

So, you can turn the current down to get a longer battery life, but it will reduce motor power (and riding pleasure) as well.

Obvious, the more efficient your system is, the more miles (or km's) you are able to press out of your battery.
Went back to the marcoq 1.9c, that delivers the same power on emtb mode but seems a lot more eco friendly. My 11.6 Ah battery does like minimal 45km's on 3/4 and even longer on setting 1/2.
 
w0utje said:
obcd said:
To get power from the motor, you need to feed it current.
The osf firmware might be driving the motor a bit more efficient due to it using simplified foc, but the biggest boost likely comes from the fact that the motor current is less restricted and the software allows the motor to produce peaks of 500 - 750W.

So, you can turn the current down to get a longer battery life, but it will reduce motor power (and riding pleasure) as well.

Obvious, the more efficient your system is, the more miles (or km's) you are able to press out of your battery.
Went back to the marcoq 1.9c, that delivers the same power on emtb mode but seems a lot more eco friendly. My 11.6 Ah battery does like minimal 45km's on 3/4 and even longer on setting 1/2.

:bigthumb:
Same experience.
Did some tests with same settings
 
Back
Top