Encoder Position Snapshot

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Encoder Position Snapshot

跳至解决方案
1,656 次查看
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 项奖励
回复
1 解答
1,591 次查看
FelipeGarcia
NXP Employee
NXP Employee

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 项奖励
回复
3 回复数
1,627 次查看
FelipeGarcia
NXP Employee
NXP Employee

Hi Daniel,

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

FelipeGarcia_1-1620431015025.png

Best regards,

Felipe

0 项奖励
回复
1,609 次查看
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 项奖励
回复
1,592 次查看
FelipeGarcia
NXP Employee
NXP Employee

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 项奖励
回复