# Digital control on a dividing head



## dbb-the-bruce (May 14, 2019)

This question is not "how to add a 4 axis".

What I'd like to do is attach a stepper to the dividing head I'm refurbishing and then have the capability to accurately control rotation for things like odd gears and other stuff.

I'm a software engineer in real life, and I've worked with a number of motion control systems over the course of my career. But I'm not very familiar with what is currently commercially available and affordable off the shelf. 

I'm envisioning buying a stepper motor with a controller and a power supply - ie. a single axis kit. The controller would be smart enough and easy enough to configure. It would also be open enough that I can easily write my own python scripts to use with it or have existing simple utility scripts/software.  Also should be OS agnostic, I'm a Linux / OSX guy.

I won't know until I've finished the dividing head refurb, but I don't think it's going to require a HUGE amount of torque to turn, and won't need a lot of holding torque either as it's driving a worm gear.

I suppose that another option would be to look for an encoder kit or even a rotary DRO - I could do the cranking by hand, but a stepper would give me enough positional accuracy and allow me to convert to full-blown CNC in the future if I so desire.

Ideally, the budget is only a few hundred bucks.

Looking for suggestions, Thanks
-Dave


----------



## jwmelvin (May 14, 2019)

I don’t quite get it. Why not buy a stepper motor and driver and use a Raspberry Pi with a stepper hat or driver board? I totally understand not wanting to build one if that’s what you mean.


----------



## Boswell (May 14, 2019)

I  think the short answer is there is no reason that you can't do what you propose. adding a stepper to a dividing head will allow you use computer control to rotate the table. Less likely to miss a step etc. I also agree that you can probably use a very small stepper because of the likely low torque requirements. However as jwmelvin suggest, it would also not be difficult to just direct drive a small chuck (i.e. 4th axis). More versatile but possibly a little more work to fabricate. Regardless of if you attach the stepper to an existing platform or fabricate a direct chuck attachment I think, as a software engineer, that you will not have any trouble creating a simple UI to use it for simple positioning like for cutting gears. Looking forward to seeing what you come up with.


----------



## MikeInOr (May 15, 2019)

There are friction brakes that are made to bolt onto a stepper motor.  Energize the brake to disengage the brake.  Cut the power to the brake and the spring in the brake engage the friction brake.

Look on ebay for a Parker Compumotor SX drive.  SX6 is for driving big steppers, SX8 is for driving REALLY big steppers.  The SX drives have the PLU/controller, stepper driver and power supply all built into a single industrial grade box.  An SX8 drive was many thousands of dollars when new... a used one can be found on ebay for $100 or so.  They make a really nice all in one solution and programming should not be a problem for a capable software engineer.  It took me about a day to figure out the ins and outs of the stepper language to get it to do what Iwanted it to do.  You program via an RS-232 serial interface.  Custom software for programming them is available but I just programmed them directly via hyperterminal.  There are plenty of extra IO lines incorporated into the SX box and there are even commands to automatically disengage an electric friction brake before doing any movements.  All the acceleration, deceleration, hold and and configuration for specific stepper motor characteristics are all built into the PLU - stepper language... saving you weeks of time implementing such functionality yourself in a generic PLC or SBC.


----------



## dbb-the-bruce (May 15, 2019)

Thanks for the info -
@jwmelvin - That's pretty much what I'm planing on, minus the pi. I don't know where to source this stuff (I know where to get really expensive stuff precision and demanding applications - avionics etc). I'd really rather not throw a pi at it unless it was out of the box plug and go-ish. For my first pass I'm perfectly happy scripting text commands to a motor controller.

As far as direct driving a chuck for a forth axis, sure that would work but I've already got (almost, just need to put it back together) a functional dividing head that I can mount my chucks and face plates on. I'd have to fabricate (a lot more work) or buy a direct drive setup. It should be a simple matter to make a stepper motor mount that can be bolted on in place of the handle and plates (handle and pin needs work and it only has one plate). The stepper resolution angular positioning will be multiplied by 40, and I can have a computer easily do the counting.

I'll look for the SX drives. Sounds about right. I was hoping that someone hear would say, "check these guys out, they sell inexpensive steppers and drives to hobby CNC folks". In all of my existing experience, someone else puts together the hardware and drive electronics and then hands me a manual for the controller and says "make it work around all these design mistakes we built into it" .

I'm looking for a single axis, wire up a stepper to a controller and talk serial to it that's on the cheap side.

A simple encoder readout could also work, but it would be nice to not have to do the cranking by hand.

-Dave


----------



## Boswell (May 15, 2019)

I know a lot of people find steppers on ebay. You might also check the hobby robotics sites.


----------



## gzoerner (May 15, 2019)

Dave,
Check out stepperonline.com.  They have a great selection and good prices.  I got my NEMA 23 stepper motor, controller and power supply from them.  Super fast shipping.
Glen


----------



## ThinWoodsman (May 15, 2019)

dbb-the-bruce said:


> Thanks for the info -
> @jwmelvin - That's pretty much what I'm planing on, minus the pi. I don't know where to source this stuff (I know where to get really expensive stuff precision and demanding applications - avionics etc). I'd really rather not throw a pi at it unless it was out of the box plug and go-ish. For my first pass I'm perfectly happy scripting text commands to a motor controller.



The thing with using a Pi or Arduino or Beagle or whathaveyou is that it's likely to be far cheaper than a dedicated servo+controller. If you haven't had much exposure to the hobbyist end of this sort of thing, check out SparkFun - for example the Motors and Drivers section, or the Kits (mostly for playing around/learning).

You could probably bang together a servo with a driver board that listens on a serial interface for text commands. Back about ten years ago when I was working with this stuff, it was all C, but that has likely changed by now given the huge community of Python users.


----------



## JimDawson (May 15, 2019)

dbb-the-bruce said:


> I'm looking for a single axis, wire up a stepper to a controller and talk serial to it that's on the cheap side.



While it's not on the cheap side as far as steppers and drives go, it does talk serial and is well documented in English, these are the drives I use for most applications.
https://www.automationdirect.com/ad.../stepper_systems/stepper_drives/stp-drv-80100 

On the cheap side is EBay, hundreds of steppers & drives to choose from.  Also do a search for stepper controller.


----------



## MikeInOr (May 15, 2019)

dbb-the-bruce said:


> I'll look for the SX drives. Sounds about right. I was hoping that someone hear would say, "check these guys out, they sell inexpensive steppers and drives to hobby CNC folks". In all of my existing experience, someone else puts together the hardware and drive electronics and then hands me a manual for the controller and says "make it work around all these design mistakes we built into it" .



Yeah... no, you misunderstood.  Parker Hannifin IS the HEAVY WEIGHT in the industrial controls world.  As in their 20 year old discontinued SX drives are FAR superior to anything you are going to find in the hobby market today!  Want to know if your stepper motor skipped a step... then do something about it... the SX drive has you covered.  Want to detect when the force the stepper is putting out exceeds a threshold... then do something about it... the SX drive has you covered.  Want to vary the wave forms sent to the stepper based on the current speed, acceleration and torque of the stepper... the SX drives not only allows you to do this they will do this automatically by just enabling that functionality.  Pretty much any stepper parameter you can think of is built into the SX drive.

Parker takes everything you could ever want to know about steppers and every thing you would ever want to do in driving a stepper and wraps it up in to a single package with the intelligence built in... then sells it on the INDUSTRIAL market for $10K for a single axis of control.  You pay $10K for a single axis drive because it will do everything you need it to do... everything that you don't know you need it to do... and do it for the next 50 years without maintenance.  My father worked for Stanley tools, he was the head of product engineering.  His team designed plants, production lines, processes, tools and insured the produced product exceeded the standards (Proto and Mac industrial tool level standards... not Stanley home mechanic standards).  They used the SX drives extensively in the machinery they designed for producing quality tools day after day for decades.

So why can you pick up an SX drive on ebay for $100... because the stupid SX drives have outlasted the industrial equipment they have been controlling for the past 20 years.  There are no corners cut on a Parker Hannifin control.  The SX drives have minuscule amounts of flash and RAM compared to Parker Hannifin's modern Zeta drives... but they are a great match to what you described you want to do.

The lift on my fathers router table (woodworking) is probably the strongest, most accurate automated router lift you will ever find.  I helped him build the table and programmed the SX drive for him.  We used a Parker Hannifin Compumotor industrial grade linear actuator that could have lifted my entire shaper (woodworking) to .001" (maybe even more precise) of where I wanted it.  At one time I had a table saw fence in which I could dial in a cutting width I wanted and the fence would move to that width automatically.  When I changed the blade on the saw I would hit a button and the fence would creep over to the blade until the blade just touched a copper plate on the fence then used that for its new zero reference.


----------



## dbb-the-bruce (May 15, 2019)

@MikeInOr - just too many discussions going on! 
I took a good look a the Parker SX6 stuff and, yeah it does look good. Your comment about handling missed steps intrigues me. Can that be done without adding an encoder? In other words, is there some feature in with the SX that will detect it account for it?

Based on my research, It looks like I'd need a single SX6 controller, ~80-100$ on ebay and a stepper with an encoder for another ~100-150$ ish. The SX clearly has a very rich feature set based on my first read of the manual.

I also took a good look at Automation Direct SureStep, and for about the same price I'd get a new integrated motor/controller and a power supply. It would however still require me to use one of my arduino boards to provide step & direction pulses. More work, fewer features. 

Do you think I'll want an encoder on the stepper driving the dividing head?

-Dave


----------



## JimDawson (May 15, 2019)

dbb-the-bruce said:


> I also took a good look at Automation Direct SureStep, and for about the same price I'd get a new integrated motor/controller and a power supply. It would however still require me to use one of my arduino boards to provide step & direction pulses. More work, fewer features.



They are expensive, but no step & direction input needed.  They can be commanded by an extensive command library, I have one I run that way over a RS232 link.  See the SureStep programming manual.  https://cdn.automationdirect.com/static/manuals/surestepmanual/scl_manual.pdf



dbb-the-bruce said:


> Do you think I'll want an encoder on the stepper driving the dividing head?



Probably not needed, but nice to have.  I think standard on the integrated motor/controllers.  This is a new product and I'm not familiar with it yet.


----------



## MikeInOr (May 16, 2019)

dbb-the-bruce said:


> @MikeInOr - just too many discussions going on!
> I took a good look a the Parker SX6 stuff and, yeah it does look good. Your comment about handling missed steps intrigues me. Can that be done without adding an encoder? In other words, is there some feature in with the SX that will detect it account for it?
> 
> Based on my research, It looks like I'd need a single SX6 controller, ~80-100$ on ebay and a stepper with an encoder for another ~100-150$ ish. The SX clearly has a very rich feature set based on my first read of the manual.
> ...




Because the stepper controller and stepper driver are integrated into a single package the controller is able to monitor the current going into each step of the stepper motor.  By monitoring the current the controller is able to detect events way beyond the ability of seperate controller / driver solutions.   ...it has been many years but MY recollection is that the controller can detect some missed step events WITHOUT the need for a seperate encoder... but my recollection could be wrong.  I specifically remember the ability of the SX to detect stall conditions without an encoder. I know the SX controllers have encoder inputs and can definitely track missed steps with the use of an encoder.

If it were me I would implement without the encoder... then add one if needed... which I doubt it will.  I don't think you will have to worry about missed steps unless you are driving your stepper motors REALLY hard... which I do not think you will be.

My understanding is missed steps generally occur when operating a stepper motor at the upper end of its torque range.   There are several parameters that you enter for the specific stepper motor you are using that the SX uses to gauge where in its envelope a stepper motor is operating.  Of course there are built in parameter sets for Parker brand (CompuMotor) stepper motors so you don't have to configure each parameter.    These parameters are used to detect missed steps (I recall) but also vary the wave form put out for the particular operating condition of the stepper.

My applications were not so accuracy critical that I worried about missed steps... so my understanding is from what I remember reading quite a while ago... not any direct experience.

I have a couple SX6's and an SX8.  The SX6 is a nice some what compact size, the SX8 is about double the width of the SX6 and quite a bit heavier.  From my completly novice familuarity with the SX drives I think the SX6 drive is a great match for your application... I think an SX8 would be unnessisarily big and bulky.

I also recall the ability of the SX drives to operate in different modes.  There was a follow mode where the SX would drive its stepper motor to follow another input.  When steppers are driven at a slow speed they no longer freely spin instead the rotation is a series of many rapis starts and stops which induce vibrations into the movement.  At slow speeds the SX drives change the wave forms sent to the stepper motor to make the rapid starts and stops into a smooth motion.

There are also provisions to chain together multiple SX drives to operate together... I think this would be along the lines of... drive one stepper to go from one limit to the other limit and quick return to the first limit then tell a second SX controller to index its stepper a set amount before the first SX goes through its cycle again.  There is another thread on here where someone wants to automate his surface grinder so he doesn't have to spend hours behind the wheels.  I think a pair of SX drives would be a good solution for this... but the poster found an application specific surface grinder stepper controll to do exactly what he wants without any additional programming.


----------



## MikeInOr (May 16, 2019)

How do you imagine your automated rotary table working?  Dial in x number of steps, press a button and have the stepper motor move that number of steps?  Inputting X was a bigger project than I expected with the SX controlling my table saw fence... I ended up using a bcd encoded 4 digit thumb dial where the first 2 digits were inches and the second 2 digits were 64ths of an inch.  It worked well but was a VERY basic human interface and took a bit of doing to make it work... something you might want to consider when selecting your solution.

Wow... that automation direct stepper controller manual looks a LOT like the Parker SXdrive manual.  

Like the Automation Direct controller the SX controller can be run via serial interface from a PLC or PC.  It definitely gives you the ability to implement a much nicer interface... but also takes away from the simplicity of a single box solution.


----------



## JimDawson (May 16, 2019)

Another option might be the ClearPath line of motors. https://www.teknic.com/products/clearpath-brushless-dc-servo-motors/  They have one option that allows operation by a serial link.  I have only used them in step & direction mode, so not familiar with the programmable method.


----------



## whitmore (May 16, 2019)

dbb-the-bruce said:


> As far as direct driving a chuck for a forth axis, sure that would work but I've already got (almost, just need to put it back together) a functional dividing head that I can mount my chucks and face plates on.
> 
> I'm looking for a single axis, wire up a stepper to a controller and talk serial to it that's on the cheap side.
> 
> A simple encoder readout could also work, but it would be nice to not have to do the cranking by hand.


It's likely that the divider head will have some ratio (40:1 is typical) from its worm drive, and to really do it right,
you'd want the encoder on its worm gear, not on the motor that drives it (because the motor shaft coupling
isn't perfectly free of backlash), and have a motor with position precision on the order of 1:1000 or better
on its output shaft.    Even a fine stepper goes 1.8 degrees per step (so, 1:200 granularity:==step size).
That will let you do as good a job with the readout/motor as a pins/plates setup, and ought to be
achievable.   It's likely that you'll want to apply some retarding torque on the divider during motion
(to prevent backlash at the worm), and it would be convenient to activate the brake
or clamp that holds the position (so you could power-down the stepper during a cut).   The
usual 'positive locking mechanism' will take a separate actuator, not dependent on the motor shaft.

Stepper acceleration/deceleration control is relatively easy with digital control, I've done it with analog
as well.   But, a good readout/encoder on the worm shaft is relatively difficult, if you want to match
the precision of plates/holes indexing.


----------



## dbb-the-bruce (May 26, 2019)

It's ALIVE!!





I ended up going with the smallest Automation Direct integrated driver/motor/encoder I could get. Works great! the 40:1 ratio of the worm means that there is very little torque needed for the motor. I've currently got the acceleration set low with a reasonably fast max V - that's why it takes so long to wind up and down. Most of the time you are making short steps and hitting it accurately is the most important part - however, if you do make long steps you don't want to wait forever to get there - doesn't really matter as it all very easy to change and I haven't scripted the user interface code yet.

The fact that drive, motor, and encoder are all one unit makes getting this hooked up and working EXTREMELY easy - hook up a power supply and serial cable and you are done. This is exactly what I was looking for.

The hardest part was figuring out the RS485 and getting the manufacturer's software working correctly - this was complicated by the fact that I had to download/install/setup a Windows Virtualbox and was using a new unproven RS485 USB dongle etc, etc. Still, all in all, it was only a couple of hours before I had the motor spinning.

Regarding resolution/accuracy - As expected, this is currently limited by mechanics of the dividing head. The worm shaft has about .0005 end-to-end (axial?) play in it. This can be adjusted tighter, and I'm going to give it another shot to see if I can reduce it more. The other adjustment is the worm engagement which seems to be just about perfect right now. The tricky part is it's difficult to change one without changing the other. Pretty sure I'll be able to improve it. Right now there is about .0015 backlash/slop measured tangentially at the rim of the headwheel/plate (about a 2" lever - small diameter parts will have proportionally less error).

With the motor micro-stepping and encoder feedback, I've got way more resolution than I need. The controller has an EG - electronic gearing parameter that can be set to determine any number of counts/rev up to some huge number. I've set it up (for now) so that 1 count == .001 deg at the dividing head. With mechanical backlash at about .02 deg (for now), I'm good.

Cost - As I said earlier in this thread, while not wanting to burn money, the cost was less important than time to get it running.

$296 for integrated driver/motor/encoder
$127 for power supply
$35   for flex coupling (motor to dividing head shaft)
$20   for USB RS485 dongle

I hemmed and hawed about getting the motor with the encoder, which added an additional $50 - I knew that I didn't need it. If the drive and micro-stepping worked as advertised, however, it would really suck to get to the 101st tooth on a 127 tooth gear and lose your place! I also justified it knowing that going forward I could move this motor/encoder around to other projects that come up.

So I could have saved ~$50 on the motor, I'm sure I could have gotten a cheaper linear power supply somewhere else but it would have been more of an unknown. I also could have shopped for used parts - the SX6 stuff that Mike recommended came to around the same ~$300 - $400 but being used would have had a lot more unknowns.

Here is the video I did of the tear down / clean up of the dividing head (it's kind of boreing and 24 min long but there is some interesting stuff in it).





I'm working on another that details all of the improvements I made to it other than adding the stepper motor, I'll post it when it's done.

-Dave


----------

