TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Here a feedback for the recent released firmware for SW102:

image.png


Although an issue was found that makes the firmware not saving anything, like the configurations or even the previous assist level. This is my focus right now.
 
Could the firmware make use of the light sensor and automatically adjust the screen’s brightness? And/or toggle the lights on and off like in the stock firmware?
 
jeff.page.rides said:
eyebyesickle said:
jeff.page.rides said:
eyebyesickle
Will you please share where you can buy the 860C for only $5 more?
And if the 860C is way better in the sunlight then both the old 850C and the new 850C? Thanks.
I'm also a little bit confused about why you need to take apart the 860C to flash it, and you don't need to take apart the 850C to flash it?
Thanks

Directly from the manufacturer, bulk order... The cost is only $5 more per unit. If we get it worked out, and it makes sense, I will arrange an associate to place an order and make it available on the market.

There is certain info needed so you don't have to take apart the 860c. The 850c was the same way until I obtained the info from the manufacturer. It can be hard to make them share this info, but I have negotiated with them, as they are also impressed with the work of casainho and other helpers. So we will have it soon...

Yesterday after my post I decided to have my wife take me over to Electrify Bike there not far from my home and they do all the work on my handcycle. https://www.electrifybike.com I asked them what they knew about 860C and to my surprise, they had the 860C in stock and ready to go. They also informed me that they mailed an 860C to casainho and he should have it anytime now. They also informed me that they flashed it before they sent it to casainho with the 850C flash with the same method and it worked, almost. If you hold down the power button while powering up then the display will display but the color mapping is wrong. It goes black when you let go of the power button, so there is something different let’s hope it’s small and easy to overcome.
We also took the 850C the 860C and the LCD3 out into the direct sunlight to compare them. The LCD3 as everyone knows is totally awesome in the sun and any other conditions. The 860C is better than the 850C but only about 20% to 30%, unlike the LCD3, is like 300% better than 850C.
In the photos, you can see what I’m talking about, but it’s not as pronounced as when you’re looking at them yourself in the sun at different angles.
The 860C looks like a higher-end LCD and the mounts are much more adjustable to get the best viewing angle. For 5 bucks more at a wholesale price, it’s definitely worth it. And who knows how useful the fourth button is going to be on the pad.


01_2_1.jpg02_2_1.jpg03_2_1.jpg04_2_1.jpg05_2_1.jpg

Hi Casainho, did you receive the 860C from https://www.electrifybike.com that they sent you?
They flashed it before they sent it with the 850C flash using the same method and it worked almost. If you hold down the power button while powering up then the display will display but the color mapping is wrong. It goes black when you let go of the power button, so there is something different let’s hope it’s small and easy to overcome.
What do you think? Do you know at this time how much more work it is going to be to get the software for 850C to work on the 860C?
 
Hi,
need help flashing 850C. I made DIY bootloader as specified in wiki (used specified components). Pins are connected correctly. Screen boots on 850c, voltage is appropriate.

The issue is that the board CP2102 USB to TTL (https://www.aliexpress.com/item/32288431622.html) is not recognised in windows 10.

When inserting I get no prompt to install drivers or anything. It is not visible in device manager.
I can install driver, but the device does not show up in device manager.

If I add drivers as legacy device in device manager I get error "This device cannot start. (Code 10)". Tried searching for solution on net but nothing works (there are same issues reported since some windows update for windows 1803 onward - prior to that chipset worked).

Viewing the aliexpress page of the USB I see windows 10 is not supported only windows versions prior to it. Is this my problem, will it only work on windows 7,8 etc.

If the same board works on someones win 10 please let me know.
If the issue is win 10, is there some other solution than installing windows 7 or 8 ... (linux version of APT Burn Tools, will flashing through virtual machine of win 7 work - virtualbox).

Tnx
 
Hi folks,
finally I found time to come out with my review and thoughts of the TSDZ2 OpenSource firmware.
First of all I deeply appreciate efforts of Casainho to reverse engineer TSDZ2's and developing a homebrew firmware for it. He inspired me to come back to microcontroller firmware development.

I first installed the OS Firmware last autumn on a brand new 48V TSDZ2. This was version 0.2 of the motor firmware and v0.4.0 of the 850C display firmware. I've modified the sources a bit and built a tweaked version with unlocked experimental high RPM feature.

First after the installation I was pleasantly surprised how fast can the motor spin. I got a solid assistance gain at higher RPM, which has almost fixed one of fundamental faults of the original TSDZ2 — too high gear ratio, which causes the motor to stick to lower RPM and to give up too early as RPM goes high. Now I could finally pedal at much more comfortable 75-80 RPM instead of 65-70. Overall the falloff of the torque at high RPM became softer, it doesn't feel anymore like a "brick wall".

But there are downsides as well. First, the manner of assistance has changed. First of all, startup assistance has lost almost totally. I've tried tinkering with settings, but none of them gave any noticeable effect. There's an option called "Startup boost", but it a bit ankward to setup and barely has any noticeable effect. There is also an option "start without pedalling". It is a tiny bit more helpful when I need to accelerate fast from stand still, nothing close to Tesla-like chain-ripping acceleration of the original firmware. This may seem unnecessary on a trail, but is quite important for everyday commuting in the city.

The second thing that bothers me is the response time. There is an option called "current ramp", which is meant to smooth out sharp changes of motor current. This is also a clever feature remembering how violently TSDZ2 is used to kick in on start with the original firmware. But on the move, when you start pushing pedals harder with the original firmware, you just get more assistance immediately, the motor just acts as an electrical amplifier of your leg. With the OpenSource firmware the motor behaves more like a petrol engine with a huge turbo. You start to push harder, and for a half a second or so happens virtually nothing, you just push harder and accelerate on your own. Eventually the imaginary turbo spools up and gives you a massive punch in the butt. With higher assist ratios this is sometimes scary and dangerous. Today I was almost thrown off a bike lane under a truck in a curve when the motor gone crazy.

There was a third complain, but it is fixed in the latest firmware version. Now the motor at low speed and input torque is not jerky anymore, I've got a nice and smooth low-power assist.

So enough critics, let me share my thoughts, findings and proposals.

I've digged into the sources of TSDZ2 firmware and realised that the pedal power is used as input for calculation of the motor's target current. In my opinion this is not correct. The concept of power is extrinsic for a human. Let's imagine a rider that starts to move from stand still. At the very first moment rider's will to get moving is maximum (and so is the force on pedals), but since pedals are not rotating, the power is zero as the power is amount of work done in a period of time. I would expect the motor to help me most at startup, but it can't as it uses power on pedals at input.

I do not understand exactly and completely what is going on in the code, but I would like to try to switch to torque-only mode and also make current ramp less aggressive to cope with assistance lag. I would appreciate any guidance on the code.
 
I think the no assist without rotation is for people who don’t want or can’t have brake sensors installed. This lets you rest on foot on the pedal with brakes applied, ready to go when the light turns green.
 
shodr said:
If the same board works on someones win 10 please let me know.
If the issue is win 10, is there some other solution than installing windows 7 or 8 ... (linux version of APT Burn Tools, will flashing through virtual machine of win 7 work - virtualbox).

Tnx
It is working for me with these drivers for w10:
https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers

You might have to force windows to update drivers manually (via Control Panel>System>Devices) by selecting the driver path..
 
Tnx for reply.

I tried on win 7 and same thing happened. I guess my board is broken. RX led is always on (even if not connected to 850c) and when connected to 850c tx is also always on (faintly). If I short circuit TX RX, TX led gets bright as other leds (RX, POWER). Is this normal.



elfnino said:
shodr said:
If the same board works on someones win 10 please let me know.
If the issue is win 10, is there some other solution than installing windows 7 or 8 ... (linux version of APT Burn Tools, will flashing through virtual machine of win 7 work - virtualbox).

Tnx
It is working for me with these drivers for w10:
https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers

You might have to force windows to update drivers manually (via Control Panel>System>Devices) by selecting the driver path..
 
Hello,
With version V.0.6.5, I set the battery current to 12 A and the motor current to 12 A.
After some tests, I note on the graphics a max battery current of 22.6 A for a max motor current of 11.8 A with a max motor power of 566 W with a battery voltage of 52.6 V.
Why is the battery current rising so high ?
Thanks.
 
Hi all,

I'm having trouble connection the ST Link V2 to the TSDZ2 through the speedsensors plug, and I would like to know what the best trouble shooting tips are.

My setup:
TSDZ2 with the stock firmware and with the stock VLCD5 display ( I have to 850C display programmed (with the Flexible Opensource firmware) and ready to go on the bike).
I've bought a second speedsensor cable so I could split it, and use it with the ST Link V2 dongle.
Then I've tried to use the dupont cables directly, with crimp sleeves over the ends
I've even shortened them to 4cm, but still no success.

I've tried to run from Win10 with the STVP software and from Linux with stm8flash tools.
On every occasion the communication doesn't want to initiate, Win 10 error is: 'cannot communicate with device' and from Linux I get: 'Tries exceeded'

I've triple checked the wiring and pin layout....but without any success. I read stories on this board if people retrying over and over until they finally get it to work, but for me....up till now without success.

I can use the ST Link V2 dongle with no problems for the 850C display, and other stm32 boards, it works perfectly.
I bought a second ST Link V2 dongle but the problem keeps the same.

Can someone tell me if there is another way, or point me to some important information about this. I've read the ST documentation about SWIM connection. They point out to use a 400Ohm resistor in series.

best regards,
LVX
 
lvx_xvl said:
Hi all,

I'm having trouble connection the ST Link V2 to the TSDZ2 through the speedsensors plug, and I would like to know what the best trouble shooting tips are.

Hi. You sound like you know what you are doing. I recorded a video of this step here. Can you check the wiring and config in the flash tool compared to the video?

https://youtu.be/S2SRKu6-Qyw

Cheers
 
lvx_xvl said:
I can use the ST Link V2 dongle with no problems for the 850C display, and other stm32 boards, it works perfectly.
I bought a second ST Link V2 dongle but the problem keeps the same.

I didn't know you could use a ST Link V2 to program the 850C display. I use separate cables for each - as much because I have a different connecter on the end.

I'm assuming you read through this section here?: https://endless-sphere.com/forums/viewtopic.php?f=28&t=79788&start=3650

My take home from that was that direct pins aren't a reliable method and a plug seemed to be better

I bought an extension cable rather than a speed sensor because I understood that the speed sensors don't always have enough wires. Its worth doing a continuity check to make sure that the cable maps the colours of wire to the correct pin sequences. They are known to change.

Are you wiring in the 5V power from the usb? I gather you need the LCD on if you want to power from the battery.

Hope this triggers something. I have been lucky enough to get it working first time but I bought 3 different ST Link dongles from 3 different vendors just in case
 
We get trouble on occasion with the" read only " bit which has to be reset on some motors. I've never really got to the bottom of it as just as I get frustrated trying to write to the motor, it will suddenly start working. My main tip so far has been to read individually each sector rather than trying to read and write all three parts of the memory. Try reading the sector on the right hand side first.
 
lvx_xvl said:
Hi all,

I'm having trouble connection the ST Link V2 to the TSDZ2 through the speedsensors plug, and I would like to know what the best trouble shooting tips are.

My setup:
TSDZ2 with the stock firmware and with the stock VLCD5 display ( I have to 850C display programmed (with the Flexible Opensource firmware) and ready to go on the bike).
I've bought a second speedsensor cable so I could split it, and use it with the ST Link V2 dongle.
Then I've tried to use the dupont cables directly, with crimp sleeves over the ends
I've even shortened them to 4cm, but still no success.

I've tried to run from Win10 with the STVP software and from Linux with stm8flash tools.
On every occasion the communication doesn't want to initiate, Win 10 error is: 'cannot communicate with device' and from Linux I get: 'Tries exceeded'

I've triple checked the wiring and pin layout....but without any success. I read stories on this board if people retrying over and over until they finally get it to work, but for me....up till now without success.

I can use the ST Link V2 dongle with no problems for the 850C display, and other stm32 boards, it works perfectly.
I bought a second ST Link V2 dongle but the problem keeps the same.

Can someone tell me if there is another way, or point me to some important information about this. I've read the ST documentation about SWIM connection. They point out to use a 400Ohm resistor in series.

best regards,
LVX

I was personally never ever able to get anything out of the ST software in windows. With stm8flash, I sometimes get the timeout. Your wires have to be as short as practical because it’s very prone to failing the connection otherwise. I only had +5V and GND from the usb ttl dongle and SWIM connected.

Also, you could try updating your programmer’s software. There is a windows only utility from st to update the firmware to the latest version, it also works with knockoffs.
 
Hi ALl,

And thank you for your replies.

@mctubster: I actually did look into your video before :thumb: , I came across it while I was searching Youtube for TSDZ2. It all seams so easy.... :(
But yes, same wiring. I tried with and without the 'reset'.

@ImpuslePurchase: Yes I've read through it, and it did give me some insights. For me the hardest bit is understanding how they (Tong Sheng) manage to use these pins/plug to program the stm8. I never had trouble connecting to a device: arduino like or other development boards. It made me think there is a need for a bit of extra hardware, maybe a resistor to pull the device pin up or down. But I cannot find any information. I've checked the ST docs, and they don't even state a maximum length for the programming cable. And the whole idea behind 'SWIM' is to program 'in circuit'.
I did also order an extension cable for the speed sensor, I've been looking to 'jbalatutube' youtube videos. :wink:
I'm using to 5V of the dongle, but I also tried to battery mode, so switching on the system via the VLCD5, and then only ground and swim to the dongle.

@Waynemarlow: I will give it a try, as soon as the weather gets better here. Storm 'Ciara' is having fun around here.

@skestans: I didn't know you can update the ST link dongles. I will check on that. Funny that the stm8flash tools only work for you. That for me means it is not the hardware that is failing. This actually triggered me that maybe my laptop is the trouble maker. I only have a macbook to try next. I hope it isn't my windows/linux laptop. I will definitely try that to....

Many thanks to you all for giving me advice. It has been a struggle, frustrating struggle to get this project going.

I will update with results soon :?: :!:

best regards,
LVX
 
lvx_xvl said:
@skestans: I didn't know you can update the ST link dongles. I will check on that. Funny that the stm8flash tools only work for you. That for me means it is not the hardware that is failing. This actually triggered me that maybe my laptop is the trouble maker. I only have a macbook to try next. I hope it isn't my windows/linux laptop. I will definitely try that to....
I would try with computer powered with battery only or charger.
 
Elinx said:
casainho said:
eyebyesickle said:
Previously, it only said 'expert' and did not specify a voltage. Which voltage was it for?.....
What I know is that the values on firmware were the ones choosen and tested by Jabalat.
Jbalat has tested the 36V values FOC angle 115 and MOTOR_OVER_SPEED_ERPS 700 for higher cadence the best settings.
maximusdm did tests for 48V and found FOC angle 220 and MOTOR_OVER_SPEED_ERPS 900 values are the best settings.
These last values haven't been added to the later releases, so eventually do this yourself. (motor.c and main.h)

Does anyone know if the high cadence mode(s) work ok with 52V (14s) batteries? I find the assistance kicks out around 90-95 rpm. If I can get 10-20 rpm higher that would be awesome.
 
casainho what does the sw102 program patch look like? in version 0.6.5 it does not save settings. I wanted to upload 0.19 but via bluetooth I can't upload an older version, only 0.6.5 or newer.
 
A short heads up regarding the battery stock in the EU. I spoke with UnitPackPower and they said that the corona virus is making imports difficult. I'm still waiting for a 52V 17.5Ah battery pack. Meanwhile, does anyone else have a different choice on batteries, 52V preferably?

I just ordered a TSDZ2 from PSWPower and i made a mistake. I ordered the XH18 display with no ebrakes. The motor came with a 6-pin connector and i have the cable in the attached picture with a 850C display to get OSF working with brake sensors and temp sensor. Can it be done? Or should i order another controller with the correct cables attached and swap it?
 

Attachments

  • s-l1600.jpg
    s-l1600.jpg
    49 KB · Views: 2,277
General question

I just installed a 36v tsdz2 motor and 850c display that came pre flashed with v19 of the OSF.

Is there any physical difference between the 36v motor (as identified by sticker in motor case) and the 52v motor ? Are they the same motor. ?
I’m wondering if I should have gotten the 48V/52v motor, however I wasnt given a choice.
Just told it was 750 Watts.

I’ve successfully used up to 60v on the motor , but limited the current to 16A.

I just don’t want to melt the motor.
 
60V and 16A makes 960W and will melt your motor unless you have a temperature sensor installed that automatically reduces the motor current.
 
silentguy said:
General question

I just installed a 36v tsdz2 motor and 850c display that came pre flashed with v19 of the OSF.

Is there any physical difference between the 36v motor (as identified by sticker in motor case) and the 52v motor ? Are they the same motor. ?
I’m wondering if I should have gotten the 48V/52v motor, however I wasnt given a choice.
Just told it was 750 Watts.

I’ve successfully used up to 60v on the motor , but limited the current to 16A.

I just don’t want to melt the motor.

This is explained on the wiki: https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/FAQ#TSDZ2_different_versions
 
Cristian said:
A short heads up regarding the battery stock in the EU. I spoke with UnitPackPower and they said that the corona virus is making imports difficult. I'm still waiting for a 52V 17.5Ah battery pack. Meanwhile, does anyone else have a different choice on batteries, 52V preferably?

I just ordered a TSDZ2 from PSWPower and i made a mistake. I ordered the XH18 display with no ebrakes. The motor came with a 6-pin connector and i have the cable in the attached picture with a 850C display to get OSF working with brake sensors and temp sensor. Can it be done? Or should i order another controller with the correct cables attached and swap it?

I got my 52V 17.0Ah battery from em3ev. Very happy with it so far.

If all you want (like I did) is too not have the motor engage when you're at a red light, foot on the pedal, and brakes engaged; then the OSF has an option to only add motor power if it feels torque on the pedals AND pedal rotation. This way, I can rest my foot on the pedal while braking and not have the motor engage, without a brake sensor. I didn't have this option on the stock firmware.
 
Cristian said:
just ordered a TSDZ2 from PSWPower and i made a mistake. I ordered the XH18 display with no ebrakes. The motor came with a 6-pin connector and i have the cable in the attached picture with a 850C display to get OSF working with brake sensors and temp sensor. Can it be done? Or should i order another controller with the correct cables attached and swap it?
PSWPower used to send out all units with 8Pin connectors until recently when we too ordered a motor without brakes etc and it turned up with an 6 pin connector.Dang that was a real pain.

Sadlly it really screws up your options somewhat as all the 8 pins are needed for both brake and throttle/temp and although you can chop wiring just outside the controller itself as you won't need the throttle wires it still leaves you having to dig into the potting on the controller to find the wires for the temp sensor.
 
obcd said:
60V and 16A makes 960W and will melt your motor unless you have a temperature sensor installed that automatically reduces the motor current.


So the 48v motor version is also 750 Watts ?

As long as I stay under 750 Watts in the 36v motor I’m ok ? For 16 amps that means 46 volts ?
What’s the safe over voltage for 36 V motor , assuming 16A current limit is set ?
I don’t have a temp sensor , as I use a throttle.


I’m keeping an eye on current

Thanks for the responses.
 
Back
Top