# Rotary table - automation



## rabler (Oct 21, 2022)

Picked up this old Van Norman 12" rotary table fairly cheap ($50 IIRC) a few months ago.  It was missing the dial/crank when I got it.  Plan on adding a small clearpath servo and controller to allow simple automation, arc cuts, hole patterns, etc.  I've seen similar project by both youtubers Oxtools and Stephen Gotteswinter.  Arguably not very sophisticated and dubious merit but I wanted a simple project to play with servo control, possibly as a prelude to a DIY cnc plasma cutter.  It'll be a reversible modification so no big deal if its just a learning exercise.  First step is to take it apart, clean it up, check it for play, and paint it.  This weighs over a 100 lbs so it is a workout to get it in/out of the parts cleaner.
.


----------



## markba633csi (Oct 21, 2022)

That's a great deal!  They usually go for much more


----------



## rabler (Oct 21, 2022)

markba633csi said:


> That's a great deal!  They usually go for much more


Yeah, one of the guys on the Amish construction crew that built my shop brought it by when they were doing the work.  I invited them into the old shop to sit while eating lunch.  It was February, so they appreciated having a heated place to eat their homemade lunch, and saw some of the machine tools.  They brought it by and said make us an offer, it's scrap otherwise.
I have an 8" and a 16", so I wasn't pressed to offer too much, but I certainly am a tool collector.


----------



## markba633csi (Oct 21, 2022)

Since I built this homemade indexer I've been wanting to find a rotary table to add a stepper to and use the same Arduino box:


----------



## TorontoBuilder (Oct 21, 2022)

markba633csi said:


> Since I built this homemade indexer I've been wanting to find a rotary table to add a stepper to and use the same Arduino box:



I built one too based on Chuck Fellows design and used his arduino code.  I've got a rotary table and a spindexer though so dont use it much. I prefer more holding power so I've always wanted a large rotary table version, but around here even the ugliest most abused large rotary table is in the hundreds of dollars.


----------



## TorontoBuilder (Oct 21, 2022)

rabler said:


> Picked up this old Van Norman 12" rotary table fairly cheap ($50 IIRC) a few months ago.  It was missing the dial/crank when I got it.  Plan on adding a small clearpath servo and controller to allow simple automation, arc cuts, hole patterns, etc.  I've seen similar project by both youtubers Oxtools and Stephen Gotteswinter.  Arguably not very sophisticated and dubious merit but I wanted a simple project to play with servo control, possibly as a prelude to a DIY cnc plasma cutter.  It'll be a reversible modification so no big deal if its just a learning exercise.  First step is to take it apart, clean it up, check it for play, and paint it.  This weighs over a 100 lbs so it is a workout to get it in/out of the parts cleaner.
> .
> 
> 
> ...


That's an excellent score you have there. 

IIRC Home Model Engine Machinist's site has a long thread entitled something like arduino rotary table for dummies.. I'd give it a read as well as any other resources you may have. 

You're very likely to find links to the entire hardware and software requirements leaving you little to do of any real difficulty. I look forward to seeing what you do, because I'm planning my own as soon as I find a viable 12" table to use for the project


----------



## rabler (Oct 21, 2022)

markba633csi said:


> Since I built this homemade indexer I've been wanting to find a rotary table to add a stepper to and use the same Arduino box:


Nice build. I'm likely to go the other way, get this working then build a homemade indexer.  Probably going to use the Arduino development environment and try using the RPI Pico chip as I have a few of them and have been looking for something to use them for.


----------



## extropic (Oct 21, 2022)

Randal,

What cleaner are you using there (plastic jug)?


----------



## rabler (Oct 21, 2022)

extropic said:


> Randal,
> 
> What cleaner are you using there (plastic jug)?


Citristrip, it's a paint stripper.  I have Master fluid solutions 2430 in my parts washer, and use a bucket heater to bring it up to about 120 F.


----------



## rabler (Oct 21, 2022)

TorontoBuilder said:


> That's an excellent score you have there.
> 
> IIRC Home Model Engine Machinist's site has a long thread entitled something like arduino rotary table for dummies.. I'd give it a read as well as any other resources you may have.
> 
> You're very likely to find links to the entire hardware and software requirements leaving you little to do of any real difficulty. I look forward to seeing what you do, because I'm planning my own as soon as I find a viable 12" table to use for the project


Thanks for the pointers.  In a past lifetime I did a fair amount of encoding in embedded asm and C, so I'm inclined to knock the rust off my skills and develop it from scratch.  I rather enjoy a bit of  clean slate approach for this kind of thing.


----------



## TorontoBuilder (Oct 21, 2022)

nice skills to have.

now i'm more keen to see what you do


----------



## rabler (Oct 21, 2022)

TorontoBuilder said:


> nice skills to have.
> 
> now i'm more keen to see what you do


Thanks!    Be patient, I have 3-4 projects in progress.  Hand scraping in a straight edge for use in rebuilding a couple of lathes.  Picking up a VMC tomorrow that will get a new linuxcnc controller.  A few others queued up that haven't gotten started.


----------



## markba633csi (Oct 21, 2022)

My coding skills weren't (and still aren't) good enough to do it from scratch so I tried the Chuck Fellows (RIP) version. Unfortunately I had trouble getting consistent results with it- skipping steps and other erratic behavior.  Obviously not OK when you are cutting gears.  So I dumped it and went to the "dummies" version which worked flawlessly. Better interface too.  Couple small code errors (keypad connector pinout) but nothing major.
I suspect there was something flaky about Chuck's pushbutton servicing routine but I never could pin it down.  Poor guy passed away before I could contact him...
-M


----------



## TorontoBuilder (Oct 21, 2022)

markba633csi said:


> My coding skills weren't (and still aren't) good enough to do it from scratch so I tried the Chuck Fellows (RIP) version. Unfortunately I had trouble getting consistent results with it- skipping steps and other erratic behavior.  Obviously not OK when you are cutting gears.  So I dumped it and went to the "dummies" version which worked flawlessly. Better interface too.  Couple small code errors (keypad connector pinout) but nothing major.
> I suspect there was something flaky about Chuck's pushbutton servicing routine but I never could pin it down.  Poor guy passed away before I could contact him...
> -M


ah I did not know chuck passed away. He helped me more than a few times

I made this so many years ago I can't recall the fix, but I had to make a minor code change to get mine working properly.


----------



## markba633csi (Oct 21, 2022)

Interesting- I always wondered why Chuck's code seemed to work for other folks but not me


----------



## rabler (Oct 21, 2022)

I'm just glad these newer microcontrollers are programmable in C (or Micropython, or ...).   I spent a lot of time pushing assembly for older 8bit ones with limited fairly limited depth stack.  A lot more painful than today's.

I got the Covid bivalent shot yesterday, plus a flu shot.  Two in one day, and today I'm feeling it.  So I decided to play with some CAD work on this.  Here's an initial draft done in FreeCad.  Key feature is no parts above the table top, or below the table bottom.   This servo runs to about 400 rpm at peak torque and about 2100 rpm at continuous torque.  A single belt reduction would be ideal but 10:1 seems to be about right for speed, this would give 9:1 as shown.  I want to be able to have it turn while milling, this is a RT not an indexer.   That gives about 1 RPM max for peak torque, about 6 RPM at max continous torque, and around 7 RPM  hypothetical "no load".   One "step" translates to .00125 degrees in this config, or 4.5 seconds of a degree.  These servos have a torque % output as a PWM signal, so I'm thinking of monitoring the torque in the microcontroller and derating the feed (RPM) based on the load. 


Note:  The worm is 40:1
This is based on 2mm pitch GT2 pulleys/belts.  I may have to go to GT3, the 20 tooth pulley is not much bigger than the 3/8" shaft on the clearpath.


----------



## rabler (Oct 21, 2022)

markba633csi said:


> My coding skills weren't (and still aren't) good enough to do it from scratch so I tried the Chuck Fellows (RIP) version. Unfortunately I had trouble getting consistent results with it- skipping steps and other erratic behavior.  Obviously not OK when you are cutting gears.  So I dumped it and went to the "dummies" version which worked flawlessly. Better interface too.  Couple small code errors (keypad connector pinout) but nothing major.
> I suspect there was something flaky about Chuck's pushbutton servicing routine but I never could pin it down.  Poor guy passed away before I could contact him...
> -M


Software debounce on the keypad?  With the combination of using 4x4 scanning plus software debounce that can get pretty messy.


----------



## markba633csi (Oct 21, 2022)

That's what I'm looking for a 40:1 table, then I can use the same Arduino file and just change the dipswitch on the 8825 drive chip for different microsteps between the indexer and the table.  Unfortunately most tables are either 72 or 90 to 1 I think

The Chuck Fellows version didn't use a keypad, just 4 buttons with a resistor divider; it sent voltages representing the buttons to an analog Atmel input. THAT was messy- he used up all the I/Os for the parallel LCD display.
The "dummies" version uses a regular 4x4 keypad and a serial LCD interface- mucho cleaner and better


----------



## rabler (Oct 21, 2022)

markba633csi said:


> Unfortunately most tables are either 72 or 90 to 1


I better double check mine tomorrow.  I’m thinking the bottom of the table looks like more than 40 teeth.  Unless it is a multi-start leadscrew/worm, that would mean it isn’t 40:1.  For the servo rpm, with 90 to 1 I’d ditch the intermediate pulleys and live with 3:1 there.

For my 10ee DC controller I used a rotary encoder rather than a keypad.  Tempting to couple that with a simple touchscreen.


----------



## markba633csi (Oct 21, 2022)

That would be cool.  Yeah I think 40:1 tables are not common (I'm not sure) so I'm curious if yours is/isnt
Although 12" would be too big for me- I want maybe 10" max
You would think the tables that can use divider plates they would be geared like dividing heads: 40 to 1


----------



## TorontoBuilder (Oct 21, 2022)

rabler said:


> I'm just glad these newer microcontrollers are programmable in C (or Micropython, or ...).   I spent a lot of time pushing assembly for older 8bit ones with limited fairly limited depth stack.  A lot more painful than today's.
> 
> I got the Covid bivalent shot yesterday, plus a flu shot.  Two in one day, and today I'm feeling it.  So I decided to play with some CAD work on this.



I haven't had the opportunity to use the newer controllers with either C or micropython but I want to do something.

I need to get my flu shot, and the new bivalent covid booster. But I want to wait at least 3rd week of November so I'll be 4 months since my 4th shot. That should give me flu protection deeper into the winter too.

The key debounce rings a bell and is likely where I made changes


----------



## rabler (Oct 22, 2022)

Thanks to @markba633csi's comment, I rechecked and this one is indeed 90 turns or 4 degrees per turn.  Must have been thinking of the little 8" Shars rotary with the dividing plates.  So I'll drop to a simpler setup with no intermediate shaft, 3:1 reduction.  That will give me around 1.5 RPM at max torque, and about 7.8 RPM at max continuous torque.  Not exactly a zippy table, but if I want faster I can always swap out pulleys.  I figure I'll add a calculation to the code that is easily changed.  Just have to be careful with rounding errors depending on how I implement the code.  Ideally it will be an integer number of steps per complete table revolution.

I'm thinking about coding several things.  Goal is to be able to index, turn to a location from a zero, and cut through an arc.  Make the code re-usable for a dividing head or other similar device.  (I have some CAD plans I started for a DIY dividing head w/ stepper or servo).    Just trying to start a wish list here, this all won't happen in one pass but I find it's easier to design with all of the features in mind than have to throw out and rebuild, or hack on.
1) backlash warning - if you reverse you need to go forward again a certain distance before being considered "correct".
2) encoder input - measure a feed (x axis for example).  Useful if you want to cut a spiral.  This start to look like ELS functionality.  May be a future expansion for gear hobbing.
3) feed rate reduction based on torque feedback.  This only would work in arc cutting, but could be a user feedback for say spiral/encoder cutting.


----------



## Lo-Fi (Oct 22, 2022)

Cool project! Interesting seeing people get into micro controllers here. I've been messing about quite a bit lately, mostly with the ESP32, though not really with machining related things.

Automatic table locks are something I'd add to the feature list. There tendancy for an RT to shift during a linear cut when unlocked is super high. Important if you're going to use for indexing.


----------



## rabler (Oct 22, 2022)

Lo-Fi said:


> Cool project! Interesting seeing people get into micro controllers here. I've been messing about quite a bit lately, mostly with the ESP32, though not really with machining related things.
> 
> Automatic table locks are something I'd add to the feature list. There tendancy for an RT to shift during a linear cut when unlocked is super high. Important if you're going to use for indexing.


I've thought about that, more of a mechanical issue than coding (which the above mostly reflects). The table has a screw down locking clamp but automating it would be challenging.  Looking the leadscrew on most RT's doesn't solve the issue.  But I could easily add a lock output for later/other use.


----------



## markba633csi (Oct 22, 2022)

Don't RTs have some type of backlash adjustment?  I thought maybe the worm was on eccentric bushings or some such arrangement to zero it out
Thanks for the tip about the smaller Shars table- 8" would be perfect for me if it's 40:1


----------



## rabler (Oct 22, 2022)

markba633csi said:


> Don't RTs have some type of backlash adjustment?  I thought maybe the worm was on eccentric bushings or some such arrangement to zero it out
> Thanks for the tip about the smaller Shars table- I'm going to check specs on some smaller units


Yes, on this one the worm leadscrew sits off center in the carrier sleeve/cylinder seen in the pictures on the first post.   So you can tune the backlash down to quite a small amount.  But similar to tightening gibs, there are challenges with getting too tight, and it takes very little backlash to create chatter in a rotary table.  I hoping that will be one of the advantages of these larger tables, more mass in the rotary component to resist chatter.


----------



## rabler (Nov 6, 2022)

Slow progress as I bounce around between projects.   Got this painted.  Stoned the bearing ring.  Stefan Gotteswinter has a youtube video of scraping in a 8" rotary.  Just don't see myself going to that level of precision.  Worm does need a little more cleaning before reassembly.

  With it being 90:1 on the table worm, I only need 3:1 or 4:1 on the stepper, so I modified the CAD layout a bit.  With the offset in the stepper mount, the floating purple gear is in about the right place for where the worm handle ends up.  Getting that to a more precise spec/layout will be needed.

Got my RPI 4 set up for Pico development.  Opted to add a USB SSD drive as the boot drive, quite a bit faster than the RPI 4 on even a good SD card.


----------



## rabler (Nov 26, 2022)

Got the RPI Pico setup, and got a stepper control PIO program written.  I'm using PIO code, sending the clock period (step rate) and number of steps to the PIO through the built in FIFO, so the processor doesn't have to bit-bang that or deal with a a lot of interrupts.  Using a 32-bit number for the clock period since that matches the fifo size, it works out that I can clock the stepper from about 20MHz down to about .005 Hz (one step every 200 seconds) without invoking the PIO frequency divider, with a ~50ns resolution on the period.   Way overkill for driving any real stepper.

I'm not much for breadboarding these days, so I went ahead and designed a PCB board and currently have that being fabricated.  I'm sure there will be some mods required once I work out any bugs.  Board is 4" x 5.5.



This PCB will be multi-purpose, it has mounting for a 20x4 LCD, outputs for the stepper at 12V, 4 channels of optio-isolated triacs to switch 120VAC (think contactors), inputs for a user rotary encoder, a leadscrew encoder,   circuitry to monitor 3-phase power, etc, etc.  Another project on I'm dovetailing in with this one is to build a WIFI logger for my RPC, measure voltage and current with phase angle for each.  Plan to mount it buried in a PVC electrical box connected to my 3Φ and set up a data logger on an RPI 4 to track my RPC performance under load.


----------



## rabler (Dec 17, 2022)

Plodding along.  Got the circuit boards back and one populated for testing/development.  Time to hook up the stepper and fabricate a bracket for the rotary table (switching from electrical work to machining). 




Concurrently working on designing a version 2 board as I work out the bugs in this one.  @WobblyHand convinced me to add a TFT touchscreen display amongst other revisions I'm making.  Here's a 3D rendering of the design so far.  Nice capability for an open source PCB design tool.


----------



## rabler (Dec 17, 2022)

The youtube channel_ Inheritance Machining _has the theme of "side projects".  The side projects spawned from this so far are to add a NAS to my network so that I can easily share files between my shop and house so that I can work on/view CAD/PCB projects on computers at either end.  That spawned the project of hooking up security cameras at the shop, house, and 1300 ft away at the barns, mostly so we have remote "horse view" cameras, although some thought to security.  While I was at it I put a WIFI node at the barns.  To finish up that side project of upgrading the fiber between the house and shop to 10GB/s, as pushing several Terabytes through the NAS, mostly for backups, takes too long at 1Gb/s.

Another unrelated but more essential side project is to get the gas heater and wood burning stove set up in the shop.  Mostly work installing the chimneys.  I'm not a fan of working on roofs, especially that high where I can't use my tractor forks as a scaffold.  So the final step in that will get hired out.


----------



## rabler (Jan 3, 2023)

Having fun working on this.  Which is a good distraction as the holidays included a broken rib, a damaged pickup truck, and a furnace failure on Christmas day during the tail end of that arctic blast.  Almost sounds like a bad country western song.

I'm building the controller for this as a swiss army knife.  Meaning I didn't quite go as far as including the kitchen sink.  But I did stuff as much onto the board as I could interface into the $5 Raspberry Pi Pico RP2040 that I'm using as a microcontroller.

My circuit board has an external I2C based A2D converter with 12 channels, (6 channels if set up in differential mode), four 4A triacs rated for 400V, outputs for a stepper with a PWM input for the Clearpath SDSK line of torque feedback, 4x20 character LCD interface, SPI interface for a 320x480 TFT display with a resistive touchscreen controller, inputs for a user driven rotary encoder knob, inputs for a leadscrew encoder, and a qwik I2C interface plug for expansion gadgets, four buttons for user input, and a few LEDs, all with supporting circuitry, optical isolation for the external inputs, etc.  Maybe I did get the kitchen sink in there somewhere, I should double check the schematic.

So the goal for the "rotary table" controller is to also include input from a leadscrew encoder so that it can act as a helical cutter on a mill, i.e., take the place of a leadscrew attached dividing head.  There is a name for those that escapes me at the moment.  I've got the menus set up for the basic rotary table operation, and an LED flashing for stepper pulses, waiting for a cable from Teknics for the clearpath stepper.   So when those arrive I'll start building the stepper mechanical interface for the table.  (Machining work!)

Given the sore ribcage, I've been playing with the other side of the board.  A/D converter.  My goal here is to sample the voltage and current on all three legs of the RPC.  I can put a copy of the board in an enclosed PVC electrical box with conduit to the RPC panel, and capture the performance of the RPC.   Transmit aggregate results over wifi to a linux box (probably a Raspberry PI but TBD) for logging.  That will keep all the wires connected to the RPC safely enclosed in electrical rated boxes. For development I'm simulating the RPC with a 120VAC -> 24VAC output home thermostat transformer I happened to have lying around.

I'm sampling all 6 input channels at 960 samples / second/channel.  So 480Hz nyquist frequency, or 16 samples per cycle of 60Hz, or 1.041667 ms sampling period.  The external A/D converter I'm using nicely samples all 6 inputs in a burst and sends 12 bytes (10 bits per sample).

I'm recording 512 samples per channel across all 6 channels.  That takes 512*1.042ms.  A little more than 1/2 a second.  One core of the RP2040 is FFT'ing all 6 channels in 94ms.  That's using 16 bit integer FFTs.  Floating point FFTs took about 295 ms, I may go back to that.  Anyway, FFTing the results gives me an easy way to extract relative phase and amplitude, plus a measure of noise power across the other frequency bins. I haven't implemented interleaving the FFTs with the sampling but that will be easy as the sampling is already interrupt driven, just need a bit of coordination and a second input buffer so I can fill one buffer while transforming the other.  Have to implement the wifi interface first though, as printing all that data to the screen is kind of pointless. Question of whether I implement the WIFI on the FFT/sampling core or the other core, I need to delve into the interrupt priority of the wifi vs. the timer I'm using for the A/D sampling as I wouldn't want the A/D sampling period trashed by wifi I/O.

Goal is eventually to not only analyze and log the RPC performance, but eventually use the triacs to switch in load balancing capacitors (via a contactor) as needed to adjust for significant load changes.  At least that is the idea.

My interface cable for the stepper should arrive any day.  Out of the electronics world for a bit and back to machining to build the rotary table mount.


----------



## extropic (Jan 3, 2023)

You're leaving us hanging regarding the Holiday period troubles. Details would be appreciated.


 Regarding the elex work,


----------



## rabler (Jan 3, 2023)

extropic said:


> Details would be appreciated.


The rib popped when I was installing a wood burning stove chimney/metal flu in the attic space of the shop.  I was crawling around on my belly above the rafters. Trying to stretch and twist the wrong way, and pop went a rib against a rafter.  Wood won over bone.  Painful.  Not very exciting.  The ignitor died on the furnace.  Had to wait a few days to get the $20 replacement part.  The truck involved an oncoming vehicle crossing the centerline forcing me into a ditch.  And 2400lbs of horse feed wrapped to pallet coming through the rear window.  All happened at less than 20mph.

Like I said, bad country-western.


----------



## extropic (Jan 4, 2023)

Ouch, Ouch and Ouch!
So sorry for your troubles.
I bet trying to get back to the attic access/ladder was no fun at all.
Heal well.


----------



## dkemppai (Jan 4, 2023)

rabler said:


> My circuit board has an external I2C based A2D converter with 12 channels, (6 channels if set up in differential mode), four 4A triacs rated for 400V, outputs for a stepper with a PWM input for the Clearpath SDSK line of torque feedback, 4x20 character LCD interface, SPI interface for a 320x480 TFT display with a resistive touchscreen controller, inputs for a user driven rotary encoder knob, inputs for a leadscrew encoder, and a qwik I2C interface plu


So it sound like you have A LOT of stuff going on in that board! Got any images/screenshots of the board? 

I'm also thinking about a digital rotary table, once a few other projects get wrapped up. So, part of the reason for the reply is to keep tabs on your progress!  

Dan


----------



## rabler (Jan 4, 2023)

dkemppai said:


> So it sound like you have A LOT of stuff going on in that board! Got any images/screenshots of the board?


Sure, check this post on the previous page.  Mostly software work since then, but I have a revised board in design too.  Just working through all the features and getting the software working in conjunction with proving out the circuit before pulling the trigger on another rev.


----------



## rabler (Jan 5, 2023)

dkemppai said:


> Got any images/screenshots of the board?


Here's a couple of updated CAD renderings.  Not perfect since it doesn't really contribute to the design to chase down 3D CAD models for every part ...


----------



## rabler (Jan 7, 2023)

I'm using the RP-2040 PIO mechanism for generating precise timing for the stepper pulses.  That gives timing resolution on the order of 16ns for driving the stepper.    Using the arm core directly would allow similar periods (probably on the order of 100ns).  Given the fastest the Clearpath SDSK can accept pulses is on the order of a microsecond, the PIO is not  necessary but should reduce timing jitter.

But, I'm keeping the display updated with actual angle at the same time.  Without the PIO, you'd probably push timing jitter on the stepper pulses to > 1 microsecond even with an interrupt timing mechanism if the display is updated concurrently. Still not horrible when the fastest the clearpath will turn is an 8 microsecond stepping period.   All of this would probably matter more with a straight stepper, the clearpath has an internal microcontroller that does some smoothing and acceleration/deceleration.

This will get more interesting when I implement leadscrew-based motion.  I haven't looked at PIO coding that yet.   Not sure if I'll try for direct ratios via the PIOs.


----------

