I am new to electronics. I am facing a problem while powering my m542 for controlling stepper. When I power it on, it behaves weirdly i.e. it keeps on restarting/blinking for some time and i have to turn it off to avoid any harm to it. Previously it use to work. I have tried re wiring it but things doesn't change. And some times it works fine.
Any help from community would be great. I have attached the wiring image
and
of arduino and m542, also I have created a video displaying my problem here is the link for the same
Photographs of wiring nests are just as useful, but not nearly as pretty, as photos of bird's nests.
Make a pencil drawing showing all your connections and post a photo of that.
Post a link to the datasheet for your stepper driver.
Post your code - without that we have no idea what you are trying to do.
And please use the code button </> so your code looks like this and is easy to copy to a text editor
#include <StepperMSeries.h>
// change this to the number of steps on your motor
#define STEPS 200
#define PULSE_PIN 23
#define DIRECTION_PIN 25
#define ENABLE 27
StepperMSeries stepper(STEPS, PULSE_PIN, DIRECTION_PIN);
void setup() {
// set the speed at 60 rpm:
stepper.setSpeed(150);
pinMode(ENABLE,OUTPUT);
digitalWrite(ENABLE,HIGH);
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
stepper.step(STEPS);
delay(500);
// step one revolution in the other direction:
Serial.println("counterclockwise");
stepper.step(-STEPS);
delay(500);
}
That diagram is much better, and sufficient for now. However a pencil drawing would have been easier to assimilate. Even a poor pencil drawing.
I know nothing about that stepper library.
This Simple Stepper Code does not use any library and should work with your driver for testing purposes. Obviously you need to get the pin reference correct. And you may need to add control of the enable pin - but it may work without it connected at all.
Thank you all for your support. I found my driver was culprit. Switch 4 that was on half current was creating this issue. I modified it to full current and it is working smoothly now.
Thank you all for your support. I found my driver was culprit. Switch 4 that was on half current was creating this issue. I modified it to full current and it is working smoothly now.
Thanks.
That's the mode that reduces current when the motor is idle for a short time - this can greatly reduce
power consumption - rather than disable it, try it out - the motor will jump back to full current on the
next step anyway.