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!
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.
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!
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.
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).