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

Queue for trajectory planing in async movement #154

Open
ChrGri opened this issue May 4, 2023 · 1 comment
Open

Queue for trajectory planing in async movement #154

ChrGri opened this issue May 4, 2023 · 1 comment

Comments

@ChrGri
Copy link

ChrGri commented May 4, 2023

Thank you for this awesome library. I recently switched from Arduino Nano to a Teensy 4.1. This required a move from the fast stepper library ( https://github.com/gin66/FastAccelStepper/blob/master/src/FastAccelStepper.cpp ), to this GIT project (its 4.1 fork to be precise). I've noticed that with the other library, async movements are handles by a queue automatically and if the target position is updated before the movement has completed, the trajectory is updated. In this library, however, the behaviour seems different. If the "moveAbsAsync()" function is called with every 30µs with varying target positions, the stepper does not move at all.

My question is: How to use this API in closed loop applications, where the stepper target position might change every some µs?
I don't want to wait until the move is completed to calculate a new target position. Instead, I want to start the movement, and update the target position when the stepper is still moving.

This snippet might explain my current implementation:

#define stepPinStepper 1
#define dirPinStepper 4
Stepper s1( stepPinStepper, dirPinStepper ); // Step pin: -, Dir pin: -

long Position_Next = 0;
void loop()
{
Position_Next++;
s1.moveAbs(Position_Next);
}

BR

@luni64
Copy link
Owner

luni64 commented May 5, 2023

Short Answers:

  1. Currently TeensyStep is not compatible to T4.x processors. I'm not aware of any T4.1 fork, Which repository are you refering to?
  2. Currently TeensyStep does not support on-the-fly changes of target positions.

Both items are not good of course. But, unfortunately, I don't have ressources to work on it in the near future.

So, sorry to say, but it might be better to look for another stepper library for your project.

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