TSDZ2 OSF for all displays, VLCD5-VLCD6-XH18, LCD3, 860C-850C-SW102.

Hi there, I have had hit and miss with the ST-LINK adapters as you may have read, my ST-LINK adapter will program without any problem a bare controller, on the 48V TSDZ2B I have just reprogrammed, (1) the STVP software threw up the normal could not connect error, this happened a few times, gave up for a while as it was winter, but before I was going to pull the controller out I gave it another go with the STVP software so, (2) connected to the controller to the computer via the ST-LINK adapter with which I knew worked got same error, so unplugged the ST-LINK adapter from the computer and plugged it back in, was then able to read the parameters from the controller, changed to the Configurator was able to compile and write the new parameters, (3) now my latest updated parameters went straight on today. I do seem to get this problem with everything connected to a controller I am programing right from the first one I ever did, bare controller fine. Even thought at first I had a V2 controller until I checked it.
Not 100%, I do not think you have damaged the controller, I have switched displays on a number of TSDZ2s when setting them up without any problems, unless you have been very unlucky. Give a go with the STVP software and go from there, My ST-LINK adapter has about 140mm of cable, and I used a fully charged laptop.
 
Thank you dcg. Just tested your way but unfortunately no way to get the adapter to read the motor. Probably I've really bricked the controller :cry:. In any case it seems to drive the motor as usual. My STVP adapter has a 10cm cable to the controller and I use a USB extension. The laptop was plugged in the net. Maybe I've to wait a few months and then try again as You did :unsure::ROFLMAO:.
 
Almost same setup, though I park my bike in my living room next to my desktop. Usb extension off about half a meter to st-link and then the wire harnas which came with it ( I'm still pushing shrinkwrap over pins ).

Because of that, before each flash with the java configurator I launch up st visual programmer and verify I have a good connection by reading out all the existing data. I have hex files I can reflash when needed without the configurator, both stock firmware and osf with working settings.

I was almost considering taking the death dz41 as 'faith' and just salvage the cable and get a much easier update experience. But 51 euro ( including shipping ) I find a tad expensive for a cable.

I feel the best way would be using such a cable, and just solder the leads to an st-link directly, shrinkwrap the whole thing and use it as dedicated 'Tongshen update cable' I could just plug into usb and the connector and go at it. Without that fear of: check if I got a good connection pushing those pins together manually, because if not I don't want to corrupt the firmware with a bad flash.

@AZ1971 what I still don't get is 'bricked controller' but 'seems to drive the motor as usual'. If your controller firmware was bricked it would impair the working of it. If the st-link works on other controllers, and fails to read data from the other one while that controller still 'drives your motor as usual' I don't think you bricked it it sounds more like it is the wrong type of controller.

I wouldn't be able to tell from a picture, my controller looked fully potted when I looked at it when I was considering if I should get all that off to install a temp sensor the hard way ( hard way because not using kit which came with throttle ).

Don't the replacement controllers you can order come fully potted or do they expect you to add weather resistance yourself? All the pictures on the adds show the controller unpotted, but I assumed this was just for the add and not how they would ship?
 
Last edited:
Yep, brought few of the cheap and cheerful ST-LINK V2s and a couple of Tongsheng 6 core extension cables, cut about 100mm of cable off with the socket and soldered the wires to the ST-LINK and sealed with UHU transparent universal power adhesive. Have couple of the extension cables so can splice brake sensor cables in. Did that on the DZ41 Display cable I do like brake with sensors.
AZ1971, controller is not bricked if it is still driving the motor and the display shows the current state, try with the STVP adapter plugged directly into the laptop as I believe there has been problems with volt drop down USB extensions. As before have had fun and games with the ST-LINKs but always go back to testing on a bare controller.
 
Last edited:
marvin78, the controllers are clear potted, the only place to reseal is where the wires past thro' the casing, there is a soft grommet but it needs a small amount of sealant as weel.
 
Following on, the revised parameters on my DZ41 / TSDZ2B 48V combo with a longer ride seem to be fine, torque sensor output has been improved with the revised parameters. New back wheel bearings sorted. Now I can fit my modified Rockshox Silver 35 forks.
 
The last test I did was made plugging directly the USB converter to the laptop and excluding the USB extension at all. No results. I do not think it's an issue with the voltage drop. The controller (and the motor) is not a new one. I've been using it for 1500km and programmed and re-programmed it at least 10 times with the same tools and configuration. Now I'm thinking about the connector from the controller to the ST-LINK...I want to open it and check if the wires are all ok. I've read that someone (Mbrusa?) had already some bad experiences with these connectors...
 
I agree, I am always a bit concerned with the connector(s) where one has to give them a bit of a wiggle to get them apart, not worried about the distance having two bikes nearing 3500km. Do a visual pin / socket check as I think the speed sensor only uses three wires which will most likely still work when plugged back in. You have been enthusiastic with your re-programing, I start getting worried after 3 or 4 times. Daft idea have you tried unplugging everything and removing the battery, only saying that as I always seem to be able program a bare controller, but I am quite happy as I have a spare 36V and 48V controller in the draw, for £30 delivered quite happy to pull a controller out if needed.
 
only saying that as I always seem to be able program a bare controller

I tried everything at start, but I found I only got a repeatable reliable experience with the battery connected ( and 'on' ).

I thought it was likely to do with using the USB extension cable, where 5v is likely to have dropped a bit ( isn't this in the wiki as well? ).

If I had bare controllers to flash, I would likely use a shorter cable though.
 
marvin78, yes like you I have been all over the various wiki's etc, but the first one I understood regarding programing was for a AKM mid-drive using ST-LINK which the maker sent me the instructions for, followed by
which I used for my first install. There has been variations some with the battery connected and some without, with USB extension or without, four wire (reset, swim, gnd and 5v) and three wire (swim, gnd and 5v) on the ST-LINK. I am sure it is a black art programing the TSDZ2. Then I go back to this one
 
Is there a way to trigger 'startup assist' without putting a foot on the pedals/rotating the cranks?

I use the tsdz2 on a cargo bike. When the bike is heavily loaded (ie. two kids on the back) - and I have been forced to stop on a steep hill - it is very difficult to balance the bike while getting a foot onto the pedal and pedalling to trigger the startup assist.

The ideal scenario would be pushing a button to start the motor. That would allow both feet to stay on the ground and drag until the bike is rolling fast enough to be stable (with the dropper-post 'dropped').

I wonder if there is a way to trick the rotation/rpm/cadence sensor in the motor into thinking the cranks have been turned? This scenario would involve holding down the remote button to engage 'startup assist' mode with one thumb - and using the other thumb to press a second button that starts the motor. I dont know

I have considered connecting a throttle. However, I am reluctant to remove the temperature monitoring function (it is hot here). I saw something about connecting the thermister to the brake wire (instead of the throttle wire) but could not find any expansion on how this would work (I would expect the brake sensor to provide an on/off signal rather than the incremental data coming from a throttle. Also, the configuration settings were limited to 'temperature' and 'throttle' - I didnt see any option to use the brake sensor input for temperature data.

Thanks!
 
*Startup assist without pedaling -> Startup assist w/o pedaling threshhold.

If you're going to run that I hope you got brake sensors installed :) But it sounds like you already know exactly :)

I know some people use walk mode as a legal 'throttle alternative' just to get off the line. But walk mode afaik doesn't only limit speed it also limits power ( I don't feel the same pull from activating walk mode, compared with 'startup boost', so I don't know if walk mode would be enough to get your heavy cargo bike off the line ).

It really is a worst case scenario, having to stop uphill. Curious what solution you eventually end up with.

edit:

(I would expect the brake sensor to provide an on/off signal rather than the incremental data coming from a throttle.
actually the brake sensor is just a hall sensor isn't it, it giving a '1 or 0' reading is something the firmware translates to from it's actual value. I always thought it should therefore be possible to alter parameters/thresholds in firmware somewhere, over having to play with positioning of magnets. Or even worse, integrated levers without adjustment possibilities?
 
Last edited:
SBMelb, as marvin78 has said brake sensors definite what you need, brake signal "0" to go and "1" to stop, logically back to front but only way it will work if brake sensors are not fitted.
The throttle seems to be digital, not a pot job, or there is a hall effect sensor in it. Which ever way I would use the throttle.
 
Last edited:
Is there a way to trigger 'startup assist' without putting a foot on the pedals/rotating the cranks?

I use the tsdz2 on a cargo bike. When the bike is heavily loaded (ie. two kids on the back) - and I have been forced to stop on a steep hill - it is very difficult to balance the bike while getting a foot onto the pedal and pedalling to trigger the startup assist.

The ideal scenario would be pushing a button to start the motor. That would allow both feet to stay on the ground and drag until the bike is rolling fast enough to be stable (with the dropper-post 'dropped').

I wonder if there is a way to trick the rotation/rpm/cadence sensor in the motor into thinking the cranks have been turned? This scenario would involve holding down the remote button to engage 'startup assist' mode with one thumb - and using the other thumb to press a second button that starts the motor. I dont know

I have considered connecting a throttle. However, I am reluctant to remove the temperature monitoring function (it is hot here). I saw something about connecting the thermister to the brake wire (instead of the throttle wire) but could not find any expansion on how this would work (I would expect the brake sensor to provide an on/off signal rather than the incremental data coming from a throttle. Also, the configuration settings were limited to 'temperature' and 'throttle' - I didnt see any option to use the brake sensor input for temperature data.

Thanks!
"Startup assist without pedaling" is designed to start the assistance immediately, but it is not designed for heavy conditions (cargo bikes).
I don't think you will benefit from it.
"Walk assist" is also not good, the power is limited.
The ideal would be a throttle to activate when you start pedaling, but you don't have it.
There is a function you could try, but to start you always need to push on the pedals, after that it is like a throttle (limited to 6 km/), it helps in the first pedal strokes.
This function is called "Startup assist" and must be enabled in the configurator if you use a stock display, otherwise in the "Startup boost" menu if you use 860C.
With the stock display it is activated with the lights on, by pressing the "Walk assist" button and, holding it down, start pedaling. After starting, continue pedaling and release the button after a few pedal strokes.
It could work.
With 860C it is not activated with the Walk assist button but by pressing the UP button.
 
"Startup assist without pedaling" is designed to start the assistance immediately, but it is not designed for heavy conditions (cargo bikes).
I don't think you will benefit from it.
"Walk assist" is also not good, the power is limited.
The ideal would be a throttle to activate when you start pedaling, but you don't have it.
There is a function you could try, but to start you always need to push on the pedals, after that it is like a throttle (limited to 6 km/), it helps in the first pedal strokes.
This function is called "Startup assist" and must be enabled in the configurator if you use a stock display, otherwise in the "Startup boost" menu if you use 860C.
With the stock display it is activated with the lights on, by pressing the "Walk assist" button and, holding it down, start pedaling. After starting, continue pedaling and release the button after a few pedal strokes.
It could work.
With 860C it is not activated with the Walk assist button but by pressing the UP button.
Thanks to everone who responded!
I think it boils down to installing a throttle - with a separate (arduino based) temperature monitor - or finding a way to momentarily emulate the signal from the torque/pas sensor - or code. On the middle option, it looks like torque sensors typically use a variable voltage to send torque data, which might be practicably emulatable. But, the separate temp sensor/standard throttle carries lower risk of damaging the motor/controller and gives finer control of the bike.
 
Brake inputs are normally open, when closed will cut the motor, has to be normally open for when brake sensors are not fitted. In industrial equipment safety circuits are always wired normally closed to take into account a broken wire condition which will always stop the machine.
 
Hello guys: I have never posted anything here, although I've had seen your great work for long, and I have quite an experience in TSDZ2 motors and OSF. I have two bicycles with that motor. First, I want to thank Casainho and Mbrusa and all the others that have developed the OSF for the TSDZ2. I find it really great. Thanks. In one bike, I felt down, and I broke my 860C display, so I bought a new one. And I put the latest version v20.1C.5-860C, with the V13 display version, because with the normal display version didn't worked. I use always the bicycle for MTB trips. With this version, in enduro trails upwards, when I find a step, when I push hard, it gives me always the E07 Overcurrent error and the motor stops working. I have the TSDZ2B 500W, with a battery of 48V, and the max current setting is 16A. It is really annoying that in every difficult section, have to start the motor again. I wanted to put the version prior the adding of the E07 Overcurrent check (v20.1C.4-860C Update 2), but with this new display, I can't put the corresponding display version. Please, what can I do to avoid this situation? Is there any parameter setting that can avoid this? What do you recommend me? Thanks in advance for your help.
 
Putting a previous version is not the best solution, you would lose all subsequent improvements.
When there is a problem it is important to report it, as you did, a solution can be found.
Only in this way can OSF grow and improve.
The E7 error was added to version 4-update-3 and confirmed in version 4-update-4 without changes.
It was added because in some versions of OSF there were cases of burned mosfets, one hypothesis was a bug that interrupted the motor control loop, so a current control was added also in the main loop (by mspider65).
During a ride, I had an accident, on a very steep climb, I made a risky gear change, the chain fell, got stuck and broke.
The motor was at maximum power and consequently the blue gear was also damaged, but the E7 error appeared and this was enlightening. I understood that the current had reached 23A and that this control could also be used to protect the blue gear.
The check time of E7 was high, so I decreased it.
Later the same accident happened to me, the chain fell and got stuck, it did not break, the motor stopped with E7 error. Turned off and on again, no damage to the blue gear.
I also had confirmation from another episode, on a path there was a very high root, I should have gotten off the bike, but instead I pushed hard on the pedals to overcome it, I got stuck against it., E7 error. Turned off and on again and I started without damage.
So from version 5 I decreased the check time, but I increased the current threshold.
The overcurrent threshold was 6A above the max current of the motor, now it is 8A.
If you have set the max current to 16A, the overcurrent error should be 24A (16 + 8), I use the conditional because it could be different.
The max current used is the minimum value between the max current set and the one calculated with max power / voltage.
Example, if you set the max power to 500W and the voltage is 54.6V, the max current will be about 9A because it is less than 16A, and the overcurrent error will be 17A (9+8).
Try to gradually increase the max power.
If even increasing the max power you still get the error, I will have to increase the check time, and you will have to do the test, if you want.
 
@mbrusa or @Elinx ;

For the std. display XH-18: How do I exit the 'Parameter Setting' Mode (-> go back to 'Data Display' mode)
I wanted to check my torque sensor readings by doing this:
"- Select Level 1
- For E04, Push light/power button 6 times (2+2+2)
- E04 flashing, press light/power again and again (another 2 times)

- Now you have 25 seconds to do the calibration"
That worked, but now whenever I press the light button, I get E-02; so I assume I am in 'Parameter Setting' Mode.
But I want to get back (permanently) to 'Data Display' mode.
How do I do that?
I read the manual 10 times and tried following it, but it did not work. I must do something wrong....
-> Can you give me a hint?


What I am doing:
Go to level 0
Press light - E02 shows up and display shows 10.5 km/h (I assume this means 'Parameter Setting' Mode is enabled)
Press light again - E02 blinks and display shows 0 km/h (-> I assume this means 'Parameter Setting' Mode is disabled)
wait or goto another level.

So, I thought with this I disabled the 'Parameter Setting' Mode.
But when I press the light button again, E02 shows up again....

Edit:
Ahh - I have to power cycle the display to get that setting active!
-> All resolved.
 
Last edited:
I am still running the 1.C.2update-2 release. Did not see any functional changes in the 1.C,2-update-3,

Yesterday, I picked up 1.C.6-beta-1. The java configurator no longer seems to have the radio button for selecting powerup default mode on the various modes? I know how to do that from the VLDC5 display. Is that the intent?
 
I am still running the 1.C.2update-2 release. Did not see any functional changes in the 1.C,2-update-3,

Yesterday, I picked up 1.C.6-beta-1. The java configurator no longer seems to have the radio button for selecting powerup default mode on the various modes? I know how to do that from the VLDC5 display. Is that the intent?
In version 2-update-3 there are no functional changes, but the probable cause of the random burning of the mosfets has been removed.
Regarding version 6-beta-1 the layout of the configurator has been redesigned, with the intent of making it more intuitive.
The setting of the assistance mode at power on is found in the "Bike setting" section, "Basic settings" tab at the bottom right.
 
@mbrusa or @Elinx ;

For the std. display XH-18: How do I exit the 'Parameter Setting' Mode (-> go back to 'Data Display' mode)
I wanted to check my torque sensor readings by doing this:
"- Select Level 1
- For E04, Push light/power button 6 times (2+2+2)
- E04 flashing, press light/power again and again (another 2 times)

- Now you have 25 seconds to do the calibration"
That worked, but now whenever I press the light button, I get E-02; so I assume I am in 'Parameter Setting' Mode.
But I want to get back (permanently) to 'Data Display' mode.
How do I do that?
I read the manual 10 times and tried following it, but it did not work. I must do something wrong....
-> Can you give me a hint?


What I am doing:
Go to level 0
Press light - E02 shows up and display shows 10.5 km/h (I assume this means 'Parameter Setting' Mode is enabled)
Press light again - E02 blinks and display shows 0 km/h (-> I assume this means 'Parameter Setting' Mode is disabled)
wait or goto another level.

So, I thought with this I disabled the 'Parameter Setting' Mode.
But when I press the light button again, E02 shows up again....

Edit:
Ahh - I have to power cycle the display to get that setting active!
-> All resolved.
Yes, one method to exit the calibration mode is to turn the display off and on again.
Or wait for the 25 seconds to end.
Or by increasing the level from 1 to 2, but not decreasing it from 1 to 0, as happens with the other parameters.
This is because in the calibration procedure the Walk assist button can be used which changes the level from 1 to 0 and must therefore remain in this mode even at level 0.
Probably you switched to level 0 before the end of the time (25s) and being still in calibration mode, the "Set parameter" setting is not available.
 
Putting a previous version is not the best solution, you would lose all subsequent improvements.
When there is a problem it is important to report it, as you did, a solution can be found.
Only in this way can OSF grow and improve.
The E7 error was added to version 4-update-3 and confirmed in version 4-update-4 without changes.
It was added because in some versions of OSF there were cases of burned mosfets, one hypothesis was a bug that interrupted the motor control loop, so a current control was added also in the main loop (by mspider65).
During a ride, I had an accident, on a very steep climb, I made a risky gear change, the chain fell, got stuck and broke.
The motor was at maximum power and consequently the blue gear was also damaged, but the E7 error appeared and this was enlightening. I understood that the current had reached 23A and that this control could also be used to protect the blue gear.
The check time of E7 was high, so I decreased it.
Later the same accident happened to me, the chain fell and got stuck, it did not break, the motor stopped with E7 error. Turned off and on again, no damage to the blue gear.
I also had confirmation from another episode, on a path there was a very high root, I should have gotten off the bike, but instead I pushed hard on the pedals to overcome it, I got stuck against it., E7 error. Turned off and on again and I started without damage.
So from version 5 I decreased the check time, but I increased the current threshold.
The overcurrent threshold was 6A above the max current of the motor, now it is 8A.
If you have set the max current to 16A, the overcurrent error should be 24A (16 + 8), I use the conditional because it could be different.
The max current used is the minimum value between the max current set and the one calculated with max power / voltage.
Example, if you set the max power to 500W and the voltage is 54.6V, the max current will be about 9A because it is less than 16A, and the overcurrent error will be 17A (9+8).
Try to gradually increase the max power.
If even increasing the max power you still get the error, I will have to increase the check time, and you will have to do the test, if you want.
Many thanks, mbrusa. I understand much more about the problem now after your explanation. I wanted to increase the Max Current, but now, I will increase the Max Power as you say. I will check it, and report to you. I'm very glad to do tests, of course. Many thanks! Another thing, I have changed the blue gear for another gear, it is called the peek gear. It is much more resistant. In the summer, the blue gear suffers a lot because the heat (I have broken some), and with this new plastic gear, I never have broken any. This is the Aliexpres link to buy it (https://es.aliexpress.com/item/3289..._main.277.1c0e194daqWjwM&gatewayAdapt=glo2esp)
 
Many thanks, mbrusa. I understand much more about the problem now after your explanation. I wanted to increase the Max Current, but now, I will increase the Max Power as you say. I will check it, and report to you. I'm very glad to do tests, of course. Many thanks! Another thing, I have changed the blue gear for another gear, it is called the peek gear. It is much more resistant. In the summer, the blue gear suffers a lot because the heat (I have broken some), and with this new plastic gear, I never have broken any. This is the Aliexpres link to buy it (https://es.aliexpress.com/item/3289..._main.277.1c0e194daqWjwM&gatewayAdapt=glo2esp)
Thanks for the link to the peek gear! Unfortunately, this seems only available for the TSDZ2B version gear ..... not for the prior TSDZ2 (with added integrated one way bearing).
If you happen to find a TSDZ2 PEEK version, please share that info!
 
Back
Top