Skip to content
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

Acceleration and deceleration are off by factor of 2. #4

Open
willdickson opened this issue Mar 3, 2018 · 1 comment
Open

Acceleration and deceleration are off by factor of 2. #4

willdickson opened this issue Mar 3, 2018 · 1 comment

Comments

@willdickson
Copy link

The acceleration and deceleration as set via the setAcc and setDec appear to be off by a factor of two. This issue appears to be due an error in the conversion constant in the accCalc and decCalc functions found in SparkFunAutoDriverSupport.cpp. According the the L6470 manual the conversion constant should be given by (tick^2)/(2^-40) where tick = 250ns. This gives ((250e-9)**2)/(2^-40) = 0.068719476736 However, the constant in the AutoDriver library is 0.137438 which appears to be off by approximately a factor of two.

@kanta
Copy link

kanta commented Sep 25, 2024

I also noticed this problem with the above issue and recalculated the conversion formula. As @willdickson said, the conversion constant for ACC and DEC should be 0.06871948.
Also, the constant for INT_SPD is 4 times smaller than the datasheet, and the constant for SPEED is slightly smaller.

So these constants need to be fixed, I think.

Register Name Current value Calculated value
ACC / DEC 0.137438 0.06871948
INT_SPD 4.1943 16.777216
SPEED 67.106 67.108864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants