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.
Jaime
Happy to send you the latest sketch. Just send me a personal email. I can't upload the sketch directly but email OK.
Just change the multiplier to suit the ratio of your rotary table.

Bruce W-S
 
@ Bruce

I'd like to ask for a sketch.
I finally got mine to work with my equipment (LCD Screen, driver, etc.) --- but it was through the help of some talented individuals on the FaceBook Arduino forum.. Having the correct library for the hardware that you have is critical, and not trivial - as there are lots of different manufacturers of the electronic components. Be prepared to go the full 15 rounds in getting this puppy to work. It took me (with help from people that knew what they were doing) a lot longer than I expected. But it is a nice addition
 
Thanks for making your sketch available to everyone Bruce. I'm anxious to now to get going. I need to get back up to speed with the Arduino.
Your sketch will definitely make things go much faster.
 
I finally got mine to work with my equipment (LCD Screen, driver, etc.) --- but it was through the help of some talented individuals on the FaceBook Arduino forum.. Having the correct library for the hardware that you have is critical, and not trivial - as there are lots of different manufacturers of the electronic components. Be prepared to go the full 15 rounds in getting this puppy to work. It took me (with help from people that knew what they were doing) a lot longer than I expected. But it is a nice addition

What kind of lcd are u using ?
Cause im trying to get a fork of this to work with the 128x64 grapiclcd which is also hard.
Could i maybe get a copy of yours to see how they implemented it ?
My lcd uses the u8g2 or u8glib lib.
Then i just have to work on getting it compatable and work out the buttons.
Seeing i want a rotaryencoder switch to run it instead of the 4x4 buttons.
 
I have a silly question: do you really need a graphic LCD? Or is it just for the challenge?
Aside from that: generally when I'm trying to get "new" (to me) hardware working on Arduino, I start with a demo program - either one that cam with the libraries or something self-penned, but simple. Once that's working you can get the settings from there. If you can't get "hello world" working, there's not much chance you'll get something more complicated working.
(Also: thank you Bruce for sharing the sketch!)
Cheers - Andrew
 
Need is a big word its more cause thats what i got on the shelf left over from a 3d printer its a 128x64 grapiclcd with intergrated rotary encoder.
Got some 20x2 and 16x2 screens aswell but am lacking the 4x4 buttons .
And i got the screen working with the demo sketches but need to write it in to the sketch for the indexer
 
just for information.

the code I use. line 30: steps steppermotor / rotation line 31: table ratio.
 

Attachments

  • Arduino_Rotary_Table_Control_2016B-220428a.zip
    2.4 KB
As promised, here are pictures of the finished product after I got the electronics sorted. It now works well. All the electronics in the case with the keyboard and display.

View attachment 117693
View attachment 117694
View attachment 117695
hope all's ok! yeah a bit behind seeing this 2020 post, i couldnt see a desc of the big knurled disc thingo adjacent the split aluminium frame .. a harmonic drive? maybe i missed your desc.
Also is your f/w the same as B MAC or different/upgraded? Hard to know/choose the 'right' one!
 
Some time ago I posted to this site a link to indexer code I wrote which uses stepper motor acceleration and deceleration capabilities, and also includes additional functionality.Several people requested that I make some additional code modifications, and I am now making that update generally available.

While this latest release has 2019 in the file name (because it is based on code originally written in 2019), this is a new modification for 2022. The following capabilities have been added (see notes in the code for additional details):
  • Ability to operate a relay
  • Ability to change the "clock-wise" designation to match the physical rotation of your indexer
  • When choosing "arc rotation" (indexer moves back and forth in a designated arc), the indexer does not move immediately after degree designation, but only when the "Go" key is pressed
The new code is available via the link below (as will be any future changes, if there are any) :

Academy of Lagado - Stepper Motor - AccelStepper.h
 
Some time ago I posted to this site a link to indexer code I wrote which uses stepper motor acceleration and deceleration capabilities, and also includes additional functionality.Several people requested that I make some additional code modifications, and I am now making that update generally available.

While this latest release has 2019 in the file name (because it is based on code originally written in 2019), this is a new modification for 2022. The following capabilities have been added (see notes in the code for additional details):
  • Ability to operate a relay
  • Ability to change the "clock-wise" designation to match the physical rotation of your indexer
  • When choosing "arc rotation" (indexer moves back and forth in a designated arc), the indexer does not move immediately after degree designation, but only when the "Go" key is pressed
The new code is available via the link below (as will be any future changes, if there are any) :

Academy of Lagado - Stepper Motor - AccelStepper.h
ah, thanks Kevin, yes its been quite a while, grateful for the improvements too, cheers:)
 
Last edited:
Just built this, quite happy with it, and it works well.
I used the code from kquiggle linked in post #475 👍
If anybody wants to have a play with it, I put it in an Arduino simulator. (I hope kquiggle is OK with me doing this.)
Rotary Table.ino - Wokwi Arduino and ESP32 Simulator
This is kquiggle's code. I'm not taking any credit for this.


Couple of important things to note about the Simulation:
The Stepper driver and motor are powered by the Arduino. Don't do that. The simulation doesn't have an option to add an extra power supply.
For some reason the stepper motor starts at -2 steps instead of 0. I get this on most steppers on all of my simulations so your steps will be off by 2, but only in the simulation.
I had to comment out the getSettings() to get it to work on the simulation. Delete lines 1232 (/*) and 1246 (/) before you upload the code to the Arduino.
You can also delete lines 521 to 523.
Don't forget the AccelStepper library.
I used an Arduino Uno. this code almost maxes out the memory, so if you want to change any of it, you won't be adding much to it. (It's got room for maybe half a dozen new lines.)

Rotary Table.jpg



I never thought I'd use the "Arc" option, but after taking out the bulk of the material, I set the dividing head up to the vertical position, set the arc to move from 0° to I think 292° and used it to finish off the outside arc of this piece. (Taking very light cuts, but it did it well)
mount1.jpg
 
Fritz -

You are more than welcome to use my code. I would also like to note that I recently made an update to the code to add some new options :
  • Ability to operate a relay
  • Ability to change the "clock-wise" designation to match the physical rotation of your indexer
  • When choosing "arc rotation" (indexer moves back and forth in a designated arc), the indexer does not move immediately after degree designation, but only when the "Go" key is pressed
You can find a link to the updated code here :

Academy of Lagado - Stepper Motor - AccelStepper.h

P.S.

There are no bug fixes in the new release, so if you are already using the previous version and it it working to your satisfaction, there is no need to update.
 
tell me what settings are needed for this driver DM 542Безымянный.png
 
Last edited:
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.
 
Back
Top