New TSDZ2 Open Source firmware with Bluetooth interface

Elinx said:
so with 60 degrees rise there is no problem with regulations.
:?:
The raise must not be more than 20 degrees (at test conditions from 25°C to max. 45°C) - as far as I understood.

Elinx said:
The same is for a higher Voltage from battery. With the same power there is a lower current through the engine coils and less temperature rise.
:?:
Still valid is:
P = U * I
So there is theoretically still the same copper loss (i.e. raise of temperature).
 
Beli said:
......
The raise must not be more than 20 degrees (at test conditions from 25°C to max. 45°C) - as far as I understood.
....
Still valid is:
P = U * I
...
I tried to explain continous power the simple way. It wasn't meant to start a discussion in this BT thread.
It could be an interesting discussion too, but this thread isn't the place for that. Only correct me if my explanation is wrong.

As answer on your remarks, my opinion.
The max. power isn't defined, so a rise of more than 20 degrees is imho overheating and could only be there for a (again not defined) short time. (NB. this is measured on the bare motor. The temperature on the housing outside will be lower,)
P=U*I, so with a higher Voltage at same power you got a higher rpm with lower current, which means imho an altered ratio between kinetic energy and heat.
 
fietstasss said:
Anyone has one or multiple assembled PCBs left for sending to the Netherlands?

I also needed a couple of PCB for a friend, but due to the global chip shortage, the current v3 cannot be ordered.
I then created a new PCB version (v4) which uses the currently available chips.
The new PCBs have already been shipped and are on their way.
As soon as they arrive I will test them and hopefully I will publish the new version of the PCB.
Furthermore, if the test goes well, I will have two spare PCBs available for those interested (one v3 and one v4 PCB)

TSDZ2_ESP32_V4_3D_up.png
 
mspider65 said:
I then created a new PCB version (v4) which uses the currently available chips.
Would be interesting which DC/DC controller chip you are using now. The LM5166 seems to be rather sensitive anyway (burned one of my PCBs completely...).
 
Beli said:
mspider65 said:
I then created a new PCB version (v4) which uses the currently available chips.
Would be interesting which DC/DC controller chip you are using now. The LM5166 seems to be rather sensitive anyway (burned one of my PCBs completely...).
LM5166 has a nominal input voltage of up to 65V and Texas Instruments are usually high quality components. If it burned out, it should have received a too high voltage (possibly electrostatic discharge).
The v4 uses the Chinese XLSEMI XL7005A, the same used on the TSDZ2 controller board. It is rated up to 80V input voltage.
 
mspider65 said:
LM5166 has a nominal input voltage of up to 65V and Texas Instruments are usually high quality components. If it burned out, it should have received a too high voltage (possibly electrostatic discharge).
It happened while plugging in the VLCD5 - with battery not being disconnected.
Also the turning on transistor in the VLCD5 burned. I guess it happened because the plug might have had contact with battery plus and the switching line before ground had contact and a too high current flow through the turning on pin of LM5166. A resistor in that line might prevent that.
mspider65 said:
The v4 uses the Chinese XLSEMI XL7005A, the same used on the TSDZ2 controller board. It is rated up to 80V input voltage.
Interesting - thank you.
 
Beli said:
It happened while plugging in the VLCD5 - with battery not being disconnected.
Also the turning on transistor in the VLCD5 burned. I guess it happened because the plug might have had contact with battery plus and the switching line before ground had contact and a too high current flow through the turning on pin of LM5166. A resistor in that line might prevent that.

Strange, because the LM5166 Enable pin is a MOS input that doesn't sink current.
However, if this is the cause, it should no longer happen with the v4 as the XL7005A has an active low Enable which is connected to an external NMOS driven by the switching line through a high value resistor.
On the other hand the v4 has a slightly worse DC/DC conversion efficiency but it will be a better choice for those with a 14s battery as in that case with the v3 you only have about 5v of headroom.

P.S:
The V4 boards arrived yesterday and the preliminary tests went well. In the next days I will complete the tests and if all goes well I will publish the files on Github.
 
Hi @mspider65;
I would like to build your board, but as I have for most of the chips similar ones already available, I will not be able to use your nice and small pcb, but something more clunky...

Therefor I have the following questions:
- Will your code / the board still work, if I will not use U4 (TMP112AIDRLR), the PCB Temp sensor?
- You are using 2 different types of chips for the level shifting of TX & RX (U5 vs U6&U7). Is there a reason for that other than available space on the PCB? I have a TXB0108 chip (8 channel bi-directional level shifter) available. Could that work as well for all RX / TX shifting?

Other than that - thank you for this great project!
 
endlessolli said:
Will your code / the board still work, if I will not use U4 (TMP112AIDRLR), the PCB Temp sensor?
I may answer: yes because it's not essential.

endlessolli said:
You are using 2 different types of chips for the level shifting of TX & RX (U5 vs U6&U7). Is there a reason for that
There is a simple reason: two different directions.

endlessolli said:
I have a TXB0108 chip (8 channel bi-directional level shifter) available. Could that work as well for all RX / TX shifting?
I 'm not sure if the auto direction sensing will work correctly or as needed. This circuit is intended for different use.
 
Beli said:
endlessolli said:
Will your code / the board still work, if I will not use U4 (TMP112AIDRLR), the PCB Temp sensor?
I may answer: yes because it's not essential.

endlessolli said:
You are using 2 different types of chips for the level shifting of TX & RX (U5 vs U6&U7). Is there a reason for that
There is a simple reason: two different directions.

endlessolli said:
I have a TXB0108 chip (8 channel bi-directional level shifter) available. Could that work as well for all RX / TX shifting?
I 'm not sure if the auto direction sensing will work correctly or as needed. This circuit is intended for different use.

Thank you for the feedback.
I would still very much like to also hear @mspider65 's judgement on this.
Especially wrt if the whole thing still works, if I leave the boards temp sensor TMP112AIDRLR (not the motor-sensor) out.

Reason I am asking is that when I stumbled through the code (I am a noob wrt programming), I saw this:
Code:
    if (err != ESP_OK) {
        ESP_LOGW(TAG,"TMP112 sensor not found: %d", err);
        i2c_cmd_link_delete(cmd);
        return;
    }
So the code checks, if the sensor is present.
But I don't understand enough from coding to judge if this is just a warning, or if this inhibits otherwise normal funcion of the board / code.

-> So, feedback would be highly appreciated.
 
endlessolli said:
Especially wrt if the whole thing still works, if I leave the boards temp sensor TMP112AIDRLR (not the motor-sensor) out.
Yes, I can confirm that everything works even without the TMP1XX sensor installed.

endlessolli said:
You are using 2 different types of chips for the level shifting of TX & RX (U5 vs U6&U7). Is there a reason for that
One is for 5V to 3.3V conversion and the other for 3.3V to 5V conversion. But in the new version I have used two SN74LVC2G17 for both conversion since I verified that the 3.3V output of the ESP32 is able to drive the inputs of the SN74LVC2G17 powered at 5V.

endlessolli said:
I have a TXB0108 chip (8 channel bi-directional level shifter) available. Could that work as well for all RX / TX shifting?
It should work but sometimes these types of circuits have problems. To be sure the only way is to try.
 
mspider65 said:
endlessolli said:
Especially wrt if the whole thing still works, if I leave the boards temp sensor TMP112AIDRLR (not the motor-sensor) out.
Yes, I can confirm that everything works even without the TMP1XX sensor installed.

endlessolli said:
You are using 2 different types of chips for the level shifting of TX & RX (U5 vs U6&U7). Is there a reason for that
One is for 5V to 3.3V conversion and the other for 3.3V to 5V conversion. But in the new version I have used two SN74LVC2G17 for both conversion since I verified that the 3.3V output of the ESP32 is able to drive the inputs of the SN74LVC2G17 powered at 5V.

endlessolli said:
I have a TXB0108 chip (8 channel bi-directional level shifter) available. Could that work as well for all RX / TX shifting?
It should work but sometimes these types of circuits have problems. To be sure the only way is to try.

Great - thank you!
I will report back once I have put it together.
 
mspider65 said:
But in the new version I have used two SN74LVC2G17 for both conversion since I verified that the 3.3V output of the ESP32 is able to drive the inputs of the SN74LVC2G17 powered at 5V.
I'm using even only one Schmitt-Trigger circuit powered by 5V (which excepts 3.3V Input high level) for both directions. Towards the ESP32 I simply use a resistor voltage divider.

Theoretically no circuit is needed at all. Towards the ESP32 just a resistor voltage divider should be enough (I added the buffer for safety reasons), from the ESP32 the 3.3V level obviously works too, at least if I remember correctly casainho is using ii this way in his wireless version.
 
Beli said:
I'm using even only one Schmitt-Trigger circuit powered by 5V (which excepts 3.3V Input high level) for both directions. Towards the ESP32 I simply use a resistor voltage divider.

Theoretically no circuit is needed at all. Towards the ESP32 just a resistor voltage divider should be enough (I added the buffer for safety reasons), from the ESP32 the 3.3V level obviously works too, at least if I remember correctly casainho is using ii this way in his wireless version.

Yes a reistor voltage divider works well, but in the other direction, a 5v buffer/driver is useful not only for safety reason but also to have a better connection reliability.
The cable that goes to the display is quite long an the noise margin using a 3.3v driver and a 5v receiver is small and, even though the cable going to the controller is short, it is still in a noisy environment with quite high currents switching at PWM frequency.
 
Sorry for took so many time to link this project on the wiki. Finally I did a relevant update to the project and so finally I added links to other projects:



I were betting on TSDZ2 fully wireless (and I reused this project mobile app) using a wireless remote but I found it was very frustrating having only a LED to give feedback for user, like to see battery SOC user would need to count LED blinks.
I decided to move back again for very small display but reusing the TSDZ2 wireless hardware + using the SW102 display firmware we did developed, so the final result is a DIY simple display, that still has Bluetooth and ANT wireless connection.

Anyway, it is very interesting to see such different approaches for TSDZ2 motor.
 
endlessolli said:
Great - thank you!
I will report back once I have put it together.

Another small obstacle - hope again on help from @mspider65 ...
If I follow your instructions in the github wiki for flashing, I get an error that the esptool.exe can not be executed.
I assume this is because I use an old 32bit Window 10 Tablet for this (and I assume the exe is a 64bit version?)

So I searched and found a esptool.exe for 32 bit version (from igrr's github) , which I used to replace the one in your esptool.zip
But still no luck - now the batch file complains about the arguments passed on.
(I checked and the esptool <arguments> syntax is different, if I compare what you use vswhat igor uses; for example -p vs -cd and others)

-> Long story short: Could you provide a 32 bit Version of the esptool.exe you are using?
 
OK - still very interested in the above question wrt 32 bit ESPTool version, but for now I did the upload on my std. 64 bit PC and it worked!
But... next problem:
My (older) Android Phone sees the device ('TSDZ2_ESP32'), when I am in the phones bluetooth settings - and I also can pair it (within the Phones settings via 123456), but - the App itself does not see the paired device:
When I go to 'Setup Bluetooth' within the App and Scan: Nothing. :-(
(I also tried to unpair it on the phones settings level and then try to see it via the App / scan function - no luck)

My phone is running lineageOS 17.1 (Android 10) and the phone has Bluetooth 4.0 capabilities (Its an old Moto G 2015 'osprey').
I tried multiple App versions from TSDZ2_ESP32v2.0.1 to TSDZ2_ESP32v2.1.11
(My day to day phone is an iPhone, so I am not soo familiar w/ Androir, but I think it tried everything, including allowing contacts etc...)

Any ideas?

This is what I get from the esp via serial, when I pair the ESP via the phones bluetooth settings:
Code:
I (111322) tsdz_bt: T ESP_GATTS_CONNECT_EVT, conn_id = 0
I (111322) tsdz_bt: C ESP_GATTS_CONNECT_EVT, conn_id = 0
I (111792) tsdz_bt: The passkey Notify number:123456
I (111852) tsdz_bt: update connection params status = 0, min_int = 32, max_int =                                                 48,conn_int = 48,latency = 0, timeout = 400
W (136142) BT_SMP: FOR LE SC LTK IS USED INSTEAD OF STK
I (136392) tsdz_bt: key type = ESP_LE_KEY_LENC
I (136392) tsdz_bt: key type = ESP_LE_KEY_PENC
I (136392) tsdz_bt: key type = ESP_LE_KEY_LID
I (136802) tsdz_bt: key type = ESP_LE_KEY_PID
I (136802) tsdz_bt: remote BD_ADDR: 7422cee11ab3
I (136802) tsdz_bt: address type = 1
I (136812) tsdz_bt: pair status = success
I (136812) tsdz_bt: auth mode = ESP_LE_AUTH_REQ_SC_MITM_BOND
I (137652) tsdz_bt: update connection params status = 0, min_int = 0, max_int =                                                 0,conn_int = 6,latency = 0, timeout = 500
I (138182) tsdz_bt: update connection params status = 0, min_int = 0, max_int =                                                 0,conn_int = 48,latency = 0, timeout = 400
 
endlessolli said:
endlessolli said:
Great - thank you!
I will report back once I have put it together.

Another small obstacle - hope again on help from @mspider65 ...
If I follow your instructions in the github wiki for flashing, I get an error that the esptool.exe can not be executed.
I assume this is because I use an old 32bit Window 10 Tablet for this (and I assume the exe is a 64bit version?)

So I searched and found a esptool.exe for 32 bit version (from igrr's github) , which I used to replace the one in your esptool.zip
But still no luck - now the batch file complains about the arguments passed on.
(I checked and the esptool <arguments> syntax is different, if I compare what you use vswhat igor uses; for example -p vs -cd and others)

-> Long story short: Could you provide a 32 bit Version of the esptool.exe you are using?

The original esptool is a python script.
I just provided a dummy-proof one click executable version.
You could just install a python interpreter an use the original esptool script.
https://github.com/espressif/esptool
 
endlessolli said:
OK - still very interested in the above question wrt 32 bit ESPTool version, but for now I did the upload on my std. 64 bit PC and it worked!
But... next problem:
My (older) Android Phone sees the device ('TSDZ2_ESP32'), when I am in the phones bluetooth settings - and I also can pair it (within the Phones settings via 123456), but - the App itself does not see the paired device:
When I go to 'Setup Bluetooth' within the App and Scan: Nothing. :-(
(I also tried to unpair it on the phones settings level and then try to see it via the App / scan function - no luck)

My phone is running lineageOS 17.1 (Android 10) and the phone has Bluetooth 4.0 capabilities (Its an old Moto G 2015 'osprey').
I tried multiple App versions from TSDZ2_ESP32v2.0.1 to TSDZ2_ESP32v2.1.11
(My day to day phone is an iPhone, so I am not soo familiar w/ Androir, but I think it tried everything, including allowing contacts etc...)

Any ideas?

This is what I get from the esp via serial, when I pair the ESP via the phones bluetooth settings:
Code:
I (111322) tsdz_bt: T ESP_GATTS_CONNECT_EVT, conn_id = 0
I (111322) tsdz_bt: C ESP_GATTS_CONNECT_EVT, conn_id = 0
I (111792) tsdz_bt: The passkey Notify number:123456
I (111852) tsdz_bt: update connection params status = 0, min_int = 32, max_int =                                                 48,conn_int = 48,latency = 0, timeout = 400
W (136142) BT_SMP: FOR LE SC LTK IS USED INSTEAD OF STK
I (136392) tsdz_bt: key type = ESP_LE_KEY_LENC
I (136392) tsdz_bt: key type = ESP_LE_KEY_PENC
I (136392) tsdz_bt: key type = ESP_LE_KEY_LID
I (136802) tsdz_bt: key type = ESP_LE_KEY_PID
I (136802) tsdz_bt: remote BD_ADDR: 7422cee11ab3
I (136802) tsdz_bt: address type = 1
I (136812) tsdz_bt: pair status = success
I (136812) tsdz_bt: auth mode = ESP_LE_AUTH_REQ_SC_MITM_BOND
I (137652) tsdz_bt: update connection params status = 0, min_int = 0, max_int =                                                 0,conn_int = 6,latency = 0, timeout = 500
I (138182) tsdz_bt: update connection params status = 0, min_int = 0, max_int =                                                 0,conn_int = 48,latency = 0, timeout = 400

Probably the ESP32 board is already connected.
When connected it isn't discoverable.
 
mspider65 said:
endlessolli said:
OK - still very interested in the above question wrt 32 bit ESPTool version, but for now I did the upload on my std. 64 bit PC and it worked!
But... next problem:
My (older) Android Phone sees the device ('TSDZ2_ESP32'), when I am in the phones bluetooth settings - and I also can pair it (within the Phones settings via 123456), but - the App itself does not see the paired device:
When I go to 'Setup Bluetooth' within the App and Scan: Nothing. :-(
(I also tried to unpair it on the phones settings level and then try to see it via the App / scan function - no luck)

My phone is running lineageOS 17.1 (Android 10) and the phone has Bluetooth 4.0 capabilities (Its an old Moto G 2015 'osprey').
I tried multiple App versions from TSDZ2_ESP32v2.0.1 to TSDZ2_ESP32v2.1.11
(My day to day phone is an iPhone, so I am not soo familiar w/ Androir, but I think it tried everything, including allowing contacts etc...)

Any ideas?

This is what I get from the esp via serial, when I pair the ESP via the phones bluetooth settings:
Code:
I (111322) tsdz_bt: T ESP_GATTS_CONNECT_EVT, conn_id = 0
I (111322) tsdz_bt: C ESP_GATTS_CONNECT_EVT, conn_id = 0
I (111792) tsdz_bt: The passkey Notify number:123456
I (111852) tsdz_bt: update connection params status = 0, min_int = 32, max_int =                                                 48,conn_int = 48,latency = 0, timeout = 400
W (136142) BT_SMP: FOR LE SC LTK IS USED INSTEAD OF STK
I (136392) tsdz_bt: key type = ESP_LE_KEY_LENC
I (136392) tsdz_bt: key type = ESP_LE_KEY_PENC
I (136392) tsdz_bt: key type = ESP_LE_KEY_LID
I (136802) tsdz_bt: key type = ESP_LE_KEY_PID
I (136802) tsdz_bt: remote BD_ADDR: 7422cee11ab3
I (136802) tsdz_bt: address type = 1
I (136812) tsdz_bt: pair status = success
I (136812) tsdz_bt: auth mode = ESP_LE_AUTH_REQ_SC_MITM_BOND
I (137652) tsdz_bt: update connection params status = 0, min_int = 0, max_int =                                                 0,conn_int = 6,latency = 0, timeout = 500
I (138182) tsdz_bt: update connection params status = 0, min_int = 0, max_int =                                                 0,conn_int = 48,latency = 0, timeout = 400

Probably the ESP32 board is already connected.
When connected it isn't discoverable.

Unfortunately, no.
When it is being paired through the phone's bluetooth settings (like I described above), I see in the App still the grey crossed out bluetooth icon. Also, in the App's bluetooth settings, it states 'No device selected'.
Finally, also no communication towards Motor or Display is visible through the App.

Any further ideas would be highly welcome; I am also open for doing / helping with troubleshooting or root cause finding of this BT problem. (I also just saw a potentially related issue raised on your Github page? 'Bluetooth 4.2 pairing issue')
 
Update: After a couple of reboots of the phone and various BT option toggles - it suddenly worked!
Amazing stuff, @mspider65!

(So far, the ESP32 (development board) is running standalone, as I am still waiting on the ESP board I am planning to use for the bike. Will update
 
mspider65 said:
endlessolli said:
endlessolli said:
Great - thank you!
I will report back once I have put it together.
....
-> Long story short: Could you provide a 32 bit Version of the esptool.exe you are using?

The original esptool is a python script.
I just provided a dummy-proof one click executable version.
You could just install a python interpreter an use the original esptool script.
https://github.com/espressif/esptool

Thanks - that worked well.
 
Back
Top