• Howdy! we're looking for donations to finish custom knowledgebase software for this forum. Please see our Funding drive thread

Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Hello guys. In these days of quarantine I had chance to flash the v.20 with mbrusa overrun fix (for LCD3)
The overrun is of course improved with good results, but I experienced a delay in motor kick in while restarting pedaling.
I have to do at least a complete pedal turn prior the motor engages.
Did anyone else experience the same (with the native displays or LCD3)?

I wait some feedback.. in case I will try to go back to the previous buba "official" beta1.

Thanks
 
mbrusa said:
....
I want to highlight that by increasing the calculated value of "ui16_cadence_sensor_ticks_stop", increases the overrun time, decreasing it lacks startup assistance.
I had reports of too fast stops and a case of lack startup assistance.
For this reason, in the next full version I will slightly increase the calculated values.
"ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 3)));" in standard mode,
"ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 1));" in advanced mode,
or maybe I'll add editable parameters in the config.h file.
Hi thineight
I had reported it in a previous post.
 
I have been over in the 'other' thread for a while having fitted an SW102 to my bike, anyway I am not enjoying the assistance that is provided by that firmware fork on my single speed bike and want to go back to the VLCD6 using the Marcoq fork. Does anyone have a link to the latest version of his Java configurator, I think it was running FW0.20?
 
HughF said:
..... go back to the VLCD6 using the Marcoq fork. Does anyone have a link to the latest version of his Java configurator, I think it was running FW0.20?
No, the last release of Marcoq was based on fw v0.19 and the Java configurator v3.7
You can download this version here

The latest release based on fw v0.20b1 is from mbrusa. Stancecoke has made a java configurator for basic settings.
You can find that version on stancecoke's github
 
Thanks for the information.
 
emr said:
emr said:
I found this item, which appears to be what we need for the Gear shift sensing as it connects to the existing VLCD5 brake sensor sockets, but it doesn't appear to use 5v source. Unsure how it can work without the 5v. It also has brake sensors suitable for hydraulic brakes...
https://www.aliexpress.com/item/33060254663.html

HTB1NDGXXND1gK0jSZFKq6AJrVXal.jpg


I purchased one of these gear sensors and have fitted it near the gear changer on the handlebar. I haven't tested on the road but I can confirm it does turn the motor off momentarily (maybe 0.5 of a second (estimated)) when changing gears on the workstand. I suspect it will be the solution to the IGH issue of needing to stop pedalling to allow the hub to change gears.

GearSensor_1.jpg

GearSensor_2.JPG

I installed my shift sensor and wow does it shift great. The second I push my shift button the motor stops it shifts fast, smooth, and quiet. Now the problem is it powers off for about 2 seconds and about 2 revolutions at 75 RPM before the power comes back on, that's a long dead-spot.
Is there a way in the firmware that we can speed up this power back on, to only a half a second?
 
jeff.page.rides said:
emr said:
emr said:
I found this item, which appears to be what we need for the Gear shift sensing as it connects to the existing VLCD5 brake sensor sockets, but it doesn't appear to use 5v source. Unsure how it can work without the 5v. It also has brake sensors suitable for hydraulic brakes...
https://www.aliexpress.com/item/33060254663.html

HTB1NDGXXND1gK0jSZFKq6AJrVXal.jpg


I purchased one of these gear sensors and have fitted it near the gear changer on the handlebar. I haven't tested on the road but I can confirm it does turn the motor off momentarily (maybe 0.5 of a second (estimated)) when changing gears on the workstand. I suspect it will be the solution to the IGH issue of needing to stop pedalling to allow the hub to change gears.

GearSensor_1.jpg

GearSensor_2.JPG

I installed my shift sensor and wow does it shift great. The second I push my shift button the motor stops it shifts fast, smooth, and quiet. Now the problem is it powers off for about 2 seconds and about 2 revolutions at 75 RPM before the power comes back on, that's a long dead-spot.
Is there a way in the firmware that we can speed up this power back on, to only a half a second?

I wonder if part of the delay is due to the time taken for the motor to start assistance as MBrusa mentioned in a previous post. Maybe the next MBrusa version will reduce the delay.

mbrusa said:
....
I want to highlight that by increasing the calculated value of "ui16_cadence_sensor_ticks_stop", increases the overrun time, decreasing it lacks startup assistance.
I had reports of too fast stops and a case of lack startup assistance.
For this reason, in the next full version I will slightly increase the calculated values.
"ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 3)));" in standard mode,
"ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 1));" in advanced mode,
or maybe I'll add editable parameters in the config.h file.
 
For connecting the Bafang gear sensor directly to the Y connector of the Tonghsheng speed sensor.

If one of the Y branch is used by the lights (it was not the case for my first bike viewtopic.php?f=30&t=98281&start=825#p1533489), we have to build a new connector with 3 cables as described on this (new) photo (TSDZ2 wires are described for example here and Bafang there).
78143998-4ea5e000-742f-11ea-9bca-59193a3139a7.jpg


Preparing the Y Tongsheng (female) -Tongsheng (male) - Bafang female connector.
Sometimes the Tongsheng extension cables have different colors, here the white (the 2) is yellow.
78337808-e4598080-7591-11ea-9255-872a394e80b0.jpg


Be careful with the heat shrinking tubes:
78171101-3bf1d200-7454-11ea-969f-7528395607cf.jpg


And here the connector ready to be connected.
78072211-0343f100-739f-11ea-8c05-cc46a5d7ffdc.jpg

And there connected:
78171358-9854f180-7454-11ea-9e5a-3aa16e8005a1.jpg
 
revher said:
For connecting the Bafang gear sensor directly to the Y connector of the Tonghsheng speed sensor.

If one of the Y branch is used by the lights (it was not the case for my first bike viewtopic.php?f=30&t=98281&start=825#p1533489), we have to build a new connector with 3 cables as described on this photo.
78020696-36ac5e80-7352-11ea-8f05-e32953aecef0.jpg


Preparing the Y Tongsheng (female) -Tongsheng (male) - Bafang female connector.
Sometimes the Tongsheng extension cables have different colors, here the white (the 2) is yellow.
78073681-a269e800-73a1-11ea-997d-2b98eb7072ea.jpg


And here the connector ready to be connected.
78072211-0343f100-739f-11ea-8c05-cc46a5d7ffdc.jpg

Thanks, if I can't find a firmware fix I'll try using the speed sensor instead of the brake sensor.
 
jeff.page.rides said:

Thanks, if I can't find a firmware fix I'll try using the speed sensor instead of the brake sensor.
I made an error in the photo which has been fixed on the new photos (the green wire,+5V is numbered 4 on Tongsheng 6 pins). I added the references. Sorry,

New edit: Regarding the firmware fix, I guess you mention the recent improvements made by mbrusa. It is a real improvement and the overrun is much shorter.

However, when biking in a city (not these days, because Paris is empty and bikes are allowed inside a distance of less than 1 km from home) with a lot of people sometimes crossing at the red lights, that is not enough and I really appreciate my installation of the gear shift sensor. I just need to downshift the gears and the engine stops immediately.

Also, I really appreciate a much easier way to shift gear while pedaling (I have an internal gear hub with 8 speeds).

If this is new with the TSDZ2, it was not new with the Bafang BBS which has a new gear sensor output cable directly from the motor.

Unfortunately the Tongsheng (Higo mini-A) connectors are not sold or you need to buy 500+pcs.

Until this type of special connector is available from a seller, we must buy extension cables and perform soldering as I did.

Revher
 
I have now purchased 2 "BAFANG Hydraulic Brake Sensor" as recommended by casinho. On his wiki page he shows how to solder/connect the 2 contacts of the sensor to the 6pin LCD cable.

Now I'm thinking about how to do this analog on the VLCD5. There are already 2 ports on the display for the brakes. I don't know how the brake function was implemented in the firmware for the VLCD5, but can I connect the two brake sensors directly to the display ports? Or do I also have to connect them to the 6pin LCD cable?

update://
Now I understand that the gear sensor works just like the brake sensor. As I understood Emma, she connected her gear sensor directly to the VLCD5 display, so I'll try that with my brake sensors as well - thanks.
 
revher said:
jeff.page.rides said:

Thanks, if I can't find a firmware fix I'll try using the speed sensor instead of the brake sensor.
I made an error in the photo which has been fixed on the new photos (the green wire,+5V is numbered 4 on Tongsheng 6 pins). I added the references. Sorry,

New edit: Regarding the firmware fix, I guess you mention the recent improvements made by mbrusa. It is a real improvement and the overrun is much shorter.

However, when biking in a city (not these days, because Paris is empty and bikes are allowed inside a distance of less than 1 km from home) with a lot of people sometimes crossing at the red lights, that is not enough and I really appreciate my installation of the gear shift sensor. I just need to downshift the gears and the engine stops immediately.

Also, I really appreciate a much easier way to shift gear while pedaling (I have an internal gear hub with 8 speeds).

If this is new with the TSDZ2, it was not new with the Bafang BBS which has a new gear sensor output cable directly from the motor.

Unfortunately the Tongsheng (Higo mini-A) connectors are not sold or you need to buy 500+pcs.

Until this type of special connector is available from a seller, we must buy extension cables and perform soldering as I did.

Revher

Thanks for the correction, I'll let you know if I try this if the firmware updates don't fix the problem.
 
bingo5 said:
Now I'm thinking about how to do this analog on the VLCD5. There are already 2 ports on the display for the brakes. I don't know how the brake function was implemented in the firmware for the VLCD5, but can I connect the two brake sensors directly to the display ports? Or do I also have to connect them to the 6pin LCD cable?

update://
Now I understand that the gear sensor works just like the brake sensor. As I understood Emma, she connected her gear sensor directly to the VLCD5 display, so I'll try that with my brake sensors as well - thanks.

Just be aware that the gear sensor requires 5v to run the electronics in the sensor. The standard brake sensors that come with the motor are purely a Closed/Open switch and the brake sensor plug has only 2 of the 3 slots populated (see image below). The VLCD5 brake sensor sockets do have all 3 pins available however, and one of the pins has 5v. You will need a plug that has all 3 slots populated.

I couldn't find anywhere to purchase the specific plugs to fit the brake sensor sockets in the VLCD5, so purchased the gear sensor that came with the appropriate plugs with all 3 slots populated.
https://www.aliexpress.com/item/33060254663.html

Below is the standard brake sensor plug showing the location of the missing terminal that will be required to get the 5v from the socket.

2020-04-03_1048.png
 
Do I need to do anything special to flash down from the latest Casainho code to 0.20beta? I have setup up my Windows machine with stvp, sdcc and the jre and have the configurator working but it refuses to flash the option byte. I know the programmer works, I used it the other day from Linux to flash up the latest 0.56 code.

Can I grab the output from the compilation stage, move it over to my Linux partition and flash with stm8flash?
 
HughF said:
I have setup up my Windows machine with stvp, sdcc and the jre and have the configurator working but it refuses to flash the option byte.

can you post the output of the terminal window with the error messages, please?

regards
stancecoke
 
Give me 30 mins...
 
Capture.PNG

I suppose it is possible I have broken my programming cable since I used it a few days ago to program from Linux? I will try and re-flash with 0.56 from Linux and see if that goes through OK.

Edit: Not the programmer, I can flash from Linux fine...
 
HughF said:
Edit: Not the programmer, I can flash from Linux fine...
can you see any problem in the Windows device manager? (yellow triangle at any device?)

regards
stancecoke
 
No, and the device appears OK in device manager as an stlink. It is not a big issue, I am out running the 'other' code at the moment with the sw102 and that behaves just like 0.20beta in pure torque mode.
 
I'm really struggling to find a good guide to installing this on my tsdz2 with vlcd5 display. Can anyone please point a poor noob in the right direction.
 
emr said:
Just be aware that the gear sensor requires 5v to run the electronics in the sensor. The standard brake sensors that come with the motor are purely a Closed/Open switch and the brake sensor plug has only 2 of the 3 slots populated (see image below). The VLCD5 brake sensor sockets do have all 3 pins available however, and one of the pins has 5v. You will need a plug that has all 3 slots populated.

I couldn't find anywhere to purchase the specific plugs to fit the brake sensor sockets in the VLCD5, so purchased the gear sensor that came with the appropriate plugs with all 3 slots populated.
https://www.aliexpress.com/item/33060254663.html

Below is the standard brake sensor plug showing the location of the missing terminal that will be required to get the 5v from the socket.

2020-04-03_1048.png
I don't know if I got you wrong or you got me wrong. I didn't and don't want to install a gear sensor, I just want two brake sensors. I don't see any sense in gear sensors, respectively I personally have no problem with the overrun fix.

Anyway, I understood the manual of casainho ( https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/How-to-install-brake-sensors ) that the Bafang brake sensor has and needs only two cables. Then it would have worked great with the brake plug with 2 pins. But unfortunately this did not work. After a lot of trial and error I noticed that it works if you short-circuit the white and the red cable of the Bafang sensor.

But I didn't find the way elegantly and wanted to do without soldering anyway (for optical and stability reasons). Therefore I crimped all 3 cables of the Bafangsensor (with XH 2,54) and plugged them into the white connector of the TSDZ2 mechanical brake. So I made a fully populated connector by myself.

So it works fantastic :D. Thanks for your help
 
7lucky7 said:
I'm really struggling to find a good guide to installing this on my tsdz2 with vlcd5 display. Can anyone please point a poor noob in the right direction.
Here is an instruction how to connect the necessary flasher: https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Flash-the-firmware-on-TSDZ2

The flashing is explained by the configuration program itself (just press the button after configuration).
 
bingo5 said:
7lucky7 said:
I'm really struggling to find a good guide to installing this on my tsdz2 with vlcd5 display. Can anyone please point a poor noob in the right direction.
Here is an instruction how to connect the necessary flasher: https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Flash-the-firmware-on-TSDZ2

The flashing is explained by the configuration program itself (just press the button after configuration).

Isn't this the casaihno code that requires a new display though!?
 
In Germany we say "Jaein", which means yes and no. I don't know if there is anything comparable in English :)

With Casainho's firmware you flash both the engine and the display. The VLCD5 display on the other hand cannot be flashed. That's why the functions are more basic and there are many workarounds to use. The advantage is that you only have to flash the motor. And this works the same way as Casainho's firmware, so I gave you the link.
 
Back
Top