Limit Switches for Drawbot

I was able to get this working roughly.

I made some beads put onto the strings. These beads will trigger my limit switches.

I then wrote a small program to go through the calibration process twice then move the system to (0,0 Cartesian).

It works pretty consistently. I know I’ll change it as the bot will probably finish at the top right. So I need to make sure it can do a zero operation from there and also from 0,0.

I suppose I could have a switch. If the switch is on, then the system will do a calibration run on boot-up.

The code is at the bottom.

/* Darcy Whyte, DrawBot2 */

// limit switch
const int switchHome = 7;     // home switch
const int ledHome =  8;      // home LED

//Motor S
const int motorAStep = 0;
const int motorADir = 1;
const int motorBStep = 2;
const int motorBDir = 3;

int i; int j;
int switchHomeState = 0;         
int homeA = 0;
int homeB = 0;

void setup() {
  pinMode(ledHome, OUTPUT);      
  pinMode(switchHome, INPUT);     
  pinMode(motorAStep, OUTPUT);
  pinMode(motorADir, OUTPUT);
  pinMode(motorBStep, OUTPUT);
  pinMode(motorBDir, OUTPUT);

  //seek home
  //switchHomeState == LOW; //don't start till switch
  //digitalWrite(ledHome, LOW);
  //while (switchHomeState == LOW) {
  //  switchHomeState = digitalRead(switchHome);
  //  if (switchHomeState == HIGH) {    
  //    digitalWrite(ledHome, HIGH);  
  //  }
  //while (switchHomeState == HIGH) {  //wait switch release
  //  switchHomeState = digitalRead(switchHome);
  //  if (switchHomeState == LOW) {    
  //    digitalWrite(ledHome, LOW);  
  //  }

  for (j=1; j


Limit Switches

I got my first set of switches.

I will wire them onto one of my mills. If that works out to save time I’ll add them to all my systems.

I think I will save more time from a “zero finder” system. But we’ll see.

Time for cnc limit switches and some sort of zero system

I’m loosing a fair amount of time operating without this stuff. I noticed Guy of ORE has some sort of “zero finding” system in place. I checked his Web site and he hasn’t detailed it so I’ll have get this solved by bugging him. 🙂

Anybody else have any ideas?