86Views1Replies

Author Options:

help on mutiple steppers on arduino mega Answered

Hello,

I am hoping to get some help for my project here.

I have three steppers that would like to control using an arduino mega 2560...my first question is: is this possible? in other words can i connect the wires from stepper (bi-polar and 4-wire) directly to the arduino pins?

secondly, is there a sample code that i can use to make the steppers sweep independently? are there specific libraries i need to use?

Regards,
Behzad.

Comments

The forums are retiring in 2021 and are now closed for new topics and comments.
0
mpilchfamily
mpilchfamily

7 years ago

1) No you need a controller board that is capable of handling the power draw of the steppers.

2) There are many differnt motor shields out there. Some have there own libraries others use more standard libraries. Look around and see what is available as far as motor sheilds go.

0
karim_bj
karim_bj

Reply 7 years ago

Ok I had written some code that I incorporated some lines to my code:

I connect the USB cable from Arduino to my PC but I cannot find the COM1 port there (not in Arduino MEga and not in Control Panel: Ports)!!

This is my setup (pictures attached - sorry for too many wirings and confusing background in advance).

This is the code I have used (very basic):

[code]

#include <Stepper.h>

#define STEPS 200

Stepper stepper1(STEPS, 0, 1, 2, 3);

Stepper stepper2(STEPS, 4, 5, 6, 7);

Stepper stepper3(STEPS, 8, 9, 10, 11);

void setup()

{

stepper1.setSpeed(60);

stepper2.setSpeed(60);

stepper3.setSpeed(60);

Serial.begin(9600);

}

void loop()

{

Serial.println("CW");

stepper1.step(STEPS);

stepper2.step(STEPS);

stepper3.step(STEPS);

delay(500);

Serial.println("CCW");

stepper1.step(-STEPS);

stepper2.step(-STEPS);

stepper3.step(-STEPS);

delay(500);

}

[/code]

I would appreciate your help. Am I connecting to wrong pins to Arduino? Am I drawing too much current?? As you can see both the "ON" green and "L" yellow LEDs are lighting!! why is that?

Thank you,

Karim.

image (19).jpegimage (20).jpegimage (21).jpeg