Maker Pro
Maker Pro

Using ramps1.4 as generic stepper interface

Chazz

Nov 3, 2018
2
Joined
Nov 3, 2018
Messages
2
Hello everyone,
I'm excited to be part of forum as it looks like I will be doing more, and more electronic oriented projects in the future!

Anyways I have an extra arduino mega, and ramps board with working stepper motors from a previous 3d printer. I have been wanting to build a star tracker/pointer thing for a while. Anyways I figured I could easily use the ramps board to interface with the steppers as needed. I found this useful tutorial right here ->

I used a volt meter to determine what pins I needed to initialize. I decided to go with the x stepper. I found A0 and A1 pins to be responsible for the "dir" and "step" and initialized them in code as he did.

After getting it all set up, I couldn't get the motor to turn at all. Not even noise. I checked the stepper driver for a voltage on the "pot" and found a voltage of about 0.45v, which is correct that means it is getting power. I also made sure the loop was running correctly by dropping in some Serial.print() functions in there. I swapped out the driver just to be sure, and doubled checked that I didn't have the pins initialized backwards. Maybe the stepper is sleeping do to other pins I'm not aware of not being initialized correctly? Maybe M0, M1, M2, are initialized incorrectly(I doubt that though, I am guessing they are hard wired to 5v). I will say that I did pull the jumpers out to see I could at least get it moving in full step mode. None of that worked. Maybe there is a good library for doing this, but I really like the tutorial linked above as it gives a lot of options when it comes to programming.

Hopefully its something minor in the code that I am getting wrong! I have working in matlab lately so jumping back into C++ has had a few hiccups!

Anyways thanks for any help in advanced looking forward to hearing from you guys.


}
//const int stepPin = A0;
//const int dirPin = A1;

void setup() {
pinMode(A0, OUTPUT);
pinMode(A1, OUTPUT);
Serial.begin(9600);
}

void loop() {
digitalWrite(A1, HIGH);

for(int x = 0; x < 200; x++) {
digitalWrite(A0, HIGH);
delayMicroseconds(4000);
digitalWrite(A0, LOW);
delayMicroseconds(4000);
Serial.print(x);
Serial.print('\n');

}
delay(1000);
}
 

Chazz

Nov 3, 2018
2
Joined
Nov 3, 2018
Messages
2
I am sure this is good news to all, I did a bit more research as many encourage, and it turns out that the enable pin needs to be set to low. On the x stepper that is pin number 38. I went ahead and set it to low and it worked like a charm.
 
Top