rickvanderzwet.nl

Personal notes on technology, sustainability and DIY projects

Revenge of the jumpers

06-01-2014 · author: rick · 3D-printing

two-jumpers-left-one-is-faulty.jpg

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.

// Pin headers for Megatronics v2.0 (MOTHERBOARD 701 in Marlin Firmware)
#define X_STEP_PIN         26
#define X_DIR_PIN          27

#define Y_STEP_PIN         4 // A6
#define Y_DIR_PIN          54 // A0

#define Z_STEP_PIN         56 // A2
#define Z_DIR_PIN          60 // A6

unsigned long prevMillis;
int steps = 0;
bool dir = HIGH;

void loop () {
   // Reverse direction after 100 steps
   if (steps == 100) {
     dir  = !dir;
     steps = 0;
   }

   digitalWrite(X_DIR_PIN, dir);
   digitalWrite(Y_DIR_PIN, dir);
   // digitalWrite(Z_DIR_PIN, dir);
   steps += 1;
   
   digitalWrite(X_STEP_PIN, HIGH);
   digitalWrite(Y_STEP_PIN, HIGH);
   // digitalWrite(Z_STEP_PIN, HIGH);
   delay(5);

   digitalWrite(X_STEP_PIN ,LOW);
   digitalWrite(Y_STEP_PIN ,LOW);
   // digitalWrite(Z_STEP_PIN ,LOW);
   delay(3);

}
Download as: plain text