By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by Forum House Ad Zone

Arduino Rotary Table MEW 249

Corrected part Number + Discussion

All Topics | Latest Posts

Search for:  in Thread Title in  
SillyOldDuffer06/03/2017 21:45:24
10668 forum posts
2415 photos
Posted by John Stevenson on 06/03/2017 21:07:30:

Dave,

...

Two other common ratios are 40:1 which is most dividing head and 72:1 for a lot of the cheaper import tables.

It's peaked my interest and I 'may' have to send for an Arduino to have a play which after I have got back from a trip.

...

Hi John,

I'll have you converted to the dark side yet!

I've added 40:1 and 72:1 to the program. Thanks for the info - that's the sort of thing I don't know.

Ta,

Dave

duncan webster07/03/2017 00:56:31
5307 forum posts
83 photos

Can it do 'number of divisions in a full circle'. If I want a 41 tooth gear (not that I do at present) can I enter 41 rather than 8.7805 degrees.

Another JohnS07/03/2017 03:10:26
842 forum posts
56 photos
Posted by Neil Wyatt on 06/03/2017 14:03:21:

Here's some big news for the flat-earthers... captured during a recent Lunar eclipse:

Hah! Love it!

Journeyman07/03/2017 10:30:22
avatar
1257 forum posts
264 photos
Posted by SillyOldDuffer on 06/03/2017 20:57:08:

A while ago John Stevenson suggested the controller would be easier to use from a keypad rather than nested menus. Unable to resist the challenge I immediately sat in my armchair.

If anyone would like to try it, this dropbox link will let you download such a beast. No proper instructions but there's a pdf that should help. It uses the same motor connections as Carl's article and also works with the DF-Robot shield, though the push-buttons aren't needed. The keypad is a cheap membrane type about £2 from ebay etc...

Thanks Dave, I have downloaded the "ino" file and am awaiting keypads to arrive from China.

John

SillyOldDuffer07/03/2017 11:02:46
10668 forum posts
2415 photos
Posted by duncan webster on 07/03/2017 00:56:31:

Can it do 'number of divisions in a full circle'. If I want a 41 tooth gear (not that I do at present) can I enter 41 rather than 8.7805 degrees.

Hi Duncan,

As it stands the code does the same (I hope!) as Gary Liming's program. His angle function has fixed steps of 5 degrees. You've got me wondering about using the keypad to type in actual values.

I don't quite understand the purpose of Gary's STEP function, but it may be what you want. Taking into account the ratio, STEP moves the motor by the number of microsteps needed to complete a rotation divided by the number of steps input by the user. I have to go out shortly so checking the maths will have to wait, but is this right for your 41 degrees?

microsteps_per_rotation / number_of_steps = 360 / 41

Dave

SillyOldDuffer07/03/2017 11:08:55
10668 forum posts
2415 photos
Posted by Journeyman on 07/03/2017 10:30:22:
Posted by SillyOldDuffer on 06/03/2017 20:57:08:

...

Thanks Dave, I have downloaded the "ino" file and am awaiting keypads to arrive from China.

John

Just in case you haven't spotted it already, the ino uses the Brevik keypad library and won't compile without it. The library is installed using the 'Manage Library' part of the Arduino IDE.

Good luck,

Dave

Journeyman07/03/2017 11:36:05
avatar
1257 forum posts
264 photos

Dave, yes I noticed that in the comments and installed the library. Compiled first time. All I need now is the keypad!

John

Baldric07/03/2017 12:34:13
195 forum posts
32 photos

Dave,
I was thinking that I will use the numbers and have ordered **LINK** as it had the start & stop buttons, I am waiting for it to arrive. I wanted the stop so that I can easily stop it if I think something is going wrong.

Baldric

duncan webster07/03/2017 13:08:22
5307 forum posts
83 photos
Posted by SillyOldDuffer on 07/03/2017 11:02:46:
Posted by duncan webster on 07/03/2017 00:56:31:

Can it do 'number of divisions in a full circle'. If I want a 41 tooth gear (not that I do at present) can I enter 41 rather than 8.7805 degrees.

Hi Duncan,

As it stands the code does the same (I hope!) as Gary Liming's program. His angle function has fixed steps of 5 degrees. You've got me wondering about using the keypad to type in actual values.

I don't quite understand the purpose of Gary's STEP function, but it may be what you want. Taking into account the ratio, STEP moves the motor by the number of microsteps needed to complete a rotation divided by the number of steps input by the user. I have to go out shortly so checking the maths will have to wait, but is this right for your 41 degrees?

microsteps_per_rotation / number_of_steps = 360 / 41

Dave

If I've understood, that seems a bit unhandy. With the motor driver set to 1/2 stepping and a 60:1 worm I need 24000 steps for a full rev or 585.4 steps for each of my 41 teeth. I deliberately chose something not a factor of 360. It must have resulted in sore fingers inputting that via an up/down button system. A lot easier to input 41, no arithmetic for starters. What do others think?

To reduce cumulative error it might be possible to have not all increments the same, as a starter for 10 alternate between 585 and 586 steps. If every increment was 585, you would be 0.03 teeth out after a full circle. Am I nit picking? Probably. Using a series of 1 off 586 followed by 2 off 585 gives 23999 which is close enough. Last cycle is 1 off 586 followed by 1 off 585 for those who are into checking sums

John Stevenson07/03/2017 13:16:49
avatar
5068 forum posts
3 photos
Posted by duncan webster on 07/03/2017 13:08:22:

If I've understood, that seems a bit unhandy. With the motor driver set to 1/2 stepping and a 60:1 worm I need 24000 steps for a full rev or 585.4 steps for each of my 41 teeth. I deliberately chose something not a factor of 360. It must have resulted in sore fingers inputting that via an up/down button system. A lot easier to input 41, no arithmetic for starters. What do others think?

To reduce cumulative error it might be possible to have not all increments the same, as a starter for 10 alternate between 585 and 586 steps. If every increment was 585, you would be 0.03 teeth out after a full circle. Am I nit picking? Probably. Using a series of 1 off 586 followed by 2 off 585 gives 23999 which is close enough. Last cycle is 1 off 586 followed by 1 off 585 for those who are into checking sums

Duncan,

This is one of the reasons that I mentioned the Steve Ward controller in that you get simple menus, more of them for very little more outlay on expense.

 

I have been following the Arduino project over on HMEM

for a 3" table and that ones does use a keypad but as with all the other threads some can't get it running after literally hours of work.

 

Now I know for some it's the learning curve and wanted to know these things which is fine but for other who want a table to carry on with another project then it's a warning what you could be letting yourself in for.

 

Even with Steve Wards controller you have a choice of literally buy the modules and plug and play or build it. True you have to wire in a stepper driver and put it all in a case but you have to do this with an Arduino anyway so nothing lost.

 

[edit] link added.

 

Edited By John Stevenson on 07/03/2017 13:19:33

Journeyman07/03/2017 13:37:14
avatar
1257 forum posts
264 photos

Duncan, as it was written originally it can do number of divisions. I tried mine out with a an offcut in the chuck on the table I set divisions to 7, a nice odd number. Then drilled a hole, step, drill hole etc. and I ended up with 7 holes that looked equi-spaced. Just to see what happened I went round the circle again and the drill went neatly into each hole without apparent deflection. Just to see what happened I ran it in reverse and the drill again dropped neatly into each hole. So the system seems to work. Not able to measure accurately enough to tell the angle the holes are at but seems pretty good for a simple test. Probablt accurate enough for my needs.

John

SillyOldDuffer07/03/2017 14:00:25
10668 forum posts
2415 photos
Posted by Baldric on 07/03/2017 12:34:13:

Dave,
I was thinking that I will use the numbers and have ordered **LINK** as it had the start & stop buttons, I am waiting for it to arrive. I wanted the stop so that I can easily stop it if I think something is going wrong.

Baldric

Hi Baldric,

Not difficult to modify the code to use separate STOP / GO buttons. At the moment I use a single button to toggle STOP/GO. The code is:

case 'G': // GO / STOP toggle
rstatus.go = !rstatus.go;
break;

After assigning 's' to the STOP button, you would change the above to:

case 'G': // GO
rstatus.go = true;
break;

case 's: // STOP
rstatus.go = false;
break;

What's complicated about using the numbers on a 4x4 keypad is fitting in the functions. Run, Step, Jog, and Angle can be assigned to F1 to F4, but what to do about ratio?

Duncan is interested in numbers too so I'll have a think. Ideally the solution shouldn't involve nested menus! It may be necessary to use a 5x4 keypad like this one.

Apart from the labels your keypad is probably the same as mine so the program should still work. I would like to make an overlay that goes over the existing key labels but that's an unsolved problem.

Dave

SillyOldDuffer07/03/2017 14:27:19
10668 forum posts
2415 photos
Posted by duncan webster on 07/03/2017 13:08:22:
Posted by SillyOldDuffer on 07/03/2017 11:02:46:
Posted by duncan webster on 07/03/2017 00:56:31:

Can it do 'number of divisions in a full circle'. If I want a 41 tooth gear (not that I do at present) can I enter 41 rather than 8.7805 degrees.

Hi Duncan,

As it stands the code does the same (I hope!) as Gary Liming's program. His angle function has fixed steps of 5 degrees. You've got me wondering about using the keypad to type in actual values.

I don't quite understand the purpose of Gary's STEP function, but it may be what you want. Taking into account the ratio, STEP moves the motor by the number of microsteps needed to complete a rotation divided by the number of steps input by the user. I have to go out shortly so checking the maths will have to wait, but is this right for your 41 degrees?

microsteps_per_rotation / number_of_steps = 360 / 41

Dave

If I've understood, that seems a bit unhandy. With the motor driver set to 1/2 stepping and a 60:1 worm I need 24000 steps for a full rev or 585.4 steps for each of my 41 teeth. I deliberately chose something not a factor of 360. It must have resulted in sore fingers inputting that via an up/down button system. A lot easier to input 41, no arithmetic for starters. What do others think?

To reduce cumulative error it might be possible to have not all increments the same, as a starter for 10 alternate between 585 and 586 steps. If every increment was 585, you would be 0.03 teeth out after a full circle. Am I nit picking? Probably. Using a series of 1 off 586 followed by 2 off 585 gives 23999 which is close enough. Last cycle is 1 off 586 followed by 1 off 585 for those who are into checking sums

I agree! Even if I get key-repeat to work (next job), it would be a considerable improvement to simply type in the required numbers and hit GO. As I mentioned in my reply to Baldric, the problem with allowing numbers is to squeeze everything in on a 4x4 keypad without going back to nested menus.

I like the idea of reducing errors. Step motors aren't fantastically accurate in the first place but that;'s no reason to leave obvious improvements out. I shall need Duncan to explain the maths though!

At the moment this project is a clean room implementation, that is I haven't looked at how others have done machine control with a push button interface. I'm not going to copy a commercial product. I expect Steve Ward has a done a good job and don't want to pinch his livelihood by knocking out an imitation.

Dave

Emgee07/03/2017 14:39:11
2610 forum posts
312 photos

Like John I too followed the HMEM arduino article by Chuck Fellows, eventually I got the Arduino UNO and a Sainsmart display. I already had a stepper and driver so it only needed a few wiring links to get up and running, fortunately the downloaded sketch from Chuck worked first time, any number of divisions can be entered and the control buttons provide steps in either direction at a single speed and there is no jogging function.

So this is a very basic set-up compared with what's achievable by adding another sketch (program) to provide further functions.

What I would like to do is add a separate switch or proximity detector to activate the single step move so that when on a cnc mill cutting gears after the cutter has cut the space and returned to the start position the table advance switch is triggered by the X axis travel and the div head rotates to the next tooth position.

I have no idea on writing a sketch but can copy and paste, or how to wire in a switch or proximity sensor, any help much appreciated.

Emgee

typo edited

Edited By Emgee on 07/03/2017 14:42:59

Journeyman07/03/2017 16:47:10
avatar
1257 forum posts
264 photos
Posted by SillyOldDuffer on 07/03/2017 14:00:25TOP/GO. The code is:

What's complicated about using the numbers on a 4x4 keypad is fitting in the functions. Run, Step, Jog, and Angle can be assigned to F1 to F4, but what to do about ratio?

Dave, I would guess that most people only have the one R/T or Dividing Head that they want to automate. Therefore the ability to change ratio easily may not be required. I for one would just hard code it into the program. I presume that there is also the choice of adding an extra button, possibly one of those paddle switches I am already using to start it running in the required direction?

John

Neil Wyatt07/03/2017 18:16:34
avatar
19226 forum posts
749 photos
86 articles

An alternative to nested menus is to have sequential ones, press a menu key and cycle through the relative short list of modes, so the display runs through (e.g.) 'angle', 'Number of holes', 'jog', 'continuous' etc. you just enter a number and press go.

The four function keys could be: Menu, backspace, enter and direction (the latter one would toggle CW/CCW). No need for nesting and each key keeps its function.

For my projects I tend to have the major selections as sequential menus, then nested functions when needed within each major menu.

Neil

Bazyle07/03/2017 18:44:53
avatar
6956 forum posts
229 photos

If you have numbers all you need after that is 'backspace'. You start with say an menu of 4 items so pick one, that gives you another menu and so on until the last menu is 1=go, 0=abort. If you make a mistake all you need is backspace or the abort at the end (or assign a key on every page or this)
It takes only 2 key strokes to give you 100 options.
There is a system in use for tens of millions of devices worldwide called "SNMP" that is number driven like this and it is very reliable. Even today I have accessed devices in peoples homes (legally) all over the UK using SNMP to retrieve data and set control parameters. Unfortunately it is being replaced by TR069 which is XML to please the programmer geeks who can't handle simple numbers and that is a cumbersome nightmare.

Neil Wyatt07/03/2017 21:06:50
avatar
19226 forum posts
749 photos
86 articles
Posted by Bazyle on 07/03/2017 18:44:53:

If you have numbers all you need after that is 'backspace'. You start with say an menu of 4 items so pick one, that gives you another menu and so on until the last menu is 1=go, 0=abort. If you make a mistake all you need is backspace or the abort at the end (or assign a key on every page or this)
It takes only 2 key strokes to give you 100 options.

Yep, but people has asked for a way to avoid nested menus, also multiple options often don't work well on a two-line 16 character LCD

My battery charger has three buttons (left, right, select) and does something like this:

menu 1 top line: Chemistry

Buttons 1&2 scroll through (on) bottom line: NiCad, NiMH Lion, SLA

Select then moves on to number of cells, then capacity.

Finally you get presented with the settings and have to press left or right to start the charge or cancel (if you have made an error).

When running the display shows voltage, current, elapsed time and temperature. The select key aborts.

Downside is I have made steps in the capacity selection too large, it's a bit slow.

Mike Poole07/03/2017 21:31:46
avatar
3676 forum posts
82 photos

The most user friendly menu system I have encountered is my Brennan MP3 unit, the menus are selected by a rotary knob which scrolls through the major headings then push knob to select,which will either drill down to the next selections or when you reach the required parameter push to select and turn to alter value and push to enter, job done. The trouble with any menu system is you either need to know where what you want is located or waste time hunting it down. The most useful page in a manual is the menu tree where you can see at glance what you want and where to find it. Many industrial intelligent sensors have a few buttons to access a menu and enter the parameters, by the time you have entered an IP address, subnet mask and all the other stuff you quickly lose the will to live.

Mike

Edited By Mike Poole on 07/03/2017 21:32:15

SillyOldDuffer08/03/2017 19:21:57
10668 forum posts
2415 photos

There's a new version of my keypad controlled indexer available here.

The main changes are:

* v0.6 beta added extra ratios ( Thanks to John Stevenson)


* v0.7 beta changed keypad to use Pin 11 rather than 13. (Fixes a keypad issue due to pin 13 being 'special' )

WARNING!

WIRING CHANGE: Motor PULSE (aka STEP) is now output on Pin 13 not PIn 11 as before. The motor will not turn unless this hardware change is made.  Also Pin 11 replaces Pin 13 on the keypad.  The circuit diagram is not updated yet.

* v0.8 beta Adds Key repeat. (May be repeating too quickly!)


* v0.9 beta Allows numbers to be got from keypad by entering # in the JOG, ANGLE & STEP modes. A second # finishes entry . It is now possible to type in a JOG, STEP or ANGLE rather than using +/- to change the number. (Thanks to Duncan Webster)

Dave

Edited By SillyOldDuffer on 08/03/2017 19:26:26

All Topics | Latest Posts

Please login to post a reply.

Magazine Locator

Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!

Find Model Engineer & Model Engineers' Workshop

Sign up to our Newsletter

Sign up to our newsletter and get a free digital issue.

You can unsubscribe at anytime. View our privacy policy at www.mortons.co.uk/privacy

Latest Forum Posts
Support Our Partners
cowells
Sarik
MERIDIENNE EXHIBITIONS LTD
Subscription Offer

Latest "For Sale" Ads
Latest "Wanted" Ads
Get In Touch!

Do you want to contact the Model Engineer and Model Engineers' Workshop team?

You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.

Click THIS LINK for full contact details.

For subscription issues please see THIS LINK.

Digital Back Issues

Social Media online

'Like' us on Facebook
Follow us on Facebook

Follow us on Twitter
 Twitter Logo

Pin us on Pinterest

 

Donate

donate