Electronic Dividing Head using the Arduino

Help Support HMEM:

harrzack

Member
Joined
May 14, 2013
Messages
10
Reaction score
2
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.
 

Anatol

Well-Known Member
Joined
Jan 21, 2018
Messages
265
Reaction score
40
Location
Los Angeles
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
 

Anatol

Well-Known Member
Joined
Jan 21, 2018
Messages
265
Reaction score
40
Location
Los Angeles
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.
 

Captain_Obvious

Active Member
Joined
Jun 3, 2017
Messages
43
Reaction score
17
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.
 

kaolsen1728

Member
Joined
Sep 25, 2017
Messages
8
Reaction score
2
Location
Seattle, WA
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

dwk

Member
Joined
Oct 20, 2018
Messages
13
Reaction score
2
Location
united kingdom
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?
 

fubuddy

Active Member
Joined
Oct 17, 2018
Messages
25
Reaction score
3
Location
orange
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
 

fubuddy

Active Member
Joined
Oct 17, 2018
Messages
25
Reaction score
3
Location
orange
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

fubuddy

Active Member
Joined
Oct 17, 2018
Messages
25
Reaction score
3
Location
orange
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.
 

ray28450

New Member
Joined
Mar 25, 2013
Messages
3
Reaction score
0
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.



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



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...



The Sainsmart gets its power from the Arduino.

Another picture



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.



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
 

ray28450

New Member
Joined
Mar 25, 2013
Messages
3
Reaction score
0
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.



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



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...



The Sainsmart gets its power from the Arduino.

Another picture



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.



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
 

Foozer

Well-Known Member
HMEM Lifetime Supporter
Joined
Nov 26, 2008
Messages
1,168
Reaction score
76
Location
Camano Island, WA
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?
#define stepDir 2 //Digital Pin 2 outputs Step Direction
Pin 2 of the Arduino to the dir pin of the driver [TB6600 pin is balled DIR]
 

fubuddy

Active Member
Joined
Oct 17, 2018
Messages
25
Reaction score
3
Location
orange
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

Foozer

Well-Known Member
HMEM Lifetime Supporter
Joined
Nov 26, 2008
Messages
1,168
Reaction score
76
Location
Camano Island, WA
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
 

fubuddy

Active Member
Joined
Oct 17, 2018
Messages
25
Reaction score
3
Location
orange
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
 

fubuddy

Active Member
Joined
Oct 17, 2018
Messages
25
Reaction score
3
Location
orange
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.
 

Foozer

Well-Known Member
HMEM Lifetime Supporter
Joined
Nov 26, 2008
Messages
1,168
Reaction score
76
Location
Camano Island, WA
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.
Dug up my test platform. ill load up the code and see what happens. Hiding from the Honey Do List - Back later . .
 
2

Latest posts

Top