Thanks for the quick replies. Yes I have the IDE loaded and have registered but the help stuff is just meaningless I just want to be able to install Garry Lining's indexing software.
Cheers Iain
Well, you need to open Gary's file by double-clicking on it – the IDE will ask if you want to create a folder for it, say OK. Then it will open in the IDE and you can read it. Probably there will be some parameters you have to change to suit your mechanics.
Then you verify any changes by clicking the tickmark at the top left of the IDE window – if all is well it will compile and give a success message at the bottom of the window.
Then connect your PC to the Nano using a USB cable – here you will have to look at the instructions on the site, but it's usually straightforward. There's a few things needed like telling the IDE which board you have and maybe selecting the right COM port, but it isn't that hard.
Then click on the right arrow next to the tick mark at the top – this will compile the code again and upload it to the Arduino, and start it. Once the code is running the USB lead can be unplugged.
I built a stepper motor indexer about 2 years ago, not knowing about the unit(s) mentioned here. Mine uses an Arduino Nano as controller, with a NEMA 23 stepper motor drive through a DRV8825 'stepstick', a small three-jaw chuck and a magnetic brake to lock it in place after each step.
I built it originally because I wanted to drill regularly-spaced holes around aluminium rims for model cars. I had been doing this in the lathe, but found it quite difficult due to the small rim sizes in a large chuck. After some experiments, the brake was fitted to ensure that the chuck would not turn (as it did sufficiently to break drills of sub-millimetre size). I mount the indexer on a small gantry-type CNC router, which is used to actually drill the holes. This would also give me the option to program the router in conjunction with the indexer stepper to do the whole job automatically, but so far I haven't got around to that.
The indexer uses a 4*20 character LCD display, with 3 pushbuttons to enter values and for operation. The indexer can be set up to rotate in defined steps in either direction at specified speeds, just by pressing a single button. (I did play with an 'auto-run' mode, making the step automatically at specified time intervals, but scrubbed it because it was very easy to 'miss' as step (me, not the indexer).
It can also be set to rotate in either direction continuously at specified speeds – I use it for coil winding.
The software is not complicated, and there is room in the memory for other functions to be included, but I have found the 4-line LCD display to be a bit limiting. I keep thinking about updating it to use an ESP32, and possibly a TFT display to show more information, (and colour!) because this would allow other functions as well. The ESP 32 has more memory, and can also be connected via Wi-Fi (built-in) which would allow control over a smartphone or tablet, but this is something for the future – the thing does it for me for the moment.
a magnetic brake to lock it in place after each step.
I'm surprised the brake was necessary, did the holding torque on the stepper not suffice, or was there slight play in it?
As posted above, my experience with the ESP chips has been very positive. They're barely more expensive than the arduinos when you get them on aliexpress. Toolchain is fairly straightforward if you just use the arduino tool to flash them.
Like you, when I first built it, my thinking was that the holding torque of the motor would be sufficient, so my first version didn't have the brake. However, on a couple of occasions, it did move – at the time I was making a tiny countersink to the hole. It wasn't backlash – it actually moved a (part?) step apparently. Eventually I put this down to the fact that I was using the driver in 1/16 step mode, which I found does reduce the holding torque (to about 70% as far as I can find out). , and I think possibly that as I fed the countersink in, it was just enough to move it. (but I'm not sure how!)
I also wanted to be able to leave work in the chuck, but with power off, so eventually the brake was tis easiest solution. The one I used is a 24v DC version, intended for use with a NEMA23 motor. Same diameter as the motor, and about 2cms thick overall. It only uses about 250mA to pull it off, so it was easy to switch it using a small power MOSFET driven by one of the Nano pins, and it locks the shaft solid – no worries! It is 'failsafe', in that it has to be powered to remove the brake.
I actually found the mechanics simple and cheap – the most difficult problem was the switching – I wanted to keep it simple, and used a film-type keypad to begin with, which quickly gave up the ghost. A small mechanical keypad was next, but I didn't like that next to the mill with flying swarf, so eventually I used 3 pushbuttons on the controller box – 2 buttons cycle 'up/down' through numbers/menus on the display, and the third starts/stops operations – seems to work for me.
For the size of the work I use it for, there is enough torque to also turn the work against a small (3mm max) milling cutter – I guess you could use full-step operation for more torque, but less accuracy.
Tony – there is no worm/wormwheel on my indexer – the chuck is driven directly by the stepper, with the brake screwed to the front of the stepper and acting on the same shaft. The stepper has 200 full steps/rev, but is run in 1/16 step mode, so has 3200 steps per rev. This is a step size of 0.1125 degrees/step, which is much smaller than I needed. Of course, it means there is not always a full step count for some rotation angles, but I rounded up or down in the calculation to get to the nearest whole number of steps, implying a maximum error of half a step, or 0.05625 degrees – close enough for me. Of course, if you need additional torque to turn a bigger chuck, then you could use gearing, but I didn't want or need the additional complexity, and it would also allow use of full or 1/2 stepping for more torque (or just use a bigger stepper)
I'll be building something along those lines somewhere in the future as I think I can make something easier to use than a dividing head for a lot less money.
Could you point me in the direction of the magnetic brake you used please?
DC Electromagnetic Brake 24V 2.0Nm(283oz.in) for Nema 23 & 24 Stepper Motor
I think its the first one on the page link above.
This is the 'Brake' page, but they do all sort of stepper and servo related stuff (look under 'Products'. I'm sorry, I don't know what the cost to UK will be – I live in Eastern Europe, and delivery was in a couple of days by DHL from Germany.
I mentioned in an earlier post that I used 1/16 step mode, which reduces the holding torque to about 70%. Its worth noting that the step size is very small in this mode (3200 steps per rev with a 1.8 degree motor). If you can live with less (bigger) steps, then you could possibly use say 1/4 step mode, giving 800 steps/rev, and the holding torque would be around 90+%, or even 1/2 Step mode, giving 400 steps/rev. This may avoid the need for the brake – I guess it depends on what you want to use it for.
I also used a NEMA23 motor – a bigger motor frame would have a higher holding torque – I didn't need the size.
Good luck with it (I keep thinking of different things I could do with it just by modifying the software – but so little time)
Sorry – the site software has changed my URL to a "Link" – if you have problems, send a PM.
Bear in mind that stepper accuracy in microstep mode is unlikely to be very good, it will depend on the linearity and basic precision of the motor itself as well as tolerance in the driver. Microstepping is more to get smooth and quiet operation at higher speeds than guarantee higher resolution.
You may have just wrecked the whole 3D router/printing industry!
I have a small 3D Router, and a 3D printer, the controllers of both of them are fixed at 1/16 steps. Of course, accuracy is probably not so 'vital' in these machines, but there are certainly no perceptible measurable or cumulative errors, and I have machined small metal parts on the router.
Given that 1/16 step mode on a 200 step motor produces 3200 steps per rev, then dare I say that single steps never happen in practise. I would guess perhaps that some 'averaging' takes place, but I don't know. I do know that for the indexer I built, I don't need steps of 0.1125 degrees (360/3200) which is what I (should) get with 1/16 steps – its more like steps of multiple degrees – maybe a few hundred steps (perhaps I should have used 1/2 or 1/4 steps). My main need was to make regular steps without having to faff about with index wheels and so on. That said, I haven't been able to detect any measurable errors with my indexer – Perhaps I am wrong, but I would expect this type of microstep error to be cumulative (slipping, perhaps?), but it certainly doesn't seem to be doing that.
I would appreciate your ideas on this – meantime I intend to see what happens with different stepping modes – these will introduce their own errors, because as each step becomes larger, so calculating the number of steps for a given number of degrees will inevitably lead to rounding – bigger steps, bigger rounding errors. This was why I used 1/16 steps in the first instance (I explained that I rounded the number of steps/degree in the software in an earlier post).
The only way I can see round these problems is to use some form of gearing – but I consider that a backward step.
– Perhaps I am wrong, but I would expect this type of microstep error to be cumulative (slipping, perhaps?)
[…]
.
My understanding is that your 200 steps will be ‘accurate’ to a level stated in the the specification of the motor; because they are effectively notches. … but microstepping is analogue in nature and therefore the interpolation between the motor steps is less predictable.
MichaelG.
.
Typical full-step accuracy for general purpose commercial stepper motors is 1.8° +/- 5%
Very interesting, I happened to be reading that same hackaday article last night John.
It looks like the steppers should be decently accurate in microstepping mode with a good driver as longs as they're not under load. So if you move the load without cutting, then put a brake on, perform the cutting operation, break off, move and so forth you should get decent accuracy.
To be truly accurate at higher resolution it seems like you'd have to move to closed loop control with a good encoder and controller. That'd be the next step up though. I think when I design my version I'll build it with a direct drive from a stepper and a manual brake for starters (primarily planning to use it for cutting gears).
It'll be fun to dust off some of the control theory I was taught decades ago and see if I can build a closed loop controller for a DC motor. We worked with one in uni to learn about PID controllers. It was controlled through matlab and we manually tuned the PID. The only prohibitive thing there is the high cost of a (good) rotary encoder).
Routers and printers usually have some reduction between motor and whatever they drive. My CNC mill for example has 5mm ballscrews, a 2:1 reduction; and the usual 200 step motors. CNC lathe has a 1/8" leadscrew, and a 2:1 reduction to the motor; with a 5mm pitch ballscrew on the cross slide directly driven by the motor. The reduction reduces the effect of the stepping error. As those references show the basic step accuracy is typically 5% of 1.8 degrees, whether the step if full or microstep. So on my mill I could expect one full step to be 12.5 +/- 0.625 microns. Using say 1/4 step it would be 3.125 +/- 0.625 microns
The microstep error isn't cumulative provided you don't have stiction etc effects that could give unpredictable movements. For example, when you apply a microstep the torque delta can be very small, and if it isn't large enough to overcome stiction the motor just won't move. Could also be problems with unbalanced loads. Let alone the driver errors. I was a bit dismayed to see that the DRV8825 drivers which are a later generation than the old 4988s actually perform worse!
Where microstepping comes into its own is getting smoother fast movement. I use a stepper to lift the gravity arm of a clock movement and lower it onto the pendulum pallet every minute, via a cam. I'm using an Arduino Nano and wanted to keep the stepping rate down. I started with full stepping and the motor just buzzed and stalled. Eventually went for quite a high microstep ratio which gives much better acceleration and significantly reduces noise level.
I have a Myford dividing head which I've converted to use a stepper. This has a 60:1 reduction in the DH itself, plus 2:1 between the stepper and the worm. From measurements I know that this is accurate to at least 0.1 degrees so far as I can tell. I did think about using a stepper directly but as well as simple dividing I want to do spiral milling (knurls etc) which needs good resolution and accuracy and also rigidity to resist cutting forces. The DH is very good for this but does have backlash which means you need to plan the cutting to use unidirectional rotary motion. Some people use toothed belt reduction between stepper and mandrel to improve resolution but avoid backlash – even better is a harmonic drive but those are much more expensive.
I think think the overall conclusion, for a general purpose rotary axis, is use a reduction for resolution and microstepping for speed and smoothness. Gearing definitely isn't a step back.
I did use a DRV8825 – perhaps I should change that. I did start with an A4988, but the motor took rather more current than it liked so I changed to the DRV8825 – these links show that was a backward step.
I'm not in a position to challenge the results in the link, however I still think that the effects of microstepping are dependant on the application. As I tried to explain earlier, I originally wanted a device which would rotate small objects a specified distance to allow regular drilling (wheel hubs and rims in my case). This does not require a rotation of more than 360 degrees (although it will rotate continuously if required – see my first post).
This means that it is rotating under virtually no load (except for the weight of the chuck) between between programmed halts. As your links appear to indicate, mis-stepping is apparent in all modes. Although I didn't consider this when I built it – I simply used 1/16 mode because I believed that multiple smaller steps would give me finer control. From the figures I noted earlier, I should get 3200 steps per rev, so a step of 1 degree should have 3200/360 = 8.8 steps. In practise, this works fine for me – the thing rotates sufficiently accurately for my purposes, and is locked by a separate brake when it stops, to counter pressure on the workpiece.
For me, its a question of building what sufficed to do the job. Practise has shown me that a purely mechanical dividing head was 'overkill' for what I needed, as would be a closed loop servo system, when this simple device does the job – and other people in this thread seem to have the same experience.
However, you make a good point, so designers should take this into account depending on the functionality required. When time permits, I will try to check its accuracy – the articles you have linked to make me wonder about the accuracy of some of the things produced on 3D printers and routers.
For me, its a question of building what sufficed to do the job. Practise has shown me that a purely mechanical dividing head was 'overkill' for what I needed, as would be a closed loop servo system, when this simple device does the job – and other people in this thread seem to have the same experience.
However, you make a good point, so designers should take this into account depending on the functionality required. When time permits, I will try to check its accuracy – the articles you have linked to make me wonder about the accuracy of some of the things produced on 3D printers and routers.
Directly driving a plain table with a stepper is unusual I think. Most Model Engineers use an Arduino to replace the dividing wheels and clock indicator on an existing Rotary Table. Rotary Tables usually have a built in 60:1 or 90:1 worm drive and its mechanical advantage goes a long way to solving both torque and accuracy problems. There's no need for a brake, and – in practice – it's hard to detect inaccuracies. (Though I'm sure positioning isn't perfect.)
When cutting gears or moving the table through a succession of unusual angles the Arduino removes the need to install Dividing Wheels and – best of all – frees the operator from sussing out the division table, watching the clock arms, and keeping count. The advantage is the computer does all the sums and remembering while the Rotary Table does the mechanical bit without stressing the stepper much. The Arduino makes operations like gear-cutting far less tedious and error-prone.
The disadvantage of a worm driven rotary table is it turns rather slowly, but this is true of any job where dividing wheels are needed.
Designing machines is always an adventure in compromise! I like the promise of mechanical simplicity and low cost offered by a direct drive table, but note the effect on accuracy and the need to add a complicating electric brake. An interesting idea – keep up the good work!
Dave
Noticed you had bother with a membrane keypad. I used one on my controller because they're semi-dirt/wet resistant and are cheap to replace if damaged. Mine's survived so far, but it's not had a proper filthy workshop thrashing – I've managed to keep it clean! I've found testing my efforts thoroughly to be surprisingly difficult. What makes complete sense to me on my Dining Table doesn't always work well in someone else's workshop. Now I'm worried my membrane keypad wasn't a good idea after all…
I did use a DRV8825 – perhaps I should change that. I did start with an A4988, but the motor took rather more current than it liked so I changed to the DRV8825 – these links show that was a backward step.
I built a CNC control for my mini mill and found that it was missing steps. I finally discovered that the steps were missing because the DRV8825 was overheating from the amount of current required and would simply shut down until it cooled a bit, usually just for a few steps. Knowing that power is related to the current and voltage, since current draw was the limiting factor, I increased the drive voltage a bit and now it never misses a step.
Bear in mind that stepper accuracy in microstep mode is unlikely to be very good, it will depend on the linearity and basic precision of the motor itself as well as tolerance in the driver. Microstepping is more to get smooth and quiet operation at higher speeds than guarantee higher resolution.
Microstepping increases the resolution of the system. Torque between full steps is less so positional accuracy due to system stiction gets worse between full steps. Your last point on speed I don't agrree with. Gecko Stepper drives switch from microstepping at low seeds for resolution to full stepping at higher speeds for more torque.
Re the membrane type switch. I have had problems with these in the past – On at least two of them, the top plastic layer apparently became hard and brittle over time, and eventually cracked. One of them was on a heating controller system – at the time I suspected that it was due to the temperature of the room it was in cycling hot and cold (the boiler was also in this room, hence the temperature variations).
However, I later used another one on a borehole pump control system – this was mounted on a box outside – and the same thing happened – in each case it took about a year to fail – the top surface where you press them cracked and flaked away. As I result, I don't trust them any longer, and prefer discrete switches. Of course, this is a pain when I need numerical entry, so I usually end up with an 'Up' button and a 'Down' button which cycle through displayed values, and a third button to initiate whatever action I need.
Some day I might get around to playing with using the proximity sensing capability of the Arduino inputs.
Not sure if this is in the right place, but it might provide some helpful data – clocks, motor feedback systems, Arduino programming, gear-cutting and more. If its wrong, I'm sure a moderator will remove it.
Lots of stuff in the various links scattered around on the site.