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

Run bug! #23

Open
Zhehua-Hu opened this issue May 16, 2023 · 1 comment
Open

Run bug! #23

Zhehua-Hu opened this issue May 16, 2023 · 1 comment

Comments

@Zhehua-Hu
Copy link

While I set Xaxis.move,Yaxis.move both negtive, both of two motor not run.

I am using ESP32 with arduino & TMC2209 driver.

I have tested that 3 type work and only 1 type not work.

Code:

#include <Arduino.h>

#include <AccelStepper.h>
AccelStepper Xaxis(1, 16, 17); // step, direction
AccelStepper Yaxis(1, 25, 26); // step, direction
void setup() {
    int x_circle = 3200;
    int y_circle = 3200;

    Xaxis.setMaxSpeed(x_circle*8);
    Yaxis.setMaxSpeed(y_circle*8);
    Xaxis.setAcceleration(1*x_circle);
    Yaxis.setAcceleration(1*y_circle);

    // work!
//    Xaxis.move(1*x_circle);
//    Yaxis.move(1*y_circle);

    // work!
//    Xaxis.move(1*x_circle);
//    Yaxis.move(-1*y_circle);

    // work!
//    Xaxis.move(-1*x_circle);
//    Yaxis.move(1*y_circle);

    // NOT WORK!
    Xaxis.move(-1*x_circle);
    Yaxis.move(-1*y_circle);
}
void loop() {
    Xaxis.run();
    Yaxis.run();

}
@Zhehua-Hu
Copy link
Author

@waspinator my email: [email protected]. Thank you firstly!

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