-
Notifications
You must be signed in to change notification settings - Fork 553
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
Kv rating fix #347
Kv rating fix #347
Conversation
Thank you very much for contributing this! I'm going to hold off merging it until after the next release, which I hope will be quite soon. That will give us some time to then test the effects on the dev branch. Introducing this change will correct the calculations, but it will have the side effect of changing the behaviour of existing setups. Many people will have "tuned" their settings, picking a KV value for themselves which differs from the actual one but works well in practice. People will have to change these values after we introduce the fix. So its something we need to do carefully. |
I have another question: why not pre-multiply the KV_rating value by the factor of _SQRT3/_RPM_TO_RADS in the init method, and then not have to do this multiplication/division each time through the loop? |
That is also a possibility. I was not sure if the KV_rating variable might be used for something else and would be needed without the multiplier. However, I can make the change so that it is pre-multiplied if that is preferable. |
I also have the feeling this will be confusing if KV_rating is used somewhere else. |
You're right - it would be confusing to have the parameter so named, but the value represent a different quantity. So keep as is, but perhaps remove the unneeded brackets from the calculation - not sure if the compiler would respect the order implied by the parenthesis or optimize it away, but in this case we'd prefer the brackets around the two constants to make it clear to the compiler? |
This looks good to me. This solution is much better both in terms of the code that is easy to understand(sqrt(3) instead sqrt(2)), and keeping the KV_rating the same as the one user has set will make it much easier to set for the user. |
So it's merged! :-) Thank you very much for the contribution and the discussion! |
Hi Guys, Is the statement in the docs about increasing the kv by 10-20% still valid now ? |
fixes: #344
Need to verify that this is the correct math/logic. It assumes sinusoidal bemf. Perhaps can add an option for more trapezoidal bemf motors.