Arduino control for a 3” rotary table

Discussion in 'Machine Modifications' started by bmac2, Jul 17, 2016.

Help Support HMEM by donating:

  1. Apr 18, 2017 #101

    xrayxray

    xrayxray

    xrayxray

    Active Member

    Joined:
    Feb 28, 2017
    Messages:
    41
    Likes Received:
    2
    Good Stuff Al... makes sense with your great explanation..rotary table still working good now it's shifted.

    Cheers.
     
  2. Apr 23, 2017 #102

    bmac2

    bmac2

    bmac2

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 16, 2013
    Messages:
    997
    Likes Received:
    697
    Actually a shield only has to be conductive and connected to ground. Pass a magnetic field over a conductor, it generates electricity. Pulse it on and off and everything else in the room goes a little nuts. We had a screen room at work used for calibration of avionics equipment and it was a fine copper mesh. This is 25 pair cable used for voice and data and the shield is aluminum. Here’s a tip. Like hobby electronics? Get a buddy that’s a cable splicer. To them 3 feet of cable is garbage, to me it’s a pot of colour coded gold!

    IMG_1913 (Medium).JPG
     
  3. Jul 13, 2018 #103

    Cromaglious

    Cromaglious

    Cromaglious

    New Member

    Joined:
    Nov 19, 2017
    Messages:
    3
    Likes Received:
    0
    This my take on the 4th axis rotary table. Jmc-motor.com NEMA 23 285 oz. in. IHSS57-36-20 integrated closed loop stepper. Belt drive reduction, belt on order. Give it 20 to 48vdc and step and direction. Built in driver and encoder. Enough power to turn against a 3/8 end mill doing serious work. I also have a weld positioner using a 48:1 blue ebay worm drive and a Shopsmith 12" sanding platter. That is currently driven using a 6600 ebay driver and an old cnc3040 NEMA 23 dumb stepper .
     

    Attached Files:

  4. Jul 13, 2018 #104

    neilw20

    neilw20

    neilw20

    Member

    Joined:
    Jan 11, 2011
    Messages:
    11
    Likes Received:
    0
    This is meant to be constructive, to help you. Not laying $hit on your good work. :rolleyes:

    Look at this fragment of code...

    case 'D':
    num=0.00;
    lcd.setCursor(16,1);lcd.print(" ");
    lcd.setCursor(16,1);
    break;
    }
    Degrees = 360/num; // <----- Division by ZERO!! for case 'D'
    key = kpd.getKey();
    }
    return Degrees; //num;
    }'

    Doing this sort of thing on micros, in my experience, NEVER needs floating point arithmetic on such a basic operation like working stepper motors.
    For 200 step per rev and 90:1 for gear gives (200 * 90) / 360 gives 50 steps per degrees.
    Want to move 13.5 degrees (internally counting from 0 to 3600) gives STEPS = (135 * 50) / 10 = 675;
    Want to move 13.4 degrees (internally counting from 0 to 3600) gives STEPS = (134 * 50) / 10 = 670;
    Want to move 0.1 degrees (internally counting from 0 to 3600) gives STEPS = (1 * 50) / 10 = 5;
    Always do the MULTIPLY FIRST, usually for better results.
    Dynamically changing time delays in loops, so that it accelerates and decelerates smoothly will allow much higher speeds.
    Once above the critical speed of the motor you can't just stop or start it instantly.
    A stepper is torsionally loaded against a permanent magnet, like a spring, and once you yank on the spring too quickly you can loose steps because inertia wins.
    https://www.google.com/search?q=ste...ast5zcAhXFmJQKHaPHDX4QsAQIPg&biw=1375&bih=751
    Look at the manufacturers data sheets for motors.
    Study this.. It might explain a few things
    https://en.wikipedia.org/wiki/Stepper_motor
     
    Last edited: Jul 13, 2018
  5. Oct 29, 2018 #105

    chucketn

    chucketn

    chucketn

    Senior Citizen

    Joined:
    Dec 17, 2009
    Messages:
    1,302
    Likes Received:
    154
    Occupation:
    Fully retired
    Location:
    Near Jonesborough, TN
    I know this is an old thread, but I built a rt controller based on this same code from Bob Pratl way back when. I was making a 3d printed case for it and had to disassemble my working mock up to put the parts into the case. I stupidly forgot to make a schematic or sufficient notes to get it re-connected. And, now can't remember how I put it together.
    In the interim, I used the Arduino Mega with other projects. Now, I find I've lost my code.
    My setup used a Arduino mega, the 4x4 keypad that the late John Stevenson posted about way back when, a TB6560 driver, and a 20x4 lcd, but no I2c. I used the mega to accommodate the lcd and the keypad.
    I know I shared my working code with someone on this or another forum, but I can't find it. BMac2, Foozer, anybody... Do you remember the thread, or maybe have a copy of my version of the code?
    I could start over, and probably will have to, but thought I would ask.
    I have searched all the forums I'm on, my email sent folder, and 3 computers... Can't find the schematic I used nor the code...
    I know I had it working, because I made a set of Atlas change gears, and several other gears with it, with the components mounted on a crappy wood base...
     
  6. Oct 29, 2018 #106

    Foozer

    Foozer

    Foozer

    Well-Known Member HMEM Lifetime Supporter

    Joined:
    Nov 26, 2008
    Messages:
    1,165
    Likes Received:
    69
    Gender:
    Male
    Occupation:
    Retired
    Location:
    Camano Island, WA
    Don't recall seeing a mega based script, do recall your mentioning it [Stepping Motors Thread] where you said you modified a script from Bob Prati, but doesn't appear that the code was posted. Feel your pain - I've lost scripts, know I saved them, just can't find them.

    Robert
     
  7. Oct 29, 2018 #107

    chucketn

    chucketn

    chucketn

    Senior Citizen

    Joined:
    Dec 17, 2009
    Messages:
    1,302
    Likes Received:
    154
    Occupation:
    Fully retired
    Location:
    Near Jonesborough, TN
    Thanks for responding, Bob. Well, gives me something to do... Already found a 4x4 keypad test sketch. Tested it on Arduino and mega. This time I'll document as I go..., and save the code in several places.
    I know I saved it before, just can't find it. And, I'm sure I shared it with someone...
     
  8. Oct 29, 2018 #108

    Foozer

    Foozer

    Foozer

    Well-Known Member HMEM Lifetime Supporter

    Joined:
    Nov 26, 2008
    Messages:
    1,165
    Likes Received:
    69
    Gender:
    Male
    Occupation:
    Retired
    Location:
    Camano Island, WA
    Start a thread and document your rebuild adventure.
    Rebuild often comes out better than the original . . .
     
  9. Oct 29, 2018 #109

    bmac2

    bmac2

    bmac2

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 16, 2013
    Messages:
    997
    Likes Received:
    697
  10. Oct 29, 2018 #110

    chucketn

    chucketn

    chucketn

    Senior Citizen

    Joined:
    Dec 17, 2009
    Messages:
    1,302
    Likes Received:
    154
    Occupation:
    Fully retired
    Location:
    Near Jonesborough, TN
    Thanks Foozer, and Bob. I have started down that long dusty road... I have gotten the keypad to work with the mega, the display - not so much...
    I loaded the "Hello World" example and can only get the back light and intensity to work. I had left the Keypad connected and tried to change the pins the display, a 20x4, connected to. I think that is what I did before.
    I may just break down and buy another setup, of an ICII lcd ad a new Arduino Uno and start with the proven sketch.
     
  11. Oct 29, 2018 #111

    bmac2

    bmac2

    bmac2

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 16, 2013
    Messages:
    997
    Likes Received:
    697
    Just had a peek and on the MEGA the ICII pins are :
    Mega2560 pin 20 (SDA), pin 21 (SCL)
     
  12. Oct 30, 2018 #112

    chucketn

    chucketn

    chucketn

    Senior Citizen

    Joined:
    Dec 17, 2009
    Messages:
    1,302
    Likes Received:
    154
    Occupation:
    Fully retired
    Location:
    Near Jonesborough, TN
    So I don't need a separate I2C card? Duh... Yes I do... O.k., just ordered a 20x4 lcd with I2C module attached. When that gets here I'll start again.
    Sux getting old, you forget so much hard learned knowledge.
    Thanks all for your help. I'll be back...
     
    Last edited: Oct 30, 2018
  13. Oct 31, 2018 #113

    bmac2

    bmac2

    bmac2

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 16, 2013
    Messages:
    997
    Likes Received:
    697
    Chuck you have to look at the up side. I figure my brain cells are finally down to a manageable number.
     
  14. Oct 31, 2018 #114

    Wizard69

    Wizard69

    Wizard69

    Well-Known Member

    Joined:
    Mar 9, 2013
    Messages:
    1,341
    Likes Received:
    267
    Now that is funny!

    I understand Chucks problem though. I do have a cure for one old age problem. When you misplace something and can’t find it after months of looking just go down to the hardware store and buy a new one. You will find that missy by tool within 15 minutes of getting home!!!!!
     
  15. Oct 31, 2018 #115

    DJP

    DJP

    DJP

    Well-Known Member

    Joined:
    Dec 7, 2012
    Messages:
    468
    Likes Received:
    114
    My aging aunt passed along her wisdom.... 'When you are finished using something; put it back. Do not put it down. '

    I'm finding that she was right and it applies well to a metal machine shop.
     
  16. Oct 31, 2018 #116

    chucketn

    chucketn

    chucketn

    Senior Citizen

    Joined:
    Dec 17, 2009
    Messages:
    1,302
    Likes Received:
    154
    Occupation:
    Fully retired
    Location:
    Near Jonesborough, TN
    Good advice! I try, but I am so easily distracted ( oh, shiny... or I need an X to make a Y, and now I need a Z to make an X, wash, repeat...). Now, what was I doing? Mostly, if I can't remember what I was doing, I never know when I'm finished!
     
  17. Oct 26, 2019 #117

    Qtron

    Qtron

    Qtron

    New Member HMEM Supporter

    Joined:
    Oct 20, 2019
    Messages:
    3
    Likes Received:
    0
    Gender:
    Male
    Occupation:
    Electronics Tech
    Location:
    Oz
    Hi Neilw20,
    newbie here, any chance of a copy of the rotary table code with your improvements, i cant write code..(yet)
    i assume your code runs quicker without floating point assisting..
    havent a clue what i am writing here!
    am willing to pay for your efforts.
    i compiled te xrayxray zipped file & original file using arduinodroid,
    on samdung TabA tablet. seems to work but i keep getting diagnostic (results) exclamations: use of undeclared identifier 'getdegrees' and 2 other 'gets'! also 'printadvance' & 'rotation'
    compiled ok.

    i went thru all pages of this thread , no reference to this type of diagnostics results.
    Also,
    i dunno where to get that 4x4 membrane keypad, no brands seem to be mentioned anywhere..
    cheers,
    Qtron
     
  18. Oct 26, 2019 #118

    Qtron

    Qtron

    Qtron

    New Member HMEM Supporter

    Joined:
    Oct 20, 2019
    Messages:
    3
    Likes Received:
    0
    Gender:
    Male
    Occupation:
    Electronics Tech
    Location:
    Oz
    to clarify, i get the same errors on orig file & XrayXray zipped, sorry cant fnd the right page in this thread for the zipped version, the orig being on page 1.
     
  19. Oct 27, 2019 #119

    kquiggle

    kquiggle

    kquiggle

    Well-Known Member

    Joined:
    May 29, 2012
    Messages:
    358
    Likes Received:
    107
  20. Oct 27, 2019 #120

    Qtron

    Qtron

    Qtron

    New Member HMEM Supporter

    Joined:
    Oct 20, 2019
    Messages:
    3
    Likes Received:
    0
    Gender:
    Male
    Occupation:
    Electronics Tech
    Location:
    Oz
    Cheers Mr Kquiggle, MUCH appreciated.
    I also sus'ing out YouTube's Myfordboy's "Stepindexliming23.ino comprehensive Indexer, 620 lines of code!!!
    A clever dick indeed:)
     

Share This Page