Encoder Position Snapshot

cancel
Showing results for 
Search instead for 
Did you mean: 

Encoder Position Snapshot

Jump to solution
400 Views
dh1
Contributor II

Hi

For our motor control application, we use incremental quadrature encoders. Our controllers typically have the ability to "latch" (take a snapshot of) the encoder position, which can happen by using the encoder index or a digital input.

Now we miss a functionality with the i.MX RT's encoder peripheral. We can use the Trigger Pin to take a snapshot of the position. But the Trigger Pin can only react on rising edge, not on falling edge of the signal. Is there any way to react on the falling edge of the signal?

Another attempt would be to use the HOME signal, which can react on both edges. But the HOME Signal can only reset the counter positions, not latch the position at the occurrence of the signal transition.

Is there any way to find out how much the "offset" of the reset operation was? E.g. if the counter position was 1000 at the time of the HOME Signal transition, then the position will be reset to 0.
Is there a way to find out the value 1000 afterwards?

Thanks and best regards, Daniel

0 Kudos
1 Solution
335 Views
FelipeGarcia
NXP TechSupport
NXP TechSupport

Hi Daniel,

As you mentioned trigger pin can only react at rising edge so I don’t think this is possible. The thing that comes to my mind is that you have an external interrupt that when is triggered you manually read counter registers so the holding registers are written with its value. Unfortunately, there is no configuration of the module itself that can perform this.

Regards,

Felipe

View solution in original post

0 Kudos
3 Replies
371 Views
FelipeGarcia
NXP TechSupport
NXP TechSupport

Hi Daniel,

Have you tried using holding registers? Please check below snippet from the RM.

FelipeGarcia_1-1620431015025.png

Best regards,

Felipe

0 Kudos
353 Views
dh1
Contributor II

Hi Felipe

Thanks for your reply.

Yes we are using the holding registers.
We use the TRIGGER pin as this is the only pin which allows to copy the current position to the holding registers. But it only allows to react to the rising edge of the signal. We need to be able to react on both edges.

The HOME and INDEX allow to react on both edges, but they can only reset the current position to 0, not to copy the current position to the holding registers.

We could work around the problem, if we know the "shift value" when the reset to 0 happens. Is there a way to know it?

Thanks and regards,
Daniel

0 Kudos
336 Views
FelipeGarcia
NXP TechSupport
NXP TechSupport

Hi Daniel,

As you mentioned trigger pin can only react at rising edge so I don’t think this is possible. The thing that comes to my mind is that you have an external interrupt that when is triggered you manually read counter registers so the holding registers are written with its value. Unfortunately, there is no configuration of the module itself that can perform this.

Regards,

Felipe

0 Kudos