On Mon, Aug 3, 2015, at 04:19 AM, Gene Heskett wrote:
> > The discussion is nice, but it still doesn't get me a signal I can strobe > the .hold lines with. In my first reply to Andy I also included something aimed at you: >> Gene: >> >> If you XOR the two quadrature signals together you'll get one >> edge (rising or falling) on every transition. >> >> The HAL oneshot component can be configured to produce >> a pulse on both rising and falling edges. >> Although now I see that you aren't using the software encoder counter, you have a 5i25. So that means the individual quadrature signals don't exist in HAL and what I described won't work. Which raises the question: how fast are your quadrature signals? If you are using a hardware encoder counter because your signals are too fast to count in software, then your scheme is doomed from the start. If they are too fast for HAL to count, they are also too fast for HAL to do the summation, etc, on every quadrature edge (or every fourth edge). Have you actually looked at a halscope trace of the velocity feedback using the 5i25 counter with the spindle running at your expected min and max speeds? Do you really know how bad the jitter is, and what frequency it is jittering at? Is the dominant jitter frequency one cycle per slot, or one cycle per revolution, or something else? I don't remember every detail of every message about this encoder project. Can you repeat the basics: 1) what is the lowest expected operating speed 2) what is the highest expected operating speed 3) how many slots on the wheel Thanks, John > This is what I have written so far: > > gene@GO704:~/linuxcnc/configs/GO704fast$ cat encoder_filter.hal > # this is a sample outline of an encoder filter to reduce noise from > # imperfections in in the optical disk, and from sample quantization. > loadrt sample_hold names=enc0,enc1,enc2,enc3 > loadrt sum2 names=sum01,sum23,sumenc > # arrange these to save the previous modules state, > # otherwise it cascades thru in one cycle > addf enc3 servo-thread # so it saves enc2's output > addf enc2 servo-thread # so it saves enc1's output > addf enc1 servo-thread # so it saves enc0's output > addf enc0 servo-thread # so it saves encoder velocity > addf sum01 servo-thread # now total it up > addf sum23 servo-thread # ditto > addf sumenc servo-thread # ditto > setp sumenc.gain0 .25 # scale it back to unity > setp sumenc.gain1 .25 # scale it back to unity > net encfilter_in hm2_5i25.0.encoder.00.velocity-out enc0.in > # feed enc0 > net filter-1 enc0.out enc1.in sum01.in0 # link > output > net filter-2 enc1.out enc2.in sum01.in1 # link > output > net filter-3 enc2.out enc3.in sum23.in0 # link > output > net filter-4 enc3.out sum23.in1 > # link output > net filter-5 sum01.out sumenc.in0 > # put it all together > net filter-6 sum23.out sumenc.in1 > # put it all together > net spndl-velocity sumenc.out > # to where ever needed > > This of course needs to be broken up and inserted in the main hal file in > the appropriate locations. So I'll setp the .hold lines for all (false) > thru which should give the desired shift if the addf orders are > reversed. > > The manpage for sample_hold make no suggestion as to how to handle the > hold/sample signal. Concise is nice, but not when it leaves out > important data. > > Anyway, its the middle of the night & I need some more z's. > > Thanks guys. > > Cheers, Gene Heskett > -- > "There are four boxes to be used in defense of liberty: > soap, ballot, jury, and ammo. Please use in that order." > -Ed Howdershelt (Author) > Genes Web page <http://geneslinuxbox.net:6309/gene> > > ------------------------------------------------------------------------------ > _______________________________________________ > Emc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-users -- John Kasunich [email protected] ------------------------------------------------------------------------------ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
