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

Implemented Constant Acceleration Move #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ochoadavid
Copy link

Hi! I implemented a constant acceleration move function. I wonder if it can be useful to someone else.
Few thinks to note:

  • I'm certain that there is a better way to implement this. In this implementation the velocity is adjusted by the actual position. The function used is:
    V= 2 * V_max * t (0 < t < 0.5)
    V= 2 * V_max - 2 * V_max * t (0.5 < t < 1.0)
    (using t as a lineal position parameter)

  • The moveCA command takes two arguments: the absolute position and the max speed in RPM. Given the nature of a CA movement the max speed should be adjusted to have a reasonable movement time for each movement as the same RPM will produce slow acceleration rates in long movements and fast acceleration in short movements.

  • Fine adjusting the pid parameters could still be necessary in some dynamics.

@coolio986
Copy link
Collaborator

@ochoadavid, This firmware tries to maintain non floating point calculations in order to keep the code as fast as possible without division errors. Can you make these changes using integer math instead of floating point?

@ochoadavid
Copy link
Author

Hi!

Ok. I will try to change the implementation as soon as I've some time.

@coolio986
Copy link
Collaborator

Thanks @ochoadavid !

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

Successfully merging this pull request may close these issues.

2 participants