Electronic Dividing Head using the Arduino

Home Model Engine Machinist Forum

Help Support Home Model Engine Machinist Forum:

markba633csi

New Member
Joined
Jul 17, 2017
Messages
4
Reaction score
0
Chuck Fellows for president! Great work Chuck, I'm sure you have inspired hundreds of code newbies, me included.
I purchased a SainSmart clone on Aliexpress, I found it was giving pushbutton errors quite often and I checked the voltage divider resistor values and 3 of them were wrong. The biggest error was that the top-most resistor was 3k instead of 2k. Big improvement in stability now. I'm thinking there might should be some decoupling caps on the shield Vcc? The stock board apparently has none.
Mark S.
 

Foozer

Well-Known Member
HMEM Supporting Member
Joined
Nov 26, 2008
Messages
1,181
Reaction score
83
Location
Camano Island, WA
Chuck posted into this thread a steppermath.xls that shows the error rate for a 127 tooth gear cut. Easy enough to alter the values to check ones own mileage . . .

For myself am adding a 10th degree option somewhere in the script - i.e. for 7.2 degree, - [stepsBy10thDegree = (Degrees * multiplier) / 10;]
At 400 steps & 36:1, can get away with a reasonable error rate . .
 

rodw

Well-Known Member
Joined
Dec 2, 2012
Messages
1,146
Reaction score
340
I don't think there is any need to use hardware to debounce buttons when you've got the power of a microprocessor to do it in software. There are plenty of methods but here is one. https://www.arduino.cc/en/Tutorial/Debounce

Foozer, Chucks spreadsheet on page 19 of this thread is specific to his algorithm so it can't be universally applied. Having said that, Chuck's algorithm accumulates steps, my (revised) algorithm accumulates errors. The end result is identical. The missed steps from rounding are spread around the full 360 degree circle.
 

markba633csi

New Member
Joined
Jul 17, 2017
Messages
4
Reaction score
0
My replica of Chuck's original design still glitches now and then, I thought it might be switch bounce but now I'm not so sure. I set up a 555 timer pulsing a transistor to simulate the "right" button closure and I still get occasional opposite rotations and sometimes the number of divisions will suddenly increment up or down by one count. It could be emi noise from my 8825 driver getting into the arduino a/d or possibly a hiccup in the code itself- I need to get out the scope and do some more checking. I can't trust it yet for actual gear cutting till I get more consistent results. Also I need to understand the code in more depth, especially the "move the stepper" section.
Mark S.
Mt. View, Ca
 

cfellows

Well-Known Member
Project of the Month Winner
Joined
Aug 25, 2007
Messages
3,890
Reaction score
715
Thanks for all the comments, folks. Very rewarding to see people are able to use the results of some of my work. It would be interesting to know just how many people have built a dividing head based on my software.

For me, it was all in fun in developing a real world application for the Arduino. Love that little computer! My career started with programming in the Air Force back in 1962. Of course, that was a long before the advent of the C language, but the Arduino took me back to some of those earlier year experiences when computers didn't have much, if any, of an operating system.

The most important test for me was to be sure that all my program values reset to their starting points after a full revolution in either direction. If one could accomplish that with a wide variety of different circle division numbers, then the algorithm was most likely working properly.

Chuck
 

Foozer

Well-Known Member
HMEM Supporting Member
Joined
Nov 26, 2008
Messages
1,181
Reaction score
83
Location
Camano Island, WA
I Made One . . .
Little 3" rotary table with stepper mount similar to BMac's design.
Trimming some trees, had a hunk of wood - First attempt at actually using it.
One hole, wrong spot . . .

fly1.jpg
 

almarghi

Member
Joined
Aug 14, 2011
Messages
12
Reaction score
2
I have build two of them, using arduino nano with some small changes (regarding the outputs) and I didn't have any problems with the algorithm, but with the key voltage levels on the analog input. Both worked perfectly from the first time, without any issues.
Since I don't trust any contraption without feedback, I oversized all power components - motors and power supplies - and it worked. For supplying the arduino board, I have build a swithing 9V dc-dc converter and I have used its onboard 5V linear supply.
in the attached picture you can see a bearing cage with 64 holes. No position error detected.
Please excuse my bad english,
Alex

P0002_072416.jpg


IMG_20170617_113513.jpg
 

ShopShoe

Senior Member
Joined
Oct 1, 2010
Messages
1,219
Reaction score
311
Ever since Chuck Fellows posted the original article, I have been working on this. My inability to get much shop time in has made it take so long, but now it is to a point where I can post my progress.

Originally, I started to make both the rotary table and this version, and I ordered a 4-inch rotary table from Grizzly which turned out to be so non-ridgid as to make the rotary table version a dead end for now, although I might revisit it at some point.

I chose a spindexer as the basis for the unit as I have a selection of 5C collets and one thing I often do is use them with collet blocks to make 4-sided and hex ends on rods and get tired of indexing with the blocks, especially if my setup is somewhat tricky.

ShopShoe_Indexer_M_1055.jpg

Before doing much else, I machined a key slot in the base parallel to the shaft and then carefully machined off the base casting to provide a way to also mount the entire assembly in my mill vise. I may never use the key slot, but at least it is there if I want to.

ShopShoe_Indexer_M_1056.jpg

The next step was a piece of 0.25 aluminum, which was repeatedly modified as the project proceeded. It is a little rough, but I see this as a usable experiment rather than a bling contender.

I made things easier on myself by using Chuck's original drive ratio, choosing a timing belt and pulleys from McMaster-Carr (Usual disclaimer: No ties to them).
To avoid milling or drilling the spindexer shaft, a taper lock was made for the shaft drive pulley, although I later found out that the motor had enough torque make things slip and I decided to add a 0.125 key to keep things locked up.

ShopShoe_Indexer_M_1057.jpg


I also used Chuck's version of the Arduino, Chuck's driver board, and Chuck's keyboard shield. I added sealed momentary switches and connected them in parallel to the switches on the keyboard shield, and just drilled a hole to allow using the reset switch with a paper clip or somesuch. I found few reasons to need reset, and fewer buttons simplifies the panel. The circuitry is mounted in a diecast aluminum box, and a piece of 0.25 plexiglass is milled to fit into a milled-out window in the box to see the display.

ShopShoe_Indexer_M_1062.jpg

A separate power supply can be placed somewhere away from chips and coolant and saves having to cook up an elaborate enclosure. A modified square electrical box provides for enclosing the AC connections and also holds a separate 9-volt supply for the Arduino and other circuit boards. The motor power supply is 12-volts, which is adequate for this use. The red neon indicator signifies AC input to the box. The green indicator signifies the 12-volt supply is on. Connection to the control box is with 4-conductor cable, 2 conductors for each power supply. I used the square 4-conductor connectors to make sure that connections are never confused.

ShopShoe_Indexer_M_1064.jpg

I find the indexing works well enough for my use. I did need to experiment with the numbers of steps just a little, but most problems were due to mechanical slippage or to electrical crosstalk during the breadboard stage. Once everything was buttoned up and enclosed it settled down.

https://youtu.be/B60SzUv1BEw

I still have a little bit of fiddling to do, cleaning up dykem and etc. I bought the Arduino experimenter kit and have another Arduino now and another driver board, so I may do some more experimenting.
 

jeep534

Member
Joined
Jan 23, 2013
Messages
14
Reaction score
4
Your english looks fine from here :thumbup: I would like to know more about your indexers with more (bad english) and pictures...
Thank You
archie
I have build two of them, using arduino nano with some small changes (regarding the outputs) and I didn't have any problems with the algorithm, but with the key voltage levels on the analog input. Both worked perfectly from the first time, without any issues.
Since I don't trust any contraption without feedback, I oversized all power components - motors and power supplies - and it worked. For supplying the arduino board, I have build a swithing 9V dc-dc converter and I have used its onboard 5V linear supply.
in the attached picture you can see a bearing cage with 64 holes. No position error detected.
Please excuse my bad english,
Alex
 

cfellows

Well-Known Member
Project of the Month Winner
Joined
Aug 25, 2007
Messages
3,890
Reaction score
715
Thanks for posting, Shopshoe. It's great to see folks getting some good out of this thread.

Chuck
 

almarghi

Member
Joined
Aug 14, 2011
Messages
12
Reaction score
2
Hi jeep534,
there is not much to tell. You can see both of them in the photos. One of them is vertical, the other horizontal.
The vertical one is a gear belt type, 1:5, with an normal XL037 belt. There is only one bearing inside, double row angular contact, SKF3306 ATN9, to be as flat as possible. My milling machine is an Optimum BF20L, small but not very rigid :(, so I have to be as low as possible with the spindle.
The second dividing head, is a 1:80 HarmonicDrive personal construction. Unfortunatelly I lost all photos I made during construction. I have only the project drawings left and I can take some pictures of the completed head.
Since I work mostly with aluminium, large diameters with thin walls, the Harmonic Drive head has now a 6jaw , 100mm chuck to prevent deformation.
 

Captain_Obvious

Active Member
Joined
Jun 3, 2017
Messages
43
Reaction score
17
Hi all,

Sorry for the delay, but I've been a bit busy lately. I finally got the dividing head somewhat finished. I still need to make a box for the PSU and the stepper driver, but the actual dividing unit is now complete. I haven't tried it out yet, but I don't see why it wouldn't work just fine.

As I mentioned before, I did contemplate making some sort of a spindle brake, but it seems pretty pointless, as the steel reinforced polyurethane belt is much more rigid than the original rubber belt I was planning to use. I'll have to take some test cuts and see how rigid this thing actually is.

The spindle housing is a solid chunk of steel with a hole bored through and a recess milled at both ends for the 6007 ball bearings. Not ideal bearings for this purpose, but they do seem good enough. If I choose to use angular contact bearings, I still have plenty of material so I can bore the bearing seats a bit larger. The motor bracket is aluminium.

The spindle is an ordinary straight shank ER32 collet holder and the stepper motor is a 3Nm Nema 23 unit running at 48V.

div1.jpg


div2.jpg
 

Captain_Obvious

Active Member
Joined
Jun 3, 2017
Messages
43
Reaction score
17
No lost bets here. I firmly believe it should be mandatory to paint all metalworking machinery pink. Polka dots are optional due to their mildly psychedelic effects which may result in either futuristic machine designs or severed limbs.

Besides my shop is already full of boring green and grey and black machines.
 

tjwal

Well-Known Member
Joined
Sep 22, 2013
Messages
96
Reaction score
16
Nice. Is that a focusing ring? I 3d printed some for my son. I've since acquired a cutter but haven't tried it yet.
 
Top