New Lathe build encoder index pulse stopped working

More
09 Sep 2019 12:50 #144598 by pl7i92
it may look like this with no other parts just use the phasa A for a counter and compare if it eqals it is your REV signal
loadrt encoder num_channel=1
loadrt comp count=1
addf encoder.update-counters base-thread
addf comp.0 base-tread
addf encoder.capture-position servo-thread
setp encoder.0.counter−mode 1
net encscale encoder.0.position-scale [JOINT_yourscale]INPUT_SCALE
net encscale comp.0.in1

net enc0A encoder.0.phase-A <= parport.0.pin-10-in

net enccomp encoder.0.position comp.0.in0

net equenccomp comp.0.equal #1 Rev

Please Log in or Create an account to join the conversation.

More
17 Sep 2019 00:16 #145352 by andypugh

if abs(encoder.count mod encoder.position-scale) <1 index-Z = 1
in some kind of pseudo-code should always give a signal once every turn no matter direction. But I couldn't find a "mod" hal component.


For power-of-two encoders you could just watch a single bit of the binary number:
linuxcnc.org/docs/2.7/html/man/man9/bitslice.9.html

Writing a simple HAL component is very easy, if you know any C at all.

linuxcnc.org/docs/2.7/html/hal/comp.html

Your component would be about as simple as the 15.2 sincos example there.

Please Log in or Create an account to join the conversation.

Time to create page: 0.093 seconds
Powered by Kunena Forum