Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

HrKlev said:
Im trying to get the flashing software to work now but I had some problems installing ST Tools. It woul not install directly to C: drive it kept popping up errors, so I just made a folder named tsdz2. I have edited the flash.bat file so it points to that folder. But I am still getting this error like it doesnt seem to find the correct path when I press compile and flash. I have attached a screenshot below. It basically says it STVP_Cmdline is not recognized as a command or executable file. This is probably a really noobish problem but I would appreciate if someone coul point out what I have done wrong. Thanks.

I had the same problem. I got around it by simply copying the ST Microelectroncs folder in its entirety, in the C:\Program (86) directory to C:\ and i seemed to work from there on.
 
mbrusa said:
Waynemarlow, I don't have an LCD3 to do the comparison, I tried not to change the motor code, but with "fix overrun" there can be a difference.
The "fix overrun" modification can cause resistance when starting or accelerating (as if the brakes are applied), this can be remedied by increasing the "Motor ramp down additional" value up to 20.
This slightly increases the overrun time but avoids this inconvenience.
Inadvertently I left the default value of this parameter at 1 which is too low. Now I changed it to 8, it's the least I recommend.
If you notice other differences between the two versions using the same settings, let me know what they are.

To check if you have the latest version, in the main folder of the repository there is the commits.txt file with the list of changes.
The version (number, date and description of the last of the commits) is now displayed in the configurator at the top right.
Thanks, I'll change that figure to 8 and work from there. Its odd though on the LCD3 version V20 Beta 1 there is almost zero hint of an over run.

Another question. I fitted a 48 Volt motor I had laying about as a trial and went across to the experimental setting to see if I could get a better cadence. What does the acceleration number actually do. I set mine on 20 to be conservative but Leon seems to think up to 30 with a 52 volt battery. He states with higher numbers this may stress the gears ( presume blue gear ).

The reason I ask is that I dropped a chain on a steep pitch between the cassette and hub causing a jam and immediately chewed a blue gear. Since going across to V20 on the LCD3 I have not damaged a gear until this one, was it the extra torque of the 48 volt motor, was it the acceleration setting, over run etc ?

I should reiterate under those circumstances I was probably pulling 700 motor watts and standing on the pedals with the chain immediately stopping, the blue gear did exactly what it was designed for, to act as a fuse within the gear train. I suspect no firmware would have prevented that happening.
 
Waynemarlow said:
I had the same problem. I got around it by simply copying the ST Microelectroncs folder in its entirety, in the C:\Program (86) directory to C:\ and i seemed to work from there on.

Well, that worked! Thanks!

Im quite blown away how smooth this firmware is compared to stock, even without touching the torque sensor calibration stuff! Im not sure how many people have been involved in this, but thanks a ton to all of you! :bigthumb:

Will have to read up on a couple settings to fine tune the thing and how to set the different modes with the display so I can try it out on the trail. Didnt quite get to feel the difference between EMTB mode and power mode in the parking lot.
 
emr said:
emr said:
jeff.page.rides said:
Thanks,
Does anyone know what the wiring diagram would be to wire the shift sensor to the brake sensor and do they use the same type signal source?

I have a Shimano 11 speed IGH and find that I need to stop pedalling for a second or so to allow the hub to change gears. This can cause a loss of momentum and riding rhythm. This is partially due to the TSDz2 continuing to power the drive even though I am only applying a little pressure on the pedals. Unlike a Rohloff, the Shimano IGH does require the force on the IGH to be significantly reduced to allow shifting without mashing the gears.

If the 3 wire gear sensor can be used with the 2 wire Tsdz2 brake sensor sockets on rear of the VLCD5 screen, this might allow enough period of loss of engine force to allow the IGH to change gears. Of course the rider will also need to reduce the force on the pedals, but hopefully not need to stop pedalling completely as is currently the case.

(I do not want to use the 'Speed sensor' option as is used by revher, as my bike doesn't use the 25km limitation)

So my question is the same as 'jeff.page.rides', any suggestion as to to what the wiring connections would be to connect the 3 wire gear sensor to the 2 wire brake sensor on the VLCD5 display.

My testing indicates the brake switch is 'open' circuit when the brake is not applied and goes 'closed' when brake applied. There does not appear to be 5v at either of the brake sensor pins on the VLCD5 display. So maybe the two pins on the VLCD5 brake sensor can be connected to the gear sensor ground and signal wires, and I need to find a 5v source for the remaining wire on the gear sensor.

If I can obtain the wiring details, I will fit the gear sensor to the gear cable where it exits the gear changer mechanism on the handlebar, as it is only a short distance to the VLCD5 display.

Cheers Emma

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

Hi Emr

Did you end up using this gear sensor? I am also looking at getting this for my wife bike. She has a Nexus 7 and due to the motor continuing after she stops pedalling she is grinding the gears. I'm keen to know how this works before ordering it.

Thanks
 
Regarding a brake/shift sensor, I see that it'll only work with 8pin but not 6pin. Question: which connector do I have to check to determine if it's a 6 or 8 pin?

-------

I just installed the newest firmware and noticed in the manual that Motor Acceleration value shouldn't be more than 5 for 48V battery with 36V motor. With the previous firmware version I left this value as it was set by default (25) and biked for ~700km and nothing happened. Can anyone please explain what possible damage I can cause to the motor if I leave this value set more than 5?
 
Hi. I have my tsdz2 and vlcd5 on its way from Germany. Is there a guide on how to install the firmware on a VLCD5?
 
PhilUK said:
Hi. I have my tsdz2 and vlcd5 on its way from Germany. Is there a guide on how to install the firmware on a VLCD5?

The Wiki in the github explains it quite good: https://github.com/emmebrusa/TSDZ2-Smart-EBike-1/wiki

There is no need to flash the display for this version, only the controller. Just choose the correct display in the configurator.

There's also 3 manuals in the github files that you shoul read through if you haven't already :)
 
Waynemarlow said:
Thanks, I'll change that figure to 8 and work from there. Its odd though on the LCD3 version V20 Beta 1 there is almost zero hint of an over run.

Another question. I fitted a 48 Volt motor I had laying about as a trial and went across to the experimental setting to see if I could get a better cadence. What does the acceleration number actually do. I set mine on 20 to be conservative but Leon seems to think up to 30 with a 52 volt battery. He states with higher numbers this may stress the gears ( presume blue gear ).

The reason I ask is that I dropped a chain on a steep pitch between the cassette and hub causing a jam and immediately chewed a blue gear. Since going across to V20 on the LCD3 I have not damaged a gear until this one, was it the extra torque of the 48 volt motor, was it the acceleration setting, over run etc ?

I should reiterate under those circumstances I was probably pulling 700 motor watts and standing on the pedals with the chain immediately stopping, the blue gear did exactly what it was designed for, to act as a fuse within the gear train. I suspect no firmware would have prevented that happening.
By increasing the value of the "Motor acceleration" parameter, a faster starting acceleration is obtained (simplifying).
Buba has indicated conservative maximum values to avoid problems with the blue gear.
Consider that the acceleration at the start with the original firmware is much higher.
Regarding the jam you have had, this parameter is irrelevant.

You will have noticed in the configurator the ERROR_MOTOR_BLOCKED parameters for blocked motor or wheel control.
They were already foreseen by buba, but they were not modifiable and entailed a too high intervention time. Now you can easily modify them according to your needs, better an unwanted intervention than the breaking of the blue gear. But in your case, the immediate blocking, I think is impossible to control with the software.
 
mbrusa said:
By increasing the value of the "Motor acceleration" parameter, a faster starting acceleration is obtained (simplifying).
Buba has indicated conservative maximum values to avoid problems with the blue gear.
Consider that the acceleration at the start with the original firmware is much higher.
Regarding the jam you have had, this parameter is irrelevant.

You will have noticed in the configurator the ERROR_MOTOR_BLOCKED parameters for blocked motor or wheel control.
They were already foreseen by buba, but they were not modifiable and entailed a too high intervention time. Now you can easily modify them according to your needs, better an unwanted intervention than the breaking of the blue gear. But in your case, the immediate blocking, I think is impossible to control with the software.

Thanks, you are confirming what I thought maybe the case.

Another question. In the V20 we have the ability to switch into experimental mode to make the cadence possibly higher, is this a form of FOC that Casainho has implemented in the V50 ?
 
lupe 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

Hi Emr

Did you end up using this gear sensor? I am also looking at getting this for my wife bike. She has a Nexus 7 and due to the motor continuing after she stops pedalling she is grinding the gears. I'm keen to know how this works before ordering it.

Thanks

Yes @Lupe, I did fit the gear sensor, which was an easy installation. It works as advertised and means I can continue peddling while changing gears, although I do reduce peddle pressure slightly while changing gears, just as one would do if there was no motor.

The cut off seems to be about 0.5 of a second, but that combined with the delay in the motor resuming power results in about a 1 second cut off. This hasn't been a problem for me, and is still a big improvement over not having the sensor. It also helps preserve the IGH with no more crunching of gears.

I am currently running the MBrusa v20beta.1a OSF, and it has resolved the overrun issue for me. I haven't installed the 20beta.1b yet but plan to do so.

Cheers Emma
 
Thanks Emma. I think I will order one then 😊 I am just running the stock firmware but think we'll go to the open source firmware in time. What has you experience been with the OSF?
 
lupe said:
Thanks Emma. I think I will order one then 😊 I am just running the stock firmware but think we'll go to the open source firmware in time. What has you experience been with the OSF?

@Lupe
The MBrusa v20beta.1a OSF has been fine for me (over run issue resolved). With the OSF, one has the ability to modify the behaviour of the motor, and I particularly like the 'Ramp' option to configure the acceleration behaviour. This should help preserve the 'Blue' gear.

If using the OSF, I recommend also installing the 'Temperature Sensor' to avoid overheating the motor and causing permanent damage. While you have the motor apart to install the sensor, it will also be a good opportunity to add some of the recommended heat transfer methods employed by various users. See this thread...
http://52.25.253.50/forums/viewtopic.php?f=28&t=102046&sid=fd630f9da66db34d51dbd229661dece4

I haven't added any heat transfer materials to my motor so far (I need to), and motor reaches the temp limit quite easily and quickly on anything above ECO setting. I plan on using a combination of the silicon pads and silicon putty method.

Cheers Emma
 
Thanks Emma. Good advice!! Just a quick question re the gear sensor - do you have it by the shifted on the handle bars or by the hub? I guess to go to the hub you need an extension cable.

Also does the motor heat up more after installing the OSF or does that happen with the stock firmware as well. When I have ridden the bike I feel the motor - and while it is warm it has never been unreasonable hot. That was after riding at speed and tour modes and occasionally turbo up hills.

How good is the OSF compared to the stock? I have read a lot of really good reviews.
 
lupe said:
......
Also does the motor heat up more after installing the OSF or does that happen with the stock firmware as well. When I have ridden the bike I feel the motor - and while it is warm it has never been unreasonable hot. That was after riding at speed and tour modes and occasionally turbo up hills.

How good is the OSF compared to the stock? I have read a lot of really good reviews..................
You can't feel the temperature of the motor outside on the case. This because there is a isolating airgap between the motor and the outer case. By adding heat conductive material between motor and case you will feel that the case will be hotter.
For producing heat, if the motorpower is the same, there is no difference with stock or OSF.
The advantage of OSF, if the temperature of the moter rises, the motor power will control down with the use of a internal temperature sensor.
With OSF you can overpower and underpower the motor if you want, depended what you have done for temperature control, like adding the sensor and pads.

For comparing stock and OSF. You must feel it to know it. This because the customizing options of OSF.
If you make a backup of stock FW before you flash OSF, you can always back to stock. Trying only costs you a 3 USD ST-link
 
Guys, having a lot of either finger troubles or possibly the software is not performing as it should.

I'm setting up the units from the Configurator for a 36 volt motor running on a 48Volt battery.

My problems are many but to start with the voltage display ( No 2 ) is only showing 34.6 volts rather than the expected 54.00 as measured. I've tried this on two bikes and displays and its the same for both, Technically the motor should shut down but its working fine so it has to be something to do with the display set up. I have the configurator set in kmh, does the screen have to be also set to kph ?

When I touch the light button nothing happens, I think it should scroll through the three set 2, 4, 7 ?

If I double touch the light button it shows Err 02 which should be the volts but shows Err02 and 0 alternatively as though you are wanting to change the parameters regardless of the assistance level. If I then double tap the light button again I get Err 03 with sometimes the motor Watts sometime showing or it will revert back to the main speed screen.

I've tried ever so hard to get into the Cadence calibration routine without any luck what so ever, has anybody managed to calibrate it as per the manual ?

As a curiosity the 48 volt motor really high lights the over run in comparison to the 36 volt units. Having 3 units here ( 1 36 volt LCD3 1 36 volt on VLCD5 and 1 48 volt on VLCD5 all on 48 volts ) I can ride and compare, the 36 volt motor running on 48 or 52 volts is just so much nicer, the 48 volt unit seems to be really clunky and all on or off whereas the 36 volt motor is so quite and just seems to want to perform.
 

Attachments

  • Configurator 1.JPG
    Configurator 1.JPG
    109.4 KB · Views: 678
  • Configurator 2.JPG
    Configurator 2.JPG
    111.7 KB · Views: 677
mbrusa said:
revher said:
Stancecoke made his wiki "open to everyone" on GitHub and that the reason why I already made the OS/X and Linux page.
So please mbrusa, open the wiki for editing.

Revher
Revher, thanks for your collaboration.
Now the wiki is open.
Hi all, and thank you Mbrusa for opening the wiki.

I tried to update the OS/X and Linux wiki page.

I am supposing that on these Operatins systems, people know how to use the command line!

Please have a look! And feel free to make remarks and improvements.

Also, I tried to flash the latest version mb.20beta1.B on my new bike and I already said on this forum some words on the too long time to initiate and change the lights on/off.

Therefore I reversed to latest version "mb.20beta1.A" using the git history and checking out to the latest workable version of Stancecoke ($ git checkout 17a3649) before Stancecoke deleted his simple java configurator. It was after Mbrusa overrun improvements which I really liked.

After flashing this version A to my bike I really enjoy it, much more that current version B. I don't know if we could name this version A as the latest stable version? Unfortunately, it was not tagged on GitHub.

Therefore, I explain on the OS/X and Linux wiki how on can reverse to an earlier version and use the very simple JavaConfigurator of StanceCoke. Please have a look and comment.

Regards,

Revher
 
Waynemarlow said:
...
When I touch the light button nothing happens, I think it should scroll through the three set 2, 4, 7 ?

If I double touch the light button it shows Err 02 which should be the volts but shows Err02 and 0 alternatively as though you are wanting to change the parameters regardless of the assistance level. If I then double tap the light button again I get Err 03 with sometimes the motor Watts sometime showing or it will revert back to the main speed screen.

I've tried ever so hard to get into the Cadence calibration routine without any luck what so ever, has anybody managed to calibrate it as per the manual ?
...
Waynemarlow, you must first understand the difference between the two data visualization methods and decide which one to use.
I left the manual method of the previous version, it requires pressing the lights button 2 times for each data.
Seeing your settings, you only enabled this.
You have chosen to display data 2, 4, 7. With the bike stationary, the value of 4 and 7 is zero.
The manual method is not the best to use with the bike on the road. Better to use the automatic one, you must enable "Auto display data with light on", just turn on the lights and after 5 seconds with E02 displayed the selected data will be displayed in sequence, then the lights can be turned off or left on.

I saw that you disabled "Set parameter on startup", did you do it for safety? Keep in mind that it is more complicated to change the settings, especially to make the calibrations. You must first set "Set parameter" to level 0-OFF, then you have 30 seconds to make settings or calibrations.
If you intend to leave "Set parameter on startup" disabled, set "Time to return default display mode" to 60, or disable "Return to default display mode" and you can take all the time you want for the settings. You will have to go back to view mode manually.
My advice is to enable "Set parameter on startup" and "Auto display data with light on".

If you are unable to calibrate the cadence sensor, to try you can set the "Cadence sensor high percentage" to 420, it is an average value that should work.

Regards
 
MBrusa

Many thanks for all the work and time put into this.

OK I've largely sussed this and once you can get into the swing of things, its quite straight forward. The biggest thing was to find at which time you are in display mode or parameter set mode. Could I suggest some how to flash the spanner on the display whilst in parameter mode or just some variance so that you can visually see which mode you are in, it was at this point that I found the hardest to decipher what mode you were in. Once I had twigged what to look for, the rest came pretty easily.

Yes I had purposely left the parameter on startup disabled, one of my bikes is my loaner to mates and people wanting to experience EMtb and finger pushing of light symbols is the first thing they do after keeping their foot on the pedals at startup :wink:

Once I had go the gist of things it was easy enough to calibrate the cadence sensor.

Thanks

Wayne.
 
Elinx said:
lupe said:
......
Also does the motor heat up more after installing the OSF or does that happen with the stock firmware as well. When I have ridden the bike I feel the motor - and while it is warm it has never been unreasonable hot. That was after riding at speed and tour modes and occasionally turbo up hills.

How good is the OSF compared to the stock? I have read a lot of really good reviews..................
You can't feel the temperature of the motor outside on the case. This because there is a isolating airgap between the motor and the outer case. By adding heat conductive material between motor and case you will feel that the case will be hotter.
For producing heat, if the motorpower is the same, there is no difference with stock or OSF.
The advantage of OSF, if the temperature of the moter rises, the motor power will control down with the use of a internal temperature sensor.
With OSF you can overpower and underpower the motor if you want, depended what you have done for temperature control, like adding the sensor and pads.

For comparing stock and OSF. You must feel it to know it. This because the customizing options of OSF.
If you make a backup of stock FW before you flash OSF, you can always back to stock. Trying only costs you a 3 USD ST-link

Thanks Elinx - I will give the heat sensor a go then. Keen to get the best set up possible.
 
Sorry more questions - Can you install the heat sensor and use the motor reduction feature with the vlcd5 display osf?
 
revher said:
......
Therefore I reversed to latest version "mb.20beta1.A" using the git history and checking out to the latest workable version of Stancecoke ($ git checkout 17a3649) ..........
Accessing github's archives that way, is an interesting option I didn't aware of, thanks.
I understand why it isn't, but it's a pity that the earlier versions cannot simply be found in the repo.

lupe said:
...install the heat sensor and use the motor reduction feature with the vlcd5 display osf?
The heat sensor can be used with OSF only. So also with the mbrusa's version for stock display's.
But think about it that it replaces the throttle function. Before compiling you made a choice for throttle, temperature or neither.
So if you have throttle and you want to keep it, then you can't use a temperature sensor with OSF

uitsnede.png
 
revher said:
Hi all, and thank you Mbrusa for opening the wiki.

I tried to update the OS/X and Linux wiki page.

I am supposing that on these Operatins systems, people know how to use the command line!

Please have a look! And feel free to make remarks and improvements.

Also, I tried to flash the latest version mb.20beta1.B on my new bike and I already said on this forum some words on the too long time to initiate and change the lights on/off.

Therefore I reversed to latest version "mb.20beta1.A" using the git history and checking out to the latest workable version of Stancecoke ($ git checkout 17a3649) before Stancecoke deleted his simple java configurator. It was after Mbrusa overrun improvements which I really liked.

After flashing this version A to my bike I really enjoy it, much more that current version B. I don't know if we could name this version A as the latest stable version? Unfortunately, it was not tagged on GitHub.

Therefore, I explain on the OS/X and Linux wiki how on can reverse to an earlier version and use the very simple JavaConfigurator of StanceCoke. Please have a look and comment.

Regards,

Revher
Hi Revher

I don't know OS / X and Linux, so no comments or improvements. It's definitely fine.

What you write about the "mb.20beta1.A" version leaves me perplexed.
I don't understand what you mean by "Also, I tried to flash the latest version mb.20beta1.B on my new bike and I already said on this forum some words on the too long time to initiate and change the lights on / off."
Strange that you find a difference in the use between the two versions, are you sure you have the same settings?

This morning, for scruple, I also made a comparison on the street, with the same parameters I did not notice any difference, really none.
I tried with 36V motor, 36V battery, power assist, "Experimental high cadence mode" both enabled and disabled, "Start-up without pedaling" both enabled and disabled.

I have another private repository with the "mb.20beta1.A" version, but it doesn't seem appropriate to make it public, it's an incomplete version and with some problems to fix.
I like to look forward and not backwards ...

Regards
 
Elinx said:
I understand why it isn't, but it's a pity that the earlier versions cannot simply be found in the repo.

??? you can access every single commit on github with clicking on the paranthesis button. You'll get the normal screen, where you can press the green "clone or download" button.

git_commit_overview.PNG

regards
stancecoke
 
mbrusa said:
revher said:
Hi all, and thank you Mbrusa for opening the wiki.


Therefore I reversed to latest version "mb.20beta1.A" using the git history and checking out to the latest workable version of Stancecoke ($ git checkout 17a3649) before Stancecoke deleted his simple java configurator. It was after Mbrusa overrun improvements which I really liked.

After flashing this version A to my bike I really enjoy it, much more that current version B. I don't know if we could name this version A as the latest stable version? Unfortunately, it was not tagged on GitHub.
Hi Revher

I don't know OS / X and Linux, so no comments or improvements. It's definitely fine.

What you write about the "mb.20beta1.A" version leaves me perplexed.
I don't understand what you mean by "Also, I tried to flash the latest version mb.20beta1.B on my new bike and I already said on this forum some words on the too long time to initiate and change the lights on / off."
Strange that you find a difference in the use between the two versions, are you sure you have the same settings?

This morning, for scruple, I also made a comparison on the street, with the same parameters I did not notice any difference, really none.
I tried with 36V motor, 36V battery, power assist, "Experimental high cadence mode" both enabled and disabled, "Start-up without pedaling" both enabled and disabled.

I have another private repository with the "mb.20beta1.A" version, but it doesn't seem appropriate to make it public, it's an incomplete version and with some problems to fix.
I like to look forward and not backwards ...

Regards
Thank you Mbrusa for your work and quick answer. I also haven't had time to compare the sources of both versions to understand why there is a longer time at boot and when I change the light on/off with version B. I am not an experimented user and I use my bike in town, in the traffic, changing gears every 10 seconds, not in the mountain. What I have learned is that I can't have a foot on any pedal when booting because of the pedal sensor (torque sensor) which is calibrating at each reboot. It is true with the original firmware and I think that it is still valid with the OSF. And this is the reason why a too long boot is not good. Also, you explained earlier that in order to switch the lights on or off, you had to check a long process again (similar to a boot?). And definitely the boot of the version A is shorter. I already published the version B screen that I used which, I hope so, is equal to the version A which is in the OS/X Linux wiki even if the definition of the "Battery capacity" changed (at least in the config.h). My settings are 36V, XH18, 10.4Ah, coaster brake (which means not brake setting, no walk assist), 25km/h max speed.

I think that for a newbie, the Stancecoke Configurator is easier to manage. Having a unique config.h instead of advanced.h is not a problem. But the basic settings should be basic.
In addition, there are 3 steps in the current configurators (both): Configure, Build and Flash. They could be separated by three different buttons because only the Configure is crucial for a GUI.
An important step, at least for me, concerns the backup of the firmware which is either the original or the latest flashed firmware. It could be backup with the time/stamp written within the file name (like for the time-stamps.ini files).

And also, only the main.ixh should be flashed, not the EEPROM etc.
On Windows, the stm8flash from cygwin works fine too. Therefore I would appreciate that the flash step which has been commented in the Makefile_windows should be uncommented. When renamed as a simple Makefile. The global process could be:
Code:
$ java -jar JavaConfigurator.jar&
and a simple click on "Configure" to get config.h on src/controller and
Code:
$ (cd src/controller && make flash)
to both, build the firmware (main.ihx) and flash it to the motor. The make flash (which is doing the build step prior to the flashing if any file like config.h or any .c file changed) could also include a 'make backup restore' is order to test the hardware connection and produced a dated firmware like TSDZ2-20200524-01-32.bin . But incorporating the date in a file name is dependent of the OS and will require two different Makefile one for Windows and one for UNixes.

To be continued...
Regards,

Revher
 
Back
Top