Part Number: TMS320F28377D
Other Parts Discussed in Thread: CONTROLSUITE
Sir/Madam,
I am referencing your example project for qep speed position estimation. In that project following settings have been done to initialize qep module.
EQep1Regs.QUPRD = 2000000; // Unit Timer for 100Hz at 200 MHz
// SYSCLKOUT
EQep1Regs.QDECCTL.bit.QSRC = 00; // QEP quadrature count mode
EQep1Regs.QEPCTL.bit.FREE_SOFT = 2;
EQep1Regs.QEPCTL.bit.PCRM = 00; // PCRM=00 mode - QPOSCNT reset on
// index event
EQep1Regs.QEPCTL.bit.UTE = 1; // Unit Timeout Enable
EQep1Regs.QEPCTL.bit.QCLM = 1; // Latch on unit time out
EQep1Regs.QPOSMAX = 0xffffffff;
EQep1Regs.QEPCTL.bit.QPEN = 1; // QEP enable
EQep1Regs.QCAPCTL.bit.UPPS = 5; // 1/32 for unit position
EQep1Regs.QCAPCTL.bit.CCPS = 6; // 1/64 for CAP clock
EQep1Regs.QCAPCTL.bit.CEN = 1; // QEP Capture Enable
Now I have a doubt. Since QCLM bit is set to 1, therefore at every unit timeout, a value will from POSCNT will be latched into POSLAT register which is used for calculating speed. Now PCRM bit is also set to 0, that means POSCNT will be reset to 0 on every index pulse. So my doubt is, since there will be multiple periods within a unit time out, isnt it a possibility that wrong speed will be calculated, as there is no synchronization between time out and index pulses.
Example code I am referencing to is located at "C:\ti\controlSUITE\device_support\F2837xD\v210\F2837xD_examples_Cpu1\eqep_pos_speed\cpu01".
Also I have another doubt, in my application code for close loop vector control I have generated theta by integrating speed. And in TI example code for the PMSM sensored vector control, POSCNT is used for generating theta. Now if theta is generated using POSCNT, it will be reset to 0 at every index pulse, which is mechanical theta. And to convert that to electrical theta it is divided by lines of encoder and multiplied with pole pairs. Now my doubt is doing this calculation will only change the peak of theta but how will it change the frequency of theta to electrical frequency.
Regards
Rishabh