Project of the Month built by mirek111

Help Support Home Model Engine Machinist by donating using the link above or becoming a Supporting Member.
Home Model Engine Machinist > The Tools and Tips > Machine Modifications > Arduino Rotary Table for Dummies

Reply
 
Thread Tools
Old 01-11-2018, 02:16 AM   #131
tjwal
 
Join Date: Sep 2013
Posts: 39
Liked 5 Times on 3 Posts

Default

Quote:
Originally Posted by jkcab View Post
John,

I,m sorry I was referring to Bob's sketch in this tutorial!

I also made the changes you listed and I got this error for line 164 change "Long was not declared in this scope"?

Thanks for your patience,

Jeff
is "long" all lower case?

I didn't make many changes to the keypad input part of Bob's code, but I do recall having a bit of difficulty getting my keypad to work. As I recall Bob's original keypad was 3x4 and the column-row pinout seemed to be reverse of what mine is. I wrote the keypad_test sketch so I could figure out what was going on. When I pressed the 1 key the sketch was detecting the keypress but reporting a different result to the serial monitor. Then it was just a matter of adjusting the pin assignments to get it to work.


tjwal is offline  
 
Reply With Quote
Old 01-11-2018, 03:21 AM   #132
Foozer
HMEM_LIFETIMESUPPORTER.png
 
Foozer's Avatar
 
Join Date: Nov 2008
Location: Camano Island, WA
Posts: 1,124
Liked 82 Times on 70 Posts
Likes Given: 2

Default

Code from post 17 Arduino_Rotary_Table Rows 11,10,9,8 Col 7,6,5,4
... from post 80 Dummies_Rotary_Table Rows 9,10,11,12 Col 5,6,7,8

Tested 4x4 keypad
byte rowPins[ROWS] = {9,10,11,12};
byte colPins[COLS] = {5,6,7,8};

Reports correct button pushes . .


Attached Thumbnails
DSCF0251.JPG  
__________________
"Nothing is more irritating than that which exposes the pedigree of ideas"----Lord Acton----

Last edited by Foozer; 01-11-2018 at 03:55 AM.
Foozer is offline  
 
Reply With Quote
Old 01-12-2018, 01:58 PM   #133
jkcab
 
Join Date: Jan 2011
Posts: 16
Default

John,

I typed long with an upper case L and am assuming we are case sensitive? As for the keypad pin out fozzer's description is accurate. I renumbered your sketch to match Bob's as I had already wired it and it was working correctly under Bob's sketch. When trying yours with the numbers changed I got no response to the keypad at all. I then uploaded Bob;s sketch back in and all worked. I will need to take another look to make sure it was typed correctly?

Jeff
jkcab is offline  
 
Reply With Quote
Old 01-13-2018, 09:22 AM   #134
Foozer
HMEM_LIFETIMESUPPORTER.png
 
Foozer's Avatar
 
Join Date: Nov 2008
Location: Camano Island, WA
Posts: 1,124
Liked 82 Times on 70 Posts
Likes Given: 2

Default

While watching Rick & Morty played around with the sketch
Sketch from post 80 has listed

const int stp = 8; // connect pin D8 to step
const int dir = 9;

8 & 9 are used by the keypad, haven't looked thru all the post to see if that was caught, changed them to 3 & 4
Also and this may just be the keypad library on my machine, changed all instances of 'Keypad kpd' to 'Keypad keypad'

To clean up screen
char key = keypad.getKey();
lcd.clear(); <---- added
lcd.print("Enter Selection:");

Buttons and screen working in harmony

Robert
__________________
"Nothing is more irritating than that which exposes the pedigree of ideas"----Lord Acton----
Foozer is offline  
 
Reply With Quote
Old 01-13-2018, 09:59 AM   #135
rodw
 
Join Date: Dec 2012
Posts: 1,061
Liked 313 Times on 244 Posts
Likes Given: 161

Default

Quote:
Originally Posted by jkcab View Post
John,

I typed long with an upper case L and am assuming we are case sensitive?

Jeff
C is a case sensitive language.
__________________
RodW
Brisbane, Australia
vehiclemods.net.au
rodw is offline  
 
Reply With Quote
Old 01-13-2018, 05:55 PM   #136
jkcab
 
Join Date: Jan 2011
Posts: 16
Default

Ok Guys here is my report. I fixed the case sensitive problems and I apparently transposed the numbers for rows and columns. I fixed that also. I am using an 84 ozin nema 17 motor to turn a Sherline rotary table that is 72:1. I changed the steps on the motor driver to 1/8 and in the sketch to 800 and all worked fine. I then tried 1/16 at 1600 and it worked also. The problem is with 1/16 it seams to lack enough torque and is really sloooow! In the end I put it back to 1/2 step and 400. I am using a 20v 3A power supply. I think the only thing else I could do is use a higher voltage supply in hopes that it will increase speed?

Thanks again for the help,

Jeff K.
jkcab is offline  
 
Reply With Quote
Old 01-13-2018, 06:56 PM   #137
jkcab
 
Join Date: Jan 2011
Posts: 16
Default

I have everything finished and hooked up. John's sketch dose some strange things with the maths. I typed in 17 divisions to test an odd number. It reports a move of 21.18 degrees and moves 1694 steps. The next time you hit the button it moves double the steps but reports the correct degrees 42.36. it goes on in odd steps from there. I then uploaded Bob's sketch since I am still at 400 and 1/2 stepping and performed the same test. The only thing wrong there is it dose not report the number of steps to move on the LCD? however it lands right back at the start when you travel the full 17 increments 3 times around.

Jeff K.
jkcab is offline  
 
Reply With Quote
Old 01-14-2018, 03:38 PM   #138
kquiggle
 
Join Date: May 2012
Location: Michigan
Posts: 268
Liked 66 Times on 44 Posts
Likes Given: 1

Default Stepper motors - have I got this right?

I've been working on a build based on the original post for this topic, and it has been a very useful learning experience. Of course there is a ton of info online about steppers (drinking from the fire-hose, anyone?), but a few things seem to be hard to find. Here are some things I think I learned, which may or may not be correct, so if anyone can confirm or correct these items I would appreciate it. Also, I have not been able to find a really good reference on controller settings (what they are and how best to set them), so if anyone has one please let me know.

Things I learned (?) about stepper motors :
  1. Do NOT rotate the stepper motor by hand while connected to the controller – it will generate a voltage which may damage the controller.
  2. NEMA motor sizes : These refer to the size of the motor faceplate, not the overall size of the motor. Motors with the same NEMA size can vary in length, rated current, maximum torque, etc.
  3. Settings on the controller :
    1. Running current – the current supplied to the motor by the controller. Increasing the running current increases the torque. Do NOT set the running current higher than the rated current for the motor.
    2. Stop – amount of current to supply the motor when stopped; more current = more holding torque. [really not sure about this one]
    3. Excitation – set the motor for stepping or microstepping.
    4. Decay – controls how quickly the current to the motor drops off when stopping (it’s counterintuitive : fast decay = slow stop, quick decay = fast stop).
  4. Microstepping – generally speaking, microstepping will reduce torque to about 71% of full stepping.
__________________
For a successful technology, reality must take precedence over public relations, for nature cannot be fooled. - Richard Feynman
Visit my website!: Academy of Lagado
kquiggle is offline  
 
Reply With Quote
Old 01-14-2018, 03:54 PM   #139
kquiggle
 
Join Date: May 2012
Location: Michigan
Posts: 268
Liked 66 Times on 44 Posts
Likes Given: 1

Default Straight-through Indexer - WIP

I've been working on an electronic indexer based on the original post on this topic, making what I call a "straight-through" design (see picture) with the motor driving an ER32 collet holder. I plan to use this on my mini-mill to make gears and other small items which can be held in an ER32 collet (or mounted on a mandrel in the collet). My goal is to build a simpler (cheaper!) indexer.

Initially I was concerned that the motor might not have enough torque to do the job, but it seems to be working. The design also includes a mechanical rotation lock, so I'm not counting on motor holding torque to keep things stationary while milling.

I'm running the motor at max rated current (1.4A) with microstepping set to 16. Since there is no reduction gearing the collet holder moves quite briskly. This give me a resolution of 0.1125 degrees/step, but I need to make the coding more complicated to make full use of this resolution (working on that).

Here's a link to the build in progress:

https://sites.google.com/site/lagado...ing-head?pli=1


Attached Thumbnails
indexer.jpg  
__________________
For a successful technology, reality must take precedence over public relations, for nature cannot be fooled. - Richard Feynman
Visit my website!: Academy of Lagado

Last edited by kquiggle; 01-14-2018 at 09:56 PM. Reason: attaching photo
kquiggle is offline  
 
Reply With Quote
Old 01-15-2018, 12:04 AM   #140
Foozer
HMEM_LIFETIMESUPPORTER.png
 
Foozer's Avatar
 
Join Date: Nov 2008
Location: Camano Island, WA
Posts: 1,124
Liked 82 Times on 70 Posts
Likes Given: 2

Default

inserting the change [line 152 should be ToMove=(long)((bob/360.0) *(float)( Multiplier + 0.5 - cumSteps));] from post 126 gives the error - It seems to be adding tomove to itself

'vert back to the original till the 'Why' is solved . . Been punching the A - B with 17 divisions for a while and so far error free . .


__________________
"Nothing is more irritating than that which exposes the pedigree of ideas"----Lord Acton----
Foozer is offline  
 
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
wtb rotary table toolroom Buy / Sell / Trade / eBay 7 03-06-2018 12:58 PM
Arduino control for a 3” rotary table bmac2 Machine Modifications 101 04-23-2017 01:17 AM
Rotary table Coomba General Engine Discussion 64 08-22-2016 04:34 PM
My Second Rotary Table,80 mm table. gus Introduction 75 07-29-2014 08:36 PM
Using a rotary table. radfordc General Engine Discussion 10 03-10-2009 12:58 PM



Newest Threads






- Top - Member List