Electronic Dividing Head using the Arduino

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.
Greetings! I'd be curious to know how you handle odd-numbers of divisions.

Here is a link to my attempt 4 years ago:

I'm afraid that when you work directly from the stepper, the odd number steps won't come out quite right ( like the problem dividing plates solve for a traditional dividing head.

My latest idea (yet to be tried) is to drive a rotary table with it's big-reduction worm gear, and create a very fine number of steps-per-degree that would render the error inherent in the odd counts to an insignificant level. So I'm curious as to how you've addressed this issue.

Love your mounting block/vise setup - a technique I will use when I resume the project.

=Alan R.
 

love the polka dots! But white is a bit ordinary, I'd have going with turquoise or lime green, - for full psychaledic effect. Mind you, having afterimage spots dancing before your eyes while machining *might* not be advisable
 
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

Yes Chuck,
I also love the bare bones, close to the machine quality of the small microprocessors. Newbies to microprocessors think these are "computers" in the modern sense, with (quasi)infinite memory and processing power. As someone trained on machines with limited resources, you understand the need for (and value of) 'elegant' code. Quasi-infinite resources induces laziness and code bloat. Another thing that is lost on many is the necessity for closed loop thinking - the code has to be in touch with the 'real world' ! Mechanics, power supplies, electronics, code - you have to think it all as one system.
 
love the polka dots! But white is a bit ordinary, I'd have going with turquoise or lime green, - for full psychaledic effect. Mind you, having afterimage spots dancing before your eyes while machining *might* not be advisable

Lime green sounds tempting...

Anyway, I haven't used the polka dot dividing head almost at all so far, but I've been using my lathe dividing head for a year now without any issues whatsoever. I make tiny stuff and I haven't been able to detect any division errors. In the type of stuff I do, division errors will be shown without mercy in the final product and I'm seeing absolutely none.

Here's an example of the things I've made using the lathe dividing unit:
centerwheel.jpg

The diameter of the larger gear is about 12mm and the smaller one is about 2.5mm.
 
Here in Seattle, WA, I am in the process of completing the Arduino spin indexer project. Being my first Arduino project, if if were not for contributors like you Chuck as well as Gary Liming and many others, I would not have been able to nor would I have tackled this great project which will be a addition to my shop. Thank you so much for your input.
 

Attachments

  • 20181028_112352.jpg
    20181028_112352.jpg
    91.2 KB
I really must thank Chuck and others for their valuable information. Having no experience of coding the info here has been most useful.
My only problem with Chucks code (from post #50) or my setup is the lack of reverse direction. Can anyone tell me where I may be going wrong?
 
so ive tried reading thru this , the table for dummies and the other one i could find, and im more lost and confused than when i started.
im pretty sure im having the end problem of 1200 steps per rotation.
i changed the line, change line 'for(int i = 0; i < tm; i++)' to 'for(int i = 0; i < 1200; i++)' but... i sstill get 1080 steps per 360 not 1200
my problems are compounded by the driver im using requiring an extra wire for enable.
i had it all figured out and moving, but in the process of trying to fix the numbers i have lost the working sketch for movement.
the scrolling is killing my wrist and the constant walking in and out from pc to shop is pissing my wife off, frustrated to the point im about to cry :p

china 4th axis from ebay, all the info i can get is....
Angle: 0.3 degrees / step
Reduction ratio: 6:1 (Synchronous belt deceleration mode)
Stepper motor: 2 phase nema23 stepper motor

tb6600 driver, uses enable, pulse and direction signals.
i have enable set to pin 12. enable low or high seems to do something but im not exactly sure how to use it.
if someone who actually understands this code could look at it and tell me what i did wrong i would be so happy.
i currently have it to where it hums when i try to move it, when i put in 360 degrees it says steps 1080
 
if i could just enter the # of steps i want into the jog prompt i would be sooooo happy. all i need is simple divisions of 2 3 4 5 6 and 8.
i can do that math real easy on my own, 240 steps = 5 divisions, a to jog..... im just not getting the code.
 

Attachments

  • Arduino_Rotary_Table_Control_2018.zip
    2.2 KB
lol, i got it, in //setup vars i changed it to 1200 steps 1 raito, and made the multiplayer 1
also in , float getdivisions, at the botom of that snippet, i changed degrees to = 1200/num
this gives me 1200 steps labeled as degrees. im sure i can change that text too, but you know, gota find it.
and if i enter 240 steps, and hit A 5 times i get 5 divisions with my 0 back at 0.
hope this helps anyone else with the 1/3 problem.
and still, if anyone has a working program for 1/3 raitos with degrees and divisions, i would not mind it at all.
 
I've made some strides on my Arduino powered dividing head the past few days. Here's a little background for what I am doing. First, the Arduino micro controller.

db5e6546.jpg


Available online for under $30, has 32K memory, numerous analog and digital inputs and outputs, including serial and PWM.

Next, the Sainsmart LCD display and keyboard shield

b829d9dc.jpg


This board is called a shield because it is pin compatible with and piggybacks right on top of the Arduino board. It has a 2 line x 16 character display and 5 input keys plus a reset. The keys are configured like the cursor keys on a PC having a left, right, up, and down as well as a select. So, with this shield in place, the microcontroller can be used with only a power supply and doesn't have to be tethered to a computer. The keys provide input and the LCD provides the display.

Here is the Sainsmart shield mounted on the Arduino...

f89430c6.jpg


The Sainsmart gets its power from the Arduino.

Another picture

93e96bf4.jpg


The Arduino is programmed by hooking it up to your PC through a USB cable. This also provides power to the Arduino board. A free programming environment is available for the PC and allows you to develop programs in a language that looks almost exactly like C. There are a host of standard libraries for interfacing to LCD's, keyboards, wireless, serial devices, and others. You write the programs and compile them on the PC. The compiler then automatically downloads the program to your Arduino. Once the program is loaded on the Arduino, you can decouple it from the computer and run it off a separate power supply from 9 - 12 volts. The program will stay in the Arduino memory even when the power is switched off.

423c8d56.jpg


So this is the basis for controlling my electronic dividing head. The up and down arrow keys will be used to set the number of divisions I want, then the left and right arrow keys will be used to step forward or backward one division at a time. The program I have written will calculate the number of stepper steps need for each division and keep track of the position I'm on. The display shows the number of divisions and the current dividing head position.

I have purchased a stepper driver board that is about the size of a postage stamp and will power a stepper of up to 2 amps, 35 volts. I still have to select the stepper motor I want to use and build the mechanical part of the dividing head. Still have a few challenges ahead of me.

Chuck
 
I've made some strides on my Arduino powered dividing head the past few days. Here's a little background for what I am doing. First, the Arduino micro controller.

db5e6546.jpg


Available online for under $30, has 32K memory, numerous analog and digital inputs and outputs, including serial and PWM.

Next, the Sainsmart LCD display and keyboard shield

b829d9dc.jpg


This board is called a shield because it is pin compatible with and piggybacks right on top of the Arduino board. It has a 2 line x 16 character display and 5 input keys plus a reset. The keys are configured like the cursor keys on a PC having a left, right, up, and down as well as a select. So, with this shield in place, the microcontroller can be used with only a power supply and doesn't have to be tethered to a computer. The keys provide input and the LCD provides the display.

Here is the Sainsmart shield mounted on the Arduino...

f89430c6.jpg


The Sainsmart gets its power from the Arduino.

Another picture

93e96bf4.jpg


The Arduino is programmed by hooking it up to your PC through a USB cable. This also provides power to the Arduino board. A free programming environment is available for the PC and allows you to develop programs in a language that looks almost exactly like C. There are a host of standard libraries for interfacing to LCD's, keyboards, wireless, serial devices, and others. You write the programs and compile them on the PC. The compiler then automatically downloads the program to your Arduino. Once the program is loaded on the Arduino, you can decouple it from the computer and run it off a separate power supply from 9 - 12 volts. The program will stay in the Arduino memory even when the power is switched off.

423c8d56.jpg


So this is the basis for controlling my electronic dividing head. The up and down arrow keys will be used to set the number of divisions I want, then the left and right arrow keys will be used to step forward or backward one division at a time. The program I have written will calculate the number of stepper steps need for each division and keep track of the position I'm on. The display shows the number of divisions and the current dividing head position.

I have purchased a stepper driver board that is about the size of a postage stamp and will power a stepper of up to 2 amps, 35 volts. I still have to select the stepper motor I want to use and build the mechanical part of the dividing head. Still have a few challenges ahead of me.

Chuck
 
i also cant get reverse to work using a tb6600,
im using the code from the dummies thread.
i cannot find this or anything like it in the script
#define stepDir 2 //Digital Pin 2 outputs Step Direction
 

Attachments

  • Arduino_Rotary_Table_Control_2016.zip
    2.2 KB
i also cant get reverse to work using a tb6600,
im using the code from the dummies thread.
i cannot find this or anything like it in the script
#define stepDir 2 //Digital Pin 2 outputs Step Direction

My Bad - looked at script post #50
The one you have in 276 shows dir as pin # 3 so pin 3 to dir+ on the 6600 with dir- of the 6600 connected to gnd.

const int dir = 3; // connect pin 3 to dir
 
yes, thats how i have it and what it says, line 276, im assuming you meant 27.... my editor does not have lines labeled... is there a better arduino code program ? im used to using context, where i can search words, and scroll straight to numbered lines, and this has none of the good stuff.

what currently happens, is when i hit A it moves forward, when i hit B it makes a clicking sound, when i hit A again it sometimes advances, and sometimes makes the clicking sound, if i hit A again after the clicking sound it advances forward again.
yellow is on pin 3 and goes to Dir + , green is on pin 2 and goes to Pulse + , orange is connects to a ground, and goes to all 3 negatives.
enable is wired but not used in the code.

20181101_144358.jpg
 
o i have not checked the polarity of the wires on the motor, i may have one set wrong. but im pretty sure its wired the same as all my other working motors.
 

Latest posts

Back
Top