iDRY Vacuum Kilns

Sponsors:

Arduino Setworks (with video!)

Started by hackberry jake, September 26, 2013, 08:41:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hackberry jake

Quote from: Ga Mtn Man on January 25, 2014, 11:21:59 AM
Hey Jake,

I re-read this thread and couldn't find if you are using any sort of encoder for head position.  How does your setworks know where the head is?
It uses a stepper motor so an encoder isn't needed. There are 200 steps per revolution. If you send it 200 steps it will rotate exactly 360 degrees.
Quote from: schmism on January 25, 2014, 12:36:06 PM
I would include a micro-switch at the end of travel positions for  oh-sht moments.   this provides a safety so something doesnt get damaged and also serve as a reference point to re-zero the head/system.

Next thing you need to do is rig a system to your back log stops so that when its up the arduino knows what height it is and wont let the saw head go lower so you never have to worry about cutting into the back stops again.

as for your speed, try just reversing your sprokets first.  3 times faster than your current speed shouldn't be to bad although you may want to program in a cushion on the stop side.  If i remember my stepper programing from college there should be a ramp up/down function you can set that will help cushion your starts/stops


When you cut frameing material you expect to use it rough sawn?  or just expect for the surface to clean up good enough with just 1/16th off each side?

there is 1/8 Kerr taken out so the cut size is actually pretty close to 1.5". I have thought about putting a limit switch on it and using it to zero the head, but after each move, the arduino saves its location. I would try swapping sprockets but the gearbox is a 5/8" bore and the mill is 3/4".
https://www.facebook.com/TripleTreeWoodworks

EZ Boardwalk Jr. With 20hp Honda, 25' of track, and homemade setworks. 32x18 sawshed. 24x40 insulated shop. 30hp kubota with fel. 1978 Massey ferguson 230.

Ga Mtn Man

I realized it was a dumb question after I posted it.  Stepping a precise number of degrees really is the essence of what a stepper motor is. 
"If the women don't find you handsome they should at least find you handy." - Red Green


2012 LT40HDG29 with "Superized" hydraulics,  2 LogRite cant hooks, home-built log arch.

hackberry jake

I just modified the code to save the sawhead height last night and I haven't had a chance to try it, but I hope this works. If anybody else uses this in the future, I believe all you will have to change is the "ratio" variable to whatever ratio your mill is using.
https://www.facebook.com/TripleTreeWoodworks

EZ Boardwalk Jr. With 20hp Honda, 25' of track, and homemade setworks. 32x18 sawshed. 24x40 insulated shop. 30hp kubota with fel. 1978 Massey ferguson 230.

shortlogger

How long till I can get my mill retrofitted with the Hackberry Jake setworks system ? Sure would beat my hand winch .
1 Corinthians 3:7 So then neither he who plants is anything, nor he who waters, but God who gives the increase . "NKJV"

hackberry jake

Quote from: shortlogger on January 29, 2014, 06:01:23 PM
How long till I can get my mill retrofitted with the Hackberry Jake setworks system ? Sure would beat my hand winch .
i did all the hard work for ya. The research and development, the code writing, layout, ect. Now all you gotta do is buy parts and assemble it. And i just got done checking my sprockets. The 5/8" bore on the gearbox is a 10 tooth and the 3/4" bore sprocket on the hand crank shaft is a 20 tooth. I just ordered a 15 tooth sprocket for the gearbox, so that should give me a 50% increase in speed.
https://www.facebook.com/TripleTreeWoodworks

EZ Boardwalk Jr. With 20hp Honda, 25' of track, and homemade setworks. 32x18 sawshed. 24x40 insulated shop. 30hp kubota with fel. 1978 Massey ferguson 230.

Ga Mtn Man

How much you gonna charge for one of those custom made motor-to-gearbox adapters? :laugh:
"If the women don't find you handsome they should at least find you handy." - Red Green


2012 LT40HDG29 with "Superized" hydraulics,  2 LogRite cant hooks, home-built log arch.

shortlogger

The mechanical stuff is no prob. but the computer part I'm exta ignorant in that department I need a pre wired preprogrammed controller that I just plug in
1 Corinthians 3:7 So then neither he who plants is anything, nor he who waters, but God who gives the increase . "NKJV"

hackberry jake

Its almost that easy. Look at the code and just run a wire from whatever the code calls it to that pin on the arduino. Copy and paste the code I posted and thats it. Its easier than it seems, and if ya have any questions, just pm me and ill walk you through it.
https://www.facebook.com/TripleTreeWoodworks

EZ Boardwalk Jr. With 20hp Honda, 25' of track, and homemade setworks. 32x18 sawshed. 24x40 insulated shop. 30hp kubota with fel. 1978 Massey ferguson 230.

shortlogger

I'm reading up on stepper motors and ardunio systems and it's starting to make sense . Will the system have  to be AC or  can it run off the mills DC battery  supply? Got a bunch going on for a few more weeks but when I get caught up I'm gonna try and make the switch . I'm sure I'll have some questions then thanks .
1 Corinthians 3:7 So then neither he who plants is anything, nor he who waters, but God who gives the increase . "NKJV"

hackberry jake

My cabinet has three voltages in it. 120 vac comes inside and goes to the 48 vdc power supply and I have two wires from the ac running to the small plug-in 9vdc power supply for the arduino. The arduino just sends low level (like a fraction of an amp) 5volt signals to the stepper driver telling it which direction to move and how far. The stepper driver gets the 48volt supply and does all of the "heavy lifting" as far as the electronics go. My 48 volt supply is an ac to dc supply because i didnt know if my mills charging system could handle the setworks. If your mill has an alternator, then you could get away with a 12vdc to 48vdc inverter. The steppers that are "setworks sized" will run on anything from 24vdc to 80vdc, depending on the stepper. Most cheaper drives max out around 50 volt max. With steppers, voltage is correlated to speed and amps is correlated to torque.
https://www.facebook.com/TripleTreeWoodworks

EZ Boardwalk Jr. With 20hp Honda, 25' of track, and homemade setworks. 32x18 sawshed. 24x40 insulated shop. 30hp kubota with fel. 1978 Massey ferguson 230.

whitedog

 Hello all. I would like to to add this setworks to a band sawmill I am building. When I paste the code ( setworks for boardwalk.txt) in the arduino IDE fine but when I try to verify it will not compile. What I get is this 
' serLCD' does not name a type. 

Has any one else used this code? Any Ideas? 

whitedog

 Code loaded with these changes.



// boardwalk setworks 
// author: Jake Smith 
// version 1 
 
#include <AccelStepper.h> 
#include <SoftwareSerial.h> 
#include <serLCD.h>                                                     //this line should read    #include <SerLCD.h>   not    #include <serLCD.h> 
#include <EEPROM.h>
 
SoftwareSerial mySerial(3,3); 
AccelStepper mystepper(1, 1, 2); //include the accelstepper library. 
//-----Defines------ 
 
 
//---pin assignments---- 
const int lcdPin = 3; 
const int stepPin = 1; 
const int dirPin = 2; 
const int SixteenthPin = 0; 
const int EighthPin = 4; 
const int QuarterPin = 5; 
const int HalfPin= 6; 
const int OnePin = 7; 
const int TwoPin = 8; 
const int TwoByPin = 9; 
const int FourByPin = 10; 
const int SixByPin = 11; 
const int EightByPin = 12; 
const int GoButton = 13; 
const int FourOrFiveQuarterPin = 14; //analog pin A0 
const int HomeButton = 15; //analog pin A1 
const int ZeroButton = 16; //analog pin A2 
const int Prog1Button = 17; //analog pin A3 
const int Prog2Button = 18; //analog pin A4 
const int UpOrDownSwitch = 19; //analog pin A5 
 
 serLCD lcd(lcdpin);                                                          // this line should read     SerLCD lcd(lcd);   not    serLCD lcd(lcdPin);
//const int stepperAcceleration = 10000; 
//const int upSpeed = 2000; 
//const int downSpeed = -4000; 
double xSteps = 0; 
double sawHeight = 1;
int dbt = 25; 
int TimesThroughLoop = 0; 
double Prog1Num = 1; 
double Prog2Num = 2; 
int ratio = 237;

//These are the eeprom addresses where the height of the
//head is saved after each move. When the power is turned 
//off to the setworks, the Arduino still knows where the 
//head is. There is an estimated life of 100,000 write cycles 
//on eeprom so these may need to be moved at a later date if
//false readings start occuring.
byte ThousandsDivideAddress = 1;
byte ThousandsModAddress = 2;
byte RemainderDivideAddress = 3;
byte RemainderModAddress = 4;

int thousands = (EEPROM.read(ThousandsDivideAddress)*250);
byte thousandsRemainder = EEPROM.read(ThousandsModAddress);
int remainderMultiplyByTwoFifty = (EEPROM.read(RemainderDivideAddress)*250);
byte remainderOfRemainder = EEPROM.read(RemainderModAddress);

long FirstThreeDigits = ((thousands + thousandsRemainder)*1000);
int LastThreeDigits = (remainderMultiplyByTwoFifty + remainderOfRemainder);
long ActualPosition = (FirstThreeDigits + LastThreeDigits);


 
//------set-up--- 
 
void setup() //runs once when power is applied or reset button is pushed. 

  delay(500);
  //Serial.begin(9600); 
  mySerial.begin(9600); 
  delay(500); 
  //------set pins------ 
  mystepper.setMaxSpeed(4000); 
  mystepper.setAcceleration(8000); 
  
  if(EEPROM.read(ThousandsDivideAddress) == 255)
  {
  mystepper.setCurrentPosition(80*ratio);
  }
  else
  {
  mystepper.setCurrentPosition(ActualPosition); 
  }
  
   
  pinMode(lcdPin,OUTPUT); 
  pinMode(stepPin,OUTPUT); 
  pinMode(dirPin,OUTPUT); 
  pinMode(SixteenthPin,INPUT_PULLUP); 
  pinMode(EighthPin,INPUT_PULLUP); 
  pinMode(QuarterPin,INPUT_PULLUP); 
  pinMode(HalfPin,INPUT_PULLUP); 
  pinMode(OnePin,INPUT_PULLUP); 
  pinMode(TwoPin,INPUT_PULLUP); 
  pinMode(TwoByPin,INPUT_PULLUP); 
  pinMode(FourByPin,INPUT_PULLUP); 
  pinMode(SixByPin,INPUT_PULLUP); 
  pinMode(EightByPin,INPUT_PULLUP); 
  pinMode(GoButton,INPUT_PULLUP); 
  pinMode(FourOrFiveQuarterPin,INPUT_PULLUP); 
  pinMode(HomeButton,INPUT_PULLUP); 
  pinMode(ZeroButton,INPUT_PULLUP); 
  pinMode(Prog1Button,INPUT_PULLUP); 
  pinMode(Prog2Button,INPUT_PULLUP); 
  pinMode(UpOrDownSwitch,INPUT_PULLUP); 
  
  lcd.clear();
  
   lcd.print("Relative = "); 
   lcd.print(xSteps/80);
   lcd.print("     ");  
   
   lcd.print("Saw Height = ");
   sawHeight = (mystepper.currentPosition());
   lcd.print((sawHeight/80)/ratio); 
   lcd.print("   ");
   
 
   lcd.print("Program 1 = ");
   lcd.print(Prog1Num/80); 
   lcd.print("    ");
   
   lcd.print("Program 2 = ");
   lcd.print(Prog2Num/80); 
   

             
 
void loop() //runs continually 

     if(digitalRead (SixteenthPin)==LOW) 
     //moves .0625 of an inch. 
     { 
       debounce (SixteenthPin); 
       xSteps = UpOrDown (xSteps, 5); 
     }  
     
     if(digitalRead (EighthPin)==LOW) 
     //moves .125 of an inch. 
     { 
       debounce (EighthPin); 
        xSteps = UpOrDown (xSteps, 10); 
     } 
     
     if(digitalRead (QuarterPin)==LOW) 
     //moves .25 of an inch. 
     { 
       debounce (QuarterPin); 
        xSteps = UpOrDown (xSteps, 20); 
     } 
     
     if(digitalRead (HalfPin)==LOW) 
     //moves .5 of an inch. 
     { 
       debounce (HalfPin); 
        xSteps = UpOrDown (xSteps, 40); 
     } 
     
     if(digitalRead (OnePin)==LOW) 
     //moves 1 inch. 
     { 
       debounce (OnePin); 
        xSteps = UpOrDown (xSteps, 80); 
     }  
     
     if(digitalRead (TwoPin)==LOW) 
     //moves 2 inches. 
     { 
       debounce (TwoPin); 
        xSteps = UpOrDown (xSteps, 160); 
     } 
     
     if(digitalRead (TwoByPin)==LOW) 
     //moves 1.625 of an inch. assuming .125 kerf. 
    // this setting will be used for 2x building material. 
     { 
       debounce (TwoByPin); 
       xSteps = UpOrDown (xSteps, 130); 
     }  
     
     if(digitalRead (FourByPin)==LOW) 
     //moves 3.625 of an inch. assuming .125 kerf. 
    // this setting will be used for 2x building material. 
     { 
        debounce (FourByPin); 
       xSteps = UpOrDown (xSteps, 290); 
     }  
     
     if(digitalRead (SixByPin)==LOW) 
     //moves 5.625 of an inch. assuming .125 kerf. 
    // this setting will be used for 2x building material. 
     { 
        debounce (SixByPin); 
       xSteps = UpOrDown (xSteps, 450); 
     }  
     
     if(digitalRead (EightByPin)==LOW) 
     //moves 7.375 inches. 
     { 
       debounce (EightByPin); 
       xSteps = UpOrDown (xSteps, 590); 
     }  
     
     if (analogRead(A0)<800)//if analog button pressed 
     // 10k resistor between pin A0 and 4/4 button. 
     { 
       { 
       delay(dbt);//delay to get accurate reading from button. 
       } 
       if (analogRead(A0)<50) 
         { 
           xSteps = UpOrDown (xSteps, 120); //0-50 is 5/4 
         } 
        
       if ((analogRead(A0) > 200) && (analogRead(A0) < 300)) 
         { 
          xSteps = UpOrDown (xSteps, 100); 
         } 
       while (analogRead(A0)<800) 
         { 
           delay (dbt); 
         } 
     } 
  
       
     if(digitalRead (Prog1Button)==LOW) 
     //Sets value in Prog1 if held for a while. 
     { 
         delay(dbt); 
         while (digitalRead (Prog1Button)==LOW) 
        { 
           delay(dbt); 
          TimesThroughLoop++; 
        
          if (TimesThroughLoop == 160) 
            { 
              Prog1Num = xSteps;  
             Display (xSteps, Prog1Num, Prog2Num);  
            } 
         } 
        if (TimesThroughLoop < 160) 
            {xSteps = UpOrDown (xSteps, Prog1Num);} 
       delay(dbt); 
       TimesThroughLoop = 0; 
     } 
     
     if(digitalRead (Prog2Button)==LOW) 
     //Sets value in Prog2 if held for a while. 
     { 
         delay(dbt); 
         while (digitalRead (Prog2Button)==LOW) 
        { 
           delay(dbt); 
          TimesThroughLoop++; 
        
          if (TimesThroughLoop == 160) 
            { 
              Prog2Num = xSteps;  
             Display (xSteps, Prog1Num, Prog2Num);  
            } 
         } 
        if (TimesThroughLoop < 160) 
            {xSteps = UpOrDown (xSteps, Prog2Num);} 
       delay(dbt); 
       TimesThroughLoop = 0; 
     } 
     
     if(digitalRead (HomeButton)==LOW) 
     //home button and goto function
     { 
         delay(dbt); 
         while (digitalRead (HomeButton)==LOW) 
        { 
           delay(dbt); 
          TimesThroughLoop++; 
        
          if (TimesThroughLoop == 160) 
            { 
             mystepper.runToNewPosition(xSteps * ratio);  
             Display (xSteps, Prog1Num, Prog2Num);
             savePosition(mystepper.currentPosition());  
            } 
         } 
        if (TimesThroughLoop < 160) 
            {
             if(digitalRead (UpOrDownSwitch) == LOW) 
             //and upordoswn switch is set to down 
               { 
               mystepper.runToNewPosition(80 * ratio); 
               
               Display (xSteps, Prog1Num, Prog2Num);
               savePosition(mystepper.currentPosition());
               } 
             else //if swith isnt down, then it is set to up. 
               { 
               mystepper.runToNewPosition(-2160 * ratio); 
                
                Display (xSteps, Prog1Num, Prog2Num);
                savePosition(mystepper.currentPosition());
               } 
             TimesThroughLoop = 0;
            } 
             delay(dbt); 
             TimesThroughLoop = 0;
             xSteps = 0;
             Display (xSteps, Prog1Num, Prog2Num); 
     } 
    
     if(digitalRead (ZeroButton) == LOW) //takes xSteps to "0". 
     { 
      xSteps = 0; 
     Display (xSteps, Prog1Num, Prog2Num);
      //Serial.println((xSteps * 1)/80,3); 
     } 
   
     if(digitalRead (GoButton) == LOW) 
     //takes amount of steps and runs the stepper. 
     { 
       debounce (GoButton);  
        
       mystepper.move(xSteps * ratio); 
       while (mystepper.distanceToGo() != 0) 
           mystepper.run();  
       xSteps = 0; 
      
       
      Display (xSteps, Prog1Num, Prog2Num);
      savePosition(mystepper.currentPosition());
       
       //Serial.println((xSteps * 1)/80,3); 
      } 
    
     if((digitalRead (UpOrDownSwitch)==LOW) && (xSteps > 0)) 
     //if the switch is LOW or switched to negative and we have a positive 
//number. 
    // make the number negative. 
     { 
      xSteps = -xSteps; 
     Display (xSteps, Prog1Num, Prog2Num);
     //Serial.println((xSteps * 1)/80,3); 
     }  
     
     if((digitalRead (UpOrDownSwitch)==HIGH) && (xSteps < 0)) 
     //if the switch is HIGH or switched to positive and we have a negative 
      //number. 
     //make the number positive. 
     { 
      xSteps = -xSteps; 
   Display (xSteps, Prog1Num, Prog2Num);
     //Serial.println((xSteps * 1)/80,3); 
     } 
 } 
 
 
 
 
 
 
 
 
 
               //debounce function 
               void debounce(int x) 
               { 
                   delay(dbt); 
                   while (digitalRead (x)==LOW) 
                      { 
                       delay(dbt); 
                      } 
                  delay(dbt); 
               } 
 
               //up or down function 
               double UpOrDown(double x, double y) 
               { 
                if(digitalRead (UpOrDownSwitch)==LOW) 
                     {x = x - y;} 
                   else 
                     {x = x + y;} 
                 Display (x, Prog1Num, Prog2Num);  
                 //Serial.println((xSteps * 1)/80,3); 
                  return x; 
               }
              
              
              //function to display current data on lcd. 
             void Display ( double x, double y, double z)
             {
              lcd.clear();
  
                 lcd.print("Relative = "); 
                 lcd.print(x/80);
                 lcd.print("     ");  
                 
                 lcd.print("Saw Height = ");
                 sawHeight = (mystepper.currentPosition());
                 lcd.print((sawHeight/80)/ratio); 
                 lcd.print("   ");
                 
               
                 lcd.print("Program 1 = ");
                 lcd.print(y/80); 
                 lcd.print("    ");
                 
                 lcd.print("Program 2 = ");
                 lcd.print(z/80);   
             }
             
             //function to save sawheight to eeprom.
             void savePosition(long currentPos)
             {
               int remainder = (currentPos%1000);
               
               long HowManyWithoutRemainder = (currentPos-remainder);
               
               int Thousands = (HowManyWithoutRemainder/1000);
               
               byte ThousandsDividedByTwoFifty = (Thousands/250);
               byte ThousandsModTwoFifty = (Thousands%250);
               byte RemainderDividedByTwoFifty = (remainder/250);
               byte RemainderModTwoFifty = (remainder%250);
               
         EEPROM.write(ThousandsDivideAddress,ThousandsDividedByTwoFifty);
         EEPROM.write(ThousandsModAddress,ThousandsModTwoFifty);
         EEPROM.write(RemainderDivideAddress,RemainderDividedByTwoFifty);
         EEPROM.write(RemainderModAddress,RemainderModTwoFifty);
             }

mitchstockdale

Quote from: whitedog on November 27, 2018, 08:26:49 PM
Hello all. I would like to to add this setworks to a band sawmill I am building. When I paste the code ( setworks for boardwalk.txt) in the arduino IDE fine but when I try to verify it will not compile. What I get is this
' serLCD' does not name a type.

Has any one else used this code? Any Ideas?
This is pretty neat, and would be very useful for the repeatability aspect.
Unfortunately not much of a coder ....the syntax thing gets me everytime always have some stupid mistake that takes hours to figure out.

How far along are you in your set up?  Have you been able to source a gear box yet. ?



whitedog

I have the saw head mostly complete. I started the saw lift with the intentions of using a stepper motor and a arduino (similar to what has been done here) but the code was to tough for me.I bought a nema 23 425 oz stepper with a 100 to 1 planetary reduction for this. When I could not program the arduino to do what I wanted I switched to a 10,000 lb winch motor and used the reduction drive that came with it   chained on to 5 pitch acme threaded rods. This is installed now and seems to work fine. Now that I found this thread I think I will have another go at the stepper thing again. Will be doing a bench build and test to see if it works for me. If it does I will change to the boardwalk setworks system. I have a nema 34 1800 oz in stepper that will replace the 425 oz in (hopefully). 

Georgia088

@whitedog did you ever get the system up and running?  We're you able to do it with a stepper motor and planetary gearbox? Running off of 12v dc battery? 

@hackberry jake this is awesome! I would love to do something similar. Do you or anyone else think it's possible to do with a stepper motor and gear box reducer? My head now travels via cable and 1500 lb winch. Think it would be accurate if the stepper/gearbox would turn a spool of cable that lifts/lowers head.  I don't have a garage tho spring like you have. Thanks for any and all advice

hackberry jake

My first thought would be to run a cable from your sawhead to a pulley on your frame and use a counterweight. Mine used a smaller 4xx oz stepper I believe
https://www.facebook.com/TripleTreeWoodworks

EZ Boardwalk Jr. With 20hp Honda, 25' of track, and homemade setworks. 32x18 sawshed. 24x40 insulated shop. 30hp kubota with fel. 1978 Massey ferguson 230.

Crusarius

you can also add encoders to the setup and have position accuracy that way. Encoders come in many different flavors. you can get rotary encoders, and linear ones. The scroll wheel on a mouse is a rotary encoder and can be adapted to work for many different things.

Ernste

Hey Jake
I've just now found this since I'm trying to find some way to automate my completely manual WM15.
What you've done here is nothing short of amazing.
I to built my own cnc and play around with 3d printing  but not at all am I even close to confident enough to take on a project like this when it comes to writing the code.
I will cut and paste your code and hope i can modify it for my needs and for metric.

I wish I could somehow thank you enough. 
BTW.
I saw that you wrote about like you no longer owns the sawmill?
Did you upgrade or?

Well anyway..
THANK YOU sawmill superhero.👍👍😃😃

JDowns71

Great job to the author and very nice setup.

If I could offer a few tips and advice.

It's very common when running a state machine to implement some sort of watchdog to ensure that if there is a mechanical or software issue that the processor returns to setup, in order to restart the routine, rather than be get stuck and require a manual reboot.  Just make sure your current state is stored in NVM, so your setup routine can adjust accordingly.

Rather than all of the delays and debouncing you could implement a few things.  First would be the use of interrupts, when a button is pressed (pin hi/lo).  You could then store the required button command in a simple byte for 8 buttons. Manipulate the byte with bitwise operators.  For example button one was pressed would equal 00000001.  Button two would override the byte with 00000010.  If you have more than 8 buttons to process and follow, just use an integer.

Now that you have interrupts to track your buttons, you could then use a timer library to separate your loop tasks to track the state of button presses.   So rather than every single processor cycle to track and debounce button presses you now have a timer, for example set at every half second or >, that would then run your state machine.

I'll take a look at your video and dig in the code some more but I think you could also simplify things with an interrupt and with resistors only need to use one pin.  Each button would have a separate resistor value, when the interrupt is triggered read the value and that was the button that was pressed.   That would further simplify having to read multiple pins every single processor cycle.

Hope that makes sense.  I could write up a simple example this weekend if that would help.

Regards,

Mattjohndeere2

Very nice. I haven't done my Arduino setup yet but my plan was to use a couple parts like the below to accomplish it. As long as there isn't much backlash in the gear/rack setup it should be pretty accurate.

Rotary encoder 
Incremental Photoelectric Rotary Encoder - 400P/R - DFRobot
Rack and gear like found here
McMaster-Carr
Keypad for manual entry like this one
Membrane 3x4 Matrix Keypad + extras [3x4] : ID 419 : .95 : Adafruit Industries, Unique & fun DIY electronics and kits

Rickcnc

Quote from: Mattjohndeere2 on October 01, 2021, 06:29:33 PM
Very nice. I haven't done my Arduino setup yet but my plan was to use a couple parts like the below to accomplish it. As long as there isn't much backlash in the gear/rack setup it should be pretty accurate.

Rotary encoder
Incremental Photoelectric Rotary Encoder - 400P/R - DFRobot
Rack and gear like found here
McMaster-Carr
Keypad for manual entry like this one
Membrane 3x4 Matrix Keypad + extras [3x4] : ID 419 : .95 : Adafruit Industries, Unique & fun DIY electronics and kits
Great to see people working on this. I experimented a few years ago and used the method referenced above with interrupts  tracking the encoder (worked flawless on the test bench, but when driven by the mill steps were lost.. I suspect noise could have been the issue, .. encoder I used was similar to the one referenced above. (Other priorities had me shelve the project for now)
Matt (few questions if you don't mind)
Have you given any thought as to how you will protect the encoder from the elements?
My prototype used a rubber 3D printer belt/rack and gear for the rack and Pinion which seamed to work.. I see your plan is much more industrial (appreciate your input on how we can keep them clean)
JDowns
Examples would be awesome.

marty3d

Nice to someone else appreciating what the Arduino can do.  I have just finished building a mill, based on the Arduino.  I use a mega2560 because it has two pairs of available interrupts to connect to encoders.  (it does have a third pair but that also handles serial communication so it isn't available).  I have a 100ppr encoder on a lift screw, and another on the carriage drive.  I also use a small rotary encoder knob to choose/set board thickness and kerf thickness.  I can set or select a given board thickness and push one button and the saw will go to the proper height and cut the board, stop at the end of the board and lift up to get ready to eject the board.  Push a second button and the saw ejects the board and drops down at the beginning of the log to get ready for the next cut.  Lifting is done by a pair of DC motors, carriage drive is done by another.  I am using one Curtis speed controller - the kind you find in golf carts.  The carriage drive has a PID feature - like cruise control - so it maintains a constant speed.  It is also strong enough to drag a log across the deck if needed for repositioning.

I tried steppers at first, but the largest ones I could find were too slow.  
Retired - and busier than ever.

Thank You Sponsors!