Rotary table - automation

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.
 
Last edited:
You're leaving us hanging regarding the Holiday period troubles. Details would be appreciated.


:grin: Regarding the elex work,

 
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.
 
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.
 
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
 
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.
 
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 ...
rotab_controller1.jpgrotab_controller2.jpg
 
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.
 
Last edited:
The symbol/footprint for an opto-coupler, which I downloaded from one of the many online parts libraries, had a couple pins swapped. Two channel opto-coupler, so one channel works and the other doesn't. These are on the output to the stepper motor so getting these working is necessary to keep going. Had a couple of other things to modify/improve also, so rather than trying to patch the board I went ahead and did another pcb fab iteration to correct this. Also included the interface for the Adafruit 320x480 3.5" TFT touch screen on this fab. Left the character LCD option there also although from a space/layout perspective, have to use one or the other.

Anyhow, that board iteration came back from jlcpcb earlier this week. So I'm back to surface mount soldering and hardware debugging. Haven't gotten to the point of being able to solder up everything without a few bad solder joints or solder bridges, so it'll probably take at least week to populate and debug the board before getting back to the software side of moving this forward. I've done quite a bit of coding to create a menu system on the LCD, using the TFT will mean some major changes/rewrites.
 
Last edited:
Mad stuff.
Said in admiring mode.


I think-expect that there may be some issues with pulsing, length, speed (at speed).
These happened with gecko drives, and most servo drive developments I know of (granite drives for one).

What I think/saw..
Length of pulse matters,
so does polarity,
so does edge peak control, (aka spark),
and apparently low or high peak (aka pulse on on or on off).

It´s quite easy to make a bang-bang on-off stepper pulse generator -- of low speed.
It´s very very hard to make a good one of high speed.

Admiring the work, somewhat envious of your skills, ..
 
Back
Top