Pages: [1]   Go Down
Author Topic: help with arduino mega controlling multiple steppers  (Read 625 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello

I posted another note in the forum but received no answer!! I am hoping to get some help with my project, your help is very much appreciated.

I have three stepper motors connected to an Arduino Mega 2560 using three SN754410 H-Bridges. I have attached pictures (sorry for the busy looking background and too many wires, in advance).
I have also got an external power supply with 12VDC and 3A output; since I realized each stepper draws 0.4A current per phase (not sure what this means though). I have connected the outputs of the H-Bridges (from 4 wire steppers) to pins:
0 (RX), 1 (TX), 2, 3, ..., 9, 10, 11.

First of all is this setup correct?
Second, is there like a sample code for multiple steppers so I can test them to sweep back and forth?

Many thanks.


* image (18).jpeg (174.53 KB, 640x480 - viewed 23 times.)

* image (17).jpeg (137.88 KB, 640x480 - viewed 12 times.)
Logged

Victoria, Australia
Offline Offline
Edison Member
*
Karma: 46
Posts: 1392
Electronics Engineer/Industrial Control
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, okay on the pics, but I think a circuit diagram, either CAD or pic of hand drawn effort would help.
I think you also need to keep away from your rx/tx pins as they are part of the programming/ serial i/o.

Tom... smiley
Logged

Everything runs on smoke, let the smoke out, it stops running......VK3DMK

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK thank you so much! I removed the wires from those pins and shifted them.
However:

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);
 
}

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).jpeg (142.48 KB, 640x480 - viewed 9 times.)

* image (20).jpeg (130.37 KB, 640x480 - viewed 12 times.)

* image (21).jpeg (135.5 KB, 640x480 - viewed 12 times.)
Logged

Victoria, Australia
Offline Offline
Edison Member
*
Karma: 46
Posts: 1392
Electronics Engineer/Industrial Control
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, sorry but to get this far with your project you must have drawn or followed a circuit diagram.
If not, then draw a diagram from what you have, these pictures show the myriad of wires needed to connect to the bridges, but not how you have done it.
Please a diagram, CAD or picture of hand drawn circuit.
Thanks for your efforts so far, however its your project and you know all about it, we don't which makes you miles ahead in understanding the system.
Have you tried the sketch, if  you want the circuit checked before you try it, then a circuit diagram is essential.

Tom..... smiley
Logged

Everything runs on smoke, let the smoke out, it stops running......VK3DMK

Pages: [1]   Go Up
Jump to: