TSDZ2 48v 2020 new firmware

Seems promising when we think about unifying the solutions for controllers difficult to convert into OSF solution. Disadvantage is external box in addition to motor itself. Then few simple questions:
- having TSDZ2B as example how to connect PAS and torque sensor?
- where the actual OSF code should be implemented: in the VESC controller i guess?
 
szkuba said:
Seems promising when we think about unifying the solutions for controllers difficult to convert into OSF solution. Disadvantage is external box in addition to motor itself. Then few simple questions:
- having TSDZ2B as example how to connect PAS and torque sensor?
- where the actual OSF code should be implemented: in the VESC controller i guess?
Yes, external box DIY is not the beautiful thing. Still, if anyone do and test the DIY solution, maybe then someone could try design a board based on the working DIY, to replace the original motor controller.

But focus on DIY first.

I am just starting with VESC. VESC can be used as a stand alone motor controller, where you send the command for target current and then motor will rotate. You do not need mich more commands than that.

Since VESC has both CAN and UART, I would use instead UART to send / receive the motor commands. Then, custom electronic board based on Arduino, would read the TSDDZ2 torque sensor and cadence sensor, have the EBike application and then send the data to the DIY display by one UART. On the second UART, this board would control the motor.

Yes, it is another board, another microcontroler, but being based on Arduino means it can be developed very fast and even probably kind of using some simulation of the EBike code. In fact, it could be the same code as firmware of TSDZ2, meaning then the display would work out of the box.

And I could use just the same system both for Bafang or TSDZ2, or any other EBike I guess.

The advantage?? The best motor eficiency and silent, and future prof for any other TSDZ2 motor controller or motor version!!
 
I connected an old VESC controller to the 48V TSDZ2 motor. VESC software were able to detect the motor characteristics (the inductance seems higher):

Technical characteristics of TSDZ2 electric motor:
- there are 2 different motors, one that is 36V and other 48V
- no load speed: 4000 RPM for both motors
- motor resistance: 36V motor has 0.094 ohm, 48V motor has 0.125 ohm
- motor inductance: 36V motor has 76uH, 48V motor has 135uH



I was tweaking the sensorless HFI silent mode and it seems to work well. I tried to block with pliers the motor shaft and I could feel the torque, although I did not tested it on the real EBike. I also did not connect the hall sensors as I am only interested on the sensorless mode.



On this short video, you can see the motor running. Note that the motor is very silent but because it was attached on the metal vice, the noise was kind of amplified:

[youtube]-gTcE93ApKA[/youtube]

 
I would like to share my latest work. As my EBike uses the Bafang M500 motor, there is no OpenSource firmware for it and the original firmware has limitations and lack of features. Bafang has a few different motors and versions, and so I decided to not develop the firmware for a specific model. Instead, I will used the popular OpenSource VESC motor controller as a DIY build to replace the original motor controller -- the beauty of this is that VESC runs any motor, so the work I am doing can be reused to TSDZ2, mainly the V2 version where there is no OpenSource firmware for it. This solution of using VESC is future prof, quick and easy to reuse to any other motor / EBike brand.

I am also use a simple DIY EBike board, to read the sensors as the throttle, torque sensor and brake. Then this board will map the torque sensor value to motor current / torque value, that is sent to VESC. This is the same logic on our OpenSource firmware for TSDZ2. This time, I decided to do it in Python an high level language, so will be easy for any software developer to understand and contribute with improvements.

The Bafang motors uses a torque sensor with CANBUS communications but TSDZ2 do it differently. Someone would need to look at TSDZ2 motor controller board circuit to read the torque sensor and then it could be added to this EBike board.

I got the Bafang M500 motor running using a throttle. The code I did, reads the throttle value and maps that value to a motor current value, that I send to VESC using command COMM_SET_CURRENT.

[youtube]QEnLWcn1LbE[/youtube]

Here is the current EBike board. Black and red wires powers the EBike board from the VESC. Yellow and white wires are UART tx and rx, for communication with VESC.

The throttle has 3 wires. The blue is the throttle output analog signal and the others are GND and 3.3V that powers the throttle. There is one resistor of 100K, as seen on the following schematic:

image.png





And this is the current Python code of the EBike board:

 
Hi Casainho,
I have bike with tsdz2. I have some idea. What do you think about adding ble/ant+ module to arduino? This way with some powermeter pedals it would be possible to implement torque assist for every motor.
 
Looks like opensource firmware for tsdz2 version 2 is a dead end now?
Hmm, maybe the best is to source a old version controller from China or somewhere else?
 
I have good news.
I was successfully able to flash the Firmware with no speedlimit to the other controller with speed limit.
I have added both firmwares below. You can flash the Firmware with a J-Link and XMCFlasher.
Hey mate, how did you do it? Edit the hex?
 
After spending many hours trying to flash osf on my tsdz2b motor it turns out I have the new controller because I can't get a voltage reading across swim and gnd pins.
Everyone was saying that only motors purchased from enerprof came with new controllers and PSWPOWER sold the old controllers but those comments must've been old.
Oh well... You live and learn.
Am I right in understanding that there is no way for me to get osf now?
Even if I were to get a new controller it would no doubt be a new version now.
 
.... only motors purchased from enerprof came with new controllers and PSWPOWER sold the old controllers but those comments must've been old.
....
You are the first and only one that mention this recently.
If so, it could be that with the introduction of tsdz2bTurbo (Tsdz8) all controllers are changed now.

With the Enerprof controller there is an extra setting "speedlimit" on/off and it isn't possible to change the speedlimit above 25km/h anymore.

Maybe a unnecessary question, but had you powered up the motor?
It must be for this Voltage test, but doesn't for flashing

If you haven't powered up, the test will be always 0V, but flashing will go with the old board.
If you had powered up, the test will be 5V with the old board, but with flashing you can blow up the input of the controller or output of STv2 programmer.
 
Last edited:
You are the first and only one that mention this recently.
If so, it could be that with the introduction of tsdz2bTurbo (Tsdz8) all controllers are changed now.

With the Enerprof controller there is an extra setting "speedlimit" on/off and it isn't possible to change the speedlimit above 25km/h anymore.

Maybe a unnecessary question, but had you powered up the motor?
It must be for this Voltage test, but doesn't for flashing

If you haven't powered up, the test will be always 0V, but flashing will go with the old board.
If you had powered up, the test will be 5V with the old board, but with flashing you can blow up the input of the controller or output of STv2 programmer.
Thank you for your reply.
I have tried it with display on and off,
Tried 3 different stlinks from different suppliers.
I have measured across the 2 pins along the flat part of the Speedo plug(swim and ground) with display on and off and cannot get a voltage reading.
I bought the motor in May 2023 and I keep thinking I'm not doing something right but I don't know what else to try.
 
I bought the motor in May 2023 and I keep thinking I'm not doing something right but I don't know what else to try.
What about the speed limit setting? Is there an enable/disable option for that inside the settings?

Problem is, you don't know if you blow up the Swim port.
To be sure if you have the old version controller pcb, you must dissamble the motor
Here you can see the differences old vs new
 
With the Enerprof controller there is an extra setting "speedlimit" on/off and it isn't possible to change the speedlimit above 25km/h anymore.
In the hidden settings menu of vlcd5 I have a setting for enabling 25kph speed limit.
I must've blown the swim port then.
It's running fine anyhow so I think I'll leave it be.
 
In the hidden settings menu of vlcd5 I have a setting for enabling 25kph speed limit.
...
If you have this toggle setting you have indeed a non flashable controller (without SWIM port).
On the old controller there is only a max. speed setting
 
Back
Top