New TSDZ2 Open Source firmware with Bluetooth interface

mspider65 said:
Wimpy747 said:
I guess if I don't want to open the motor I can also place the board in the cable in a waterproof box, think this does not affect the behavior and functioning of the board?
Yes you can do it in this way too.

mspider65 do you think making the cable to the lcd5 longer will affect anything? (like controller cable -> 1m cable to pcb -> 1m oem cable to LC5.

i want also to have the pcb near the phone (inside a box on a phone holder for extra security) but dont want to splice the oem wiring (so i will have a damn big cable :) )
 
vass said:
mspider65 do you think making the cable to the lcd5 longer will affect anything? (like controller cable -> 1m cable to pcb -> 1m oem cable to LC5.

i want also to have the pcb near the phone (inside a box on a phone holder for extra security) but dont want to splice the oem wiring (so i will have a damn big cable :) )

No problem at all, since serial connections are terminated on te ESP32 board.
 
mspider65 said:
It's really difficult to compare power consumption between two different firmware, there are really many parameters that affects the comparison. I have a 36V motor and my feeling is different and compared to the official 0.20beta i have detected a slightly lower consumption (about 5% less)
You could try to reduce the default motor inductance parameter in the android app (e.g. from 142 to 120 or 110), maybe with the current setup the FOC angle calculation for the 48V motor is too "aggressive".
Field weakening starts only above 85 rpm and only if you are using a high assistance factor. You could check if field weakening was active looking in the Graph view and selecting the "field weakening angle" parameter.
I am just working now on motor optimization (better rotor position estimation) and I hope to publish soon a new release that will provide a small further improvement.
Adjusting the value to 120 feels more robust. A little weaker, but I felt, like the motor started to stutter when using very high rpm and 142.
Is it possible to flash 0.20beta OTA in order to compare the firmwares? Most of the values should als show up fine in the app, right?
Yes, in the Android app you could set the torque offset parameter. Enable the checkbox and put the value you read on the "ADC torque" dashboard field when the your feets are not on pedals.
For some reason the torque sensor takes a long time to stabilize the signal and often the offset calculated at the startup is lower than the correct value.
:oops: That works perfektly, thank you!
Actually the only way is changing the setup on the OEM display. But I think it would also be useful to have the option to change it from the Android app. I will take this into account for the next release.
That would be great!! Thanks!
 
vass said:
E-bike lover said:
Hi guys
I am interested in this pcb too but I have just found this post after searching for months. Probably others couldn't find this post too and will be better to add these kind of pages(optimisation for tsdz2) to github.
I have a idea to improve this pcb and that is by adding gps and sim function to it so that the bike could be traceable. Anyone has any idea how to make it?
Also, it would be nice if someone could sell me 1/2 pcb in a reasonable price in EU :D

hello, VelOtto has 2 pcbs, i was going to buy 2 but you can take one of them (PM him).
I also got 2 spare ones. I think I paid to much taxes though, which made them more expensive, still trying to figure out why.
 
PandaYeti said:
Is it possible to flash 0.20beta OTA in order to compare the firmwares? Most of the values should als show up fine in the app, right?

I don't quite remember if I changed anything in the protocol, but it should probably work. Try and let me know.
Also try the new version that I am publishing now. I am confident that the new release brings improvements.
 
New Release:
All the layers (STM8 Bike Controller, ESP32 board and Android App) should be updated.
As usual all the files could be downloaded from https://github.com/TSDZ2-ESP32/TSDZ2-ESP32-Wiki/tree/master/bin
Tour1.jpg

The main new features are:

Motor optimizations:
+ PWM Freq at 19Khz
+ better rotor interpolation (Hall sensor detection runs at 38Khz, twice the PWM freq) -> better field alignment and less current ripple.
+ Updated motor svm_table according to new PWM frequency and to upper bound of TIM1 counter
+ Variable Max Field Weakening angle based on motor speed
+ Higher Power Assist multiplier resolution (2% instead of 10%)

Android App:
+ Override Street mode (long press Street Mode icon on main dashboard)
+ New Max speed cfg parameters
+ New Power assist multipliers
 
PandaYeti said:
vass said:
E-bike lover said:
Hi guys
I am interested in this pcb too but I have just found this post after searching for months. Probably others couldn't find this post too and will be better to add these kind of pages(optimisation for tsdz2) to github.
I have a idea to improve this pcb and that is by adding gps and sim function to it so that the bike could be traceable. Anyone has any idea how to make it?
Also, it would be nice if someone could sell me 1/2 pcb in a reasonable price in EU :D

hello, VelOtto has 2 pcbs, i was going to buy 2 but you can take one of them (PM him).
I also got 2 spare ones. I think I paid to much taxes though, which made them more expensive, still trying to figure out why.

Are u living in Europe? If yes, then u don't have to paid tax under 150euro. U only have to paid the shipping fee and it should ost u around 5euro only. How much did u paid for the pcb in total?(should be under 50usd)
 
E-bike lover said:
PandaYeti said:
vass said:
E-bike lover said:
Hi guys
I am interested in this pcb too but I have just found this post after searching for months. Probably others couldn't find this post too and will be better to add these kind of pages(optimisation for tsdz2) to github.
I have a idea to improve this pcb and that is by adding gps and sim function to it so that the bike could be traceable. Anyone has any idea how to make it?
Also, it would be nice if someone could sell me 1/2 pcb in a reasonable price in EU :D

hello, VelOtto has 2 pcbs, i was going to buy 2 but you can take one of them (PM him).
I also got 2 spare ones. I think I paid to much taxes though, which made them more expensive, still trying to figure out why.

Are u living in Europe? If yes, then u don't have to paid tax under 150euro. U only have to paid the shipping fee and it should ost u around 5euro only. How much did u paid for the pcb in total?(should be under 50usd)

If they came from outside Europe you should have to pay, here in Portugal i would pay 25% over the price of the item+shipping (yeah its stupid like hell to combine postage costs...)
 
mspider65 said:
New Release:
All the layers (STM8 Bike Controller, ESP32 board and Android App) should be updated.
As usual all the files could be downloaded from https://github.com/TSDZ2-ESP32/TSDZ2-ESP32-Wiki/tree/master/bin
Tour1.jpg

The main new features are:

Motor optimizations:
+ PWM Freq at 19Khz
+ better rotor interpolation (Hall sensor detection runs at 38Khz, twice the PWM freq) -> better field alignment and less current ripple.
+ Updated motor svm_table according to new PWM frequency and to upper bound of TIM1 counter
+ Variable Max Field Weakening angle based on motor speed
+ Higher Power Assist multiplier resolution (2% instead of 10%)

Android App:
+ Override Street mode (long press Street Mode icon on main dashboard)
+ New Max speed cfg parameters
+ New Power assist multipliers

Niceeeee, also nice ride and view :)
 
Hi!
I installed this PCB today, running with last firmware (esp32 v1.1.2 and controller v7) and android app v2.1.3
I have 48v motor and 48v battery (13s5p).
I can´t set Battery cell overvoltage and Battery cell all bars, it does not save the values that i input in the app, it revert to mutch lower values and the display shows E08 - battery overvoltage.
Can someone confirm this error?
 
Already see that this is a bug with 2.1.2 and 2.1.3 Android app.
With Android app 2.1.1 I was able to introduce the correct values for Battery cell overvoltage, it should be around 4.2V or 420 mV x 10, but with latest App it is out of the range, looks like it is expecting a overvoltage value for the pack, which is around 54.6V (Vx10=546) for 13S battery.
Same behavior with Battery cell All bars field.
 
sp1n4d0 said:
Already see that this is a bug with 2.1.2 and 2.1.3 Android app.
With Android app 2.1.1 I was able to introduce the correct values for Battery cell overvoltage, it should be around 4.2V or 420 mV x 10, but with latest App it is out of the range, looks like it is expecting a overvoltage value for the pack, which is around 54.6V (Vx10=546) for 13S battery.
Same behavior with Battery cell All bars field.

Yes, there is a bug introduced in the v2.1.2.
I have released a new version v2.1.4 with the fix.
https://github.com/TSDZ2-ESP32/TSDZ2-ESP32-Wiki/blob/master/bin/Android/TSDZ2_ESP32v2.1.4.apk
 
mspider65 said:
sp1n4d0 said:
Already see that this is a bug with 2.1.2 and 2.1.3 Android app.
With Android app 2.1.1 I was able to introduce the correct values for Battery cell overvoltage, it should be around 4.2V or 420 mV x 10, but with latest App it is out of the range, looks like it is expecting a overvoltage value for the pack, which is around 54.6V (Vx10=546) for 13S battery.
Same behavior with Battery cell All bars field.

Yes, there is a bug introduced in the v2.1.2.
I have released a new version v2.1.4 with the fix.
https://github.com/TSDZ2-ESP32/TSDZ2-ESP32-Wiki/blob/master/bin/Android/TSDZ2_ESP32v2.1.4.apk
wow that was fast [emoji57], thank you!
I'll test ride it this weekend.
 
@bart594 I sent you a PM. It would be nice to start a new thread with your changes to the color LCD
bart594 said:
here you will find compiled firmware files (lcd and controller) with compatible android app
https://github.com/bart594/Color_LCD/releases/tag/20.1.15

@mspider: I would be interested in adjusting your code to make the ESP32 compatible with the SW102. Bart made it such that he did not use the ESP32 at all (as far as I understood). I.e. I would like to make the ESP32 "talk" to the SW102 display. I think it should be not too difficult, seeing that the protocol is the same as the motor actually uses. But not knowing your code, it's somewhat difficult to start, would you be willing to help?

Also I would be interested in a board, if someone still has one available in Europe (NL). Otherwise, I could order another batch.
 
daenny said:
@mspider: I would be interested in adjusting your code to make the ESP32 compatible with the SW102. Bart made it such that he did not use the ESP32 at all (as far as I understood). I.e. I would like to make the ESP32 "talk" to the SW102 display. I think it should be not too difficult, seeing that the protocol is the same as the motor actually uses. But not knowing your code, it's somewhat difficult to start, would you be willing to help?

Hi daenny,
i don't have a SW102 and i don't have in plan to buy one, but it shouldn't be difficult to make the SW compatible with the SW102.
Actually the ESP32 uses the 0.20beta protocol to talk to the motor and on the LCD side, uses the OEM LCD protocol (really similar to the 0.20beta LCD protocol).
You should look into tsdz_data.c and tsdz_uart.c source files.
The raw protocol is managed by the tsdz_uart.c. The main function is tsdz_uart_task that receive and sends the raw data from the serial lines. The function processLcdMessage is called when a correct LCD message is received and the getLcdMessage function is called when a new LCD message should be sent to the LCD.
 
mspider65 said:
I don't quite remember if I changed anything in the protocol, but it should probably work. Try and let me know.
Also try the new version that I am publishing now. I am confident that the new release brings improvements.

Just tried the new firmware. It's awesome!! Couldn't take it to the real test yet (regarding heat) but it fells great!
Thanks for implementing the override Street mode by the way ;)
 
E-bike lover said:
Are u living in Europe? If yes, then u don't have to paid tax under 150euro. U only have to paid the shipping fee and it should ost u around 5euro only. How much did u paid for the pcb in total?(should be under 50usd)
Yeah, had to pay 16% tax and I had to pay DHL an extra 12,5 Eur because they payed the tax upfront....
Total is 37eur /pcb. Still got one left in case someone is interested!
 
mspider65 said:
Hi daenny,
i don't have a SW102 and i don't have in plan to buy one, but it shouldn't be difficult to make the SW compatible with the SW102.
Actually the ESP32 uses the 0.20beta protocol to talk to the motor and on the LCD side, uses the OEM LCD protocol (really similar to the 0.20beta LCD protocol).
You should look into tsdz_data.c and tsdz_uart.c source files.
The raw protocol is managed by the tsdz_uart.c. The main function is tsdz_uart_task that receive and sends the raw data from the serial lines. The function processLcdMessage is called when a correct LCD message is received and the getLcdMessage function is called when a new LCD message should be sent to the LCD.

Thanks for your hints. I managed to reproduce at least having the display directly attached to the motor and get the first values out of it. However it's using the forks that @bart made himself for the controller. It seems he changed the protocol. Also his fork of the app is not working on my phone.
So my plan would be to adjust only the SW102 code and make that compatible with your app and your controller code. So then people having the SW102 would not need the esp32.
 
daenny said:
So my plan be to adjust only the SW102 code and make that compatible with your app and your controller code. So then people having the SW102 would not need the esp32.
This is a good idea, I always wanted SW102 with a mobile app and since it has Bluetooth.

For wireless EBike standard I am developing, I use the same Bluetooth microcontroller of SW102, so, if you do this mean in future I will be able to reuse and use this mobile app, Wich would be great!!
 
casainho said:
daenny said:
So my plan be to adjust only the SW102 code and make that compatible with your app and your controller code. So then people having the SW102 would not need the esp32.
This is a good idea, I always wanted SW102 with a mobile app and since it has Bluetooth.

For wireless EBike standard I am developing, I use the same Bluetooth microcontroller of SW102, so, if you do this mean in future I will be able to reuse and use this mobile app, Wich would be great!!
Yes, it whould be nice to have the possibility to use directly the SW102 for those who do not want to do hardware modifications to the motor controller.
It will be also fine if the Android app could be used for your project.
 
damn Casainho and mspider on the same place :). Tongsheng should just get you guys onboard and do a tsdz3 with your ideias and code (and some mods for thermal stuff) and have a damn nice motor from factory (a factory could do this with 50 euros or less i would say)
 
vass said:
damn Casainho and mspider on the same place :). Tongsheng should just get you guys onboard and do a tsdz3 with your ideias and code (and some mods for thermal stuff) and have a damn nice motor from factory (a factory could do this with 50 euros or less i would say)
Wireless EBike standard will be ready to implement on any other motor. I wish others brands could make a better mid drive torque sensor motor, relatively cheap and with cheap repair parts also, yes, like TSDZ2 but with belts to be more silent. I would prefer even a less powerful motor to be smaller and lighter. And also a bigger version, maybe with 1.5Kw.
 
casainho said:
vass said:
damn Casainho and mspider on the same place :). Tongsheng should just get you guys onboard and do a tsdz3 with your ideias and code (and some mods for thermal stuff) and have a damn nice motor from factory (a factory could do this with 50 euros or less i would say)
Wireless EBike standard will be ready to implement on any other motor. I wish others brands could make a better mid drive torque sensor motor, relatively cheap and with cheap repair parts also, yes, like TSDZ2 but with belts to be more silent. I would prefer even a less powerful motor to be smaller and lighter. And also a bigger version, maybe with 1.5Kw.

Yeah, a BBSHD with torque sensor, altough expensive could be a good thing (basicaly an ultra for diy), maybe the Lightest ebike kit will be good enough.
But tongsheng could do it very easly with the help off you guys, some thermal pads and a temperature sensor and a pcb with bluetooth would make the motor way better from factory.
 
daenny said:
mspider65 said:
Hi daenny,
i don't have a SW102 and i don't have in plan to buy one, but it shouldn't be difficult to make the SW compatible with the SW102.
Actually the ESP32 uses the 0.20beta protocol to talk to the motor and on the LCD side, uses the OEM LCD protocol (really similar to the 0.20beta LCD protocol).
You should look into tsdz_data.c and tsdz_uart.c source files.
The raw protocol is managed by the tsdz_uart.c. The main function is tsdz_uart_task that receive and sends the raw data from the serial lines. The function processLcdMessage is called when a correct LCD message is received and the getLcdMessage function is called when a new LCD message should be sent to the LCD.

Thanks for your hints. I managed to reproduce at least having the display directly attached to the motor and get the first values out of it. However it's using the forks that @bart made himself for the controller. It seems he changed the protocol. Also his fork of the app is not working on my phone.
So my plan would be to adjust only the SW102 code and make that compatible with your app and your controller code. So then people having the SW102 would not need the esp32.

The 'bart' app is not signed so you have to install the app on your phone with adb
 
Back
Top