Skip to content

Unpredictable stop with Nema 23 #42

@Grandpa-G

Description

@Grandpa-G

I am trying to get the motor stop when it reaches the desired position. However, it appears the motor "free-wheels" with the inertia of the item connected to the motor. How do I get the motor to stop and not coast?

Here is a snippet. degrees is the position. I am using 6400 steps, acceleration = 1000, speed = 1000

` digitalWrite(ENABLE, LOW);
stepper.moveTo(int(degrees));

  // Run the motor until it reaches the target position
  while (stepper.distanceToGo() != 0) {
    stepper.run();
  }
  stepper.stop();

 digitalWrite(ENABLE, HIGH);`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions