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

 

Drawbot Zero Sensor

Okay, I think I have the answer to the zero-calibration problem with drawbots.

I made an eyelet out of a piece of music wire. The drawbot string will be run through the eyelet. There will be a bead threaded on the string that will push the music wire.

This will trigger a micro-switch and presto we have a consistent reference point.

I’ll just use one micro-switch. There will be a thread running from each piece of music wire down to the micro-switch.

 

Drawbot Zeroing

button

One thing I’d like to do is have my drawbot able to calibrate itself.

It’s easy to have an arduino read a button. Here’s another article.

So I figure I can have a couple of micro switches on the drawbot so each spool can be calibrated.

Perhaps a knot in the string can trigger a micro-switch. Or perhaps a colored spot on the string can be detected.

const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin

// variables will change:
int buttonState = 0; // variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}

void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}

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?

How to change CNC endmill without loosing Z zero?

I want to eventually do cnc cutting with multiple endmills.

Problem is I wont know where zero is for the work in progress. It’s easy to estimate zero at the start and it works okay for cutting. But to continue work in the middle of a job, an estimate wont do. It has to match.

Any ideas?

Few days later: Looks like there is something in Mach 3.