Notifications
Clear all

Stepper Motor Arduino Problem

1 Posts
1 Users
0 Likes
1,934 Views
(@androidftw)
Member
Joined: 4 years ago
Posts: 1
Topic starter  

I purchased a "TOAUTO Integrated Closed-Loop Nema23 Stepper Motor with Driver IHSS57-36-20 2Nm 36V Position Encoder for Lazer 3D Printer CNC Control" from Amazon.

I also purchased an ELEGOO UNO R3 Arduino starter kit which includes the UNO R3.

I tried following the tutorials the kit provides, but when I tried to control the "TOAUTO Nema23 Stepper Motor" with the UNO R3 it didn't rotate or anything. I connected the PUL+ and DIR+ with 4.7K resistors to pins 11 and 9 on the UNO R3. The PUL- and DIR- are connected to Ground. The motor itself is powered by a 36V power supply with a 100uf capacitor. The motor is set to 6400 steps.

I included pictures of how I wired everything.

My end goal is to make a diy gaming PC steering wheel.

The code I used is:

//2018.10.25

/*
  Stepper Motor Control - one revolution

  This program drives a unipolar or bipolar stepper motor.
  The motor is attached to digital pins 8 - 11 of the Arduino.

  The motor should revolve one revolution in one direction, then
  one revolution in the other direction.

*/

#include <Stepper.h>

const int stepsPerRevolution = 6400;  // change this to fit the number of steps per revolution
const int rolePerMinute = 15;         // Adjustable range of 28BYJ-48 stepper is 0~17 rpm

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 9, 11);

void setup() {
  myStepper.setSpeed(rolePerMinute);
  // initialize the serial port:
  Serial.begin(9600);
}

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

  // step one revolution in the other direction:
  Serial.println("counterclockwise");
  myStepper.step(-stepsPerRevolution);
  delay(500);
}
This topic was modified 4 years ago by AndroidFTW

   
Quote