Ebike Lishui controller, custom FW, problem at certain voltages

OP (Company: interia) #7857128

Hi fellows, I have a strange problem with ebike controller using STM32 uC (Device family :STM32F10xx Low-density)

I have a fischer 1606 ebike with a Lishui controller which did not have original display. I found that this controller has alternative firmware made by colleague stancecoke from endless sphere and formerly pedelecforum.de. Link to github with FW - https://github.com/EBiCS/EBiCS_Firmware/tree/cbbee7ec449f21d52dbe661d53a394d5e81c589d

It has several branches, master is for motors with hall sensors, there is also a sensorless branch that I am using, since fischer 1606 has sensorless geared motor.

So far I am playing with this controller on my desk, with only display connected using bench power supply (Riden 6030). Long story short is that sensorless version flashed to my controller sometimes start without an issue, sometimes right after start gets stuck in Error Handler. It looks to be input voltage dependent. At 48.6V, every power cycle ends up with E30 on my display (E30 is communication error, which is a result of program being stuck at error handler). If I change voltage to 42-43V it starts without problem most of the times. I tested also on battery to eliminate voltage ripples etc. and the same story.

I flashed master version and it works flawlessly regardless of voltage, but this is no use for me since I do not have sensors :)

I was asking stancecoke for help here https://endless-sphere.com/sphere/threads/lishui-open-source-firmware-project-kingmeter-5s.106862/page-17 and he pointed this forum as a last resort :)

I am perplexed now, stance thought that it might be due to a bit "primitive" display handling and he updated it - no change, he asked me to grab communication between controoler and the display during problem and controller is mute, he suggested it might be some issue with interruptions, which I adjusted but also to no avail. The stupid thing is that if I hook up to the board using Eclipse with disabled reset upon connection and also disabled breakpoint in main I can see it being stuck in Error Handler, once I press resume, program resumes, E30 disappears and the controller is working normally without any problems.

I am totally puzzled and do not know what to do further. There are some differences in branches (master compared to sensorless), like (and not limited to) ADC being handled by different timers and different frequencies. Could I get some advise from you why it starts up normally at certain voltages while with others not? :)

#7857144

Isn't it just the throttle or break hall sensor on adc that is triggering emergency shutdown, did you connect throttle and break on controller?

Btw the Kingmeter Protocol in Sensorless_VESC branch needs minor fixes (branch was abandoned in favor of NewGeneration12FET). you can try my fork.

edit: I see there are some new commits, it's been a while I have played with Sensorless_VESC.

OP (Company: interia) #7857171

Alexander wrote:

Isn't it just the throttle or break hall sensor on adc that is triggering emergency shutdown

This ebike does not have throttle nor brake sensors. I am not sure how to check what caused code to be stuck at error handler :|

Alexander wrote:

Btw the Kingmeter Protocol in Sensorless_VESC branch needs minor fixes

I believe that stancecoke introduced some changes pertaining to this several weeks ago, but I do not know what exactly was affected.

Funny thing is that he was usint this in his Fischer 1606 and it was working :D

Alexander wrote:

you can try my fork.

I guess I have to adjust motor parameters, anything else that comes to your mind for a geared motor without hall sensors?

#7857179

Marjano I. wrote:

I am not sure how to check what caused code to be stuck at error handler

I think it's stuck in Src/main.c line 318. set break points and use the debugger to figure out what's going on.

Marjano I. wrote:

I guess I have to adjust motor parameters, anything else that comes to your mind for a geared motor without hall sensors?

just use your config.h

Reply

A question of your own? This thread is over a year old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.