Stepper motor + Arduino Uno + CNC Shield + DRV8825 and it doesn't work

Hello,

First of all - I've been working on this for 2 days, searching the web without success.
The goal is to run a stepper motor.

Here's what we have:

2 stepper motors, Arduino Uno, CNC shield, DRV8825 driver, 24V 4.5A power supply.

Motor 1: STP-43D034 Nema 17

Motor 2: 28HB30-401A Nema 11

I set up the DRV8825 driver for Nema 11 with a ratio of 0.3.

I connected the driver to the Y connector on the CNC shield.

Here's the test program.

#include <Stepper.h>

// Ustawienia silnika krokowego
#define STEPS_PER_REV 200 // Liczba kroków na obrót silnika
#define STEPPER_PIN_1 8   // Pin 8 dla kierunku silnika krokowego
#define STEPPER_PIN_2 9   // Pin 9 dla kierunku silnika krokowego
#define STEPPER_PIN_3 10  // Pin 10 dla kierunku silnika krokowego
#define STEPPER_PIN_4 11  // Pin 11 dla kierunku silnika krokowego

// Inicjalizacja obiektu Stepper
Stepper stepper(STEPS_PER_REV, STEPPER_PIN_1, STEPPER_PIN_3, STEPPER_PIN_2, STEPPER_PIN_4);

void setup() {
  // Ustawienie prędkości silnika
  stepper.setSpeed(100);
}

void loop() {
  // Przesunięcie silnika o 10 kroków w prawo
  stepper.step(10);
  delay(500);
  // Przesunięcie silnika o 10 kroków w lewo
// stepper.step(-100);
 // delay(500);
}

The problem is how to connect the motor cables to the shield to make the motor move?

I know how to pair the cables - AA BB - but I don't know which one is AA and which one is BB. The attempt to assign A- A+ B- B+ didn't work for me because the resistance fluctuates during the tests and I can't draw any meaningful conclusions.

Motor 1 has a small connector with strange colors and moving the cables in the connector configuration doesn't help.

Motor 2 has supposedly standard colors (cables not terminated with a plug), but I've tested many combinations and it didn't help.

I don't know how to find out how to properly connect the motor.

Thanks in advance



Stepper motor basics.

simple stepper code

Identify stepper motor leads.

The stepper driver enable pins are pulled high so the stepper drivers are disabled by default. Pull pin 8 (Uno pin) low or jumper the EN/GND header on the CNC shield.

Uno pins to CNC shield pins:

Thanks,
I solved the problem . There was a problem in the code and in the "enable header" .
However, it turned out that it does not matter how I connect the cables from one pair - it is important that it be one pair. I changed cables in order and I don't see any difference(within one pair). Could it turn out to be significant under load?
The smaller motor (Nema 11) when connected correctly, hums gently all the time - when it is not moving. Is it normal? The larger Nema 17 is quiet.
I set 0.3 on the controller - the small one has 0.6A 6.7Ohm.

A post was split to a new topic: 2D Pen Plotter (___)

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