Arduino Rotary Table for Dummies

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.
The attached file contains the arduino sketch I wrote for my dividing head. The math algorithm is written to assure that the 0 (zero) location always winds up at the same point of rotation. As it moves, it recalculates the position from zero so no matter how many times it goes around or back and forth, it maintains positional integrity. The algorithm should work for your rotary table as well.
Chuck
Thank you all for your suggestions. I will try them out next time I am in my man cave. Limited time at the moment. I will post the results when I have investigated.
Thanks once again for your help, best wishes, Colin
 
So I was able to get this working very easily with the uno as these instructions are absolutely amazing and very well made but, I wanted to try and use a Arduino Micro instead of the Uno so I cant solder the connections and not have to worry about anything coming undone in the case, but when I tried to load the program on the Micro It just never seemed to work for some reason, I confirmed the Micro was connected and working properly as I got the simple "blink" program to work. Any ideas on why it wouldnt work on the Mirco? it has enough pins and I would imagine work the same as the Uno but just smaller. You might already tell but I am not very Arduino savvy as I have no idea how to make my own programs, but can load things and wire fine haha
 
So I was able to get this working very easily with the uno as these instructions are absolutely amazing and very well made but, I wanted to try and use a Arduino Micro instead of the Uno so I cant solder the connections and not have to worry about anything coming undone in the case, but when I tried to load the program on the Micro It just never seemed to work for some reason, I confirmed the Micro was connected and working properly as I got the simple "blink" program to work. Any ideas on why it wouldnt work on the Mirco? it has enough pins and I would imagine work the same as the Uno but just smaller. You might already tell but I am not very Arduino savvy as I have no idea how to make my own programs, but can load things and wire fine haha
I can't see any big differences between the Nano and Uno in I/O that would account for non operation. I would take a guess you have a ground not connected between the Nano and your stepper motor drivers. But I'm guessing without seeing your wiring diagram.
 
I can't see any big differences between the Nano and Uno in I/O that would account for non operation. I would take a guess you have a ground not connected between the Nano and your stepper motor drivers. But I'm guessing without seeing your wiring diagram.
Micro and Nano do not use same chip. But still it should be workable. Pinout needs to be checked and the board must be choosen correct?
The first thing I came across, the I2C pins on Micro are SDA-02 | SCL-03 on Nano they are SDA-A4 | SCL-A5. (so display needs to be wired to different pin numbers already) And programm needs to be changed accordingly.

Hope you will figure it out soon.
 
Last edited:
Micro and Nano do not use same chip. But still it should be workable. Pinout needs to be checked and the board must be choosen correct?
The first thing I came across, the I2C pins on Micro are SDA-02 | SCL-03 on Nano they are SDA-A4 | SCL-A5. (so display needs to be wired to different pin numbers already) And programm needs to be changed accordingly.

Hope you will figure it out soon.
Exactly what I was thinking - the nano is essentially an UNO in a smaller package, but the micro is a slightly different animal.
 
72 by 5 by 200 gives a number too large for the code to handle (72000) It'll choke on a full turn . 200 steps per degree have to change the setup a bit to handle the math


from
const int StepsPerRotation = 200;
const int TableRatio = 360;
to
unsigned long StepsPerRotation = 200;
unsigned long TableRatio = 360;

Might be more in the code that would have to be changed - BUT - your timing belt - It's going to bite you sooner of later. Chips will cut the belt eventually. Better off fabbing a direct mount - i.e.
View attachment 105182

Boo Boo in my direct mount - the open slot in the top lets chips in, piece of tape settles it.
Direct mount better, makes math easier . .
 
dear Sir
i do not find the .ino file to load in my arduino board
can you tell me where i can found it !!
thank you in advance
 
dear Sir
i do not find the .ino file to load in my arduino board
can you tell me where i can found it !!
thank you in advance
Check message #281 he provides a link to a 2019 version. There may be newer and other options given in other messages.
 
dear Sir
i do not find the .ino file to load in my arduino board
can you tell me where i can found it !!
thank you in advance
Yes, I have the same query.
#488 says go to some web site, that website tell you to come back here....seems typical of some of these writeups.
 
Yes, I have the same query.
#488 says go to some web site, that website tell you to come back here....seems typical of some of these writeups.
If you go way down on the website that#281 links to there is a link to the code. I’ll try to paste the link here. It might get cut off though
 
Yes, I have the same query.
#488 says go to some web site, that website tell you to come back here....seems typical of some of these writeups.
p.s. just saw; "original poster" used #17" there is a zip file with the code. (I could download it to my computer today and it also compiled fine on my Arduino IDE)
dear Sir
i do not find the .ino file to load in my arduino board
can you tell me where i can found it !!
thank you in advanc

Hello,

unfortunately there are a number of different versions around. All of them appear to be wrong. 😥
:) (at least the ones I had a closer look at) So it becomes a little more involved depends what you need.

You might want to check the discussion here.

https://www.homemodelenginemachinist.com/threads/help-with-arduino-idexer.35108/page-5

The older posted versions have a rounding error and they do count wrong for certain combinations were the rounding error matters.
(some people were and are still using the wrong software happily and have no issues, if the numbers are good or the error is not important then it will be fine)

The version that I "butchered" fixed the rounding error for divisions, but in the process reversing was "damaged" and, the angle advancement might have rounding errors. Sometimes the display does "wrong things" when the layout does not match the present numbers. (might also apply to older versions)
As most rotary tables have backlash reversing without some minor issue will be difficult. Rotating a full circle minus one division instead of reversing would solve the backlash, but would be useless for people who want to use it for milling under power. (even dangerous)

I could not find out so far if someone is using this for milling under power, were the angle advancement would be helpful and forward and reverse should work as someone would expect.
For dividing I use the corrected (butchered) version, it does not allow to rotate backwards and the angle movements are not of much use.

I hope this helps and does not confuse even more.

Greetings Timo
 
Last edited:
Back
Top