//This is an example of how you would control 1 stepper
#include <AccelStepper.h>
int motorSpeed = 9600; //maximum steps per second (about 3rps / at 16 microsteps)
int motorAccel = 80000; //steps/second/second to accelerate
int motorDirPin = 2; //digital pin 2
int motorStepPin = 3; //digital pin 3
//set up the accelStepper intance
//the "1" tells it we are using a driver
AccelStepper stepper(1, motorStepPin, motorDirPin);
void setup(){
stepper.setMaxSpeed(motorSpeed);
stepper.setSpeed(motorSpeed);
stepper.setAcceleration(motorAccel);
stepper.moveTo(32000); //move 32000 steps (should be 10 rev)
}
void loop(){
//if stepper is at desired location
if (stepper.distanceToGo() == 0){
//go the other way the same amount of steps
//so if current position is 400 steps out, go position -400
stepper.moveTo(-stepper.currentPosition());
}
//these must be called as often as possible to ensure smooth operation
//any delay will cause jerky motion
stepper.run();
}
The setup is exactly the same as the tutorial, with the following: Driver power supply: Wall AC/DC Adapter 12 V 2A - Model KDL-122000 Arduino power: connected to my PC USB port
I did turn the Adjust power right and left to test.
I can upload the code to the Arduino, but at this point, I only get a very hot BED, but no stepper moving, even if I turn the adjust power..
So, where should I look, and what should I change?
This is my first time with a step motor so I am a little (a lot) lost.
The windings on your motor are rated at 2a with a supplied voltage of 3V. You are putting in 12V therefore too much current is flowing. Thats where the heat is coming from.
So much for teading the datasheet before using hardware.... @OP,
Did it occur to you to read the datasheet for your motor before connecting 12V to it ?
To avoid any problems I bought the motor and the BED part from known US company that deliver all its products in red box.
I asked which power supply they recommend for this motor and I am reading their email again l: 12V- 5A
So I should get the 3V - 2 A power supply. I just tried to power directly the stepper with a 3 V, and it move, I guess one step.
can I assume the stepper is not dead?
I think you make one more test. Reduce the speed to a slow speed first and then if it works , gradually increase it. It's possible the combination of high ps voltage and high speed is causing it to stall.
It is not connectedto the BED and Arduino now but i can make it turn step by step when putting 3V to it.
I do not notice any heat, but I guess It will not get hot until I put it back on the BED and Arduino- will do that tomorrow and will update.
thanks
aheighway:
The windings on your motor are rated at 2a with a supplied voltage of 3V. You are putting in 12V therefore too much current is flowing. Thats where the heat is coming from.
The purpose of a stepper motor driver board is to limit the current while using a high voltage.
@OP, In this case the BED can't really supply the current needs of this motor. However the motor should show some signs of life if the BED is limited to 1 amp. If you want it to supply more current you must supply additional cooling.
If you want it to supply more current you must supply additional cooling.
If the BED is not rated for at least 3/4A more than you need , then you should look for a higher rated driver because running it hot is just a worst case option. It might be ok, it might fry. I don't know. Do you want have to cross your fingers every time you run it ?