New "TSDZ2 Torque Sensor Central Motor"

casainho said:
Yes, follow the cables that are wired to the board near the STM8, see here a picture:

https://opensourceebikefirmware.bitbucket.io/development_tsdz2/Various--2018.04.18_-_original_firmware_and_debug_session_using_OpenOCD.html
Thank you. Hopefully I can try it soon. I hit another delay though, the seller made a mistake and only had 2 in stock so now I need to buy a 3rd battery. Either that or I need to run 2 in a 10s2p configuration, but the cadence is going to be mighty low with a 48v motor running from 42v down to 30v.
 
eyebyesickle said:
Hi,

I know some people have had problems with '52v' units not actually being 52v etc... I drafted up a little programming manual for someone, maybe more people can get some use from it. It goes from making the programming cable, to installing and configuring the software (for windows) to the actual programming. Nothing fancy, just voltage and amps... Hopefully it is somewhat helpful to someone. Let me know how bad it sucks! :lol: :wink: I suppose I could've done a video - I probably should do both...

PDF below but the pics are small and you need to view at over 100%. I also added it to the blog/instructional, where it is formatted a bit better:

https://www.eco-ebike.com/blogs/eco-cycles-instructionals/tsdz2programmingfromscratch

Any request etc let me know... I was going to do one for controller replacement, and metal gear installation (videos for these for sure, along with a writeup) - and I was also going to do one for buying cheap lights from walmart that work on batteries, and soldering wires to them to use with the TSDZ2 and/or BBS series.

Nice job Eyebyesickle! Thank you! This is great. You should add it to the wiki as well.
 
eyebyesickle said:
Thanks again eyebyesyckle...
Have you been able to "translate" the detailed wiring diagram you posted earlier ..specificly the wire colors. ?
In particular the actual pin out on the connector plug for the ST Link connection...IE, wire colors to pins on the plug.
Also, my speed sensor has the "Y" connector cable, for lights etc...do we know if that Y has the all the pins duplicated such that we can connect the ST Link cable to the spare leg of the Y connector.
(Note:-my thinking is i could use the cable and matching plug from the "Thumb pad" extension, that i have no use for, but the wire colors are different !....)
 
Hillhater said:
eyebyesickle said:
Thanks again eyebyesyckle...
Have you been able to "translate" the detailed wiring diagram you posted earlier ..specificly the wire colors. ?
In particular the actual pin out on the connector plug for the ST Link connection...IE, wire colors to pins on the plug.
Also, my speed sensor has the "Y" connector cable, for lights etc...do we know if that Y has the all the pins duplicated such that we can connect the ST Link cable to the spare leg of the Y connector.
(Note:-my thinking is i could use the cable and matching plug from the "Thumb pad" extension, that i have no use for, but the wire colors are different !....)

Have you been able to "translate" the detailed wiring diagram you posted earlier ..specificly the wire colors. ? In particular the actual pin out on the connector plug for the ST Link connection...IE, wire colors to pins on the plug

I am not sure what you mean? I thought I provided this information with the diagram itself. The wire colors are the colors from the speed sensor extension cable, and it shows the direct pin you connect it to. You can just wire it to the 4 pin connectors, included with the kit, just make sure the right wire ends up at the right pin as shown. Or do I misunderstand?

Also, my speed sensor has the "Y" connector cable, for lights etc...do we know if that Y has the all the pins duplicated such that we can connect the ST Link cable to the spare leg of the Y connector.

Hmm... I wonder if it will transmit through. I took apart the Y splitter, and a circuit board connects the two plugs, and it appears all 6 pins will carry over from one side to the next. Cool

(Note:-my thinking is i could use the cable and matching plug from the "Thumb pad" extension, that i have no use for, but the wire colors are different !....)

Ah ha! Yea, the thumb pad is 5 pin male, but the Y is 6 pin female and would accept it! So, someone would need to split the thumb pad cable and test the wires/pins for continuity to map the pins/colors, and the same for the Y connector with the speed sensor.

I have the 6 pin and 8 pin display/controller wire/colors mapped, but that was it - just so I could wire a throttle and brakes to whatever... I will do the speed sensor when I have time. It wont take long to continuity/map with a spare controller lying around!

So, if that will work all comes down to one thing - if the missing 6th pin is one of the ones needed for the programming cable. As you may know, we need 4 of the 6 wires. Since the thumb panel has 5 wires, we will have to see if the missing pin is one that is needed...
 
casainho said:
eyebyesickle said:
Hi,

I know some people have had problems with '52v' units not actually being 52v etc... I drafted up a little programming manual for someone, maybe more people can get some use from it. It goes from making the programming cable, to installing and configuring the software (for windows) to the actual programming. Nothing fancy, just voltage and amps... Hopefully it is somewhat helpful to someone. Let me know how bad it sucks! :lol: :wink: I suppose I could've done a video - I probably should do both...

PDF below but the pics are small and you need to view at over 100%. I also added it to the blog/instructional, where it is formatted a bit better:

https://www.eco-ebike.com/blogs/eco-cycles-instructionals/tsdz2programmingfromscratch

Any request etc let me know... I was going to do one for controller replacement, and metal gear installation (videos for these for sure, along with a writeup) - and I was also going to do one for buying cheap lights from walmart that work on batteries, and soldering wires to them to use with the TSDZ2 and/or BBS series.
Thanks!!

And here the information about that 3 values that we can change on EEPROM, since you didn't write about the first one:

Here is the data of each byte:
• 1. byte value: battery min voltage (need to divided by 2.5, like 0x4E → 78; 78 / 2.5 = 31.2; battery min voltage = 31.2 volts)
• 2. byte value: battery nominal voltage (need to divided by 2.5, like 0x78 → 120; 120 / 2.5 = 48)
• 3. byte value: motor/battery max current in amps (like 0x11 → 17; 17 amps)

I confirmed just a minute ago. The LVC value does not change anything once you set the Nominal Voltage. Even though the value remains the same when 'read'... you will get an E-08 (low energy alarm) error message on the display if you try to use a 36v (even fully charged to 42v) or lower when programmed to 52v...

48v LVC switches to show the E-08 at around 40v...

So unless you do many other changes, the min voltage has no change.

Perhaps you can guide us to adjust this where it will hold? I would love to have a controller that can run at 20-60 open voltage!
 
It's a shame the controller cannot read what battery config you have installed, or allow you to manually input the configuration on the display, and then load the proper settings on the fly.

I thought someone stated that they were able to completely erase the hvc and lvc way back in the thread?
 
eyebyesickle said:
Hillhater said:
Have you been able to "translate" the detailed wiring diagram you posted earlier ..specificly the wire colors. ? In particular the actual pin out on the connector plug for the ST Link connection...IE, wire colors to pins on the plug...

I am not sure what you mean? I thought I provided this information with the diagram itself. The wire colors are the colors from the speed sensor extension cable, and it shows the direct pin you connect it to. You can just wire it to the 4 pin connectors, included with the kit, just make sure the right wire ends up at the right pin as shown. Or do I misunderstand?...
No, i was refering to the detailed (Chinese ?) original controller wiring connection drawing you posted earlier in this thread..it shows the pin allocations, but .the wire colors are all written in chinese characters !

EDIT..
Just checked the thumb pad wiring..
5 wires. Black...Red, Green. White, Brown
5 pins on the plug ...but the missing pin is the center pin,..which i suspect is the pin you use for the RST connection ?
:(
 
casainho said:
LCD3 firmware just got the very first contribution from another user - Karl Szmutny from Munich, Germany, submitted the implementation of offroad mode for the LCD3!!

Please see here the description of how ti is activated: https://github.com/OpenSource-EBike-firmware/Kunteng_LCD3_firmware/pull/3

I think is missing, is some feedback to the user so he knows if off road mode is active or not. Do you guys have any ideas for this??

nothing special, but should work. Still need to cable up everything :)
Is the Motor-Controller firmware already usable for torque-only mode? Need my bike for commuting so not a lot of "trial and error" software developing space here :)
 
eyebyesickle said:
casainho said:
And here the information about that 3 values that we can change on EEPROM, since you didn't write about the first one:

Here is the data of each byte:
• 1. byte value: battery min voltage (need to divided by 2.5, like 0x4E → 78; 78 / 2.5 = 31.2; battery min voltage = 31.2 volts)
• 2. byte value: battery nominal voltage (need to divided by 2.5, like 0x78 → 120; 120 / 2.5 = 48)
• 3. byte value: motor/battery max current in amps (like 0x11 → 17; 17 amps)

I confirmed just a minute ago. The LVC value does not change anything once you set the Nominal Voltage. Even though the value remains the same when 'read'... you will get an E-08 (low energy alarm) error message on the display if you try to use a 36v (even fully charged to 42v) or lower when programmed to 52v...

48v LVC switches to show the E-08 at around 40v...

So unless you do many other changes, the min voltage has no change.

Perhaps you can guide us to adjust this where it will hold? I would love to have a controller that can run at 20-60 open voltage!
Thanks for testing and report.

I am working on our firmware. Today I did more tests to FOC code, this was the first time I tested with a 48V battery and limiting the current to 15 amps and start the motor with wheel blocked and simple braking the wheel hard up it stops. The metal gear is working very well on this hard tests :)

The motor controller code seems to working very well and I am using only a throttle for now. Next step is to start making all the information to flow to LCD and complete ebike application. I think torque sensor will be the last part, as using throttle is much more suitable for development and testing.

shaddi said:
Is the Motor-Controller firmware already usable for torque-only mode? Need my bike for commuting so not a lot of "trial and error" software developing space here :)
I think anyone that wants to develop and test the firmware, should have a extra motor and parts, on an extra ebike. I think is to early without users jump to test it and give feedback and I as a developer, for me everything is ok but for a user, may not. I and other developers, we did burn a few KT motor controllers while developing the firmware..... :) :)
 
casainho - just about to test the WH feature on the LCD3, here's a short writeup of my understanding of the secondary menu (quickly looking at your code markups)

Hold POWER to get into the secondary menu

0 state (UP/DOWN to disable (0) or enable (1) WH display in lower right-hand corner) POWER for next menu item
1 state (UP/DOWN for incrementing (WH used so far) (0) or decrementing (1) (WH left in battery) ) POWER for next menu item
2 state (UP/DOWN to set WH at 100% SOC of battery) POWER for next menu item
3 state (UP/DOWN to set current WH of battery) POWER for next menu item

for this last menu item - wouldn't it be easier to just ask for AH of the battery and then multiply it by the current voltage? I haven't taken a look at all the code, but this seems like the simpler and more accurate solution.

Excited to try this out - will update!
 
pawepie said:
casainho - just about to test the WH feature on the LCD3, here's a short writeup of my understanding of the secondary menu (quickly looking at your code markups)

Hold POWER to get into the secondary menu

0 state (UP/DOWN to disable (0) or enable (1) WH display in lower right-hand corner) POWER for next menu item
1 state (UP/DOWN for incrementing (WH used so far) (0) or decrementing (1) (WH left in battery) ) POWER for next menu item
2 state (UP/DOWN to set WH at 100% SOC of battery) POWER for next menu item
3 state (UP/DOWN to set current WH of battery) POWER for next menu item

for this last menu item - wouldn't it be easier to just ask for AH of the battery and then multiply it by the current voltage? I haven't taken a look at all the code, but this seems like the simpler and more accurate solution.

Excited to try this out - will update!
After entering in the configurations menu, the submenu 1 (submenu 1: battery whatt hours configuration):
0. enable/disable WH display in lower right-hand corner
1. WH display counting up or counting down
2. WH at 100% SOC of battery
3. set current WH of battery

The 2. value is automatically reset to zero if LCD3 is start up and battery voltage = 54V (battery fully charged).

I see 3. to be only used when you exchange batteries and on that case you should take note of WH you see on display. Or like what is happening on one of my battery packs that is not yet fully balanced and it do not reaches the 54V yet and so I need to reset WH manually.

I must say this feature is working perfectly!!!
 
pawepie said:
casainho - just about to test the WH feature on the LCD3 (...)

Excited to try this out - will update!
I am about to break the compatibility of LCD3 firmware with original improved firmware. I left the firmware that compatible firmware on this branch: https://github.com/OpenSource-EBike-firmware/Kunteng_LCD3_firmware/tree/LCD3_firmware_for_TSDZ2_original_improved_firmware

My focus is now continue the development of our OpenSource firmware and I want also to use only LCD3 and not the original LCD, as the original is very weak. See this example: with the original there is lack of wheel speed resolution, the wheel speed value on LCD min resolution is about 3km/h when speed is over 35km/h, like it jumps from 35k/h up to 38km/h, 41km/h, etc.
Also, I will implement a way that user will setup on LCD3 the wheel perimeter in centimeters and not the wheel size, as this will make a better speed indication.
 
Poor man's cable connector. "Purple" pin (central) is hidden, but probably with the "no throttle" version I would not need.
Motor controller is enabled with a jumper. I've felt it's a level 3 or 4 assist without the LCD, just started it with the jumper.
I also tried to monitor the TX communication with an Arduino, but due to lack of my knowledge have not seen anything yet.
What I've could check is, that I've measured the 5V between "brown" pin (TX) and "black" pin (ground) when motor was enabled.
poormans_cableconnector_01.jpg

poormans_cableconnector_02.jpg
 
feketehegyi said:
I can see the serial communication from motor controller to LCD. I've used my poor man's cable connector and Arduino Uno.
And what is your plan?
 
casainho said:
feketehegyi said:
I can see the serial communication from motor controller to LCD. I've used my poor man's cable connector and Arduino Uno.
And what is your plan?

Well, now only to understand how the system works. Then create a simple display on the laptop to show those values included in the communication in human readable format. A kind of LCD display using the laptop to draw it.
After that maybe create functionality to change assist level, wheel diameter etc. and send to controller. Still on computer.

Later maybe it can end up like this as a standalone (no computer needed) LCD display for TSDZ2:
https://www.youtube.com/watch?v=9Ms59ofSJIY

Arduino-TFT-LCD-Touch-Sceen-Tutorial-Example-01.jpg


3.2"inch 240x320 TFT $20.99
3.2 Inch TFT Touch LCD Shield Expansion Board $11.99
Elegoo MEGA 2560 R3 Board ATmega2560 ATMEGA16U2 $14.99
Total cost: $47.97
 
feketehegyi said:
Well, now only to understand how the system works.
You know, with the information others did share and some more investigation, I now fully control all the information that flows motor controller <--> LCD, you can see how it works here:
https://github.com/OpenSource-EBike-firmware/Kunteng_LCD3_firmware/tree/LCD3_firmware_for_TSDZ2_original_improved_firmware

feketehegyi said:
Later maybe it can end up like this as a standalone (no computer needed) LCD display for TSDZ2:
https://www.youtube.com/watch?v=9Ms59ofSJIY

Arduino-TFT-LCD-Touch-Sceen-Tutorial-Example-01.jpg


3.2"inch 240x320 TFT $20.99
3.2 Inch TFT Touch LCD Shield Expansion Board $11.99
Elegoo MEGA 2560 R3 Board ATmega2560 ATMEGA16U2 $14.99
Total cost: $47.97
Have fun!!

I guess you will prefer to use our OpenSource firmware since it already implement other features and you can also help to implement/lobby for something you would like to have on that communication.

Here the firmware: https://github.com/OpenSource-EBike-firmware/TongSheng_TSDZ2_motor_controller_firmware
 
Now developing our firmware for TSDZ2, today I implemented the wheel speed calculation. On the LCD3 side, the user now inputs the wheel perimeter in mms (on the video I setup 2070 as it should be the value for my 26 wheel). As you can see, there is a good resolution in speed, no more jumps of 3km/h when speed is near 40km/h like on the original LCD.

Also, you can see the that my battery is almost full but the max wheel speed is 43km/h (while it is on the air). I am pretty sure the motor max speed limit of ERPS (electric rotations per second) is hit:
Code:
#define MOTOR_OVER_SPEED_ERPS 520 // motor max speed, protection max value | 30 points for the FOC wave  shape at max speed

[youtube]NrikI5siE3A[/youtube]
 
eyebyesickle said:
I confirmed just a minute ago. The LVC value does not change anything once you set the Nominal Voltage. Even though the value remains the same when 'read'... you will get an E-08 (low energy alarm) error message on the display if you try to use a 36v (even fully charged to 42v) or lower when programmed to 52v...

48v LVC switches to show the E-08 at around 40v...

So unless you do many other changes, the min voltage has no change.

Just to be clear, I believe what you are stating here is that is possible to setup the motor to use just about any battery voltage however you cannot change the range between the high and low voltage cutoffs. Thus you can use any battery you like, but you would have to reprogram the controller before switching batteries of different voltages (unless they are close, like a 52v battery and a 48v battery and you are ok without being able to use 100% of the 2nd battery's charge).

Since the controller allows some headroom (my 48v controller now allows up to 56.7v +/-), perhaps there is a way to program the controller for a "non existent" battery that lies between 2 voltages. Like instead of programming it for a 52v battery it can be programmed for a 50v battery. That would likely allow (using my experience as an example) a battery up to 58.8v which would just squeak by for a full charged 52v 14s battery, yet the low cutoff would probably still be great for a 48v 13s battery.

It is not perfect but perhaps it would be a little more helpful if we can choose a setting that falls between 2 battery voltages that will allow both those batteries to be utilized to their full capacity.
 
John and Cecil said:
eyebyesickle said:
I confirmed just a minute ago. The LVC value does not change anything once you set the Nominal Voltage. Even though the value remains the same when 'read'... you will get an E-08 (low energy alarm) error message on the display if you try to use a 36v (even fully charged to 42v) or lower when programmed to 52v...

48v LVC switches to show the E-08 at around 40v...

So unless you do many other changes, the min voltage has no change.

Just to be clear, I believe what you are stating here is that is possible to setup the motor to use just about any battery voltage however you cannot change the range between the high and low voltage cutoffs. Thus you can use any battery you like, but you would have to reprogram the controller before switching batteries of different voltages (unless they are close, like a 52v battery and a 48v battery and you are ok without being able to use 100% of the 2nd battery's charge).

Since the controller allows some headroom (my 48v controller now allows up to 56.7v +/-), perhaps there is a way to program the controller for a "non existent" battery that lies between 2 voltages. Like instead of programming it for a 52v battery it can be programmed for a 50v battery. That would likely allow (using my experience as an example) a battery up to 58.8v which would just squeak by for a full charged 52v 14s battery, yet the low cutoff would probably still be great for a 48v 13s battery.

It is not perfect but perhaps it would be a little more helpful if we can choose a setting that falls between 2 battery voltages that will allow both those batteries to be utilized to their full capacity.

Yes that sounds good, but I think the differential is just tight enough to chop off the top end, and the low end if you do that... The low end is not as much of a problem... but you have to keep that high end.

I'll do some testing to see how low I can get the LVC while the HVC still hits 58.8...
 
Yes, the low end does not seem to do squat! I have been keeping track of my power consumption. If I ride about 2.75 miles I consume about 5v of power with a nearly full charged batter (56.5-51.5v). If I run the battery down to 42v (when the battery bms shuts it down) I only get maybe 5.5-6 miles total. So I am getting about the same distance out of the top 5v that I do for the bottom 10v. Perhaps this is why Casainho's gf is using about half the energy that he is using (and also due to human power). The watt per mile calculations appear to be very different depending on where in the charge cycle the battery exists at the time.
 
John and Cecil said:
Yes, the low end does not seem to do squat! I have been keeping track of my power consumption. If I ride about 2.75 miles I consume about 5v of power with a nearly full charged batter (56.5-51.5v). If I run the battery down to 42v (when the battery bms shuts it down) I only get maybe 5.5-6 miles total. So I am getting about the same distance out of the top 5v that I do for the bottom 10v. Perhaps this is why Casainho's gf is using about half the energy that he is using (and also due to human power). The watt per mile calculations appear to be very different depending on where in the charge cycle the battery exists at the time.

Well, the battery voltage drops off much faster as it gets lower... which is why we look at watt hours consumed...
 
I find the open firmware development intriguing, but is there any way the discussion of it can be shifted over to the other topic that casainho started for it? This general topic for the TSDZ2 has become overrun with that discussion, which may give new readers the impression that hacking the motor software is an unavoidable requirement and turn them off the product. Those interested in just buying and riding with the TSDZ2 rather than modifying it may find their eyes glazing over after page after page of uber-technical software discussion. Since there's already another topic for the technical aspects of that, it doesn't make sense to keep the discussion in this topic.
 
I havn't any ST-Link yet, and havn't even spun up my TSDZ2.
Still working to build my battery management shunts and
get the right side of the old bottom bracket out. I bought
all the nuts and bolts for a Sheldon tool, so maybe this
weekend I'll at least have the motor in place.

I've got eyebicycle's programming guide (also the guy who
sold me my motor with firmware update and bronze gear).
It seems pretty thorough, but I disagree with his conclusion
that the number located at (4002) is battery amps in binary
coded decimal. 0x14h may not mean 14A, with a 1:1 ratio.
Over a limited range, it may measure deceptively close...

What makes more sense is that this is hexidecimal for 20A.
Which would be Peak motor Amps, from which 14.4A RMS
sinewave power could be carved. Thus the ratio seen at
the battery might very well be 0.707A per increment.
A square root of two over two thing, its just a theory.

Test: When we increment from 0x09h to 0x10h, do the
measured battery amps increase by 1A, or by 5A??? May
reveal if those amps were in decimal or hexidecimal.
 
Back
Top