On Wed, 6 Jun 2018, Ralph Stirling wrote:

Date: Wed, 6 Jun 2018 16:41:24 +0000
From: Ralph Stirling <ralph.stirl...@wallawalla.edu>
Reply-To: "Enhanced Machine Controller (EMC)"
    <emc-users@lists.sourceforge.net>
To: "emc-users@lists.sourceforge.net" <emc-users@lists.sourceforge.net>
Subject: [Emc-users] hostmot2 encoder latching

I need to latch encoder counts at the edge of the index
pulse.  The hm2_7i92 encoder hal component has a
"latch enable", "count-latched", and "latch-polarity" pins,
which sound very promising.  There is zero documentation
on these as far as I can find.  Looking at the source code,
I am still confused, and wonder if I'm seeing a bug:

       do_flag(
           &hm2->encoder.control_reg[i],
           index_enable,
           HM2_ENCODER_LATCH_ON_INDEX
       );

       do_flag(
           &hm2->encoder.control_reg[i],
           !index_enable && latch_enable,
           HM2_ENCODER_LATCH_ON_PROBE
       );

       do_flag(
           &hm2->encoder.control_reg[i],
           index_enable || latch_enable,
           HM2_ENCODER_INDEX_JUSTONCE
       );

What I think I want is the INDEX_JUSTONCE mode, but
the "index_enable || latch_enable" doesn't make sense
to me.  That would suggest that either index_enable or
latch_enable pins would set this mode, Anybody (Jeff maybe?)
care to clarify the functionality of this latching capability?

It would be nice if the hostmot2 man page and web docs
could be updated with these pins, which have been around
for quite a while.

Thanks,
-- Ralph

Unfortunately I dont think the latched position or count pins have ever worked that is, the underlying hardware works (its used for homing to index) but the driver does not calculate the proper latched count or position values. There is a single count latch register so any latch function must be shared with index.



Peter Wallace
Mesa Electronics


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to