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

EndlessCadence said:
casainho said:
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?
Go ahead.
 
jbalat said:
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.
Yesterday I did a longer ride and I have more or less the same experience. Is it because we're both using a 36V motor and in my case a 48V battery? Which motor profile are you using? In the past you customized some parameters in the firmware if I remember correctly. I never really used v0.3 because at that time my bicycle wasn't completely usable.

Yes it's definitely a workout to reach max configured power even at assist level 9. A workout isn't a real problem for me though as I'm used to my unassisted road bike, but I have the assisted one to prevent sweating :p
 
I think my motor controller's EEPROM on address 0 is faulty , the symptom is when I turn on the LCD it's isn't start up, stuck at initialization only showing all symbols (this occured for me yesterday firstly on the ride from work to home and I didn't flash my controller a while so it's not related by flashing the firmware). I'm using 0.12 firmware both on LCD3 and motor controller, I try EndlessCadence suggestion for flashing

"2. Using ST Visual Programmer, directly program the data memory after opening STVP without reading the data memory tab (basically writing all zero's to the data memory). This will give a verification error because the firmware will directly overwrite the data memory, but then you have your defaults.
3. Using ST Visual Programmer, write 00 to the first two positions of the data memory at address 004000.

My sequence which works anytime:
1. Update the display firmware
2. Clear display data memory using method 2 above (won't give verification error)
3. Update the motor controller firmware
4. Clear motor controller data memory using method 2 above (will give verification error)""

The second method works only as long as I don't turn off the LCD, the next time it stuck again at initialization. I try the third method and write 00 to the first two positions of the data memory at address 004000 bit it's fail on verification and when I read the data tab again it shows different values on the first two address.

Is there a way to disable this check or remap to another EEPROM address?
 
wheex said:
I think my motor controller's EEPROM on address 0 is faulty , the symptom is when I turn on the LCD it's isn't start up, stuck at initialization only showing all symbols (this occured for me yesterday firstly on the ride from work to home and I didn't flash my controller a while so it's not related by flashing the firmware). I'm using 0.12 firmware both on LCD3 and motor controller, I try EndlessCadence suggestion for flashing
So, for your clear description I can say that almost for sure are the UART TX/RX pins that got loose/unconnected. When LCD3 do not receive data from the motor controller, it just keep like that. But also, if you keep applied brakes at system startup.
 
wheex said:
I try the third method and write 00 to the first two positions of the data memory at address 004000 bit it's fail on verification and when I read the data tab again ot shos different values on the first two address.
This correct because firmware will directly overwrite the data memory with default values again. Try to read the option bytes tab for me?

I once had this issue too (and reported it here). My display was working perfect and after flashing both firmwares it showed all symbols and I found out that the option bytes of the motor controller somehow got corrupted, luckily that can be fixed easily.
 
EndlessCadence said:
jbalat said:
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.
Yesterday I did a longer ride and I have more or less the same experience. Is it because we're both using a 36V motor and in my case a 48V battery? Which motor profile are you using? In the past you customized some parameters in the firmware if I remember correctly. I never really used v0.3 because at that time my bicycle wasn't completely usable.

Yes it's definitely a workout to reach max configured power even at assist level 9. A workout isn't a real problem for me though as I'm used to my unassisted road bike, but I have the assisted one to prevent sweating :p

I have exactly the same and sometimes on higher speed above 35km/u I get hick-ups with the power assist. It looks like it gets out of sync.
I have the same configuration 36v motor and 48v batterypack.

Just to be sure what values are you guys using for the parameters below using 0.12 version:

Menu 8.0 Motor voltage type
0 for 48V brushless motor (TSDZ2 52V version has a 48V brushless motor);
1 for 36V brushless motor.
This configuration is needed for FOC calculations.

Menu 8.2 PAS max cadence
25 km/h This value is used for calculation of human pedal power that will after be used for motor assist level.

I think the 25 km/h is a typo on the wiki and should be around 110?
 
casainho said:
So, for your clear description I can say that almost for sure are the UART TX/RX pins that got loose/unconnected. When LCD3 do not receive data from the motor controller, it just keep like that. But also, if you keep applied brakes at system startup.
Do you think I have problem with TX/RX pins even in that case when the LCD3 is working after a fresh install, it shows the speed correctly, I have assist too. But after I turn off the lcd it's no longer start again.
 
So that's the issues of 0.13 List:

-Soc in temp field, works, but strange behavior.
-Offroad skipping speed limit does not work
-Menu 8/2 Pas requiered/not requiered makes no difference (but I'm not quite sure what is to expect here)

Guess I'll have to try 0.12 now. Display flashing should be possible through the display wire, I guess, or is it really necessary to open the display?

There is something wich could make the config a little easier without big effort. Now, it's blinking Manu-Number, than it's blinking value number, then it's the value. All in the same field. But Menu-Number and Entry-Number could be shown all the time in different fields. This is not important, anyone here can do the config as it is. But it would be a little better and chances to alter the wrong value are lower.
And another one:
When it comes to set battery cut offs and similar value, you're hanging there pressing the damn key a hundred times. If it is possible, this values should count up or down much faster on an ongoing keypress on up or down.
 
wheex said:
casainho said:
So, for your clear description I can say that almost for sure are the UART TX/RX pins that got loose/unconnected. When LCD3 do not receive data from the motor controller, it just keep like that. But also, if you keep applied brakes at system startup.
Do you think I have problem with TX/RX pins even in that case when the LCD3 is working after a fresh install, it shows the speed correctly, I have assist too. But after I turn off the lcd it's no longer start again.
That is strange....
 
EndlessCadence said:
wheex said:
I try the third method and write 00 to the first two positions of the data memory at address 004000 bit it's fail on verification and when I read the data tab again ot shos different values on the first two address.
This correct because firmware will directly overwrite the data memory with default values again. Try to read the option bytes tab for me?

I once had this issue too (and reported it here). My display was working perfect and after flashing both firmwares it showed all symbols and I found out that the option bytes of the motor controller somehow got corrupted, luckily that can be fixed easily.
@wheex, please to to read the option bytes tab for the motor controller and display.
 
EndlessCadence said:
@wheex, please to to read the option bytes tab for the motor controller and display.
OK I will post it when I got home in the evening.
 
wheex said:
The second method works only as long as I don't turn off the LCD, the next time it stuck again at initialization. I try the third method and write 00 to the first two positions of the data memory at address 004000 bit it's fail on verification and when I read the data tab again it shows different values on the first two address.

I got the same response the LCD Will not start propperly again . I tried connecting the controller via STLink ( i use only 3 pins. Controller is powered via battery) to the PC while the LCD is on and then it works again. I changed some values in the configuration regarding the battery and max amps then turned of the controller tried to start and it works now. I dont know IF this is the propper way to solve this issue but it worked for me. Maybe you can try
 
casainho said:
Bartman said:
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.

Would the torque sensor being faulty also cause walk mod not to work ?
 
Bartman said:
casainho said:
Bartman said:
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.

Would the torque sensor being faulty also cause walk mod not to work ?
Walk assist isn't implemented yet, only on the display.
 
EndlessCadence said:
The defaults should work fine. To get the defaults you have three options:
1. Reset to defaults using the display, but casainho reports this isn't working?
2. Using ST Visual Programmer, directly program the data memory after opening STVP without reading the data memory tab (basically writing all zero's to the data memory). This will give a verification error because the firmware will directly overwrite the data memory, but then you have your defaults.
3. Using ST Visual Programmer, write 00 to the first two positions of the data memory at address 004000.

My sequence which works anytime:
1. Update the display firmware
2. Clear display data memory using method 2 above (won't give verification error)
3. Update the motor controller firmware
4. Clear motor controller data memory using method 2 above (will give verification error)

I had some strange issues on firmware 13 so switched back to 12 but had also some strange things like motor power drops at higher speeds, offroad speed was ignored, wrong number of level assists etc.
But today I reprogrammed again with firmware 12 with the sequence EndlessCadence mentioned above and now everything works great again. So I think my memory/parameters weren't "cleaned".
 
casainho said:
nieles said:
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!!

no need for a special pin.. you need to send a special character in the 1st second when the MCU powers up. have a look at the flowchart on page 9 of document UM0560 (linked in this thread somewhere or google)

then once the bootloader is enabled we need some software on the PC to send the right dataframes on the UART line.
 
nieles said:
no need for a special pin.. you need to send a special character in the 1st second when the MCU powers up. have a look at the flowchart on page 9 of document UM0560 (linked in this thread somewhere or google)

then once the bootloader is enabled we need some software on the PC to send the right dataframes on the UART line.
Good!!

Can you volunteer to test both flashs and document with some screenshots and pictures of the wirings? This documentation would then go to the wiki, as the first recommend option because it should be easier to do.
 
Here is my data tabs after a successful fresh install and my LCD didn't worked. https://drive.google.com/open?id=1AT4z0apFW0vR-A27zt45bxTGIj9_pJlR. I experience random fault after a fresh install sometimes the display works sometimes not when I use the same hex files and method, if the display is working I can switch it off and on again without problem but If I remove the battery and immediately turn the display on some energy still in the controller the display is turn on for a second and the display is never initialize again.
 
I could do that, but it's not that easy. The PC application is only available on Windows and it's not great. It only sends the special sync code once, so you really need to time connecting the uart cable, pushing start and resetting the controller for some reason. (I don't remember exactly what was needed as this is more than a month ago)

So we need some proper pc software to make this a better solution better than using the st-link programmer.
 
casainho said:
EndlessCadence said:
casainho said:
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?
Go ahead.
Working on it. Are you using eclipse? Is it alright if I delete all project files and eclipse files for now? Because of the new structure they're incorrect anyways... Those files are still in the "old" repositories for reference. Makefiles are already working, but I can only test the build on Windows. Repository is almost ready :D
 
FYI, see the new repository here: https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike
I've also created a release script to quickly release and version new software, Windows only for now.

The releases can now be found here: https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/releases
No more view as "raw" and "save as" of the hex files, just click on them and they will download.

If you have any feedback please let me know!
 
Good work EC !!

Hey guys just need your opinion on this.. please respond with your preference

I feel that the new Assist levels are not working properly (or as intended). I assigned level 9 to 3000W and I am still only getting 300w or so.

I think we need to go back to the old way which sets the assist level as a multiplier (i believe this is how my Bosch works) that way you can use the quick power setting to get the best combination of assist and power while you ride depending on conditions and how tired you are

Also the power boost stuff causes problems. As I am coasting down hill and back off power then try to go uphill on the other side i get no power for at least 3 turns. I would also like to leave this out as it is not necessary and causes problems.

At what stage was this change implemented ? Can we fork the code before this ???
 
jbalat said:
Good work EC !!

Hey guys just need your opinion on this.. please respond with your preference

I feel that the new Assist levels are not working properly (or as intended). I assigned level 9 to 3000W and I am still only getting 300w or so.

I think we need to go back to the old way which sets the assist level as a multiplier (i believe this is how my Bosch works) that way you can use the quick power setting to get the best combination of assist and power while you ride depending on conditions and how tired you are

Also the power boost stuff causes problems. As I am coasting down hill and back off power then try to go uphill on the other side i get no power for at least 3 turns. I would also like to leave this out as it is not necessary and causes problems.

At what stage was this change implemented ? Can we fork the code before this ???
Thanks jbalat!

You already know I have the same experience but I disagree that the assist level in watts is really causing the issue. It's also just a multiplier/factor but it looks like power. I will look into this. Btw, are you already using a temperature sensor?

I've disabled power boost in my configuration because I don't really like the feeling and in my opinion it can be bad for the motor. The motor has to deliver a lot of torque for this, especially from a stand still. To disable: Set both menu 4.0 (boost config) and menu 4.2 (boost time) to zero. This works for me. I don't think we have to remove this code because it can be easily disabled by anyone who doesn't like it but maybe we can make this the default?

In the future I would prefer to have feature toggles in the configuration so a real boost disable without changing other settings and just leave them default. This way one can really compare the firmware with the feature toggled on or off. I did this for the offroad mode.

We shouldn't fork the code or go back in time because we'll loose a lot of changes then it's also unnecessarry we should be able to fix this.
 
Hi everyone. Thanks for everyone's great work here, it's appreciated.

I know this will go against the gain but I also loved the simplicity and elegance of assist level based on a multiplier of rider input. It was simple to understand and simple to control via the lcd. That coupled with a quiet, efficient motor and I was in heaven.
 
EC no my temp sensor didn't work properly. When I heated it up the temperature on the screen went from 13 to zero only when I wired the positive and negative back to front otherwise it was stuck on 13. Mind you 13 is what you get with no sensor...crap !! It sort of worked better on the bench but very flaky. Not sure where to go from here.

Hurricane I am with you. It was easy to use and handy to control power separately from sensitivity. I know casainho feels the same way. It's like I'm on level 2 but I want 500w and I'm in level 5 but I only want 150w so I can save power. How cool :) At the time I was 100 percent happy with how the motor worked including how smooth and powerful it was.

There are some cool features in the current code too but the fact the motor performance has been compromised I would happily lose them all just to go back :(
 
Back
Top