Nema 17 clockwise counterclockwise end-stop

Bonjour à tous,

je souhaite contrôler un nema 17, (sur un socle rotatif, et avec une uno), lorsque le moteur tourne dans un sens et qu'il arrive en butté du end-stop et bien qu'il tourne dans l'autre sens puis pareil pour le sens.

Je suis débutant,

merci pour votre compréhension,

// Include the Arduino Stepper Library
#include <Stepper.h>

// Number of steps per output rotation
const int stepsPerRevolution = 200;

// Create Instance of Stepper library
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);


void setup()
{
  // set the speed at 60 rpm:
  myStepper.setSpeed(10);
  // initialize the serial port:
  Serial.begin(9600);
}

void loop() 
{
  // step one revolution in one direction:
  Serial.println("clockwise");
  myStepper.step(50);
  delay(900);

  // step one revolution in the other direction:
  Serial.println("counterclockwise");
  myStepper.step(-50);
  delay(900);
}

Veuillez utiliser google translate si vous postez sur un forum en anglais.

À quoi sert le programme que vous avez publié ? Que doit-il faire qu'il ne fait pas ?

Quels sont vos “end stops”?

Please use google translate if you post on an English language forum.

What does the program you posted do? What should it do that it is not doing?

What are your "end stops"?

a7

Hello, thank for your answer and okay for English!

End-stops are toggle switches. The nema 17 is controlled by A4988 driver
(like on 3D printers).

I just googled

stepper motor with end stops

and there is much discussion you might benefit from.

Does the program you posted above operate the stepper motor?

It looks like it would turn 90 degrees one way, pause then turn 90 degrees the other way.

Have you written any programs at all? If not, you should just start with buttons and LEDs and the examples in the IDE, very easy and basic things you will need to know.

If you have written some more advanced programs, even a little bit, you should be able to get something working, we can help with your efforts.

But first describe as best you can the overall goal of the current experiment or project that you are working on. Just in plain terms (English, haha) what the program is supposed to do, and what inputs or other information is going to control the stepper motor.

a7

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.