Arduino control for a 3” rotary table

Home Model Engine Machinist Forum

Help Support Home Model Engine Machinist Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Good Stuff Al... makes sense with your great explanation..rotary table still working good now it's shifted.

Cheers.
 
From my understanding, the metal needs to be ferrous to interact with the magnetic field (other than to generate an induced current, where it only needs to be a metal) to 'interrupt' (not really the right word) the magnetic field. You can do the experiment yourself just to see - grab 2 decently powerful magnets and arrange them with like poles facing each other so they repel, then drop a piece of plate between them and you will see both will stick to each side of the plate, even though without the plate they wouldn't get close to each other. Basically the magnetic fields are no longer interacting with each other and are effectively blocked by the metal. So the theory is a fully enclosed ferrous box would interrupt magnetic influence from any direction and shield your electronics. I haven't done the experiment myself but I am under the impression non-ferrous will not 'interrupt' the field in this manner. I really should try it myself just for curiosity's sake I guess...

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
 
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 .
 

Attachments

  • 20180706_211537.jpg
    20180706_211537.jpg
    36.8 KB · Views: 564
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:
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...
 
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
 
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...
 
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.
 
Just had a peek and on the MEGA the ICII pins are :
Mega2560 pin 20 (SDA), pin 21 (SCL)
 
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:
Sux getting old, you forget so much hard learned knowledge.
Thanks all for your help. I'll be back...

Chuck you have to look at the up side. I figure my brain cells are finally down to a manageable number.
 
Chuck you have to look at the up side. I figure my brain cells are finally down to a manageable number.

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!!!!!
 
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.
 
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.

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!
 
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

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
 
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.
 
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:)
 

Latest posts

Back
Top