BT Interface for TSDZ2 Open Source firmware - Work in progress

Electric Motors and Controllers
mspider65   100 W

100 W
Posts: 169
Joined: Aug 04 2019 2:10pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by mspider65 » Apr 03 2021 9:59am

AZUR wrote:
Apr 03 2021 7:20am
Hi Mspider65,

I have one more question about the PCB-ESP32.

There are 2 types of fixed IPEX. IPEX1 and IPEX4 for the antenna.

IPX1.jpg

Which one fits the PCB?

Can you send me the aliexpress link where you bought it?

Was it on aliexpress or was it on another website?

Thanks

Azur
10pcs 2.4G wifi receiver antenna Bluetooth remote control model aircraft antenna built-in gold-plated silver plated ipx

https://a.aliexpress.com/_uGlK3B

AZUR   100 W

100 W
Posts: 209
Joined: Apr 05 2018 6:52am

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by AZUR » Apr 03 2021 10:25am

mspider65 wrote:
Apr 03 2021 9:59am
AZUR wrote:
Apr 03 2021 7:20am
Hi Mspider65,

....

Was it on aliexpress or was it on another website?

Thanks

Azur
10pcs 2.4G wifi receiver antenna Bluetooth remote control model aircraft antenna built-in gold-plated silver plated ipx

https://a.aliexpress.com/_uGlK3B
Thanks Mspider.

According to the specification of the PCB plug, U.FL-R-SMT-1 (80),
It's IPEX1. With a diameter of 2.0mm in the male.
Plug mail Antenna U.FL-R-SMT-1(80).jpg
Plug mail Antenna U.FL-R-SMT-1(80).jpg (55.94 KiB) Viewed 1527 times
https://www.systemgear.net/products/det ... _id=22719

Azur

AZUR   100 W

100 W
Posts: 209
Joined: Apr 05 2018 6:52am

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by AZUR » Apr 04 2021 12:00pm

Hi Massimo,

Thank you for all the information you have given me

I will place the PCB on the outside of the motor between the motor housing and the display.

I am thinking of replacing the cable that comes out of the controller, to the display, with another cable with one more wire.

This cable goes to the box where I will put the PCB. Then a cable will come out of the PCB box to the display.

I made a diagram of the connections that is represented in the figure.
PCB wire.jpg
PCB wire.jpg (63.51 KiB) Viewed 1503 times
Can I do it like that?

Regards,

Azur

mspider65   100 W

100 W
Posts: 169
Joined: Aug 04 2019 2:10pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by mspider65 » Apr 04 2021 2:18pm

AZUR wrote:
Apr 04 2021 12:00pm
Hi Massimo,

Thank you for all the information you have given me

I will place the PCB on the outside of the motor between the motor housing and the display.

I am thinking of replacing the cable that comes out of the controller, to the display, with another cable with one more wire.

This cable goes to the box where I will put the PCB. Then a cable will come out of the PCB box to the display.

I made a diagram of the connections that is represented in the figure.

PCB wire.jpg

Can I do it like that?

Regards,

Azur
No you can't.
The +batt green wire cannot be connected to the DS18B20 themperatiure sensor. It will be burned. +Batt is at battery voltage.

AZUR   100 W

100 W
Posts: 209
Joined: Apr 05 2018 6:52am

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by AZUR » Apr 04 2021 2:37pm

mspider65 wrote:
Apr 04 2021 2:18pm
AZUR wrote:
Apr 04 2021 12:00pm
Hi Massimo,

....

I made a diagram of the connections that is represented in the figure.

PCB wire.jpg

Can I do it like that?

Regards,

Azur
No you can't.
The +batt green wire cannot be connected to the DS18B20 themperatiure sensor. It will be burned. +Batt is at battery voltage.
Thanks.

So I have to put one more wire for the VDD.

Can I use Ground wire from the display cable?

Beli   1 W

1 W
Posts: 55
Joined: Dec 07 2020 5:08pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by Beli » Apr 04 2021 3:20pm

I finally have my display with ESP32 working.
It's inside a sealed weather resistant ASA 3D print including anti-reflective glas, haptic feedback motor and a battery buffered real time clock and break connectors, display directly plugged at the motor. Dimensions only 74x45x16mm. Still more program coding to do, like Bluetooth connection to Smart BMS...
Attachments
Display1.jpg
Display1.jpg (82.44 KiB) Viewed 1490 times
Display2.jpg
Display2.jpg (102.98 KiB) Viewed 1490 times
Display3.jpg
Display3.jpg (182.84 KiB) Viewed 1490 times
Display4.jpg
Display4.jpg (43.08 KiB) Viewed 1490 times
Display5.jpg
Display5.jpg (47.54 KiB) Viewed 1490 times

mspider65   100 W

100 W
Posts: 169
Joined: Aug 04 2019 2:10pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by mspider65 » Apr 04 2021 3:31pm

AZUR wrote:
Apr 04 2021 2:37pm

Thanks.

So I have to put one more wire for the VDD.

Can I use Ground wire from the display cable?
Yes Ground signal is a common reference.

mspider65   100 W

100 W
Posts: 169
Joined: Aug 04 2019 2:10pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by mspider65 » Apr 04 2021 3:33pm

Beli wrote:
Apr 04 2021 3:20pm
I finally have my display with ESP32 working.
It's inside a sealed weather resistant ASA 3D print including anti-reflective glas, haptic feedback motor and a battery buffered real time clock and break connectors, display directly plugged at the motor. Dimensions only 74x45x16mm. Still more program coding to do, like Bluetooth connection to Smart BMS...
Nice work.
Well done :thumb:

Beli   1 W

1 W
Posts: 55
Joined: Dec 07 2020 5:08pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by Beli » Apr 05 2021 6:54am

@mspider65

Thanks for your good work!

One part I want to ask: can you tell what the battery power filter with alpha calculates? Something like cos phi or eta for the motor? [Edit: no, just had a look again, it's only depending on former and new value]
And what I noticed now having the possibility to read pedal power directly on the display: without torque sensor calibration (and compensating non-linearity) the values are more random than real usable values.
Last edited by Beli on Apr 05 2021 7:09am, edited 1 time in total.

casainho   100 GW

100 GW
Posts: 5767
Joined: Feb 14 2011 2:43pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by casainho » Apr 05 2021 7:05am

Beli wrote:
Apr 04 2021 3:20pm
I finally have my display with ESP32 working.
It's inside a sealed weather resistant ASA 3D print including anti-reflective glas, haptic feedback motor and a battery buffered real time clock and break connectors, display directly plugged at the motor. Dimensions only 74x45x16mm. Still more program coding to do, like Bluetooth connection to Smart BMS...
Beautiful build!!
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

fietstasss   100 µW

100 µW
Posts: 9
Joined: Dec 08 2020 1:41pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by fietstasss » Apr 05 2021 7:38am

fietstasss wrote:
Apr 01 2021 3:54am
Thanks for your reply!

Indeed, the hall-sensor cables have been repaired, as i also suspected them from being broken.
As this didn't help, i also took away the plastic potting around the pcb and did a proper continuity-test on those cables, that all seems ok.

But, after your reply i went to the next step and tried to measure the hall-sensor as described here:
viewtopic.php?f=3&t=105444&p=1543436&hi ... l#p1543566

In short, i've placed 5v+ on the red wire, and GND on the black wire.
Then, through a 10K resisor, i applied the 5v also the my red measurement probe, and connected the black measurement-probe to GND.
I then measured the blue, green and yellow wire individually whilst rotating the motor axle.

Interpretation of the result is not very clear to me, it seems like the yellow one gives a bit of a strange result (only passing through 3.5v instead of 5v (can be seen from ~0.34s))

To enable you guys to check it, i've made movie of the results, what do you think?
To make it easier to speak about, order of measuring in video was Blue > Green > Yellow (both on connector and on motor)

Anyone with an idea about these Hall-Sensors? Is the yellow-wired one broken?

huan   10 µW

10 µW
Posts: 6
Joined: Apr 09 2021 9:38am

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by huan » Apr 09 2021 9:43am

Hello,
first of all a big thank you mspider and also other developers of tsdz2!
Ive ordered at pcbway and git a mail today.

Code: Select all

Hi,
Please find picture attached,positions U6,U7 component we purhcased as per part number#M74VHC1GT126DF1G component is smaller than pads in your deisgn , but can be soldered. Shall we go ahead ?
Pls change land pattern as per component datasheet in future orders.
I think thats not a problem, but i want to make sure and answer the mail after i got a reply here. Also an information for future orders.
Attachments
T-B2W357345A.jpg
T-B2W357345A.jpg (135.51 KiB) Viewed 1381 times

mspider65   100 W

100 W
Posts: 169
Joined: Aug 04 2019 2:10pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by mspider65 » Apr 09 2021 10:58am

huan wrote:
Apr 09 2021 9:43am
Hello,
first of all a big thank you mspider and also other developers of tsdz2!
Ive ordered at pcbway and git a mail today.

Code: Select all

Hi,
Please find picture attached,positions U6,U7 component we purhcased as per part number#M74VHC1GT126DF1G component is smaller than pads in your deisgn , but can be soldered. Shall we go ahead ?
Pls change land pattern as per component datasheet in future orders.
I think thats not a problem, but i want to make sure and answer the mail after i got a reply here. Also an information for future orders.
This the first time Pcbway give this warning. Since the component code is correct and all the previous orders went well, i think also it isn't a problem.

michih.   100 W

100 W
Posts: 103
Joined: Nov 11 2018 8:33am

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by michih. » Apr 16 2021 11:50am

@ mspider65 are you interested in a new infinion controller for the tsdz2?

MFG Michael

mspider65   100 W

100 W
Posts: 169
Joined: Aug 04 2019 2:10pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by mspider65 » Apr 17 2021 1:03am

michih. wrote:
Apr 16 2021 11:50am
@ mspider65 are you interested in a new infinion controller for the tsdz2?

MFG Michael
Thanks, but at the moment I have little free time that I could devote to the development of the Firmware for the new controller

Tsdz2Canyon   100 µW

100 µW
Posts: 9
Joined: Jun 30 2019 3:19am

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by Tsdz2Canyon » Apr 21 2021 2:20am

Pooyan wrote:
Mar 18 2021 1:08pm
pgwguk wrote:
Jun 05 2020 8:14am

I installed the board on an 8 pin controller, so slight difference on the colours referenced in the wiki - I can help to update this if needed.
I also have an 8 pin controller i.c.w. a VLCD5 display, do you have a schematic where i can see which colours you need for the connection BT PCB to controller?
Hi
My controller is also the 8pin version.
Could You post a schematic for it?
Or point me to the right direction...

Thanks

mspider65   100 W

100 W
Posts: 169
Joined: Aug 04 2019 2:10pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by mspider65 » Apr 21 2021 6:37am

Tsdz2Canyon wrote:
Apr 21 2021 2:20am

Hi
My controller is also the 8pin version.
Could You post a schematic for it?
Or point me to the right direction...

Thanks
https://opensourceebike.github.io/TSDZ2 ... ematic.png

Tsdz2Canyon   100 µW

100 µW
Posts: 9
Joined: Jun 30 2019 3:19am

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by Tsdz2Canyon » Apr 21 2021 8:43am

:oops: there it was!
Thank You

Beli   1 W

1 W
Posts: 55
Joined: Dec 07 2020 5:08pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by Beli » Apr 23 2021 1:17pm

@mspider65

I noticed that updating the STM8S firmware didn't work with my built display. Obviously it takes too long to power up the ESP32 at the module I use - longer than the available one second to trigger the STM8S bootloader.

I found now a different way. I used the free ui8_rx_buffer[5] from message ID 1 to initialise the STM8S reset command WWDG_SWReset()
With that when starting the firmware update from Android app it runs straight through without the need of powering off and on.
Maybe it would be something to include in any future release by you too.

mspider65   100 W

100 W
Posts: 169
Joined: Aug 04 2019 2:10pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by mspider65 » Apr 24 2021 1:25am

Beli wrote:
Apr 23 2021 1:17pm
@mspider65

I noticed that updating the STM8S firmware didn't work with my built display. Obviously it takes too long to power up the ESP32 at the module I use - longer than the available one second to trigger the STM8S bootloader.

I found now a different way. I used the free ui8_rx_buffer[5] from message ID 1 to initialise the STM8S reset command WWDG_SWReset()
With that when starting the firmware update from Android app it runs straight through without the need of powering off and on.
Maybe it would be something to include in any future release by you too.
Good idea! I did not know that the bootloader could also be activated with a soft reset.

Beli   1 W

1 W
Posts: 55
Joined: Dec 07 2020 5:08pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by Beli » Apr 24 2021 2:11pm

mspider65 wrote:
Apr 24 2021 1:25am
Good idea! I did not know that the bootloader could also be activated with a soft reset.
I was not sure about that too - just tried and it works.

casainho   100 GW

100 GW
Posts: 5767
Joined: Feb 14 2011 2:43pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by casainho » Apr 27 2021 3:53am

The TSDZ2 motor controller V2 is a way more capable hardware to implement FOC (ARM 32bits 64MHz VS STM8 8bits 16 MHz, and with added 3 motor phase current sensors), which will mean more efficiency motor control and less noise. Also the microcontroller manufacturer provides a ready code for FOC witth an application note documenting, so should be very fast to get it working!!

With TSDZ2 motor controller V2, there will be no need to do hall sensors calibrations and we can have sure to get the best efficiency possible and lowest noise.

The cost of the motor controller V2 is the same 35€ as old motor controller. The only thing that changes is the programmer to flash the firmware, that is the J-Link but is also very cheap as it costs 4€ on Ebay.

This is a call for help, because, if more developers help, I am pretty sure we can have the very first working version of the firmware in 1 month or less!

I just started the very initially firmware, here the repository: https://github.com/OpenSourceEBike/TSDZ ... troller_v2
We also have all the information about the hardware, like all datasheets and application notes of the new microcontrollers as also all other chips.

And building the very initial code:
Image
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

michih.   100 W

100 W
Posts: 103
Joined: Nov 11 2018 8:33am

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by michih. » Apr 27 2021 5:57am

I can confirm that, the engine was significantly quieter with the new controller. the original software is nowhere near as good as the V12!

MFG Michael

mspider65   100 W

100 W
Posts: 169
Joined: Aug 04 2019 2:10pm

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by mspider65 » Apr 29 2021 2:22am

New version released.
Everything must be updated, Android App, ESP32 and Controller.

The files are always on Github: https://github.com/TSDZ2-ESP32/TSDZ2-ES ... master/bin
- Android: TSDZ2_ESP32v2.1.9.apk
- ESP32: TSDZ2-ESP32-Mainv1.1.7.zip
- STM8: TSDZ2-v13.zip

This version contains mainly some fix to the Motor Controller.
In particular:
- the annoyng problem of the "power glitch" which rarely occurred is solved.
- removed potential overrun error in ADC buffered values read
- PWM frequency reduced to 18KHz
- PWM "Dead Time" increased from 1us to 1.5us

Regarding the "Dead Time" increase, i found the OEM Firmware uses a vales of 3,1us but the original OSF firmware used a value of only 1us. Dead time is a very delicate parameter and its incorrect setting can cause higher consumption and in the worst case serious overheating of the controller.
I only did a test ride of a couple of hours and my impression is that this intervention has further reduced the power consumption. I await your feedback for confirmation.

Blacklite   100 W

100 W
Posts: 140
Joined: Jan 30 2019 2:42am
Location: Brisbane

Re: BT Interface for TSDZ2 Open Source firmware - Work in progress

Post by Blacklite » Apr 30 2021 9:03am

Im wondering what the reasoning for the reduce to 18kHz PWM is? Is it timing given the extra instructions to read the ADC in the PWM interrupt?

Post Reply