Hi Guys
a year or so back I was helped to create a stepper motor solution for my home aquarium, and up to now its worked great but I have found the Arduino motor shield was unable to keep up with the my demands so I have increased the stepper driver.
I really struggled with the code as I am not technically minded in anyway, infact I still don't understand what it does apart form when I change 3 key areas to get the solution to do what I want.
Heres the question. on the new stepper driver I have set it up to produce 3.7A and set the micro step table to 2, I have wired in the parallel stepper motor, power and GND, But I am at a loss to the Step + Step - and the Directions + and Direction -
I have really tried to understand the below and tried a few configurations of what I think make sense and whats shown onto of the Motor shield but nothings working.
Can anyone tell me where to put the cable into the Arduino to get this back up and running - My fish tank really needs to have this operational again ASAP.
DIR(A/B) are pins 13 and 12 on the Motor shield , but I also have Brake on (9&8) and PWM A&B on (3,11)
Both of these are mentioned in the below code and before all I have to do was wire up the Motor shield and slide it onto the arduino
Please please anyone advise would be great
The code is below the kind chap help me write
// Bounce.pde
// -- mode: C++ --
// Make a single stepper bounce from one limit to another
//
// Copyright (C) 2012 Mike McCauley
// $Id: Random.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $
#include <AccelStepper.h>
// Define a stepper and the pins it will use
AccelStepper stepper(2, 12, 13); // dir_a and dir_b pins used
const int pwmA = 3;
const int pwmB = 11;
const int brakeA = 9;
const int brakeB = 8;
void setup(){
Serial.begin(9600);
stepper.setMaxSpeed(780);
stepper.setAcceleration(1550);
stepper.moveTo(135);
pinMode(pwmA, OUTPUT);
pinMode(pwmB, OUTPUT);
pinMode(brakeA, OUTPUT);
pinMode(brakeB, OUTPUT);
digitalWrite(pwmA, HIGH);
digitalWrite(pwmB, HIGH);
digitalWrite(brakeA, LOW);
digitalWrite(brakeB, LOW);
// initialize the serial port:
}
void loop()
{
// If at the end of travel go to the other end
if (stepper.distanceToGo() == 0)
stepper.moveTo(-stepper.currentPosition());
stepper.run();
}





