Hello all, Gray code is not primarily meant for mechanical switches, but for asynchronous counters. In the case of adding 1 to, say, binary 1111 1111, all the bits have to switch, one after the other, to yield 1 0000 0000 which, in the asynchronuos case, takes 8 times the time of a single carry operation. Imagining a 24 bit counter this can amount to a very large amount of time with the risk of losing counts in the meantime. So, the maximum count frequency depends on wether a carry operation is due or not. The Gray code avoids this at the cost of an odd and rather unusual decoding scheme. Greetings form Germany Peter Blodow
At 07:39 10.03.2009, you wrote: >On Tue, 2009-03-10 at 01:54 -0400, Stephen Wille Padnos wrote: >... snip > > To do that, you need to use weighted_sum. > > There is no gray code converter at the moment, though it should be > > pretty easy to write one. > > > > - Steve > >Steve: Oops, your right, I used weighted_sum on my Hardinge tool >changer. >... >### TURRET ### ># create signals for tool loading loopback >linkpp iocontrol.0.tool-prepare iocontrol.0.tool-prepared >linkpp iocontrol.0.tool-change turret.0.position-change >linkpp turret.0.position-changed iocontrol.0.tool-changed > ># decode turret encoder inputs >net ones ppmc.0.din.06.in wsum.0.bit.0.in >net twos ppmc.0.din.07.in wsum.0.bit.1.in >net fours ppmc.0.din.08.in wsum.0.bit.2.in >net eights ppmc.0.din.09.in wsum.0.bit.3.in ># wsum.N.hold bit in > >net TurretCurrentPosition wsum.0.sum turret.0.position-current >net TurretRequestedPosition iocontrol.0.tool-prep-number >turret.0.position-requested >... > > >I checked out gray code on wikipedia and the advantage of gray seems to >be with using mechanical switches to sense position. With gray, you >don't need to wait for switches to settle to get a valid code, since >only one switch changes between positions. I'll be using clock bits to >control when the bits get read, so I'm tending toward using binary, or >the magnetic analog sensor. >----------- >Kirk >http://www.wallacecompany.com/machine_shop/ > > > >------------------------------------------------------------------------------ >_______________________________________________ >Emc-users mailing list >[email protected] >https://lists.sourceforge.net/lists/listinfo/emc-users ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
