Hello all,
I'm starting to build a CNC machine from very little knowledge or background in electronics. So I got a motor, Arduino Uno, power supply, motor driver etc on eBay. Hooked everything up (I think correctly). I can control the motor no problem, but I am getting 800 steps per rev instead of the 200 the motor is specked for.
I'm using:
Moons ML23HSAP4300 stepper
http://www.moonsindustries.com/products/Steppermotor/RotarySteppermotor/Hybrid_Stepper_motor/Standard_HB_Stepper_motor/HB2P_ML23HS/
4A TB6600 Stepper Motor Driver Controller
with switches OFF OFF ON for no microstepping
pin 2 to DIR- 3 to DIR+ 4 to PUL- 5 to PUL+
a 24v 5A power supply
#include <Stepper.h>
const int maxRotations = 48;
int pause = 1000;
const int stepsPerEighth = 508;
int rotationNumber;
Stepper myStepper(800, 2, 3, 4, 5);
void setup() {
myStepper.setSpeed(300);
}
void loop() {
for (rotationNumber=1; rotationNumber<=maxRotations; rotationNumber++)
{ myStepper.step(stepsPerEighth);
}
delay(pause);
for (rotationNumber=maxRotations; rotationNumber>=1; rotationNumber--)
{ myStepper.step(-stepsPerEighth);
}
delay(pause);
}
code is a bit screwy I've got the motor hooked up to a ball screw with a 5mm pitch so 508 steps gets me 1/8 in travel and the code is moving it to get 6" of travel
I doubt the structure my machine will give me +-0.000246063 of accuracy so I don't need 800 steps
Also, "someThing == wrong", I don't know what, and my brain won't let me move on until "someThing != wrong"
I figure it something with my wiring cause I'm a noob or something, but it has me stumped.