Hi, which module have you been trying to use? The software Encoder module or the QDC module? Both support the index pulse detection and encoder count latching so LinuxCNC can acquire the index position count.
Hi.
QDC.
The encoder_raw code is good and there are only hardware problems (optocouplers and RC filters cut the bandwith).
But this is very bad idea to send encoder's index pulse by ethernet.
Let's make calculations.
3000 rpm and 1 ms base_thread is 18 degrees accuracy - not acceptable.
The solution is send not index, but raw_count lathed at encoder's index edge interrupt routine.
There is in your code, line 321 in qdc.cpp file:
this->indexCount = ENC_GetPositionValue(this->encBase);
But there is no indexCount hal pin...
In the fact, we don't need receive index pulse at component side, because change of indexCount means index was betwen last and present data transmision.
So we can update indexCount at every encoder's index edge, but use them only if hal index_enable pin is true. (look at my code).
I tried use raw_count and index pins connected to PRUencoder module. Sometimes it works, mostly not.
But even if it works, PRUencoder resets position to zero at received index, not at real index.
In my code, position is reset not to zero, but to
pos = (fb.raw_encoder - latched_enc) / pos_scale;
(raw_encoder may be not equal latched_enc)
So there is no delay.
In this case I not need PRUencoder, because I move pos and vel calculations to my component.