0
$\begingroup$

The RAMPS X Clone as X1 works beautifully But I am having a strange problem: If you look at the code, there are two different parts. One is for a simple stepper move, and the other is for a simple acceleration. The simple move with X and clone X1 work. Simple Accel clone X1 does not. While X fulfills its command to move to the right side by a thousand steps, X1 does not: It moves 300 steps to the left (approximately) and then 700 steps to the right!

Can anyone find the bug?

The code link: https://gist.github.com/d333gs/dcf4f4124e640bd9d9b5ea50a662454d

$\endgroup$

1 Answer 1

0
$\begingroup$

I hope someone finds this useful. OK, this is working: I repeated the command, first with 1 step and then the full 1000 steps. Now, the motors move together in the same direction.

digitalWrite(X_DIR_PIN, HIGH);
simpleAccel(1);
digitalWrite(X_DIR_PIN, HIGH);
simpleAccel(1000);
digitalWrite(X1_DIR_PIN, HIGH);
simpleAccel(1);
digitalWrite(X1_DIR_PIN, HIGH);
simpleAccel(1000);

GitHub: d333gs/Code update

$\endgroup$
1
  • 1
    $\begingroup$ Code link is a 404? $\endgroup$
    – Trish
    Commented Nov 28 at 11:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .