TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

djwlindenaar said:
Showing off my lighting solution on my bike. It's powered from the TSDZ2 and with a small fix, it works with this firmware.

The front is the original light supplied with the motor. The rear is a waterproof USB led strip from AliExpress https://s.click.aliexpress.com/e/VSnGOxPd1

IMG_20190225_191935.jpg
I am really happy that you found the issue and solved it. Can you please submit a pull request so we can add to next version?

Thanks for sharing that picture, seems great that idea of the LED strip. Would like to add to wiki that picture and a bit more details in how to buy and install that LED strip??
 
djwlindenaar said:
Showing off my lighting solution on my bike. It's powered from the TSDZ2 and with a small fix, it works with this firmware.

The front is the original light supplied with the motor. The rear is a waterproof USB led strip from AliExpress https://s.click.aliexpress.com/e/VSnGOxPd1

IMG_20190225_191935.jpg

Nice! Yes, very interested in a walk through of your wiring (or a wiring diagram). Looks like endlesscadence's diagrams from a few months ago are down (from whatever hosting source they were at).
 
Hi casainho ,
Could you tell me the relationship between Phase A(SPWM) with Phase Asv(SVPWM)?and how to calculate them?

the numbers in ‘Phase Asv ’column are different with the firmware,are they be suitable for use?
 

Attachments

  • spwm-svpwm.jpg
    spwm-svpwm.jpg
    9.8 KB · Views: 1,998
  • as.jpg
    as.jpg
    10.7 KB · Views: 1,998
haiyi911 said:
Hi casainho ,
Could you tell me the relationship between Phase A(SPWM) with Phase Asv(SVPWM)?and how to calculate them?

the numbers in ‘Phase Asv ’column are different with the firmware,are they be suitable for use?
Sorry, I don't remember now how I got the values. I did read in a few sources. I shared most my relevant sources, you can find if you search on google for KT motor controller firmware.
 
casainho said:
1. when lag occurs because of some fail on power boost, I quick hit the brakes and power boost starts immediately. This is a workaround.

2. I always use "Motor assistance startup without pedal rotation" = 1 so I do not have that issue. If you acan, give a look at the code to try understand what may be causing that issue.

Thanks for the feedback. I'm guessing your brakes have a cutout and they "restart" the boost code?

I will try Motor assistance startup without pedal rotation also ... though without the brake cutout might be too much at lights etc. My brakes have the wiring, but I was trying to cut down on it!

I had a quick look at the code, I'm not a C programmer but will sit down and try to make sense of the boost function at least ... are there any timeouts or resets in the order of a 2-3 seconds that come to mind?

Also I have a 60FPS camera - will setup by the motor and at least get a better sense of when it happens ... seems random to me, but there could be a good pattern.

Cheers
 
mctubster said:
are there any timeouts or resets in the order of a 2-3 seconds that come to mind?
Yes, look at the code and you will find the time of power boost (boost time + fadeout time).
 
I just put this code on master:

Correct pedal human power #74

Users did report that pedal human power is about 2x more.

@casainho had the idea to evaluate the torque sensor peak signal (measuring peak signal every pedal rotation) as being a sinewave and so the average would be:

> [Average value = 0.637 × maximum or peak value, Vpk](https://www.electronics-tutorials.ws/accircuits/average-voltage.html)

For a quick hack, we can just reduce actual value to 0.637.
 
it feel good, champion like indurain are about 500/600w in explosif mode, a friend who run marathon ( but 63 year old ) and many bicycle ( road without assit and MTb assisted with me ) made an " effort test " and was mesured a 230W peak,
i saw i was sometimes more than 400 w peak with V0.16 open source LCD3 and i m pretty sure my max power must be about 200w ( never tested in a medical or sport center but will do it ) may be 250w in explosif mode but probably less ...

Soo, 0.637 seems to be good value .
 
elem said:
it feel good, champion like indurain are about 500/600w in explosif mode, a friend who run marathon ( but 63 year old ) and many bicycle ( road without assit and MTb assisted with me ) made an " effort test " and was mesured a 230W peak,
i saw i was sometimes more than 400 w peak with V0.16 open source LCD3 and i m pretty sure my max power must be about 200w ( never tested in a medical or sport center but will do it ) may be 250w in explosif mode but probably less ...

Soo, 0.637 seems to be good value .
Thanks for reporting.

This as also the side benefit to increase a bit the resolution of assist levels, as 0.1 factor that is the min LCD3 can handle, was to much when I need to increase next assist level only by 50% what would be 0.15 but LCD3 just handle 0.2. Now, with about half of human power measure, I can setup assist level 1 as 0.2 and assist level 2 as 0.3 and so on. But in feature maybe we should try increase resolution, on color LCD will be much easier to show numbers like 0.01.
 
A question for @Buba (Buba is the only active developer other than me) and others:

I think that we need higher resolution on the assist level factor. I think a lower value that a user can do is like 25W (previous would be about 50W but with last change I did, should be half). If user want to have max power assist of 1000W (on a 52V battery, charged at 56V, where max charged is 58.8V) on the smallest power he does, max assist possible will be: 25 * 25.5 = 637.5 W, far from the target 1000W. We are using 8 bits for assist level factor variable, hence the max of 25.5. I think we should also have resolution like 0.025 while now we have only 0.1. So, I think we would need to change LCD3 assist level code...

My question is: since code is full, what do you think is better to do, 1. keep current LCD3 firmware closed to this changes and add this changes only to 850C LCD? or 2. you will work to make this changes on LCD3 (I understand should be hard and you may not be motivated to do this). This questions apply to other possible needed changes for maintenance of current features. Also, I think it is desirable to have other features that I think LCD3 will never have space for it, like password at startup (LCD3 original firmware has that feature and also 850C LCD, maybe every LCD...) -- what should we do for future LCDs that can have more features???

If was now, I would let some free space on LCD3 so it would be possible to make small changes/maintenance on current features.
 
I have ordered a TSDZ2 kit and LCD3 with a view to installing this firmware. I am a software developer and am interested in the code. I had a look at github and see the term "ERPS" mentioned a lot. I can't find an explanation of this anywhere. Can someone tell me what ERPS stands for?
 
emyr666 said:
... I had a look at github and see the term "ERPS" mentioned a lot. I can't find an explanation of this anywhere. Can someone tell me what ERPS stands for?
casainho said:
ERPS: electric revoltuino per second: https://en.wikipedia.org/wiki/Revolutions_per_minute
casainho said:
ERPS

TSDZ2_demagnetized_motor-07.jpg


Motor rotor has 16 magnets. Each pair makes 1 ERPS, so the rotor rotates at 8 ERPS if it rotates 1 RPS.

Hall sensor detects 1 ERPS, because each magnet pair has both north and south magnetic field (360 degrees).
 
casainho said:
A question for @Buba (Buba is the only active developer other than me) and others:
...
My question is: since code is full, what do you think is better to do, 1. keep current LCD3 firmware closed to this changes and add this changes only to 850C LCD? or 2. you will work to make this changes on LCD3 ...

If was now, I would let some free space on LCD3 so it would be possible to make small changes/maintenance on current features.

I have a few thoughts on this. I agree with Casainho that having this higher resolution on assist is important. Are there perhaps little-used features that take up a lot of code space? If so perhaps it should have its own fork like the OEM display effort. My other thought is, are their functions that are common to all displays that could be moved to the controller firmware instead of the LCD3? I know this might require too much effort to be possible with existing resources but it is a question worth asking. I defer, of course, to those actually doing the development.
 
Hi guys,
Since my KT LCD3 died, is it possible to enable the TSDZ2 by simply connecting
"green|P+|battery voltage" to "white|Vin|ground when LCD disabled and P+ (battery voltage) when LCD is enabled"?

https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Wire-KT-LCD3-to-TSDZ2

cheers
vscope
 
vscope said:
Since my KT LCD3 died, is it possible to enable the TSDZ2 by simply connecting
"green|P+|battery voltage" to "white|Vin|ground when LCD disabled and P+ (battery voltage) when LCD is enabled"?

https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Wire-KT-LCD3-to-TSDZ2

I think it does not work. A lot of variables are not filled with data so the controller is waiting for them via serial. As i suggested, there should be some config-vars and runtime-vars splitted in the code and everything "non-critical" could be filled with default values.
https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/issues/30
 
shaddi said:
I think it does not work. A lot of variables are not filled with data so the controller is waiting for them via serial. As i suggested, there should be some config-vars and runtime-vars splitted in the code and everything "non-critical" could be filled with default values.
https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/issues/30

thx for the info!
 
Long time, no write...

I have been buried in work the last two weeks and worked every single day. I literally had no time to read and update myself on all the updates posted here. But hopefully things will slow down a bit in the coming days and I will have some more time.

Anyway, fun to see that the thread is so full of life and that this great community is growing!

casainho said:
A question for @Buba (Buba is the only active developer other than me) and others:

I think that we need higher resolution on the assist level factor. I think a lower value that a user can do is like 25W (previous would be about 50W but with last change I did, should be half). If user want to have max power assist of 1000W (on a 52V battery, charged at 56V, where max charged is 58.8V) on the smallest power he does, max assist possible will be: 25 * 25.5 = 637.5 W, far from the target 1000W. We are using 8 bits for assist level factor variable, hence the max of 25.5. I think we should also have resolution like 0.025 while now we have only 0.1. So, I think we would need to change LCD3 assist level code...

My question is: since code is full, what do you think is better to do, 1. keep current LCD3 firmware closed to this changes and add this changes only to 850C LCD? or 2. you will work to make this changes on LCD3 (I understand should be hard and you may not be motivated to do this). This questions apply to other possible needed changes for maintenance of current features. Also, I think it is desirable to have other features that I think LCD3 will never have space for it, like password at startup (LCD3 original firmware has that feature and also 850C LCD, maybe every LCD...) -- what should we do for future LCDs that can have more features???

If was now, I would let some free space on LCD3 so it would be possible to make small changes/maintenance on current features.

I have a couple of ideas that will optimize the code for space. After this it will maybe be possible to implement a higher resolution. I will try to increase the resolution, optimize in regard to size and also submit a pull request for you all to test!
 
Hi TSDZ2 open firware community, thanks for all your great job, you decided me to buy this motor.
I try to get as much information as possible so as not to pollute the discussions with trivia, but I can't find an answer to the following question:
Is the open source firmware of the 850C LCD compatible with the latest version of the your controller firmware?
 
NIPSEN said:
Hi TSDZ2 open firware community, thanks for all your great job, you decided me to buy this motor.
I try to get as much information as possible so as not to pollute the discussions with trivia, but I can't find an answer to the following question:
Is the open source firmware of the 850C LCD compatible with the latest version of the your controller firmware?
No it is not. That firmware is far from being stable, I am using in my bicycle and it give me a lot of troubles -- I am not finding time to improve this firmware.
 
casainho said:
No it is not. That firmware is far from being stable, I am using in my bicycle and it give me a lot of troubles -- I am not finding time to improve this firmware.

Thx for your answer, I hope you will find more time or that you will choose to prioritize the development of the 850C at the expense of the LCD3 (which is quite limited in memory).

In any case, I will probably buy both screens to help you with your tests.
 
FYI, I just found a TSDZ2 sell with 850C LCD :

https://fr.aliexpress.com/store/product/Free-shipping-electric-bike-kit-48V500W-Tongsheng-TSDZ2-mid-drive-motor-kit-with-torque-sensor/904105_32821670861.html

Probably a custom firmware.
 
NIPSEN said:
FYI, I just found a TSDZ2 sell with 850C LCD :

https://fr.aliexpress.com/store/product/Free-shipping-electric-bike-kit-48V500W-Tongsheng-TSDZ2-mid-drive-motor-kit-with-torque-sensor/904105_32821670861.html

Probably a custom firmware.

If you buy that motor you might be interested to know that I had some KT-LCD3 displays custom made specifically for the open source firmware project that are plug compatible with the 850C available here (my shop). We also have that same motor with the 850C or KT-LCD3 (found here) but we have to charge a little more because of support, tariffs, etc. We will also be making a small (~$50) donation to the developers as a token thank you for all their hard work (and fried controllers, displays, etc. :) ).
 
Hello everybody,
I'm working on Windows 10,
the installed SDCC is at version mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.8.0 #10562 (MINGW64),
the STVP is at versione 1.8.0.0.

When I compile the files in the src folder on master branch of Flexible OpenSource firmware for TongSheng TSDZ2 mid drive ebike motor with SDCC i get an ihx file.
Which are the next step to get the hex file for the STVP? How can I be sure that the my hex and the TSDZ2-v0.18.2.hex are the same if I didn't modify any src file?

Can someone help me?
 
Hello every one

The inner motor seems to have given upp :(
I manager to order a replacement that Will take some time.

My question is: if i connect my old hub motor 36v 350w (hall sensor) to the controller. Will it run normal or i Will be damaging the controller?

I am running the open source firmware V 17

Best regards
 
rmnlsn said:
Hello everybody,
I'm working on Windows 10,
the installed SDCC is at version mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.8.0 #10562 (MINGW64),
the STVP is at versione 1.8.0.0.

When I compile the files in the src folder on master branch of Flexible OpenSource firmware for TongSheng TSDZ2 mid drive ebike motor with SDCC i get an ihx file.

Hi! That is correct. If you compile everything correctly you will have a file named main.ihx.

rmnlsn said:
Which are the next step to get the hex file for the STVP?

You need to convert the ihx file to the hex format. To do this follow this tutorial:

https://www.instructables.com/id/8051-Programming-Using-Small-Device-C-Compiler-SDC/

In short:

1. Open command
2. Go to the directory where you have the ihx file. Example: type cd Desktop if it is located inside Desktop
3. Type packihx main.ihx > TESTING.hex, replace "TESTING" with whatever name you prefer
4. You will now have the old ihx file and the new hex file in the same directory
5. Use the hex file in ST Visual Programmer as you normally would with any other hex file

rmnlsn said:
How can I be sure that the my hex and the TSDZ2-v0.18.2.hex are the same if I didn't modify any src file?

It should and must be the same if you are compiling the same source files. Do note that the latest source files will not compile version 0.18.2 of the firmware. The source files have been updated and are continually developed for the next version: 0.19.0.

rmnlsn said:
Can someone help me?

Hope it helped!
 
Back
Top