How do I use encoder's signal by etimer ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I use encoder's signal by etimer ?

1,399 Views
rogerdai
Contributor II

Hello Sir:

I find MBD_toolbox not having the bolck as follows:

pastedImage_1.png

When I use encoder to get position signal, how do I do in MBD_toolbox? 

Thanks a lot.

Best Regards,

Roger.

Tags (1)
0 Kudos
5 Replies

1,078 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi Roger, 

You can now use the eTimer_configuration and eTimer_capture blocks that offers you a high degree of flexibility in choosing what to do.

Capture.JPG

Hope this helps!

Daniel

0 Kudos

1,078 Views
rogerdai
Contributor II

Hi Daniel:

I found that the capture block is not the function I want.

Will there  upgrade MBD_toolbox version to add CNTR block in the future?

Beacause the encoder IC sends out absolute position's pulses to MCU when encoder IC is reset, but the capture can't catch the pulses.

The attachment is my Model.

Thanks, 

Roger

0 Kudos

1,078 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi Roger, 

I don't think i'm getting what you are trying to do.

So the encoder IC will have 3 outputs: A, B and INDEX

A and B signal are quadrature signals and can help you identify the direction and number of counts.

The INDEX is a signal generated only one per rotation period to signal a rotation completion. In the software you can use the eTimer CAPTURE to get high-to-low or low-to-high transitions of this signal. Have a look at this video starting with 3.20 minute:  Video Link : 7832 

Nonetheless, you may or may not chose to use the INDEX in your algorithm. Since the encoder is a relative type of sensors - you will need to start the movement from a well defined position - usually in industry this is done by aligning the motor rotor with phase A: first you force the rotor to align with B phase and then you polarize the A phase and the rotor will be force to be aligned with that.

Then you start to count the relative counts for A/B signals. To know when a rotation is complete (emulate the INDEX) you can do a MODULO with the number of count per revolution given by your encoder. 

This way there is no need for the third input INDEX

Anyhow - we will consider your feedback in case we will to an update for the MPC5744P toolbox. This request is logged as AST-648

I hope you can figure it out and resolve the application with the actual support level from the Toolbox.

Best regards,
Daniel

0 Kudos

1,078 Views
rogerdai
Contributor II

Thanks your reply.

I'll try to use capture to resolve my problem.

I look forward to seeing the update for the MPC5744P toolbox.

Roger

0 Kudos

1,078 Views
dumitru-daniel_
NXP Employee
NXP Employee

Ok, please keep us posted about your progress. 

Unfortunately i do not have an encoder to test it - but i'm pretty sure you could resolve it with the actual toolbox offerings.

Keep in touch!

Best regards,
Daniel

0 Kudos