587,916 active members*
3,782 visitors online*
Register for free
Login
IndustryArena Forum > OpenSource CNC Design Center > Arduino > Arduino Sherline Rotary Table controller
Page 4 of 5 2345
Results 61 to 80 of 86
  1. #61
    Join Date
    Nov 2010
    Posts
    19

    Re: Arduino Sherline Rotary Table controller

    thanks, Ive ordered an I2c 4x20, I just was sure about which pin numbers on the arduino to hook it up to

  2. #62
    Join Date
    Jun 2015
    Posts
    2

    Re: Arduino Sherline Rotary Table controller

    Hello Sloucks,
    I finally managed to get the electronics into function after a lot of trial and errors in the sketch. Now I'am running into the following problems:
    The stepperdriver chip (DRV 8825) becomes very hot in a short time even with the heatsink in place and I expected, when dividing a 360° circle into a number of divisions, that the stepper finishes at the same spot as where it started, but that is certainly not the case. I did the test with 2 different steppers: a 12 V 2,5 A - 1,8° / step and a 12 V 1,7 A - 0.9° / step. I altered the corresponding lines in the sketch accordingly of course. I also had to alter the stepdelay, otherwise there was no movement at all. No load was attached to the steppers.
    I hope that someone can give me a hint where to find a solution to this problem.
    Marquant.

  3. #63
    Join Date
    Nov 2010
    Posts
    19

    Re: Arduino Sherline Rotary Table controller

    You should be able to reduce the current by turning the pot on the driver. If they overheat they with go into thermal cutout and lose steps so f you fit the excessive current draw it may fix the your other problem.

  4. #64
    Join Date
    Jun 2015
    Posts
    2

    Re: Arduino Sherline Rotary Table controller

    Thanks,
    I will give it a try. At the polulu site there is aninstruction on how to set the current on the driver.

  5. #65

    Re: Arduino Sherline Rotary Table controller

    I like the keypad integration in the OP's design. We built one a year or so ago using a cheap TB6560 driver and push buttons for input, based on a sketch found online somewhere (maybe on this board). It worked well and we discussed modifying the sketch to use a keypad, but I never got around to it. I think I'll try to incorporate the OP's sketch and maybe a different driver (Polulu or EasyDriver from Sparkfun).


  6. #66
    Join Date
    Nov 2010
    Posts
    19

    Re: Arduino Sherline Rotary Table controller

    Hi Slouks, Just want to ask about this part of the code

    const int StepsPerRotation = 400; //Set Steps per rotation of stepper
    const int TableRatio = 72; //ratio of rotary table
    const int Multiplier = (StepsPerRotation * TableRatio)/360;

    When i change the Table ratio to 140 (or any number above 90) the stepper barely moves.. I change it back to 70 or 80 and it works correctly. It has me a bit stumped it there any thing else i need to do to get a table ratio of 140? Also dropping or increasing the steps per rotation, does something similar. any ideas?

  7. #67
    Join Date
    Sep 2009
    Posts
    1856

    Re: Arduino Sherline Rotary Table controller

    how many steps are need to turn you rotary table 399.9
    http://danielscnc.webs.com/

    being disabled is not a hindrance it gives you attitude
    [SIGPIC][/SIGPIC]

  8. #68
    Join Date
    Nov 2010
    Posts
    19

    Re: Arduino Sherline Rotary Table controller

    The table has a ratio of 140, and the steeper driver requires 400 steps per rotation so 56000 steps

  9. #69
    Join Date
    Sep 2009
    Posts
    1856

    Re: Arduino Sherline Rotary Table controller

    what motor is it
    http://danielscnc.webs.com/

    being disabled is not a hindrance it gives you attitude
    [SIGPIC][/SIGPIC]

  10. #70
    Join Date
    Nov 2010
    Posts
    19

    Re: Arduino Sherline Rotary Table controller

    it a nema 17 200 steps per rotation.

  11. #71
    Join Date
    Mar 2016
    Posts
    1

    Re: Arduino Sherline Rotary Table controller

    GOOD EVENING.
    CAN I USE ARDUINO UNO?
    GRATEFUL

  12. #72
    Join Date
    Dec 2009
    Posts
    166

    Re: Arduino Sherline Rotary Table controller

    adruino int can only hold a number up to 32000
    so 140 * 400 = 56000 // this will not work also when divided by 360 will yield a Floating point number
    I haven't tested but you could try
    Float Multiplier = Float(StepsPerRotation * TableRatio)/360

    the result = 155.5555

    so you could do ((14 * 40)/360) * 100 will get the same result without going over 32000

  13. #73
    Join Date
    Apr 2004
    Posts
    733

    Re: Arduino Sherline Rotary Table controller

    Quote Originally Posted by squirrel_41 View Post
    adruino int can only hold a number up to 32000
    so 140 * 400 = 56000 // this will not work also when divided by 360 will yield a Floating point number
    I haven't tested but you could try
    Float Multiplier = Float(StepsPerRotation * TableRatio)/360

    the result = 155.5555

    so you could do ((14 * 40)/360) * 100 will get the same result without going over 32000
    Arduino compiler can do long 32 bit integers.

    https://www.arduino.cc/en/Reference/Long

  14. #74
    Join Date
    Dec 2009
    Posts
    166

    Re: Arduino Sherline Rotary Table controller

    True but now he should know why it's not working

  15. #75
    Join Date
    Nov 2010
    Posts
    19

    Re: Arduino Sherline Rotary Table controller

    Thank you I will give it a try

  16. #76
    Join Date
    Jan 2006
    Posts
    58

    Re: Arduino Sherline Rotary Table controller

    It will be useful a jog function in order to set a start position. Dividing head has a worm gear so it is difficult to set start position by hand.

  17. #77
    Join Date
    Feb 2006
    Posts
    175

    Re: Arduino Sherline Rotary Table controller

    Newbie to Arduino here.

    How do you change speed ? ( change pulse rate without reprogramming )
    If you can slow down the motor when jogging, that would allow reaching a home position much easier...assuming you can stop ?
    In industrial machines, jogging stops when the button is released.
    No offense guys, I realize this is not a commercially made controller and not all functions are available.
    Rich

  18. #78
    Join Date
    Oct 2008
    Posts
    1

    Re: Arduino Sherline Rotary Table controller

    Hi all
    I made my project with arduio motor shield R3 instead of pololu, but the stepper dont run...Any idea about sketch or libray..?
    Tks

  19. #79
    Join Date
    Jun 2016
    Posts
    1

    Re: Arduino Sherline Rotary Table controller

    I corrected the above sketch to fix syntax issues with all the LCD Print Commands, that caused it to fail on Arduino 1.6.13. :


    /*
    A program for controlling a single stepper motor driving a rotary table.
    Uses a 4x4 matrix keypad for entry of degrees and direction to move the table.
    Serial I2C display, Pololu stepper driver.
    */


    #include <Wire.h>
    #include <LiquidCrystal_I2C.h>
    #include <Keypad.h>

    const byte ROWS = 4;
    const byte COLS = 4;
    char keys[ROWS][COLS] = {
    {'1','2','3','A'},
    {'4','5','6','B'},
    {'7','8','9','C'},
    {'.','0','#','D'}
    };

    byte rowPINS[ROWS] = {11,10,9,8};
    byte colPINS[COLS] = {7,6,5,4};

    Keypad kpd = Keypad(makeKeymap(keys),rowPINS,colPINS, ROWS, COLS);

    LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x20 for a 16 chars and 2 line display

    //setup vars
    const int stp = 12; //connect pin 12 to step
    const int dir = 13; // connect pin 13 to dir
    const int StepsPerRotation = 400; //Set Steps per rotation of stepper
    const int TableRatio = 72; //ratio of rotary table
    const int Multiplier = (StepsPerRotation * TableRatio)/360;
    const int stepdelay = 1;
    float Degrees = 0; //Degrees from Serial input
    float ToMove = 0; //Steps to move
    int Direction;
    int repeat = 0;



    void setup()
    {
    lcd.init(); // initialize the lcd
    pinMode(stp, OUTPUT);
    pinMode(dir, OUTPUT);

    // Print welcome message to the LCD.
    lcd.backlight();
    lcd.print("Rotarye Control");
    lcd.setCursor(0,2);
    lcd.print(" CrankyTechGuy CNC");
    lcd.setCursor(0,3);
    lcd.print(" Copyright 2014");
    delay(2000);
    lcd.init();
    }

    void rotation(float tm, int d)
    {
    if(d == 0)
    {
    digitalWrite(dir, LOW);
    }
    else
    {
    digitalWrite(dir, HIGH);
    }

    for(int i = 0; i < tm; i++)
    {
    digitalWrite(stp, HIGH);
    delay(stepdelay);
    digitalWrite(stp, LOW);
    delay(stepdelay);
    }
    }

    float GetNumber()
    {
    float num = 0.00;
    float decimal = 0.00;
    float decnum = 0.00;
    int counter = 0;
    char key = kpd.getKey();
    lcd.print("Rotarye Control");
    lcd.setCursor(0,2);lcd.print("Enterees then");lcd.setCursor(0,3);lcd.print("press");
    lcd.setCursor(8,1);
    bool decOffset = false;

    while(key != '#')
    {
    switch (key)
    {
    case NO_KEY:
    break;

    case '.':
    if(!decOffset)
    {
    decOffset = true;
    }
    lcd.print(key);
    break;

    case '0': case '1': case '2': case '3': case '4':
    case '5': case '6': case '7': case '8': case '9':
    if(!decOffset)
    {
    num = num * 10 + (key - '0');
    lcd.print(key);
    }
    else if((decOffset) && (counter <= 1))
    {
    num = num * 10 + (key - '0');
    lcd.print(key);
    counter++;
    }
    break;
    }
    decnum = num / pow(10, counter);
    key = kpd.getKey();
    }
    return decnum;
    }

    int GetDirection()
    {
    int dir = 0;
    lcd.setCursor(0,2);lcd.print(" ");

    lcd.setCursor(0,3);
    lcd.print(" FWD[A] REV[B]");
    while(dir == 0)
    {
    char key = kpd.getKey();
    if(key == 'A')
    {
    dir = 1;
    }
    else if(key == 'B')
    {
    dir = -1;
    }
    }

    lcd.clear();
    return dir;
    }

    void loop()
    {
    if(repeat == 0)
    {
    Degrees = GetNumber();
    Direction = GetDirection();
    }

    Degrees = Degrees * Direction;

    if(Degrees < 0)
    {
    ToMove = (Degrees*Multiplier)*-1;
    lcd.setCursor(0,0);
    lcd.print("REV lcd.print(abs(Degrees),2);lcd.print((char)223)");
    lcd.setCursor(6,1);
    lcd.print("Moving rotation(ToMove,0)");
    lcd.setCursor(6,1);
    lcd.print(" ");
    }
    else
    {
    ToMove = Degrees*Multiplier;
    lcd.setCursor(0,0);
    lcd.print("FWD lcd.print(Degrees,2);lcd.print((char)223)");
    lcd.setCursor(6,1);
    lcd.print("Moving rotation(ToMove,1)");
    lcd.setCursor(6,1);
    lcd.print(" ");
    }
    lcd.setCursor(0,2);
    lcd.print("Repeatancel[B]");
    char key = kpd.getKey();
    while(key != 'B')
    {
    key = kpd.getKey();
    if(key == 'A')
    {
    if(Degrees < 0)
    {
    ToMove = (Degrees*Multiplier)*-1;
    lcd.setCursor(6,1);
    lcd.print("Moving rotation(ToMove,0)");
    lcd.setCursor(6,1);
    lcd.print(" ");
    }
    else
    {
    ToMove = Degrees*Multiplier;
    lcd.setCursor(6,1);
    lcd.print("Moving rotation(ToMove,1)");
    lcd.setCursor(6,1);
    lcd.print(" ");
    }
    }
    }
    lcd.clear();

    }

  20. #80
    Join Date
    Jun 2006
    Posts
    30

    Re: Arduino Sherline Rotary Table controller

    Hello,

    I would like to use it the last sketch. but i have error message:

    Arduino: 1.8.0 (Windows 10), Board: "Arduino Nano, ATmega328"

    lepteto_osztofej:87: error: missing terminating " character

    lcd.setCursor(0,2);lcd.print("Enterees");lcd.setCu rsor(0,3);lcd.print("press

    ^

    lepteto_osztofej:182: error: missing terminating " character

    lcd.print("Repeatancel;

    ^

    D:\lepteto_osztofej\lepteto_osztofej.ino: In function 'float GetNumber()':

    lepteto_osztofej:88: error: expected ')' before ';' token

    lcd.setCursor(8,1);

    ^

    D:\lepteto_osztofej\lepteto_osztofej.ino: In function 'void loop()':

    lepteto_osztofej:183: error: expected primary-expression before 'char'

    char key = kpd.getKey();

    ^

    lepteto_osztofej:184: error: 'key' was not declared in this scope

    while(key != 'B')

    ^

    exit status 1
    missing terminating " character

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

Page 4 of 5 2345

Similar Threads

  1. G1049 Rotary Table Versus Sherline set up
    By rkernell in forum Benchtop Machines
    Replies: 0
    Last Post: 08-21-2010, 03:31 AM
  2. Sherline rotary table threading
    By MechanoMan in forum Benchtop Machines
    Replies: 0
    Last Post: 07-08-2009, 11:23 PM
  3. Adapter for Sherline rotary table
    By diamondback21 in forum Taig Mills / Lathes
    Replies: 3
    Last Post: 04-13-2009, 11:26 AM
  4. Sherline CNC rotary table adaptation
    By uptoolateman in forum Benchtop Machines
    Replies: 14
    Last Post: 02-06-2009, 09:48 PM
  5. SHERLINE rotary table
    By ACME in forum Benchtop Machines
    Replies: 1
    Last Post: 11-17-2004, 05:15 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •