TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Electric Motors and Controllers
Bartman   10 W

10 W
Posts: 67
Joined: Feb 11 2018 2:38pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by Bartman » Oct 01 2018 2:00pm

I need some help. I can't get my motor to give any assistance. I flashed the KTLCD3 to v.0.12, and my TSDZ2 to v0.12. The LCD3 gave a validation error, but I reflashed and it verified ok.

I wired up the LCD3 as per wiki and can configure it, and see the read speed settings from the wheel etc. I can read all the settings in section 9. I have configured it for 10 cells (36v) is section 1, set the max amps, wheelsize. i even reset it to defaults and tried again. I have no way of trying back the original 36v firmware as I stupidly did not make a copy so have no way of knowing if this is a hardware issue or not. in section 9 get a reading from parameter 2 ADC torque sensor, but only a 0 reading from the parameter 3 - Pedal torque sensor. Walk mode does not work. The wee man shows on the LCD but nothing happens. I'm thinking I have a hardware fault on the TSDZ2.

Can any help ? can anyone supply me with the original version of the firmware to flash with STlink ? so I can try the original TSDZ2 VLCD 5.

Thanks

casainho   1 GW

1 GW
Posts: 3376
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Oct 01 2018 3:17pm

Bartman wrote:
Oct 01 2018 2:00pm
in section 9 get a reading from parameter 2 ADC torque sensor, but only a 0 reading from the parameter 3 - Pedal torque sensor.
You got everything working and seems you understand well how the parameters works.
As you could understand, your torque sensor is not working :-( :-(
If you search on past messages you will find that did happen to others users -- faulty torque sensor on a new TSDZ2. I suggest you to contact the seller and also find the message of other users and tell to the seller, because this is happening to some users, fortunately, seems not to many users.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

EndlessCadence   100 W

100 W
Posts: 217
Joined: Aug 22 2018 4:31am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by EndlessCadence » Oct 01 2018 3:20pm

casainho wrote:
Oct 01 2018 4:44am
EndlessCadence, about the offroad mode, there are 2 things I would like you to change:
1. no blinking of assist symbol, just keep it disable. For me blinking is kind of alert and in my ebikes I keep offroad mode always enable, that is the default for me and so I prefer no blinking.
2. ON/OFF buttons and UP and DOWN were already used before offroad mode, can you please change the keys for offroad mode? why not using UP + ON/OFF + DOWN to switch the modes?
1. It was your own suggestion.
2. Having to press all three buttons at once is quite impossible during driving. Only the button UP + ON/OFF were used before by the max battery power screen/feature. I don't know who is using this feature and I don't know why it has to be quickly accessible and can't be in the configuration menu. DOWN + ON/OFF wasn't used at all.

We've already discussed these items during the development of offroad mode. Simply disable offroad feature and you're not bothered by the blinking assist symbol and the UP + ON/OFF combination works for the max battery power screen as it was previously.

Bartman   10 W

10 W
Posts: 67
Joined: Feb 11 2018 2:38pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by Bartman » Oct 01 2018 3:25pm

casainho wrote:
Oct 01 2018 3:17pm
Bartman wrote:
Oct 01 2018 2:00pm
in section 9 get a reading from parameter 2 ADC torque sensor, but only a 0 reading from the parameter 3 - Pedal torque sensor.
You got everything working and seems you understand well how the parameters works.
As you could understand, your torque sensor is not working :-( :-(
If you search on past messages you will find that did happen to others users -- faulty torque sensor on a new TSDZ2. I suggest you to contact the seller and also find the message of other users and tell to the seller, because this is happening to some users, fortunately, seems not to many users.
Muito Obrigado Casainho, I was hoping it was not that, but everything pointed to it.

User avatar
jbalat   10 kW

10 kW
Posts: 555
Joined: Nov 10 2012 11:50pm
Location: Melbourne, Australia

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by jbalat » Oct 01 2018 6:42pm

Endless thanks for you tips I will try option 2. I actually thought about doing that this morning but haven't tried it yet. Maybe just add a note to the top of the wiki ??

Looks like this memory issue is affecting almost everyone so hope its sorted quickly.

Update..
Tried everything but it won't clear the memory even holding power while I flash. I can't go back to 0.3. I go to select number of cells but it only let's me select 0 or 1 ! Other menus dont even have sub menus. What gives ?

Anyway got 0.12 loaded. Thanks for your help :)
Good news is that it works and was pre configured. Bad news is cadence is back down. I might try compiling my own version to see if i can boost the cadence again.
Please subscribe to my Youtube home page for Quadcopters, FPV and Bike Rides http://www.youtube.com/jbalatutube
My build log here http://endless-sphere.com/forums/viewto ... =6&t=55352
For some cool ebike talk join us on The Best ebike https://www.facebook.com/groups/193581737807033/
Tech talk TSDZ2 Opensource firmware https://endless-sphere.com/forums/viewt ... &start=150
Opensource TSDZ2 Wiki https://github.com/OpenSource-EBike-fir ... _wiki/wiki

casainho   1 GW

1 GW
Posts: 3376
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Oct 02 2018 4:12am

EndlessCadence wrote:
Oct 01 2018 3:20pm
casainho wrote:
Oct 01 2018 4:44am
EndlessCadence, about the offroad mode, there are 2 things I would like you to change:
1. no blinking of assist symbol, just keep it disable. For me blinking is kind of alert and in my ebikes I keep offroad mode always enable, that is the default for me and so I prefer no blinking.
2. ON/OFF buttons and UP and DOWN were already used before offroad mode, can you please change the keys for offroad mode? why not using UP + ON/OFF + DOWN to switch the modes?
1. It was your own suggestion.
2. Having to press all three buttons at once is quite impossible during driving. Only the button UP + ON/OFF were used before by the max battery power screen/feature. I don't know who is using this feature and I don't know why it has to be quickly accessible and can't be in the configuration menu. DOWN + ON/OFF wasn't used at all.

We've already discussed these items during the development of offroad mode. Simply disable offroad feature and you're not bothered by the blinking assist symbol and the UP + ON/OFF combination works for the max battery power screen as it was previously.
1. I remember and after seeing it, I think is best to not keep blinking.
2. Quick controlling of max battery power screen/feature is important for offroad, when I am climbing and I want a constant motor power. I experienced this a few times and it is very relevant to me, I prefer to change that value and not the assist level. I prefer and higher assist level, where with a few pedal torque I get the max motor power limited by that feature. It makes a big difference in the experience when riding offroad on mountains. Also in future I want to make it adjustable in a way the I see all the main screen, lie if I was changing assist level.
EndlessCadence wrote:
Oct 01 2018 3:20pm
We've already discussed these items during the development of offroad mode. Simply disable offroad feature and you're not bothered by the blinking assist symbol and the UP + ON/OFF combination works for the max battery power screen as it was previously.
Does not make sense to me to have duplicated action for the same buttons combinations, I think it brings difficult to understand how system works and probably will frustrate the user.

Why not them use ON/OFF + DOWN for cycle offroad mode? (I use ON/OFF + DOWN to configure temperature field but I agree this is not important to be quick configuration, can be only on configuration menus).

Also I would like to have quick click button click + long click combination, this would expand the options, I would like to use to change options on the odometer field, like UP / DOWN to change assist level as now and quick + long click on UP / DOWN to change the field on odometer (grouping information's on odometer, like showing the various distances).

Some good news is that there is a seller working with the chinese manufactures to provide LCD3 already programmed and with the programming connector!! :-)
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

casainho   1 GW

1 GW
Posts: 3376
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Oct 02 2018 4:36am

EndlessCadence wrote:
Oct 01 2018 3:20pm
We've already discussed these items during the development of offroad mode. Simply disable offroad feature and you're not bothered by the blinking assist symbol and the UP + ON/OFF combination works for the max battery power screen as it was previously.
I am not an user of offroad mode, I always drive on street at 30, 35 or 40km/s. Can you please explain an user case of offrode mode? does the users needs to change fast that mode? how many times does it activate that mode when riding?
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

User avatar
stancecoke   10 kW

10 kW
Posts: 996
Joined: Aug 02 2017 2:56pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by stancecoke » Oct 02 2018 7:02am

casainho wrote:
Oct 02 2018 4:36am
I am not an user of offroad mode, I always drive on street at 30, 35 or 40km/h. Can you please explain an user case of offrode mode? does the users needs to change fast that mode? how many times does it activate that mode when riding?
Do you just don't care about the law in portugal? As far as I understand the directive 168/2013 of the european union applies in Portugal, too?!

Normally you will switch to offroad mode only once per tour.

regards
stancecoke

bart1006   10 W

10 W
Posts: 89
Joined: Sep 24 2012 11:10am
Location: Zwolle

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by bart1006 » Oct 02 2018 7:16am

casainho wrote:
Oct 02 2018 4:36am
EndlessCadence wrote:
Oct 01 2018 3:20pm
We've already discussed these items during the development of offroad mode. Simply disable offroad feature and you're not bothered by the blinking assist symbol and the UP + ON/OFF combination works for the max battery power screen as it was previously.
I am not an user of offroad mode, I always drive on street at 30, 35 or 40km/s. Can you please explain an user case of offrode mode? does the users needs to change fast that mode? how many times does it activate that mode when riding?
I use it every day when I go into the city I go to 25km and 250 watt and switch when i go out of the city or where there is less traffic.

I prefer the 2 buttons combination instead of 3 which will be hard to do while riding.
If you disable offroad mode the power and up bottom is just working for max power.
Is there somebody who is using 25km and 250watt who also want to switch quickly for max power?

Maybe we can think it through when the long/short/combination is going to be implemented.

casainho   1 GW

1 GW
Posts: 3376
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Oct 02 2018 7:45am

stancecoke wrote:
Oct 02 2018 7:02am
Do you just don't care about the law in portugal? As far as I understand the directive 168/2013 of the european union applies in Portugal, too?!
No I don't care as long others don't care, specially the police. Here people use mopeds that goes way over max speed limit and a few other things out of law for mopeds, police don't do nothing.

I prefer to drive at 30 or 40km/h because that way I feel less disadvantage over driving a car, in terms of time I take to arrive to places. Also at those higher speeds I feel safe to ride near the busy roads with cars.

And about switching to legal street/offroad modes, I think it is illegal to do it, even if the technology permits.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

User avatar
stancecoke   10 kW

10 kW
Posts: 996
Joined: Aug 02 2017 2:56pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by stancecoke » Oct 02 2018 8:04am

casainho wrote:
Oct 02 2018 7:45am
And about switching to legal street/offroad modes, I think it is illegal to do it, even if the technology permits.
Of course that's illegal, therefore the idea is to have a "hidden" offroad function, that's disabled by default at system start up.

regards
stancecoke

nieles   10 kW

10 kW
Posts: 672
Joined: Jul 14 2008 5:39pm
Location: The Netherlands

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by nieles » Oct 02 2018 9:04am

casainho wrote:
Sep 26 2018 4:18am
shaddi wrote:
Sep 26 2018 3:34am
EndlessCadence wrote:
Sep 26 2018 2:55am
plans related to wireless communications, debugging and updating the firmware wirelessly as well! Will reveal more when they're more than just plans. :wink:
Serial Bootloader? :o
The motor controller may have enough free memory to do that...
dont know if this was posted already, but there is a bootloader embedded in a special piece of memory on the MCU. ST also has a demo pc software to program the device. (windows)

i tested this on the LCD3 and it works fine. but you need to keep the pwr button pressed which is annoying LOL

EndlessCadence   100 W

100 W
Posts: 217
Joined: Aug 22 2018 4:31am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by EndlessCadence » Oct 02 2018 9:15am

EndlessCadence wrote:
Oct 01 2018 4:06am
casainho wrote:
Sep 30 2018 4:22pm
I agree if you agree to make that management - as you did for the release V0.13. If I were develop alone, I would take shortcuts but having help of others, I do agree.
It's best if we both add new features in new branches and this way I can maintain the master branch and thus the official releases. Beta testers can use the version from the development branch. Maybe I need more access to the repository to do this properly and quick.

Also it really helps if we can migrate to a mono repository. All parts of the firmware in one repository, display and motor controller (and wiki?). LCD and controller are strongly tied together after all, this way we prevent mismatches. Later on we can new displays and other extensions as well, share code etc...
Casainho, can you comment on the above?

EndlessCadence   100 W

100 W
Posts: 217
Joined: Aug 22 2018 4:31am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by EndlessCadence » Oct 02 2018 9:26am

nieles wrote:
Oct 02 2018 9:04am
dont know if this was posted already, but there is a bootloader embedded in a special piece of memory on the MCU. ST also has a demo pc software to program the device. (windows)

i tested this on the LCD3 and it works fine. but you need to keep the pwr button pressed which is annoying LOL
Do you have some more information about this?

Edit: found it here I think. Nice!

spiked   1 mW

1 mW
Posts: 15
Joined: Sep 07 2018 10:20am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by spiked » Oct 02 2018 9:59am

Hello all,

I've been lurking here for a while, while obtaining all the gear necessary to install a TSDZ2 and LCD3, and program them with the open source firmware. Thanks for all the amazing efforts on this front!

I've flashed the LCD3 with v0.12, and am about to flash the motor/controller. Just wanted to ask a question - can you go back to stock firmware for the motor? This build is for my wife, and she's pretty happy with the stock firmware/VLCD5. If for any reason she doesn't like the open source setup, I'd like to be able to go back to stock config.

I seem to remember casainho saying early on that he had read the controller firmware, and then reflashed it. So I assume it is not protected, and I can save it to a file before flashing the open source version? Are there any gotchas I need to worry about when saving the file, and when attempting to reflash to go back to stock (I realize I will have to reinstall the VLCD5)?

Thanks, and am looking forward to future enhancements! (If all goes well with my wife's build I'll be building one for myself 🙂 🚴)

casainho   1 GW

1 GW
Posts: 3376
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Oct 02 2018 10:09am

nieles wrote:
Oct 02 2018 9:04am
casainho wrote:
Sep 26 2018 4:18am
shaddi wrote:
Sep 26 2018 3:34am
EndlessCadence wrote:
Sep 26 2018 2:55am
plans related to wireless communications, debugging and updating the firmware wirelessly as well! Will reveal more when they're more than just plans. :wink:
Serial Bootloader? :o
The motor controller may have enough free memory to do that...
dont know if this was posted already, but there is a bootloader embedded in a special piece of memory on the MCU. ST also has a demo pc software to program the device. (windows)

i tested this on the LCD3 and it works fine. but you need to keep the pwr button pressed which is annoying LOL
I guess it does not work on the first time when we need to unlock and erase the original formware, other way would great so users would not need to open the LCD3.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

EndlessCadence   100 W

100 W
Posts: 217
Joined: Aug 22 2018 4:31am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by EndlessCadence » Oct 02 2018 10:11am

spiked wrote:
Oct 02 2018 9:59am
Hello all,

I've been lurking here for a while, while obtaining all the gear necessary to install a TSDZ2 and LCD3, and program them with the open source firmware. Thanks for all the amazing efforts on this front!

I've flashed the LCD3 with v0.12, and am about to flash the motor/controller. Just wanted to ask a question - can you go back to stock firmware for the motor? This build is for my wife, and she's pretty happy with the stock firmware/VLCD5. If for any reason she doesn't like the open source setup, I'd like to be able to go back to stock config.

I seem to remember casainho saying early on that he had read the controller firmware, and then reflashed it. So I assume it is not protected, and I can save it to a file before flashing the open source version? Are there any gotchas I need to worry about when saving the file, and when attempting to reflash to go back to stock (I realize I will have to reinstall the VLCD5)?
I can't comment on doing this because I've never tried and I'm in no way thinking of going back to the stock firmware!
Thanks, and am looking forward to future enhancements! (If all goes well with my wife's build I'll be building one for myself 🙂 🚴)
Alright, go save up some money you'll want it as well I'm sure :P

casainho   1 GW

1 GW
Posts: 3376
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Oct 02 2018 11:56am

EndlessCadence wrote:
Oct 02 2018 9:15am
EndlessCadence wrote:
Oct 01 2018 4:06am
casainho wrote:
Sep 30 2018 4:22pm
I agree if you agree to make that management - as you did for the release V0.13. If I were develop alone, I would take shortcuts but having help of others, I do agree.
It's best if we both add new features in new branches and this way I can maintain the master branch and thus the official releases. Beta testers can use the version from the development branch. Maybe I need more access to the repository to do this properly and quick.

Also it really helps if we can migrate to a mono repository. All parts of the firmware in one repository, display and motor controller (and wiki?). LCD and controller are strongly tied together after all, this way we prevent mismatches. Later on we can new displays and other extensions as well, share code etc...
Casainho, can you comment on the above?
For me ok. I also already thought on the mono repository.

I gave you now access to create repositories, I hope is ok for your needs.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

Eremit   10 mW

10 mW
Posts: 30
Joined: Sep 24 2018 8:33am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by Eremit » Oct 02 2018 6:17pm

casainho wrote:
Sep 30 2018 5:39am
Eremit wrote:
Sep 29 2018 9:35pm
EndlessCadence wrote:
Sep 29 2018 1:03pm
Today I've tested firmware version 0.13. Worked great and so did offroad mode!
With me, with offroad mode enabled but switched off, Bike exceeds the 25 km/h. Still.
Also, "Battery Charge in the Temperature Field" enabled, shows nothing there.

So if that works with you but not with me, what could be the problem? Still using 24V Battery Pack.
About showing SOC, I am a bit lost I must say, because of changes I did on previous versions and the current version I use that is on development branch (no version released yet).
Other than enable that option of refer, you may need to ON/OFF + DOWN click to cycle between show nothing to show SOC or motor temperature (if is enable). Please try and report!!

1. So you are using a 24V battery pack??
2. Did you calc what is the max speed your motor should give?? please do it and compare to the motor ERPS speed you can read on LCD3. Probably you are getting max motor speed for 24V.
I made another field session, and suddenly there was the right SOC(? Batt usage in %) in the temp field. So I switched it off - gone. Switched it on - still gone, but after a while and some clicking, it was there. So it's fine with me, althought I could not find out the scheme of screen refreshing.

1: Yes, still using 24 V
2: Irrelevant. Bike can reach 30km/h. Offroad enabled and switched off: Bike should be limited to 25km/h Offroad enabled and switched on: Bike should reach 30km/h. Both is possible and tested, but I have to change the km/h-Limit in offroad mode for that (This value is superficial, because already given in menu2, I think). Wether I switch on or off the Offroad Mode, I reach that value. If I set it to 30, Bike reaches 30. So it has nothing to do with the max speed of the motor while driving. Offroad Mode simply fails in ignoring the speed limit.

User avatar
jbalat   10 kW

10 kW
Posts: 555
Joined: Nov 10 2012 11:50pm
Location: Melbourne, Australia

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by jbalat » Oct 02 2018 11:46pm

Hey guys I rode to work today on version 0.12. I had a headwind so I bumped it up to level 9 but still arrived very sweaty. I adjusted the power to 500w but I could rarely get above 350w.

On the older 0.3 version I could ride around on level 2 assist and just change power as required.

There was a bug I found that when I stopped for a couple of seconds and then went to take off I had no assistance for 3 revs.

Anyway had my winge, wish I didn't flash but I did. In order to test this stuff I need to know I can switch from one version to another without repercussions

Have a bunch of questions for you GURUS :D

1. Now does anyone know how to truly wipe the LCD3 totally clean ? I'm still having issues getting the old firmware on it :(

2. Is the display just picking up old values stuck in the motor controller ?

3. I need to enter 10 for number of cells in the menu but it only lets me enter 0 or 1... Where is this "Byte Size" info stored is it in the display or the motor ? Is it the options tab or memory tab ?
Last edited by jbalat on Oct 03 2018 2:26am, edited 1 time in total.
Please subscribe to my Youtube home page for Quadcopters, FPV and Bike Rides http://www.youtube.com/jbalatutube
My build log here http://endless-sphere.com/forums/viewto ... =6&t=55352
For some cool ebike talk join us on The Best ebike https://www.facebook.com/groups/193581737807033/
Tech talk TSDZ2 Opensource firmware https://endless-sphere.com/forums/viewt ... &start=150
Opensource TSDZ2 Wiki https://github.com/OpenSource-EBike-fir ... _wiki/wiki

nieles   10 kW

10 kW
Posts: 672
Joined: Jul 14 2008 5:39pm
Location: The Netherlands

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by nieles » Oct 03 2018 1:35am

casainho wrote:
Oct 02 2018 10:09am
nieles wrote:
Oct 02 2018 9:04am
casainho wrote:
Sep 26 2018 4:18am
shaddi wrote:
Sep 26 2018 3:34am


Serial Bootloader? :o
The motor controller may have enough free memory to do that...
dont know if this was posted already, but there is a bootloader embedded in a special piece of memory on the MCU. ST also has a demo pc software to program the device. (windows)

i tested this on the LCD3 and it works fine. but you need to keep the pwr button pressed which is annoying LOL
I guess it does not work on the first time when we need to unlock and erase the original formware, other way would great so users would not need to open the LCD3.
you are right, with locked firmware the bootloader is disabled unfortunately :(

we would need to get unprogrammed displays or custom programmed displays for this to work.

casainho   1 GW

1 GW
Posts: 3376
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Oct 03 2018 2:38am

Eremit wrote:
Oct 02 2018 6:17pm
casainho wrote:
Sep 30 2018 5:39am
Eremit wrote:
Sep 29 2018 9:35pm
EndlessCadence wrote:
Sep 29 2018 1:03pm
Today I've tested firmware version 0.13. Worked great and so did offroad mode!
With me, with offroad mode enabled but switched off, Bike exceeds the 25 km/h. Still.
Also, "Battery Charge in the Temperature Field" enabled, shows nothing there.

So if that works with you but not with me, what could be the problem? Still using 24V Battery Pack.
About showing SOC, I am a bit lost I must say, because of changes I did on previous versions and the current version I use that is on development branch (no version released yet).
Other than enable that option of refer, you may need to ON/OFF + DOWN click to cycle between show nothing to show SOC or motor temperature (if is enable). Please try and report!!

1. So you are using a 24V battery pack??
2. Did you calc what is the max speed your motor should give?? please do it and compare to the motor ERPS speed you can read on LCD3. Probably you are getting max motor speed for 24V.
I made another field session, and suddenly there was the right SOC(? Batt usage in %) in the temp field. So I switched it off - gone. Switched it on - still gone, but after a while and some clicking, it was there. So it's fine with me, althought I could not find out the scheme of screen refreshing.
I am also having this issue on V0.12 about SOC, I must say. I were using the most recent code from development and I had not that issue.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

casainho   1 GW

1 GW
Posts: 3376
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Oct 03 2018 2:51am

jbalat wrote:
Oct 02 2018 11:46pm
Hey guys I rode to work today on version 0.12. I had a headwind so I bumped it up to level 9 but still arrived very sweaty. I adjusted the power to 500w but I could rarely get above 350w.

On the older 0.3 version I could ride around on level 2 assist and just change power as required.
We didn't touch on the code about motor, FOC, etc. I guess you need to build your own version to include your changes about field weakening. If you think is not that, than you should change the assist level factor on LCD3.
jbalat wrote:
Oct 02 2018 11:46pm
There was a bug I found that when I stopped for a couple of seconds and then went to take off I had no assistance for 3 revs.
That happens to me also, sometimes. I guess it is some combinations of using brakes, etc that makes startup boost not working for that time.
jbalat wrote:
Oct 02 2018 11:46pm
Have a bunch of questions for you GURUS :D

1. Now does anyone know how to truly wipe the LCD3 totally clean ? I'm still having issues getting the old firmware on it :(

2. Is the display just picking up old values stuck in the motor controller ?

3. I need to enter 10 for number of cells in the menu but it only lets me enter 0 or 1... Where is this "Byte Size" info stored is it in the display or the motor ? Is it the options tab or memory tab ?
LCD3 saves data on EEPROM. On current code seems that the code that verifies if data there is ok (looking only at custom KEY value on address 0) is not working properly. If you put your EEPROM to zeros, I don't know what can happen because some values there should not be zero!
I think the best way is for us to solve this issue of EEPROM not being cleaned by the firmware it self....

2. No, that should not happen.

3. On the display. Here the code, and as we can see, it should let you increase the value up to 15!! I don't know why has that behaviour for you!! (unless you are changing any other configuration that just change between 0 or 1!!)

Code: Select all

    // battery cells number
    case 2:
      if (get_button_up_click_event ())
      {
        clear_button_up_click_event ();
        if (configuration_variables.ui8_battery_cells_number < 15) { configuration_variables.ui8_battery_cells_number++; }
      }

      if (get_button_down_click_event ())
      {
        clear_button_down_click_event ();
        if (configuration_variables.ui8_battery_cells_number > 7) { configuration_variables.ui8_battery_cells_number--; }
      }
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

casainho   1 GW

1 GW
Posts: 3376
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Oct 03 2018 2:55am

nieles wrote:
Oct 03 2018 1:35am
you are right, with locked firmware the bootloader is disabled unfortunately :(

we would need to get unprogrammed displays or custom programmed displays for this to work.
1. User could open the LCD3 the very first time to unlock the firmware and then would never more to open it up or solder wires to outside. I think this still is better to current solution!! Current solution is needed for developers as we need to debug the code using the STLinkV2 connection.

2. Also, can we do this on the motor controller? or there is some pin that need to be pressed in order the bootloader to work??

Would be great if someone could volunteer to write a wiki page with instructions for 1., as I think users will prefer that!!
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

EndlessCadence   100 W

100 W
Posts: 217
Joined: Aug 22 2018 4:31am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by EndlessCadence » Oct 03 2018 3:38am

casainho wrote:
Oct 02 2018 11:56am
For me ok. I also already thought on the mono repository.

I gave you now access to create repositories, I hope is ok for your needs.
Thanks! Can I create a new repository with all the parts of the firmware or do you still have branches which need to be merged to master first?

Post Reply