I don't know what you mean by "set the index pin as general gpio" if the 
hpg encoder hardware pins are setup as they should be you shouldn't have a 
problem.

index-enable doesn't reset counts, if "arms" the index-pin itself to reset 
the counts and the index-enable pin on the next index pulse.

So setp index-enable true, then physically trigger index pin > index-enable 
will go false and counts will reset. If index-enable is staying true, then 
the index pin is not getting triggered. You will likely never be able to 
see the index pin from an encoder go true in hal, it is too short for a 
servo-thread to sample usually. The encoder firmware (HPG) will catch it 
which is why the index-enable pin exists. You can't trigger a reset based 
on the index-pin itself being read from hal, you enable the encoder 
firmware to reset itself when it sees the index.

On Saturday, January 4, 2020 at 1:58:49 PM UTC-5, Aurelien wrote:
>
> I have setup the pru index pin as a general gpio input and test from 
> halcmd show pin = work fine.
>
> But i never see some reset for count vs rawcount when this pin is set for 
> pru index else never see some changing status False/True.
>
> setp hpg.encoder.00.chan.00.A-pin 0         # 931 
> setp hpg.encoder.00.chan.00.B-pin 1         # 929 
> setp hpg.encoder.00.chan.00.index-pin 2     # 930
>
> P9_29 pruin # ENCyB
> P9_30 pruin # ENCyI
> P9_31 pruin # ENCyA
>
>
> net spindle-index-enable hpg.encoder.00.chan.00.index-enable <=> 
> motion.spindle-index-enable
> or 
> net spindle-index-enable <= motion.spindle-index-enable
> net spindle-index-enable <=> hpg.encoder.00.chan.00.index-enable
> or
> #setp motion.spindle-index-enable 1
>
>
> Is there something i can try for check if this index work correctly ?
>
> Br
>

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/f8ab5fac-b04e-4394-b017-a2711d950009%40googlegroups.com.

Reply via email to