Hello, I am having a problem with the Stepper.h library.
I am using a Arduino Uno,
a MicrostepDriver (Shop - MCI Electronics),
a Nema step motor
(https://www.omc-stepperonline.com/download/23HS22-2804S-HG50.pdf),
and a Dell 19V power supply.
The step motor is connected to the MicrostepDriver as follows:
Blue to B-
Red to B+
Green to A-
Black to A+
The Dell power supply is connected to the MicrostepDriver as follows:
Black to GND
White to VCC
DIR - and PUL - are connected to GND on the UNO.
DIR + is connected to Pin 2 and PUL + is connected to Pin 3 (Pins 2 and 3 on the UNO, that is).
The Microstep settings are as follow:
S1: ON
S2: ON
S3: OFF
(1 Microstep)
S4: ON
S5: OFF
S6: ON
(1 A current)
The Nema step motor has a step angle of 1.8 degrees, so 200 steps/revolution.
With the following code the motor only makes around 1/4 of a full revolution:
#include <Stepper.h>
int stepsPerRevolution=200;
Stepper myStepper(stepsPerRevolution,2,3);
int motSpeed=12;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
myStepper.setSpeed(motSpeed);
}
void loop() {
// put your main code here, to run repeatedly:
myStepper.step(stepsPerRevolution);
delay(2000);
myStepper.step(-stepsPerRevolution);
delay(2000);
}
I have however been successful doing the same thing with the AccelStepper.h library, so that when I asked myStepper to take 200 steps, it completed one full revolution.
sorry if I have mis-formatted this post or forgotten to include any information.
-Einar