-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Motor stutter when braking to a stop after triggering duty cycle current limit bug #262
Comments
Sidenote: I was not able to trigger this bug by having duty cycle current limit start set to 94% or 96% |
I saw FW 5.3 changenotes include a fix for "motor screaming", so I tested it just now, but unfortunately I can still reproduce this bug as before. Now the motor is really screaming! |
I haven't seen anything like this before. Sounds like either the motor parameters are really wrong or that the hardware is damaged. Did you run detection? Did you perhaps overwrite the detection values with default ones before reading them when updating that parameter? Which remote and control mode? What kind of motor? What is the input voltage? Does if come from a battery or a power supply? |
Yes, I ran motor detection. I don't believe I overwrote detection values, since they get read after the motor setup wizzard automatically. (I will check this explicitly once more, just to be sure) Using a PWM remote (mini trigger remote), and control mode is current with brake. Motor is a 75kv direct drive motor from Torqueboards, 28 poles. (Size is something like 68 x 100 ) Input voltage is coming from a 12s Li-Ion battery pack. I will swap out for another vesc and motor later today just to be 100% sure it isn't HW related. |
Tried another vesc and another motor – same result on FW 5.2. Filmed a video going through motor detection, and reproducing the bug + went through some of the real-time data, in case it helps: |
Looks to me like something is broken. Has the BMS ever cut the power while braking hard? If that has happened with both VESCs connected it is likely that both of them have died from that voltage spike and only are half-working now. A few more things to try:
|
On these 2 ESCs I have not had the BMS cut power. That's why I set max regen to 18A in the video, the BMS triggers at 20A. (Forgot to do this once with a stormcore, but luckily it survived the cutout) As I showed in the video, restarting the ESC or just not triggering the bug in the first place (with duty cycle settings being equal) will not cause this motor stutter, and the ESCs work perfectly from what I can tell. Definitely a FW bug in my mind... After this behavior there are no faults logged. I will try the last few things you suggested though and see if they make a difference. |
This is caused by utils_map returning NaN in duty cycle limit when both limits and current duty are the same value. Also same thing happens when d axis gain scalling options are both at the same value. |
You are right. I never came to trying to set them to exactly the same value, as I thought this was related to the current controller becoming unstable when running out of voltage to regulate the currents (which is a confirmed issue on some setups and the reason for the gain scaling). In my tests I set it to the highest value as I though that would be the worst case. I will look into this tomorrow and go through all places where utils_map is used. |
This problem is actually more tricky than I thought. I was thinking of just avoiding the numerical instability, but the problem is that setting the parameters close to the instability is inherently an unstable configuration. For example, setting Duty Cycle Current Limit to 94% is asking it ramp down over a very narrow range, so when hitting full speed the current controller will oscillate between the set current and 0, which probably isn't good. Same think with the d axis scaling - setting them too close is configuring a heavy oscillation in the gain when approaching that duty cycle. I think I will avoid the instability with some trick and also check the parameters so that an unstable configuration is not requested. |
I went through all uses of utils_map and tried to avoid the problem with appropriate margins based on each case: The test builds are updated now too: Can you give the latest version a try and see if it solves the problem? I was not able to reproduce the problem myself for some reason, even when setting Duty Cycle Current Limit Start to the same as Maximum Duty Cycle before the fix. |
I fully agree! :)
Oh wow, strange!
Tried and I can no longer trigger this issue! 🥳 Tried current limit start values 85%, 95%, 99%, 100%; can't get the motor to lock up, so braking remains fine. No motor stutter. Small sidenote: Thank you for fixing this! :) |
Perfect! I'm closing this issue then. Thanks for reporting and helping with the testing! |
One thing I just remembered is that if duty cycle current limit start now means a percentage rather than an absolute value, it would make sense to change the default 85% (for electric skateboards) to 90%, so that it behaves similar to before. |
85% is just some value I came up with, I have no idea what most people prefer. The lower this value is, the longer the torque ramp down is as you are approaching full speed (and the more top speed it costs you). If you do some testing and find a good default value I can use that in vesc tool for e-skate. Personally I set my speed limit much lower than top speed, so I never reach speeds where I would notice any difference. |
Vesc tool 3.0.0
FW 5.2
Trampa Vesc 6+
Steps to reproduce:
(Under Motor Settings -> General -> Advanced)
Note:
Although it might be that fixing the bug in step 5. is all that is needed, this behavior worries me because I had experienced similar brake stuttering behavior when trying to set up a direct drive skateboard with another vesc. So my hypothesis is that something about this duty cycle limit bug triggers something that then allows this brake stuttering bug to be possible. I think it is really odd that even after changing settings this bug persists, and only rebooting fixes it again.
Let me know if you need a video / if there is some debug info I can collect somehow :)
The text was updated successfully, but these errors were encountered: