bbs-fw icon indicating copy to clipboard operation
bbs-fw copied to clipboard

[BBS02] Speed sensor loses tracking

Open MrHumanRebel opened this issue 1 year ago • 92 comments

Recently rode the bike with the latest 1.3.1 version for a long run, I noticed around every 10-15 minutes the speed sensor data is not shown properly for a few seconds. For example cruising at constant 35 km/h and sor a few moments firstly a lower speed is shown like 15-20 km/h and then a spike up to the 50s, then it is back to normal. Might be a sensor pulse filtering issue, but I'm just guessing at this point, I have no more information about his anomaly.

The speed sensor and the magnet is located perfectly to each other, and working (and so blinking) perfectly fine. This is with a BBS02B.

Thanks in advance!

MrHumanRebel avatar Apr 23 '23 18:04 MrHumanRebel

No idea. I think there is one other guy on a BBS02 who had similar issue too along with a lot of other issues. Haven't seen a this on my BBSHD or TSDZ2. I can leave the issue open but if this was a common firmware issue on the BBS02 I would have expected quite a few reports.

I own no bike with BBS02 so I have no experience of how it runs on that controller, support was added blindly by me and then tested by others.

danielnilsson9 avatar Apr 23 '23 20:04 danielnilsson9

Hi, i did not notice this problem on my bbs02b

kb79000 avatar Apr 23 '23 20:04 kb79000

Yeah I did notice this on my last longer ride with road speed limited PAS levels. The motor randomly cuts power for no apparent reason and spins up again while the speed on the display goes up to 50s. Not very often though as you say so it is hard to diagnose.

silenec avatar Apr 23 '23 22:04 silenec

Yeah I did notice this on my last longer ride with road speed limited PAS levels. The motor randomly cuts power for no apparent reason and spins up again while the speed on the display goes up to 50s. Not very often though as you say so it is hard to diagnose.

My bbs02b with v1.3.1 has this same problem of random power cuts, it happens about 2 or 3 times in a 10 mile ride

ronmicro avatar Apr 25 '23 18:04 ronmicro

Alright, definitely sounds like a firmware issue then. Was anyone of you running 1.2? Was the issue present there too or is it new in 1.3?

danielnilsson9 avatar Apr 25 '23 18:04 danielnilsson9

Alright, definitely sounds like a firmware issue then. Was anyone of you running 1.2? Was the issue present there too or is it new in 1.3?

Personally, I started using this firmware from 1.3.1 so I have no information regarding this.

MrHumanRebel avatar Apr 25 '23 18:04 MrHumanRebel

I started from 1.3.1 too but i just tried version 1.2.0 on a long ride and it still happened a couple of times

ronmicro avatar Apr 29 '23 13:04 ronmicro

Ich habe auch mit 1.3.1 angefangen, aber ich habe gerade Version 1.2.0 auf einer langen Fahrt ausprobiert und es ist immer noch ein paar Mal passiert

that's a shame, do you have any idea what could be wrong, when does it happen, is there a trigger or did you notice something?

Larswagner1987 avatar Apr 29 '23 14:04 Larswagner1987

Hi,

I Have 1.2.0 too and noticed the same. I though this was related to the fact that i have max current set to 33 amps in a bbs02 and it was hitting some kind of extreme condition but I see it might be due to other thing. In my case, I noticed that behaviour when locking the rotor and demanding max current for a few seconds. I managed to see an error coming in the log.

Gonespa avatar Apr 29 '23 14:04 Gonespa

I also suspect that it has something to do with the current, every time the motor is supposed to give current it happens, on the road it's just not a problem but as soon as there is an increase it starts as soon as he has to give more current then he interrupts 1-2 seconds and then the line comes back, I have a bbs02b motor 48v 750Watt

Larswagner1987 avatar Apr 29 '23 14:04 Larswagner1987

Are you guys using pas or throttle when it happens and if you are in SPORT, is it still in SPORT after the problem?

dav0000000 avatar Apr 29 '23 16:04 dav0000000

ich benutze nur pas und die normal , also kein Gas oder Sport

Larswagner1987 avatar Apr 29 '23 17:04 Larswagner1987

I have only noticed this when using the throttle. I am not 100% sure about the mode, but I would say thay the mode is not changing. If it happened I would probably not notice it since I have configured the "standard" mode as full power mode (and the one I use 99% of the time0 and "sport" mode as a tamed down one.

Gonespa avatar Apr 29 '23 17:04 Gonespa

I have no gas in use, I tried again to generate the error and it only comes when the engine draws power, then the power goes away and comes back then it's fine and at some point it starts again, it's weird, it can but just look at my display and see how the watt reading goes to 0 in time and then is full again. must be a small thing, but where only in the log is there nothing in it for errors.

Larswagner1987 avatar Apr 29 '23 19:04 Larswagner1987

@Gonespa Probably not related to this issue unless others also have their current set that high. It's been reported before that it's not possible to set current above 25A for BBS02 because some other hardware protection is triggered outside the control of this firmware, that is probably what you are seeing. Set max current to 25A and it should work normally.

danielnilsson9 avatar Apr 29 '23 20:04 danielnilsson9

@danielnilsson9 I have mine set to 23a and it can be 25a, could it be because the engine had the misfires as a result???

Larswagner1987 avatar Apr 29 '23 20:04 Larswagner1987

@Gonespa Probably not related to this issue unless others also have their current set that high. It's been reported before that it's not possible to set current above 25A for BBS02 because some other hardware protection is triggered outside the control of this firmware, that is probably what you are seeing. Set max current to 25A and it should work normally.

Agreed, I only mention it since the described behaviour looks exactly as I saw. I mean, behaves just like when the motor control micro returns an error: power disconnects completely for 1 or 2 seconds and the resets. Looks to me it is returning some kind of error. I was thinking, is it possible to save in permanent storage "the first error" returned, so that it can be retrieved like a car MCU does with the app?.

Anyways, other than that extreme condition, I also noticed this a few times when using the bike in much less stressing conditions.

Gonespa avatar Apr 30 '23 06:04 Gonespa

@danielnilsson9 The only thing I have done now is connect the laptop and start and then the error comes, but it only shows Motor target current changed to 0% for 1 second and then it goes back to normal, and once it says Failed to read voltage from motor controller, everything was fine so far.

Larswagner1987 avatar Apr 30 '23 08:04 Larswagner1987

@danielnilsson9

I've tried everything now and it's a pity that this error is there, as soon as the laptop is connected it doesn't come up anymore as soon as it's not connected it comes up which is strange, the cables are new. I tried different settings but it didn't work, I don't know what the problem is anymore, sometimes it's there immediately, sometimes it's only there after 4 km, then it doesn't work at all, it just breaks off and then the performance comes back after 1-2 Seconds, I've got the original bbs02 version back on it now, if you find the bug and then have a new version I'll try it.

Larswagner1987 avatar Apr 30 '23 11:04 Larswagner1987

I see, yes you are probably better off with the original firmware. These issues are not likely to be fixes as I don't have a bbs02 and are not doing any work on that motor. So unless someone else decides to do some investigation here it will probably stay this way.

danielnilsson9 avatar Apr 30 '23 11:04 danielnilsson9

@danielnilsson9

ok shame, like I said, it's great except for the error, I can only send you a bbs02 controller or the original hex file, can you do something with it then?

Larswagner1987 avatar Apr 30 '23 12:04 Larswagner1987

I got back from another ride and I can say this bug appears way more often and / or is more noticeable when going uphill. I can pretty much predict some situations where it happens. It almost always happens when approaching a hill.

  • when road speed goes down and current goes up, the motor stops and starts again like 90% of the time
  • it rarely happens when road speed goes up and current goes down (going downhill)
  • it happens less often when going at constant speed in lower PAS levels
  • it happens less often when road speed is higher (= more pulses from the speed sensor) even with stronger assist level
  • it is probably the same problem I mentioned in https://github.com/danielnilsson9/bbs-fw/issues/105
  • when going uphill in PAS5 (PAS + MaxSpeedPercent, config file in the link above), I got the motor to constantly skip even without throttle - previously I thought it only happened with PAS + Throttle + MaxSpeedPercent but that is not the case
  • it does not happen when using throttle only (no PAS)

I think we should test some bare minimum firmware - no temperature monitoring, no throttle, no keep current, no push walk, no ramping anything that is not necessary, maybe even no speed sensor if possible etc. and see when it starts working properly.

silenec avatar Apr 30 '23 18:04 silenec

@silenec then try it and let me know, I definitely need the speed sensor and the shift sensor too, I don't need the rest like the gas, I hope that the error trigger is found, the original version is really not nice to use there this version is perfect. thank you already 👍

Larswagner1987 avatar Apr 30 '23 18:04 Larswagner1987

@Larswagner1987 Thanks but I have a BBS02 controller and firmware but diagnosing things that only occurs while riding on high power is hard with a controller on my desk.

@silenec That makes sense, I was never able to reproduce that issue, I have ridden > 100km since then using PAS and throttle on high power on my BBSHD but it's rock solid, I have not seen a single glitch.

Weird thing is that there is not really any BBS02 specific code here in this firmware apart from pin assignments and motor MCU configuration. Search "BBS02" in all files and you will find very little. The motor MCU config was directly mirrored from the original BBS02 firmware.

Does the speed on you display show incorrect value each time this happens?

danielnilsson9 avatar Apr 30 '23 18:04 danielnilsson9

Sometimes I see speed glitches on my display when it happens but sometimes I do not yet the motor still stops. It is weird. Maybe something in the NEC MCU does not like how the new FW behaves? Maybe there are some limits like maximum change of current / % of requested power per second or something and the limits might be different for BBSHD? And when something goes over the limit, NEC MCU "resets" and starts again? I have no idea honestly.

silenec avatar Apr 30 '23 18:04 silenec

Ye maybe, I was thinking along these lines too as there is actually an error code reported from NEC MCU on BBS02 described here https://github.com/danielnilsson9/bbs-fw/wiki/NEC-Motor-Control-Protocol which I guessed was an overcurrent error but could be anything really. It's not exported to any error code sent to the display so you will never se an error when it occurs. Would be interesting to know if that error is set when this issue occurs.

NEC MCU shutting down doesn't explain the speed sensor reading issue though, since speed sensor reading is done by this firmware..

danielnilsson9 avatar Apr 30 '23 19:04 danielnilsson9

Now that I think about it... I put new chain on an older cassette once and the chain used to skip. The motor somehow detected that and every time the chain skipped, the motor did exactly this - stopped and spinned up again. Same thing when my rear tire slipped on ice in winter - motor stopped and started again. Not sure how that worked exactly. That was a few years ago on stock FW. Might it be the "chain skip protection" (if there is one) getting triggered by glitchy speed sensor values? Is the speed sensor reading reported to the NEC MCU or not? I guess not so this would not make sense then... hmm

silenec avatar Apr 30 '23 19:04 silenec

I had speed sensor rise with a watchdog reset a while back. Only way I knew was SPORT mode always reset to STANDARD as the system restarted.

dav0000000 avatar Apr 30 '23 19:04 dav0000000

Hello

have you tested everything? a friend of mine thinks it could be something with the magnets, because when you drive and the power is gone, he took a closer look and noticed that it could be in the pas leagues, but there could also be incorrect information, the second could be there it's all mirrored what's wrong with the current values, since the BBs motor does a mini reset and then it's full again, or could it be that the memory/ram is too full and that's why it's happening?

Larswagner1987 avatar May 02 '23 05:05 Larswagner1987

I tried disabling the speed sensor in the config tool today but made no difference, still a lot of drops over a long ride

ronmicro avatar May 03 '23 12:05 ronmicro