Hi Andy, Steve and Dave Thanks for the replies, I see from the initials that you (Andy) are the person who posted this solution in the first place.
I didn't realise that the last line had wrapped, the spindle-index-enable line isn't wrapped normally, must have happened when pasting into the email. It will be a couple of days before I can try this out properly so I will come back to you then. The timing magnets will not be perfecting in phase. Mach only requires 1 long pulse and 3 shorter ones, which I achieved with different sizes. The time between is not critical and whilst they will be pretty much 90degrees apart, it will not be exact I do have a small 6 channel encoder available, but its resolution is 2500, which even I with my limited knowledge thought might be too fine. My max speed is 2400rpm but normal working speed does not tend to go above 1200 and threading not above 600, so do you think this might be a feasible? It requires a line driver circuit, which is what I assume Dave is refering to, I did have a schematic for one somewhere. regards Mick Date: Fri, 23 Apr 2010 18:00:55 +0100 From: Andy Pugh <[email protected]> Subject: Re: [Emc-users] Single index pulse threading To: "Enhanced Machine Controller (EMC)" <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1 On 23 April 2010 17:12, Schooner <[email protected]> wrote: > > loadrt encoder num_chan=1 > > addf encoder.update-counters base-thread > > addf encoder.capture-position servo-thread > > setp encoder.0.position-scale 1 > > net spindle-position encoder.0.position-interpolated => motion.spindle-revs > > net spindle-velocity encoder.0.velocity => motion.spindle-speed-in > > net spindle-index-enable encoder.0.index-enable <=> > > motion.spindle-index-enable > > net spindle-pulse-and-index parport.0.pin-11-in => encoder.0.phase-A > > encoder.0.phase-Z ;set to correct pin. " > > > > /I am afraid I do not understand how encoder.0.phase-Z could be > > connected to anything, there is only one index pulse. > You can use the same p-port pin to drive more then one "logical pin" in HAL. In this case you need to link the encoder A-phase to your pin-11 so that EMC can calculate a spindle speed, and also the Z-phase (which is the index pulse) to the same pin. > > I included the above into my .hal minus the last line. > You need the last line. Note that it is actually part of the line above but has line-wrapped. There is another troublesome wrap in the index-enable line. > > If I rotate the spindle manually, I get a positive indication every rev, > > so maybe the hal monitor > > display just cannot update quickly enough. > HAL monitor doesn't, know. For transient signals you should use Halscope, it works a lot better. It is one of the most useful tools in EMC in fact. It is in the same menu as the Hal Config and Hal meter. > > Have I missed something or is the answer that you cannot thread with > > just an index pulse and you must have a timing pulse too, connected to > > encoder.0.phase.Z perhaps?? > Yes, you need both, but they can be from the same pickup and the same parallel port line. Incidentally, I think you have speed and no index rather than the other way round. I think you might also need to add a line: setp encoder.0.counter-mode 1 to the HAL to tell it to not look for the B-phase. Details here: http://www.linuxcnc.org/docview/html//man/man9/encoder.9.html > > Would my 4 magnet set-up through a second pickup provide that, if a > > timing pulse is required , or is that too coarse? > More pulses is better, but a few inaccurately-times pulses is probably worse than 1PPR for introducing errors to the spindle velocity calculation. -- atp ------------------------------ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
