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

perryscope said:
That's odd. But glad it's working for you. Would you mind uploading a screenshot of the stm32 st-link main window. Does it look like the bytes are correct for the .bin file. Also did you erase from stm32 st-link or was the screen already flashed?
Target Chip erase
Erase_Chip.jpg
Load bin file
Load_bin.jpg
Target program
Target_program.jpg
After flash
After_flash.jpg
 
bruwie said:
perryscope said:
That's odd. But glad it's working for you. Would you mind uploading a screenshot of the stm32 st-link main window. Does it look like the bytes are correct for the .bin file. Also did you erase from stm32 st-link or was the screen already flashed?
Target Chip erase

Yes those are the steps I followed but it looks like my 850C is only 256K bytes? I wonder if that's the difference?

850-C-256k.PNG
 
fi7ippo said:
Hi Buba I saw the 0.20.0 wiki, wonderful, You have make a epic job :bigthumb:

Is it safe to compile and test?

Wow, thank you! Appreciate it!

I advice against testing it for now. Especially when I am so close to have a version that can be tested by all users. Would love your feedback when it is ready!

In my earlier versions I could change motor parameters during trips, directly from the LCD. I did this to test the limits of the system. One of many tests I wanted to do was to stress the blue gear bearings until they were totally destroyed. Did many, many startup tests and different checks. I was very successful in destroying the bearings in the blue gear. I do this so you do not have to. :wink: The version on my fork is far safer and close to finished but I still advice to wait.

I apologize for taking so long.



fi7ippo said:
I read a bit the code and maybe I don't understand well, but on

src/controller/adc.c says

64 // read ADC torque sensor value
65 uint16_t ui16_temp = UI16_ADC_10_BIT_TORQUE_SENSOR;
66
67 // filter the ADC torque sensor value and set to offset variable
68 ui16_filter(&ui16_temp, &ui16_adc_pedal_torque_offset, 9);

what is ui16_temp ?

We create a 16 bit unsigned integer called ui16_temp. It is a temporary variable where we store the 10 bit value of the torque sensor ADC.

Then that variable is passed to a function that filters the value and stores it in another variable called ui16_adc_pedal_torque_offset. The number "9" is the amount of filtering that is supposed to be done in the filter.

The variable, ui16_adc_pedal_torque_offset, is actually the resting torque value we have discussed previously in the thread.

Let me know if you want to know more or are curious of anything!



fi7ippo said:
I've not yet understand what is the difference in the new 4 type motor logic, (torque - pas - cadence - emtb) but I'll try when a beta will available

Basically:

Torque Assist = We look at the torque sensor value and convert that to a motor torque value. The harder we press the pedals the more torque we get from the motor. It is a linear correlation assuming your torque sensor is linear in the range you are riding. This works very similarly to the original firmware.

PAS/Cadence Assist = This is actually the standard riding mode on most electric bikes. Most electric bikes can only senses crank rotation. When the system senses crank rotation it will engage the motor so as to assist the user.

eMTB = This is a dynamic riding mode that works much like torque assist. But it adjusts the assist factor depending on the amount of torque applied and the wheel speed. You need more assistance when going faster and this is not linear. So this is why eMTB is dynamic and changes depending on circumstances.



fi7ippo said:
On the new wiki there is a new parameter scale on menu (9 Motor Controller Setup)

2 Motor acceleration 70%

What scale have the new parameter 2 Motor acceleration? Maybe 100% for 10A/s rump up or what?

It is difficult to explain but when using the torque sensor it has a natural time delay. This gives enough of a power ramp up that we only need to configure the possible available power and the rate of change of that possible power. I have tested this so much in many different versions it has resulted in a better current controller/ torque controller. Not PI yet but maybe in the future IF it is necessary. Anyway, the result is a very natural feeling and the system has become very responsive.



fi7ippo said:
Option 3 Pedal torque conversion factor - and 4 Weight on pedal is perfect, wow, wonderful work :thumb: :thumb:

I like it too! It is so simple and will be perfect for users that want to calibrate the torque sensor so the system can calculate the human power more accurately. Can also be used to check the accuracy, precision and range of the torque sensor. It is more natural and easier to understand and we instinctively have a feeling if something is not right or non-linear just by looking at the weight value.

Just measure with a scale or use some weights and you are set. Adjust until you are happy! Glad you liked it!



fi7ippo said:
I had some time to swap the torque sensor with a brand new untouched new one, and I can say that the new sensor have a lower range, rest 31-32 maximum about 74 and lower capacity (about 40kg) but I'll post a complete data in a few days!

Among other things I forgot to install the white Teflon thickness before the torque sensor, and I would not damage the sensor windings, so I will have to disassemble it again.
I have also noticed that without this thickness inside it all seems smoother than before when a rubbing noise was heard, I think I will try it without thickness for about fifty km.

Thank You Buba, have a nice day!

Yes, that seems to be very common. Most of the torque sensors start out with values around 30-40 when new. Nice of you to provide that data and information! This is exactly why this community is so great!

Thank you, fi7ippo!
 
buba said:
casainho said:
hefest said:
After some time with new version of firmware, it looks like the "no power" issue is still there, but not as pronounced as before.

I think I figured out the way to reproduce it, although not every time.

On red light, with brakes with sensors on and sitting on the bike with feet on the pedals. When I start, there is no power for few seconds and display is slowing 0 watts. With older version of firmware this was more frequent and it was taking more time.
That happens to me just like you describe, in v0.19.0.

Are you guys using Startup Boost? Does it happen with it off?

Have no power issue in the 0.20.0 development but am not using Startup Boost either. Did experience some slow starts in the 0.19.0 though.

hefest said:
I'm using startup boost yes. Will try with boost off once the weather allows.

casainho said:
I was not using Startup Boost when I got that issue.

Okay guys, this is hopefully solved in the next version!
 
thineight said:
fi7ippo said:
Hi Buba I saw the 0.20.0 wiki, wonderful, You have make a epic job :bigthumb:

Where is the 0.20 wiki? I'm curious to have a look at it in the meantime... :wink:
Thanks

The super secret 0.20.0 wiki is far from finished but it is linked below :wink:

https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/0.20.0
 
Made repair sensor. Pasted a thin layer of PCB, and adjust the position of the sensor, set 25. Everything works great! Saved $ 100.
 

Attachments

  • IMG_20190714_213133.jpg
    IMG_20190714_213133.jpg
    74.7 KB · Views: 1,540
  • IMG_20190714_213330.jpg
    IMG_20190714_213330.jpg
    156.6 KB · Views: 1,539
perryscope said:
bruwie said:
perryscope said:
That's odd. But glad it's working for you. Would you mind uploading a screenshot of the stm32 st-link main window. Does it look like the bytes are correct for the .bin file. Also did you erase from stm32 st-link or was the screen already flashed?
Target Chip erase

Yes those are the steps I followed but it looks like my 850C is only 256K bytes? I wonder if that's the difference?

850-C-256k.PNG
Please take a picture of the microcontroller to make sure it is another version from the ones I have, see here a picture showing

https://github.com/OpenSource-EBike-firmware/Color_LCD/wiki/Bafang-color-LCD-850C
 
perryscope said:
bruwie said:
perryscope said:
That's odd. But glad it's working for you. Would you mind uploading a screenshot of the stm32 st-link main window. Does it look like the bytes are correct for the .bin file. Also did you erase from stm32 st-link or was the screen already flashed?
Target Chip erase

Yes those are the steps I followed but it looks like my 850C is only 256K bytes? I wonder if that's the difference?

850-C-256k.PNG
Please take a picture of the microcontroller to make sure it is another version from the ones I have, see here a picture showing:

https://github.com/OpenSource-EBike-firmware/Color_LCD/wiki/Bafang-color-LCD-850C

GD32F103RET6
This is a 32 bits ARM Cortex M3 that should be very similar to STM32F103.

GD32F103RET6 main characteristics:

Maximum Speed Up to 108MHz
Flash Memory: 512K
RAM: 64K
Package: LQFP64
 
I've downloaded the proper software and files and exposed the programming pads. The pads are quite a bit narrower than the LCD-3 connectors. Are you soldering pins to the pads or just bending programming pins from the st link five wire into a narrower width? I was thinking to cut the corner out and hotglue pins to pads -- so that future flashing can be done without opening the case.

Wonderful work and thanks to all of the programmers.
 
sabergo said:
I've downloaded the proper software and files and exposed the programming pads. The pads are quite a bit narrower than the LCD-3 connectors. Are you soldering pins to the pads or just bending programming pins from the st link five wire into a narrower width? I was thinking to cut the corner out and hotglue pins to pads -- so that future flashing can be done without opening the case.

Wonderful work and thanks to all of the programmers.
I am bending the connectors wires so I can solder on the pads. Would be nice if you guys can share pictures so I can update the wiki.
 
fi7ippo said:
dameri said:
AZUR said:
Hi,

Can I buy the display at PSWPOWER, on Aliexpress?

Full colorful LCD P850C display.

At this link:

https://www.aliexpress.com/item/32664961322.html?spm=a2g0o.cart.0.0.7bf33c00QCUMa1

Many thanks,

Azur

PSWPOWER: http://www.pswpower.com/ven.php?cargo.2016-5e-2eaj

Hi guys does the P850C works with 14s 58,8v battery?
Thank You
Yes it does, I am running 2 of them on different bicycles with 14S3P battery packs.

I need to put this note on wiki.
 
casainho said:
perryscope said:
bruwie said:
perryscope said:
That's odd. But glad it's working for you. Would you mind uploading a screenshot of the stm32 st-link main window. Does it look like the bytes are correct for the .bin file. Also did you erase from stm32 st-link or was the screen already flashed?
Target Chip erase

Yes those are the steps I followed but it looks like my 850C is only 256K bytes? I wonder if that's the difference?

850-C-256k.PNG
Please take a picture of the microcontroller to make sure it is another version from the ones I have, see here a picture showing:

https://github.com/OpenSource-EBike-firmware/Color_LCD/wiki/Bafang-color-LCD-850C

GD32F103RET6
This is a 32 bits ARM Cortex M3 that should be very similar to STM32F103.

GD32F103RET6 main characteristics:

Maximum Speed Up to 108MHz
Flash Memory: 512K
RAM: 64K
Package: LQFP64


Looks to be a different PCB layout compared to your photo, and unfortunately there is something on the chip obscuring some of the lettering. This is an existing photo I had so i will take it apart later and try to remove the mark, I think its just black marker.
IMG_20181231_170152_small.jpg
 
perryscope said:
Looks to be a different PCB layout compared to your photo, and unfortunately there is something on the chip obscuring some of the lettering. This is an existing photo I had so i will take it apart later and try to remove the mark, I think its just black marker.
That board uses the STM32F103RCT6, which has only 256 kbytes of flash memory (half of the GD32F103RET6
, that has 512 kbytes). Also STM32F103RCT6 runs at 72MHZ max frequency while GD32F103RET6 runs at max of 108MHz.

I think your LCD will not work. Can you please take more pictures of the case, reference, name on internet or such so we should avoid users buying that version??

I bought this from PSWPower (http://www.pswpower.com/ven.php?cargo.2016-5e-2eaj), can your please compare with the one you bought? can you share the link for the shop?
 
casainho said:
perryscope said:
Looks to be a different PCB layout compared to your photo, and unfortunately there is something on the chip obscuring some of the lettering. This is an existing photo I had so i will take it apart later and try to remove the mark, I think its just black marker.
That board uses the STM32F103RCT6, which has only 256 kbytes of flash memory (half of the GD32F103RET6
, that has 512 kbytes). Also STM32F103RCT6 runs at 72MHZ max frequency while GD32F103RET6 runs at max of 108MHz.

I think your LCD will not work. Can you please take more pictures of the case, reference, name on internet or such so we should avoid users buying that version??

I bought this from PSWPower (http://www.pswpower.com/ven.php?cargo.2016-5e-2eaj), can your please compare with the one you bought? can you share the link for the shop?

I thought that may be the case. I did get this screen 2nd hand some time ago (dec 2018) as a spare for my BBS-02 setup so the original seller is unknown unfortunately, but I have tried to contact them in case that can share where they purchased it from. My guess is its an earlier version but it was described as a 'Bafang (Luna) 850C (DPC-14) Advanced colour display with USB' and it did indeed have the Luna Bafang firmware on, so I suspect it came from Luna Cycles originally.

Here is a photo of the case that may help other users avoid it.

IMG_20181231_174301.jpg

DP C14.UART
DPC14L0100021
V5.2 1609060400


Anyone know how to upload the original bafang firmware back on it ;)
 
casainho said:
I am bending the connectors wires so I can solder on the pads. Would be nice if you guys can share pictures so I can update the wiki.

I'll take pictures of the approach I take. Thanks!
 
perryscope said:
I thought that may be the case. I did get this screen 2nd hand some time ago (dec 2018) as a spare for my BBS-02 setup so the original seller is unknown unfortunately, but I have tried to contact them in case that can share where they purchased it from. My guess is its an earlier version but it was described as a 'Bafang (Luna) 850C (DPC-14) Advanced colour display with USB' and it did indeed have the Luna Bafang firmware on, so I suspect it came from Luna Cycles originally.

Here is a photo of the case that may help other users avoid it.

IMG_20181231_174301.jpg

DP C14.UART
DPC14L0100021
V5.2 1609060400


Anyone know how to upload the original bafang firmware back on it ;)
Ok, nice to know it is a DPC14, I will put a warning on wiki about that model, saying it does not work.

I would say there is no way to put the original firmware back as at least if it works as 850C, it has encrypted bootloader that you erased and I guess no one has that bootloader unless the manufacturer. The original firmware "is locked" on purpose so no one can do a backup and flash again.
 
Hi! Sorry if this is the wrong place for this.

I have been very happily running v17 of the software for a while now (36v, PAS only) but recently started having issues where power reduces then goes to 0, whilst the centigrade 'c' in the bottom right hand corner of the display blinks. The display still shows torque inputs, but 0 motor watts. Seems to happen when battery is roughly half spent with about 36.5v left. Disconnecting and reconnecting the battery doesn't help, charging the battery does. Any ideas what might be going on?!

Thanks in advance!
 
I would like to buy a Teflon sheet to put in the torque sensor, what thickness does it take for you? 0.5 mm is too little?
 
Hello,
I solved it this way.
The five-pole Bafang plug now goes to the JTAG.
Unfortunately I already sealed the display with silicone, otherwise I would have taken more pictures from the inside. Unfortunately I forget this again and again.

Connector.jpg

I drilled a hole for the motor cable.

drill_hole.jpg

The adapter should work for many firmware updates.

Adaptercable.jpg
 
bruwie said:
Hello,
I solved it this way.
The five-pole Bafang plug now goes to the JTAG.
Unfortunately I already sealed the display with silicone, otherwise I would have taken more pictures from the inside. Unfortunately I forget this again and again.

Connector.jpg

I drilled a hole for the motor cable.

drill_hole.jpg

The adapter should work for many firmware updates.

Adaptercable.jpg
Interesting to see on last days the number of users that started to use the 850C LCD!!
 
Back
Top