Electronic Dividing Head using the Arduino

Discussion in 'Software and Programming' started by cfellows, May 21, 2012.

Help Support HMEM by donating:

  1. Aug 4, 2018 #261

    mwmkravchenko

    mwmkravchenko

    mwmkravchenko

    New Member

    Joined:
    Nov 23, 2017
    Messages:
    1
    Likes Received:
    0
    Beautiful work on a difficult piece to make.
     
  2. Aug 4, 2018 #262

    almarghi

    almarghi

    almarghi

    Member

    Joined:
    Aug 14, 2011
    Messages:
    11
    Likes Received:
    2
    Thank you. In the meantime that mill got cnc-ed :)
     
  3. Aug 5, 2018 #263

    harrzack

    harrzack

    harrzack

    Member

    Joined:
    May 14, 2013
    Messages:
    10
    Likes Received:
    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.
     
  4. Aug 6, 2018 #264

    Anatol

    Anatol

    Anatol

    Well-Known Member

    Joined:
    Jan 22, 2018
    Messages:
    265
    Likes Received:
    39
    Gender:
    Male
    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
     
  5. Aug 6, 2018 #265

    Anatol

    Anatol

    Anatol

    Well-Known Member

    Joined:
    Jan 22, 2018
    Messages:
    265
    Likes Received:
    39
    Gender:
    Male
    Location:
    Los Angeles
    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.
     
  6. Aug 7, 2018 #266

    Captain_Obvious

    Captain_Obvious

    Captain_Obvious

    Active Member

    Joined:
    Jun 3, 2017
    Messages:
    43
    Likes Received:
    17
    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.
     
    blighty likes this.
  7. Oct 28, 2018 #267

    liqwrench

    liqwrench

    liqwrench

    New Member

    Joined:
    Oct 28, 2018
    Messages:
    1
    Likes Received:
    0
    Gender:
    Male
    Location:
    Puyallup,Washington
    Hi Chuck, did you happen to finish the larger Nema 34 project? liqwrench
     
  8. Oct 28, 2018 #268

    kaolsen1728

    kaolsen1728

    kaolsen1728

    New Member

    Joined:
    Sep 25, 2017
    Messages:
    3
    Likes Received:
    1
    Gender:
    Male
    Occupation:
    Retired Pharmacist
    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.
     

    Attached Files:

  9. Nov 1, 2018 #269

    dwk

    dwk

    dwk

    Member

    Joined:
    Oct 20, 2018
    Messages:
    13
    Likes Received:
    2
    Gender:
    Male
    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?
     
  10. Nov 1, 2018 #270

    fubuddy

    fubuddy

    fubuddy

    Active Member

    Joined:
    Oct 18, 2018
    Messages:
    25
    Likes Received:
    2
    Gender:
    Male
    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
     
  11. Nov 1, 2018 #271

    fubuddy

    fubuddy

    fubuddy

    Active Member

    Joined:
    Oct 18, 2018
    Messages:
    25
    Likes Received:
    2
    Gender:
    Male
    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.
     

    Attached Files:

  12. Nov 1, 2018 #272

    fubuddy

    fubuddy

    fubuddy

    Active Member

    Joined:
    Oct 18, 2018
    Messages:
    25
    Likes Received:
    2
    Gender:
    Male
    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.
     
  13. Nov 2, 2018 #273

    ray28450

    ray28450

    ray28450

    New Member

    Joined:
    Mar 25, 2013
    Messages:
    3
    Likes Received:
    0
     
  14. Nov 2, 2018 #274

    ray28450

    ray28450

    ray28450

    New Member

    Joined:
    Mar 25, 2013
    Messages:
    3
    Likes Received:
    0
     
  15. Nov 2, 2018 #275

    Foozer

    Foozer

    Foozer

    Well-Known Member HMEM Lifetime Supporter

    Joined:
    Nov 26, 2008
    Messages:
    1,164
    Likes Received:
    69
    Gender:
    Male
    Occupation:
    Retired
    Location:
    Camano Island, WA
    #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]
     
  16. Nov 3, 2018 #276

    fubuddy

    fubuddy

    fubuddy

    Active Member

    Joined:
    Oct 18, 2018
    Messages:
    25
    Likes Received:
    2
    Gender:
    Male
    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
     

    Attached Files:

  17. Nov 3, 2018 #277

    Foozer

    Foozer

    Foozer

    Well-Known Member HMEM Lifetime Supporter

    Joined:
    Nov 26, 2008
    Messages:
    1,164
    Likes Received:
    69
    Gender:
    Male
    Occupation:
    Retired
    Location:
    Camano Island, WA
    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
     
  18. Nov 3, 2018 #278

    fubuddy

    fubuddy

    fubuddy

    Active Member

    Joined:
    Oct 18, 2018
    Messages:
    25
    Likes Received:
    2
    Gender:
    Male
    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
     
  19. Nov 3, 2018 #279

    fubuddy

    fubuddy

    fubuddy

    Active Member

    Joined:
    Oct 18, 2018
    Messages:
    25
    Likes Received:
    2
    Gender:
    Male
    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.
     
  20. Nov 3, 2018 #280

    Foozer

    Foozer

    Foozer

    Well-Known Member HMEM Lifetime Supporter

    Joined:
    Nov 26, 2008
    Messages:
    1,164
    Likes Received:
    69
    Gender:
    Male
    Occupation:
    Retired
    Location:
    Camano Island, WA
    Dug up my test platform. ill load up the code and see what happens. Hiding from the Honey Do List - Back later . .
     

Share This Page