Posts for the month of January 2014

Revenge of the jumpers

Searching for two hours why my X and Y direction stepper motors where not travelling the same distance when evoking the same amounts of steps. Turned out to be 'interesting'. By closer inspection of my jumpers which controlled the step sizes, it turned out one was 'empty'.

By replacing the jumper all where happy again. During my testing I noticed that the steps where also limited to 200um instead of 100um. By closer inspection this is caused by slack on the timer-belt. I am hoping to improve it by the means of using different belt.

I used a very simple test program for testing purposes, this basic framework is also nice if you want to play with single steps and all kind of other accuracy settings.

Line 
1// Pin headers for Megatronics v2.0 (MOTHERBOARD 701 in Marlin Firmware)
2#define X_STEP_PIN 26
3#define X_DIR_PIN 27
4
5#define Y_STEP_PIN 4 // A6
6#define Y_DIR_PIN 54 // A0
7
8#define Z_STEP_PIN 56 // A2
9#define Z_DIR_PIN 60 // A6
10
11unsigned long prevMillis;
12int steps = 0;
13bool dir = HIGH;
14
15void loop () {
16 // Reverse direction after 100 steps
17 if (steps == 100) {
18 dir = !dir;
19 steps = 0;
20 }
21
22 digitalWrite(X_DIR_PIN, dir);
23 digitalWrite(Y_DIR_PIN, dir);
24 // digitalWrite(Z_DIR_PIN, dir);
25 steps += 1;
26
27 digitalWrite(X_STEP_PIN, HIGH);
28 digitalWrite(Y_STEP_PIN, HIGH);
29 // digitalWrite(Z_STEP_PIN, HIGH);
30 delay(5);
31
32 digitalWrite(X_STEP_PIN ,LOW);
33 digitalWrite(Y_STEP_PIN ,LOW);
34 // digitalWrite(Z_STEP_PIN ,LOW);
35 delay(3);
36
37
38}