PDA

View Full Version : CNC Rotary table/lathe head indexing



Kwackers
16-01-2008, 10:02 PM
This forum looked a bit empty so I've posted this here. Whilst not a 3 axis machine it is technically CNC. I have posted this design elsewhere so apologies if you've already seen it.

What and why?
It's a device intended to drive a rotary table, lathe head or any form of indexing device. It's cheap - the electronics running around 30 and (for a small 4-8" table at least) can use some of the appallingly cheap steppers and drivers we see around these days...

I made it after purchasing a set of division plates for my 6" vertex table, I played with them and then decided they were tedious and error prone. So I designed this.
Basically the controller connects to a stepper which you've coupled to your rotary table / lathe head / dividing head etc. Then with a couple of button presses it'll divide, move by an angle, move continuously for machining or if you're feeling adventurous you can program complex sequences of moves which can be driven automatically or with operator intervention etc.

Being a standalone device, it doesn't tie up a computer and is much simpler to use.

For example to divide a circle into 171 parts - turn on, press [2] (division) enter the number '0171' and press [G]. Each press of left or right will now move the table 1/171 of a circle anticlockwise or clockwise. Backlash compensation is automatically applied.
The current position in degrees, current division and total number of divisions are all shown on the LCD display.

Main Features:

* Stand-alone operation. No computer needed.
* Jog mode. For easy positioning.
* Division mode. Divide a circle into any number from 1 to 9999 parts.
* Degree mode. Move any number of degrees from 0.01 to 359.99 in 0.01 degree steps.
* Continuous drive. Table is driven continuously CW/CCW at one of the (selectable) 5 speeds.
* Program mode. Allows complex sequences to be carried out and automated. (10 programs can be stored)
* Configurable for any worm drive from 1:1 to 9999:1.
* Five speed settings.
* Configurable for all common stepper / driver combinations.
* Five machine profiles.
* Automatic backlash compensation.

Attached (should be) Rotary V2.0.zip - unzip this into a folder somewhere and double click on 'Documentation.htm', this file has links to other files including a manual, partslist, circuit diagram etc. Most of it should be self explanatory. Since the device is based around a microcontroller (18F452) I've also included the firmware for it (I notice elsewhere on the forums someone has very kindly offered to program these for free...)
I've also attached some photos of the completed unit and one of it in use (hooked to a 4" rotary table which is in turn bolted to my lathe head for a spot of gear cutting).

A number of these have been built by people in my local engineering club and people who've simply 'come by' the plans. There are a number of similar commercial designs, but I reckon this knocks spots off them and for a fraction of the price...

Hope it's of some use to people here.

Lee Roberts
22-01-2008, 04:54 AM
This is an excellent contribution to the forums thank you very much, i'v also put this up as a sticky !

Kind Regards,
CM

pistolpete
17-11-2008, 12:25 AM
Tried to open these attachments but no luck. Could they be emailed to me Thanx....Pete

Kwackers
30-01-2009, 07:37 PM
I've re-attached the missing zip file to the first post.

Regards
Steve.

Lee Roberts
30-01-2009, 07:43 PM
Success !, the problem was that the file attachments were being stored in the database and not the file system on the server, when you tryed to upload the file the MySQL server was rejecting the file because the packet it was reciving was to big. Changed it to store files on the file server now so we shouldnt get that problem again.

Thanks Steve !

rasta
26-02-2009, 11:08 AM
HI ; I have come by chance to this group , and saw this very nice proyect, my question is , can you please post the uncompiled version of the firmware? the reason is that I want to have a go at trying to port the program to the picaxe (I have no experience on it but it should be fun) also is im sucessfull I will try to use the circuit to do electronic gear hobbing, using the device to multiply the clock imputs.
regards
mariano




This forum looked a bit empty so I've posted this here. Whilst not a 3 axis machine it is technically CNC. I have posted this design elsewhere so apologies if you've already seen it.

What and why?
It's a device intended to drive a rotary table, lathe head or any form of indexing device. It's cheap - the electronics running around 30 and (for a small 4-8" table at least) can use some of the appallingly cheap steppers and drivers we see around these days...

I made it after purchasing a set of division plates for my 6" vertex table, I played with them and then decided they were tedious and error prone. So I designed this.
Basically the controller connects to a stepper which you've coupled to your rotary table / lathe head / dividing head etc. Then with a couple of button presses it'll divide, move by an angle, move continuously for machining or if you're feeling adventurous you can program complex sequences of moves which can be driven automatically or with operator intervention etc.

Being a standalone device, it doesn't tie up a computer and is much simpler to use.

For example to divide a circle into 171 parts - turn on, press [2] (division) enter the number '0171' and press [G]. Each press of left or right will now move the table 1/171 of a circle anticlockwise or clockwise. Backlash compensation is automatically applied.
The current position in degrees, current division and total number of divisions are all shown on the LCD display.

Main Features:

* Stand-alone operation. No computer needed.
* Jog mode. For easy positioning.
* Division mode. Divide a circle into any number from 1 to 9999 parts.
* Degree mode. Move any number of degrees from 0.01 to 359.99 in 0.01 degree steps.
* Continuous drive. Table is driven continuously CW/CCW at one of the (selectable) 5 speeds.
* Program mode. Allows complex sequences to be carried out and automated. (10 programs can be stored)
* Configurable for any worm drive from 1:1 to 9999:1.
* Five speed settings.
* Configurable for all common stepper / driver combinations.
* Five machine profiles.
* Automatic backlash compensation.

Attached (should be) Rotary V2.0.zip - unzip this into a folder somewhere and double click on 'Documentation.htm', this file has links to other files including a manual, partslist, circuit diagram etc. Most of it should be self explanatory. Since the device is based around a microcontroller (18F452) I've also included the firmware for it (I notice elsewhere on the forums someone has very kindly offered to program these for free...)
I've also attached some photos of the completed unit and one of it in use (hooked to a 4" rotary table which is in turn bolted to my lathe head for a spot of gear cutting).

A number of these have been built by people in my local engineering club and people who've simply 'come by' the plans. There are a number of similar commercial designs, but I reckon this knocks spots off them and for a fraction of the price...

Hope it's of some use to people here.

Kwackers
27-02-2009, 10:51 PM
For anyone that's interested here's the source for v1.1 of the code.

With the exception of programming mode and some tidying up it's fairly similar to the version of the firmware included above.

It's intended to compile with Hi-Soft C.

Please note copyright on these files belong to me, I release them for personal use only.

rasta
01-03-2009, 08:46 AM
Hi Kwackers;
thanks for posting the " C" file , I will learn a lot from it.
and also will help people that wants to develop their own rotary table.
Now can you please post the pcb file? I want to try to mill it or I can try to print the file ,as printing the jpg file does not come right , when I try to reduce the size
regards
mariano


quote=Kwackers;2919]For anyone that's interested here's the source for v1.1 of the code.

With the exception of programming mode and some tidying up it's fairly similar to the version of the firmware included above.

It's intended to compile with Hi-Soft C.

Please note copyright on these files belong to me, I release them for personal use only.[/quote]

Kwackers
01-03-2009, 03:03 PM
Best way to print the PCB is to install Proteus Ares PCB software...

However, you can be a guinea pig and see if the attached PDF works. ;)

If it does - can you let me know?

rasta
31-03-2009, 06:05 AM
hi ;
the artwork did not work for me, and when I tried to make draw the circuit board , I found that
The PCB artwork shows 2 pins of the pot connected to ground and 1 pin to pin 3 of the LCD connector.
The Schematic shows 1 pin connected to ground, 1 pin to +5V and the other to pin 3 of the LCD connector.
can you please shed some light into it?
thanks
rasta

Kwackers
01-04-2009, 08:02 PM
Hi rasta,

I assume by "did not work for me" means you can't get the device to work?

I can confirm the PCB is correct (it's the one mine is built from), the schematic shows a voltage divider which will work, as will the simple variable resistor version on the pcb.

The circuit is pretty simple, as long as the PIC is programmed correctly and connected to the LCD then you should get a display.

Try the following.

Adjust the contrast - do you get anything on the display at one end of the contrast range? (This may just be squares.)

If not, check power (5v) is getting to the LCD and check the connections are correct.

If you get squares, this suggests either the PIC isn't running or the connections to the LCD are faulty (short or open circuit).

If you programmed the PIC yourself check the config bits are set (actually it doesn't look like they are contained in the .hex file in the above zip - I've attached a new .hex file that definitely has them set, please try this).

If the PIC is programmed correctly and the connections to the LCD seem ok then the only other thing that would stop it working is the area around the xtal and the two decoupling capacitors connected to it.

Hope this helps, let me know how you get on.

rasta
02-04-2009, 10:20 AM
Hi ;
thanks for the prompt reply
by stating that it did not work for me , I mean that I could not have the print of the circuit board artwork with enough contrast to etch the fine tracks properly , so I've got a friend to do the artwork for me again , thanks too for posting the new hex file I will keep you posted
regards
mariano

Kwackers
02-04-2009, 11:03 AM
Hi Rasta,

The PDF will be fine IF it prints out at the right size and your printer can print the blacks dense enough.

Some general tips I use for printing layouts which may help people...



I use an Epson photo printer (although I think any ink jet will do).

Use inkjet transparency paper (I bought mine from W.H Smiths - own brand).

Set the printer to black and white and use the best quality photo mode it has (This puts more ink down).

Make sure there are no blocked jets.

Put the paper in the printer, print and apply light pressure to one side has it feeds in - we need to do multiple passes and want to be sure it feeds identically each time.

Give the paper some time to dry, then repeat the above for another pass applying the same pressure in the same place to guide the paper in as it feeds. (It's not a bad idea to 'blot' the paper with a sheet of normal printer paper to remove any 'sticky' ink off the top between passes)

You should now see the blacks are pretty solid. If you want to be absolutely sure you cand do a 3rd pass - however I find it takes all night for the ink to dry enough before this becomes possible.

You should now have a high quality transparency, the rest depends on the photo board you use, chemical strengths etc. If in doubt it's not usually a bad idea to do exposure tests with scrap board similar to what you'd do in old fashioned photography.

Hope this helps.

giansa
17-09-2009, 09:54 PM
before all compliment for your project!!!
I have simulated it with proteus and works but i can not understand a thing
why when i push direction pos : 0.000 became 0.***?
Sorry but my english it is very poor
regards
Gianluca

Kwackers
17-09-2009, 11:04 PM
Hi Gianluca,

The divider shows the current position in 'real time', however it can't update the screen fast enough for the numbers to the right of the '.' to make sense.
So whilst the table is moving I blank the numbers to the right of the decimal by replacing them with '*'s. When the table has finished I reprint the correct number.

Someone sent me a link to some video of their rotary table they'd built to the design, for anyone interested you can see its construction and simple usage.

Regards
Steve.

YouTube - Digital indexer added to Shoba 6" rotary table

HiltonSteve
18-09-2009, 01:15 AM
I want one....

Don't know what for but i like a challenge.

Just had a quick flick through the thread and tell me if i have missed anything, can i mill the pcb on my router from your files? if so what type of blank board will be best and where would you suggest to get it from?

Sourcing electronic components should not be a problem but what about PIC programming? Will I need to buy a PIC programmer? looked into PIC programming before but never bought anything because I did not know what i would need.

I have a reasonable understanding of electronics but still a first build virgin so any help would be most appreciated!

Thanks,

Steve.

Kwackers
18-09-2009, 10:04 AM
Hi Steve,
I don't provide anything for milling PCB's, the overlays are intended for photo reproduction. However it's a fairly simple circuit, easily breadboarded or made on vero-board. So you may wish to go that route or figure out your own milled version (which of course you'll post on here for the general good. ;-)

Don't know if there's much point buying a PIC programmer for one job, someone on here did post that they'd program PIC's, or alternatively refund me the cost of the chip and postage and I'll send you one.
If you do wish to buy a programmer there are many fairly cheap devices on the web/eBay along with public domain software - plus many designs which can easily be made.
For general mucking around with PIC's I used stuff by Mikroelektronika (http://www.mikroe.com/ probably a bit pricey if you just want to program the odd PIC but for general mucking around I find them excellent...

giansa
18-09-2009, 11:47 AM
as you can see pos is always 0.000 I have simulated div
regards

Kwackers
18-09-2009, 12:47 PM
Hi Gianluca,

I'm unsure about how the proteus simulator works - however I should point out the movement is performed using interrupts - these are pretty rapid too (up to 10,000 per second). I'd guess that the simulator either can't handle interrupts or can't handle them at that speed.

Steve.

Michel95
06-11-2009, 11:54 PM
Hi,
Thank you for sharing this project and sorry for my bad English. I would like to make a suggestion. I have noticed that when the motor is stopped the windings are not powered, so the shaft is free and can change position during normal use. It could be better to add the possibility to keep the driver activated in order to hold the shaft of the motor when it stops.
Regards
Michel

Kwackers
07-11-2009, 11:24 AM
Hi Michel,

If you're using the 'enable' line from the controller then I'd suggest not using it and leave the driver permanently enabled instead.
I used it with my home made driver to put the motor into a low power mode. However lots of drivers simply turn off the motor when this is used.

If you're not using the enable line then the issue is with your driver. Some drivers will turn off if there is no activity after a preset time (most modern one's automatically go into a low power state which is ideal). This behaviour may be programmable so check your documentation.

Hope this helps.
Steve.

Michel95
07-11-2009, 11:50 AM
Hi Steve,
I use the enable line, the controller is a L297 coupled with a pair of L6203. I will use a switch to connect the enable line either to the pic or to Vcc to enable the driver permanently.
Thank you
Michel

Kwackers
07-11-2009, 12:01 PM
Hi Michel,

If you're using the L297, then a better idea is to use the enable line to raise the VREF voltage. This way you can set a high current when the table is moving and switch to a lower (holding) current when it's stationary.

This was originally how it was intended to be used.

Steve.

Ross77
15-11-2009, 11:20 PM
Brilliant idea I will definetly bulid this, after the other 10 or so projects. Hope you dont mind but a have a question not related to this Thread.

Im looking to build a stepper driver using an L297 and 2x 6203 and I want to use a PIC to control the holding torque. (by varying Vref) I noticed in the last post that your controller was designed to do this. Would you be able to shed any light on the code to do this and how it was integrated in to the circuit?

Many thanks and sorry again to hijack your thread.

Kwackers
16-11-2009, 10:19 AM
Hi Ross,
It's pretty trivial. VRef is normally provided via a voltage divider, basically you simply provide your VRef fed via two voltage dividers, one fed from +5v like normal the other fed via the enable line. Unless you isolate the two dividers there's a degree of 'interdependence' on their adjustment so you need to tweak both to get the current correct. (I think I also fed the enable via a diode to prevent it pulling VRef low when the enable line dropped.)
In software terms it's simply a line that's pulled high whenever the motor is running.

Another way that I experimented with and worked well, was to feed one of the PWM's via an RC chain (series resistor feeding a parallel cap, feeding another resistor feeding another cap). Set the frequency high(ish) and change the PWM to alter the voltage (and thus the current). The VRef input seemed quite high impedance so there was no need to buffer this. A 50% pulse width ratio would result in half voltage available. Again in software when idling all that I did was quarter the PWM ratio to drop holding current to 25% of max when the motor wasn't running.
The only reason this didn't make it into the final device was that it worked out cheaper and less messing to buy ready made drivers, which meant that the setup options for setting the stepper current made no sense.

Hope this helps,
Steve.



Brilliant idea I will definetly bulid this, after the other 10 or so projects. Hope you dont mind but a have a question not related to this Thread.

Im looking to build a stepper driver using an L297 and 2x 6203 and I want to use a PIC to control the holding torque. (by varying Vref) I noticed in the last post that your controller was designed to do this. Would you be able to shed any light on the code to do this and how it was integrated in to the circuit?

Many thanks and sorry again to hijack your thread.

Ross77
16-11-2009, 07:24 PM
Thanks Steve, thats great. Unfortunatly I've never used Pic's before and therefore I'm a complete novice. Irving and Tribbles have offered to help with the code but just wondered that as you have allready done it we wouldnt have to reinvent the wheel:beer:

Im looking at a slightly different set up where the pic is soley used for varing the vref based on the incoming step signal from Mach. If you can help any further maybe you could take a look at me my thread "Help with DIY L297 + 6203" (or some thing like that:heehee:) to save clogging up this one.

Thanks again

dchobby
14-03-2010, 11:14 PM
Hello.

Would never have been able to do this without kwackers (Steve), this thing works great, thank, thanks, thanks.

http://i226.photobucket.com/albums/dd249/dchobby/CNC%20Turntable%20project/DSC_3591.jpg

I still need to find a box for the driver, small issue. I am just so happy it is working. :smile:

Roy
Elkhart, IN USA

Nipper
25-03-2010, 11:30 PM
Hi,
I am new to MYCNCUK so you will have to patient with me I am not an Electronics person but I have worked on very large commercial CNC machines I have a small lathe and a small Knee Mill and I am going to attempt to convert them both to CNC First question is could I use this control to index a six position tool post for the lathe. Second question do you sell this control already made Regards nipper

irving2008
25-03-2010, 11:48 PM
Nipper,

Welcome. I'm sure Steve will be along sometime to answer this but my 2p (or should that be 2c) worth for Q1 is that, yes it could, but its overkill since you don't need the complexity of a fully variable positioning, you need a 'rotate to position x'. The hardware would be similar but it would need different software. If I was doing it i would put some positive position indication, or even tool type indication as feed back (replacing the keypad effectively) so that you can have 'position to parting tool', 'position to facing tool' type commands irrespective of where the tool was in the toolpost.

As to Q2, I know Steve has said he doesn't do these pre-built in the past, but I'm sure there are people in your part of the world who could help you there...

Kwackers
26-03-2010, 02:11 PM
Hi Nipper,

It's pretty much as irving2008 says. You could use the divider but it's overkill for a toolpost, also it raises the question of how do you make the whole thing 'stiff' enough to work properly? If it's for a fully automated system then you need a method for locking it down and if not then I think you'd be better with a manual indexing toolpost.

Regards
Steve.

irving2008
26-03-2010, 02:54 PM
I think auto-toolchangers have a locking plunger with a solenoid or stepper driven retractor to lock the post and a switch to indicate the plunger is clear so that the software wont turn the post until it unlocked. A switch to show the locked position would also be useful.

cncguy
08-05-2010, 02:01 AM
hi guys

i tried running the hex code on proteus and the processor is been reset every 23secs by watchdog timer. itried compilling the v1.1 still the same problem. can someone tell me what i am missing

Kwackers
08-05-2010, 09:58 PM
hi guys

i tried running the hex code on proteus and the processor is been reset every 23secs by watchdog timer. itried compilling the v1.1 still the same problem. can someone tell me what i am missing

The watch dog timer isn't used in the firmware - so if you're enabling it then that's why it's resetting!

leem123
24-08-2010, 03:04 AM
thank you for your contribution I'll start gattering the parts and beguin on the project, I do have one question do, how it will afect the table if i use gear reduction or do i have to use it with a straight shaft and no reduction?

Kwackers
24-08-2010, 10:33 AM
It depends on what you mean by reduction gear.
If you simply mean the worm on the table (i.e. in the case of a 6" vertex which is 90:1 reduction) then it's designed for that.
If you wish to reduce the gearing further by driving the input shaft to the table via a reduction gear then you can do it providing you're not reducing it by too much.

Basically it's down to the maximum number of steps for a single 360 degree rotation of the table. These can't exceed 65535 steps. So with a half stepping (400 step) motor, and a 90:1 reduction ratio the number of steps per 360 = 400 * 90 = 36,000.
If you tried to drive this through a 2:1 reducer you'd need a value of 72,000 which is too high.

Hope this helps
Steve.

leem123
24-08-2010, 10:23 PM
Thank's Steve, i did mean the worm on the table, i was'nt sure if the controller was designed for that, so it should'nt be any trouble, i apreciate your time.

petrus
17-11-2010, 04:29 PM
Hello,
Many thanks to everybody for these informations.
I'd like to built an indexing device for my watchmaker lathe.
My knoledge in electronics is not perfect, so is someone able to provide me a printed board ?
Regards, Petrus (France )

rasta
19-11-2010, 09:32 AM
Hi,
I am new to MYCNCUK so you will have to patient with me I am not an Electronics person but I have worked on very large commercial CNC machines I have a small lathe and a small Knee Mill and I am going to attempt to convert them both to CNC First question is could I use this control to index a six position tool post for the lathe. Second question do you sell this control already made Regards nipper



Hi Nipper;
there is someone in OZ that has done a tool changer for a herbert lathe, I think that is
in SA , he is a nice fellow , have a look at this

http://www.cncathome.com/latheturret.html
also there is a very nice fellow in Melbourne ,his name is Frank Tkalcevic, he is
very active in the emc forums .
regards from Sydney
mariano
mariano

Kwackers
29-11-2010, 12:13 PM
Hi,

Attached to this post V2.12b firmware.

A couple of minor bug fixes, couple of minor new features and a change to the way the worm ratio is entered, rather than enter a worm ratio (and the device 'assume' a 400 step motor) you now enter the worm ratio multiplied by the step ratio.
E.g for a 400 step motor and a 90:1 worm you'd enter 400 * 90 = 36000.

This change allows odd ratios to be entered.
I'll upload updated instructions shortly.

rooies13
09-12-2011, 03:31 PM
Hi,

Attached to this post V2.12b firmware.

A couple of minor bug fixes, couple of minor new features and a change to the way the worm ratio is entered, rather than enter a worm ratio (and the device 'assume' a 400 step motor) you now enter the worm ratio multiplied by the step ratio.
E.g for a 400 step motor and a 90:1 worm you'd enter 400 * 90 = 36000.

This change allows odd ratios to be entered.
I'll upload updated instructions shortly.

KWACKERS Do you have the source code of V2.12 and V2.12b?

Thanks

Dennis

rooies13
09-12-2011, 03:33 PM
Hi KWACKERS

Do you have the source code of V2.12 And V2.12b?

Thanks

Dennis