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

Motion planning #13

Open
dentikhval opened this issue Jan 24, 2023 · 0 comments
Open

Motion planning #13

dentikhval opened this issue Jan 24, 2023 · 0 comments

Comments

@dentikhval
Copy link

I know this code is 4 years old, and it's just a small robot arm we should not expect much from, but it is a great resource to learn from and I love Mr. Skyentific's implementation of inverse kinematics here. I took a deep dive into the code looking to scale it up to a bigger and more serious arm, and I have issues with the coordinatedMotion() function and moveMotors() behavior.

Essentially, what the implemented coordinatedMove() function does is breaks the move into 3 phases: acceleration, stable speed and deceleration. Then calculates the time and number of steps needed to go through each of these stages.

HOWEVER, the steps are always administered to the driver at the maximum possible step rate, leading to all of them being sent in one batch and then just waiting for the time for the next phase of the move to come. Rinse and repeat.
What if the motors are so fast that they perform the move sooner than the time for the next movement phase comes?
What if the move is very slow and very long?
The effect is compounded by doing that to 6 motors, one at a time (!), leading to an uneven start of movement in every one (of three) phases of motion.

Verdict: this is not coordinated movement at all!

What can be done for this to be scalable?
1 - the delay between high/low pulses for each motor must be adjusted individually for all 6 motors to ensure smooth stepping from the beginning to the end of each phase of movement

2 - steps need to be administered to motors in an asynchronous way simultaneously: e.g. synced first step, and then all steps given out with various (calculated) delays, all leading to motion at the right speed for each individual motor.

3 - use a ready library and a faster microcontroller, like Teensy 4.1 and AccelStepper, or copying code from one of the 3D printer firmwares.

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

1 participant