[Emc-users] spindle index, again - now actually got it to work with spindle-synced motion
a while ago I described how I added a simple optical encoder wheel to my lathe. Meanwhile, I eventually got it to work with G33 threading, but it wasnt as straightforward as I would have believed, so I thought I'd describe my experience. My first attempt was to use the encoder component as described in the Spindle Feedback example (User Manual chapter 34). Trying that with the threading.ngc example failed miserably - the synced-motion threading part was everything but synchronized - heavy speed variations in the Z axis (see http://www.youtube.com/watch? v=efiNyzhGFbQ , starting around second 27). I traced the problem to serious noise on the encoder.0.velocity signal (red signal in http://mah.priv.at/gallery2/main.php?g2_itemId=69102). I first tried to feed it through a lowpass (white signal) but that a) didnt work either and b) massaging a feedback signal would be counterproductive to start with. I admit that the codewheel finish left to be desired - I managed to glue it onto the pulley with maybe 0.5mm runout (the outer diameter is 18cm). And the disk isnt perfectly flat on the pulley - too much glue here and there, so the disk-sensor distance varies as well. These inaccuracies cause periodic fluctuations in the index signals, the relation to the spindle revolution can clearly be seen (note blue index pulse). So that introduced some phase noise on the signal, and that in turn causes the position estimate to fluctuate wildly, hence causing the strange Z move pattern. Adjusting the sensors and pulley brought some improvement but not sufficient. So I played around with encoder options. The fix was finally to turn off x4-mode and use encoder.0.position- interpolated instead of encoder.0.position to feed into motion.spindle- revs. The noise is pretty much gone (http://mah.priv.at/gallery2/main.php?g2_itemId=69105 ) - except for the wobble introduced by the runout of the codewheel (which btw can be clearly heard from the Z stepper during the threading run :-). The setup works fine for threading now, but I'll eventually change this to a more precise encoder wheel. hal of test setup is at: http://mah.priv.at/cgi-bin/viewvc.cgi/emc-drehbank-test/drehbank-k12a.hal?revision=1.6root=CVSview=markup out of curiosity - anybody got spindle-synced motion with *just* an index puls (1ppr) to work? -Michael btw - I'm stunned by EMC2's capabilities - great piece of work, folks! -- ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] spindle index, again - now actually got it to work with spindle-synced motion
On Saturday 25 July 2009, Haberler Michael wrote: a while ago I described how I added a simple optical encoder wheel to my lathe. Meanwhile, I eventually got it to work with G33 threading, but it wasnt as straightforward as I would have believed, so I thought I'd describe my experience. My first attempt was to use the encoder component as described in the Spindle Feedback example (User Manual chapter 34). Trying that with the threading.ngc example failed miserably - the synced-motion threading part was everything but synchronized - heavy speed variations in the Z axis (see http://www.youtube.com/watch? v=efiNyzhGFbQ , starting around second 27). I traced the problem to serious noise on the encoder.0.velocity signal (red signal in http://mah.priv.at/gallery2/main.php?g2_itemId=69102). I first tried to feed it through a lowpass (white signal) but that a) didnt work either and b) massaging a feedback signal would be counterproductive to start with. I admit that the codewheel finish left to be desired - I managed to glue it onto the pulley with maybe 0.5mm runout (the outer diameter is 18cm). And the disk isnt perfectly flat on the pulley - too much glue here and there, so the disk-sensor distance varies as well. These inaccuracies cause periodic fluctuations in the index signals, the relation to the spindle revolution can clearly be seen (note blue index pulse). So that introduced some phase noise on the signal, and that in turn causes the position estimate to fluctuate wildly, hence causing the strange Z move pattern. Adjusting the sensors and pulley brought some improvement but not sufficient. So I played around with encoder options. The fix was finally to turn off x4-mode and use encoder.0.position- interpolated instead of encoder.0.position to feed into motion.spindle- revs. The noise is pretty much gone (http://mah.priv.at/gallery2/main.php?g2_itemId=69105 ) - except for the wobble introduced by the runout of the codewheel (which btw can be clearly heard from the Z stepper during the threading run :-). The setup works fine for threading now, but I'll eventually change this to a more precise encoder wheel. There is a bit of python code on the wiki that when fed to a 3 axis mill, will carve a quite good encoder wheel from a sheet of alu, say about 16 to 18 gauge. I took that and modified it to fit the much smaller spindle, trapped between the bearing adjuster nuts at the left end of the spindle of my 7x12. I also reduced the number of holes so the hole to space was about 50%, I think in half from that code. And used a 1/16 diameter end mill and several passes so as not to push the light alu out of shape or out of flat. It is on the lathe now, and I might have it working but when I built the interrupter opto assembly, I thought I would hook it up and test it while laying on the table, and due to a lack of docs on the opto unit, apparently hooked it up in reverse polarity blew all 3 of them. So now I need to get some fresh ones, with a smaller air gap, and make it again. Bummer. So many projects, so little time left. hal of test setup is at: http://mah.priv.at/cgi-bin/viewvc.cgi/emc-drehbank-test/drehbank-k12a.hal?r evision=1.6root=CVSview=markup out of curiosity - anybody got spindle-synced motion with *just* an index puls (1ppr) to work? Work, maybe. Reliably? Very doubtful. -Michael btw - I'm stunned by EMC2's capabilities - great piece of work, folks! So am I, amazed at what it can do if I can just write the code, but I'm usually yelling for help on IRC. Dunno what I'd do without these guys. -- ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users -- Cheers, Gene There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. -Ed Howdershelt (Author) The NRA is offering FREE Associate memberships to anyone who wants them. https://www.nrahq.org/nrabonus/accept-membership.asp Human kind cannot bear very much reality. -- T.S. Eliot, Four Quartets: Burnt Norton -- ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
[Emc-users] spindle index, once more
my lathe was lacking a spindle index sensor and quadrature encoder, so I built one as follows: The code rings are printed on plain paper with an inkjet printer, and laminated into a plastic pouch; then cut with a scissor and glued to the spindle pulley (with some pressure so as to get a reasonably flat surface). The pulley on my lathe is 18cm in diameter and has about 2cms wide space for the code rings. Laminating the paper into the a plastic pouch protects the printout very well against oil and cooleant. The sensor are reflex couplers - I had CNY70's at hand, so I used those. The schematic is unspectacular: http://static.mah.priv.at/cnc/index.pdf . The couplers are mounted at about 1.5mm distance from the codewheel. - edit codewheel parameters in the Postscript source file to your liking: http://static.mah.priv.at/cnc/codewheel.ps - the parameters are reasonably documented. Pictures: http://mah.priv.at/gallery2/main.php?g2_itemId=68003 -Michael -- ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] spindle index, once more
2009/6/30 Haberler Michael mai...@mah.priv.at: The code rings are printed on plain paper with an inkjet printer, and laminated into a plastic pouch Interesting. When I tried a similar approach using clear tape I found that the reflectivity of the tape in the frequency range of the detectors was so high that the underlying colour was irrelevant. Is there any sign of interference from your VFD on the sensor pulses? I am finding that a bit of a problem. -- atp -- ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] spindle index, once more
On Tue, 30 Jun 2009 16:09:45 +0100, you wrote: Is there any sign of interference from your VFD on the sensor pulses? I am finding that a bit of a problem. Andy - are you sure it's from the VFD? I'm getting the some jitter even with the VFD powered off. Set up a spindle speed meter as per page 133 integrator manual, meter kicks randomly here with everything powered off? Steve Blackmore -- -- ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] spindle index, once more
Am 30.06.2009 um 17:09 schrieb Andy Pugh: 2009/6/30 Haberler Michael mai...@mah.priv.at: The code rings are printed on plain paper with an inkjet printer, and laminated into a plastic pouch Interesting. When I tried a similar approach using clear tape I found that the reflectivity of the tape in the frequency range of the detectors was so high that the underlying colour was irrelevant. I didnt try different colours but tried b/w on paper versus black stripes on a transparent slide, so the reflection would come from the aluminum pulley. The latter gave somewhat higher voltage swings on the coupler's collector, but the glue used to attach the ring would deteriorate things again (and dissolve the ink if glued onto the pulley without laminating), so I settled for the paper variant. Laser printers do give worse results than inkjet. The pouches came with the laminator. I mounted the sensors quite close so they'd focus on the paper and not the reflective surface (and due to lack of space :-). Angular displacement turned out to be fairly uncritical. Is there any sign of interference from your VFD on the sensor pulses? I am finding that a bit of a problem. no, actually not. In fact the cable is unshielded but I'm going to change that in the final setup. -Michael btw - there are two flavours of CNY70 in the wild, and some have collector and emitter reversed - make sure to identify the manufacturer and get the proper data sheet. -- ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] spindle index, once more
2009/6/30 Steve Blackmore st...@pilotltd.net: Andy - are you sure it's from the VFD? Yes, pretty much. The initial problem was with the limit switches nuisance-tripping, and that only happened with the lathe spindle turning, not with the milling spindle (which is on a DC motor). It even seems to only really be a problem at a certain small range of (lathe) spindle speeds too. -- atp -- ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] spindle index, once more
On Jun 30, 2009, at 3:26 PM, Haberler Michael wrote: Am 30.06.2009 um 17:09 schrieb Andy Pugh: 2009/6/30 Haberler Michael mai...@mah.priv.at: The code rings are printed on plain paper with an inkjet printer, and laminated into a plastic pouch Interesting. When I tried a similar approach using clear tape I found that the reflectivity of the tape in the frequency range of the detectors was so high that the underlying colour was irrelevant. I didnt try different colours but tried b/w on paper versus black stripes on a transparent slide, so the reflection would come from the aluminum pulley. The latter gave somewhat higher voltage swings on the coupler's collector, but the glue used to attach the ring would deteriorate things again (and dissolve the ink if glued onto the pulley without laminating), so I settled for the paper variant. Laser printers do give worse results than inkjet. The pouches came with the laminator. I mounted the sensors quite close so they'd focus on the paper and not the reflective surface (and due to lack of space :-). Angular displacement turned out to be fairly uncritical. Is there any sign of interference from your VFD on the sensor pulses? I am finding that a bit of a problem. no, actually not. In fact the cable is unshielded but I'm going to change that in the final setup. -Michael btw - there are two flavours of CNY70 in the wild, and some have collector and emitter reversed - make sure to identify the manufacturer and get the proper data sheet. Since you have an aluminum pulley you could anodize it then etch the lines on it much in the same manner you would etch a circuit board. IIRC HCl i.e hydrochloric acid works well if your resist will take it. I used to label aluminum panels by a deep etch of the letters then fill with colored epoxies. :-) HTH Dave -- ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users -- ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Spindle Index
If you make a disk, the number of slots per revolution will be limited to something like 30kHz/3k RPM = 10 Note the common thinko here: 3k RPM is not the same as 3k RPS. 3kRPM = 50 RPS, so if you assume 30 kcounts/sec, you have 3 Hz / 50 = 600 counts/rev to play with. *%$# it, I've been doing this all day. Thanks for correcting me. Someone might have taken it as being correct. Question everything seems to be good advise. Plus, writing out your units in equations. Or you could use the GNU 'units' program which is available for windows [1] or any linux distribution, [2] like so: $ units 30kHz/3krpm 1/rev * 600 I would think 50 slots per revolution would be plenty, making 200 quadrature counts per revolution, so with the correction, we go from being on the edge to being well within limits (10 kHz (?)). For Penance, I should build an encoder and test it. Let's see, a 3 disk is ~ 9 in circumference, 9/50 = .180 slot width, piece of cake. Although, I seem to remember someone has a bright yellow lathe with a disk like this. It also works in reverse: $ units 3krpm*50*4/rev kHz * 10 Now, isn't that handy? -fenn [1]: http://gnuwin32.sourceforge.net/packages/units.htm [2]: 'apt-get install units' or http://ftp.gnu.org/gnu/units/units-1.87.tar.gz - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Spindle Index
Kirk Wallace wrote: On Sun, 2008-03-09 at 16:29 -0700, Curtis W. Moore wrote: If I added pulses can it be done? My encoder is just a homebuilt opto switch. Cutting out a new wheel with more slots/holes would be trivial. Can EMC thread with just one train of pulses? Ie use just one pin of the parallel port? Just in case, the parallel port is fairly limited in speed. I am guessing 20 to 30 kHz is maximum. If you make a disk, the number of slots per revolution will be limited to something like 30kHz/3k RPM = 10 [snip] Note the common thinko here: 3k RPM is not the same as 3k RPS. 3kRPM = 50 RPS, so if you assume 30 kcounts/sec, you have 3 Hz / 50 = 600 counts/rev to play with. - Steve - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Spindle Index
On Mon, 2008-03-10 at 22:38 -0400, Stephen Wille Padnos wrote: Kirk Wallace wrote: On Sun, 2008-03-09 at 16:29 -0700, Curtis W. Moore wrote: If I added pulses can it be done? My encoder is just a homebuilt opto switch. Cutting out a new wheel with more slots/holes would be trivial. Can EMC thread with just one train of pulses? Ie use just one pin of the parallel port? Just in case, the parallel port is fairly limited in speed. I am guessing 20 to 30 kHz is maximum. If you make a disk, the number of slots per revolution will be limited to something like 30kHz/3k RPM = 10 [snip] Note the common thinko here: 3k RPM is not the same as 3k RPS. 3kRPM = 50 RPS, so if you assume 30 kcounts/sec, you have 3 Hz / 50 = 600 counts/rev to play with. - Steve *%$# it, I've been doing this all day. Thanks for correcting me. Someone might have taken it as being correct. Question everything seems to be good advise. Plus, writing out your units in equations. I would think 50 slots per revolution would be plenty, making 200 quadrature counts per revolution, so with the correction, we go from being on the edge to being well within limits (10 kHz (?)). For Penance, I should build an encoder and test it. Let's see, a 3 disk is ~ 9 in circumference, 9/50 = .180 slot width, piece of cake. Although, I seem to remember someone has a bright yellow lathe with a disk like this. -- Kirk Wallace (California, USA http://www.wallacecompany.com/machine_shop/ Hardinge HNC lathe, Bridgeport mill conversion, doing XY now, Zubal lathe conversion pending) - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Spindle Index
Curtis W. Moore wrote: I have been using Turbocnc as a control on my lathe. Turbocnc need just one pulse per rev to to lathe threading. Is there a way to do this with EMC2? Not a the moment. Many folks (me among them) believe that you really need quite a few counts per revolution to make good threads. If you only have one pulse per rev, you are counting on the spindle to hold exactly the same speed over each revolution, without varying even a tiny bit under cutting load. That said, lots of people get acceptable results using one count per revolution with other software. It is technically feasible to write a HAL component that takes a once-per-rev index pulse and generates spindle position feedback that looks like a higher resolution encoder. This will work ONLY if the spindle holds a constant speed over many revolutions. If somebody writes that component, EMC could use it to do once-per-rev threading, with the understanding that the thread quality is only going to be as good as the spindle speed stability. Regards, John Kasunich - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Spindle Index
If I added pulses can it be done? My encoder is just a homebuilt opto switch. Cutting out a new wheel with more slots/holes would be trivial. Can EMC thread with just one train of pulses? Ie use just one pin of the parallel port? --- John Kasunich [EMAIL PROTECTED] wrote: Curtis W. Moore wrote: I have been using Turbocnc as a control on my lathe. Turbocnc need just one pulse per rev to to lathe threading. Is there a way to do this with EMC2? Not a the moment. Many folks (me among them) believe that you really need quite a few counts per revolution to make good threads. If you only have one pulse per rev, you are counting on the spindle to hold exactly the same speed over each revolution, without varying even a tiny bit under cutting load. That said, lots of people get acceptable results using one count per revolution with other software. It is technically feasible to write a HAL component that takes a once-per-rev index pulse and generates spindle position feedback that looks like a higher resolution encoder. This will work ONLY if the spindle holds a constant speed over many revolutions. If somebody writes that component, EMC could use it to do once-per-rev threading, with the understanding that the thread quality is only going to be as good as the spindle speed stability. Regards, John Kasunich - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Spindle Index
Curtis W. Moore wrote: If I added pulses can it be done? My encoder is just a homebuilt opto switch. Cutting out a new wheel with more slots/holes would be trivial. Can EMC thread with just one train of pulses? Ie use just one pin of the parallel port? Nope. There MUST be a one pulse per rev index channel, so that each threading pass can start at the same place. The additional pulses are used for to control the motion once each pass has started. As I mentioned, they could be faked if we were to write a HAL component to do that. But the one-per-rev pulse is critical. Regards, John Kasunich - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Spindle Index
Curtis W. Moore wrote: If I added pulses can it be done? My encoder is just a homebuilt opto switch. Cutting out a new wheel with more slots/holes would be trivial. Can EMC thread with just one train of pulses? Ie use just one pin of the parallel port? Right now it is set up to use a standard quadrature encoder with index, so that requires 3 signal pins. Theoretically, it can be done with two signals if you already know the direction and won't be reversing the spindle. Jon - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Spindle Index
On Sun, 2008-03-09 at 16:29 -0700, Curtis W. Moore wrote: If I added pulses can it be done? My encoder is just a homebuilt opto switch. Cutting out a new wheel with more slots/holes would be trivial. Can EMC thread with just one train of pulses? Ie use just one pin of the parallel port? Just in case, the parallel port is fairly limited in speed. I am guessing 20 to 30 kHz is maximum. If you make a disk, the number of slots per revolution will be limited to something like 30kHz/3k RPM = 10 slots (?). Like John said, you should have two channels, one for index, another for A and B. You can get A and B from one channel of slots by offsetting the B sensor by 1/2 slot spacing. For more slots or speed, I think a Pluto servo card would be an inexpensive solution. -- Kirk Wallace (California, USA http://www.wallacecompany.com/machine_shop/ Hardinge HNC lathe, Bridgeport mill conversion, doing XY now, Zubal lathe conversion pending) - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users