Interface blocks for incremental encoder or resolver to be used in DevKit-MPC5744P Rev. E

cancel
Showing results for 
Search instead for 
Did you mean: 

Interface blocks for incremental encoder or resolver to be used in DevKit-MPC5744P Rev. E

716 Views
eCarMaker
Contributor III

Hello

I want to use DevKit-MPC5744P Rev. E, DevKit MotorGD and Linix motor (45ZWN24-40), which have resolver or incremental encoder for speed control of PMSM.

Do you have any Simulink file which handels the position and speed measurements using resolver and encoder using MPC5744P, Rev. E?

Could you please provide the files for Rev. E with FreeMaster GUI.

Thanks so much for your support in advance!

eCarMaker

0 Kudos
6 Replies

701 Views
adriantudor
NXP Employee
NXP Employee

Hello @eCarMaker ,

Unfortunately, we don't have a complete example as you request, but as a starting point, you can use this model that configures the mcu peripheral to use a motor encoder. 

We use Etimer in Quadrature count mode and we count the pulses at a fixed period of time. And from here you can calculate the motor speed and position.

 

Best regards,

Adrian

0 Kudos

521 Views
eCarMaker
Contributor III

Thanks Adrian,

my goal to control a PMSM motor with incremental Encoder ( 4000 pulses per mechanical rotation)

 PTA0, PTA1 are connected for ENC A and ENC B respecively. 

First of all I tried using the same setting you set in eTimer_config Block which you provieded in  EncoderMPC5744P_RevE.zip. 

The counter of eTimer is increasing from 0 to 65535 ((2^16) -1 ). Using the same setting the motor needs to rotate 16,38 mechanical rotations (65535/ 4000 pulses = 16,38) to reset the counter of eTimer. My expectation is to reset the counter of eTimer every mechanical rotation.

I did as described in AN4561, page 11 but unfortunately, no success.

Maximum number of Edges of 4 x 4000=16000
COMP1= (16000/2)-1= 7999 DEC ==> 0x1F3F
COMP2= 16000/2= -8000 DEC ==> 0x1F40 

Could you please help here and many thanks in advance!

0 Kudos

670 Views
eCarMaker
Contributor III

Hello Adrian, 

Thanks for your answer.

Is there any resolver block if the servomotor has a resolver instead of incremental encoder?

Thanks in advance!

 

0 Kudos

663 Views
adriantudor
NXP Employee
NXP Employee

Hello @eCarMaker ,

 

In MBDT there is no such resolver block, but if you use Matlab 2021b or newer, you can find a "Resolver Decoder" block in the "Motor Control Blockset" addon. I think you can use this block with MBDT.

 

Best regards,

Adrian

0 Kudos

617 Views
eCarMaker
Contributor III

Hello Adrian,

Thanks for your answer.

Do you mean this block, which introduced in Matlab 2020a  Resolver Decoder ?

I am wondering which interfaces in DevKit-MPC5744P Rev. E can be used as an excitation signal for the resolver. 

 

Best Reagrds

0 Kudos

603 Views
adriantudor
NXP Employee
NXP Employee

Hello @eCarMaker,

Do you mean this block, which introduced in Matlab 2020a  Resolver Decoder ?

Yes, I'm talking about this one.

 

You can use the SGEN peripheric. To understand this signal generator peripheric, I recommend starting from the "sgen_mpc574xp" example (you can find it in MPC57xx MBDT). 

Be very careful that the output current of this peripheric is not so strong (max 200uA according to the "MPC5744P Data Sheet" file). If your sensor will need a higher current or a higher peak-to-peak voltage, then you must use an additional electronic circuit (like an amplifier).

 

Best regards,

Adrian

0 Kudos