Hello,
I'm a student and for a project I have to use the eQEP module for a TMS320F28335 to measure the speed and position of a linear machine (PMSM). The incremental encoder ouputs the signals with frequencies between 10Hz and 100kHz depending on the speed.
I get the measured speed and position for high and low speeds without a problem. But the speed update rate for high frequencies is too slow.
The update rate is the value of the QUPRD-register divided by the clock. For correct measurements I need at least the period QUPRD=1.500.000 and the clock frequency is 150MHz. That means the DPS calculates every 10ms a new speed value. That is quiet slow. Especially after an index event, when the QPOSCNT-register is resettet to get a reference point for the position (position counter reset on index event [PCRM]=00). If I choose QUPRD much smaller like QUPRD=30000, the measured speed isn't usable at all.
For example (diagram):
The machine drives with 0.4m/s (QEPA and QEPB=20kHz) and it passes an index event/refernce point, the measured speed is 0m/s for 20ms (QUPRD=3.000.000), even when it's a lot faster. The frequencies for the PWM signals are 16kHz, so during the 20ms with no measured speed, the DSP outputs 320 (different) calculated PWM values based on the speed to the inverter. But the values are just wrong.
Is there any solution to fix this problem? I appreciate every suggestion and thanks for your help.
Best regards
Arne
Used simplified code fragment:
EQep1Regs.QUPRD = 3000000; if( EQep1Regs.QFLG.bit.UTO == 1 ){ v_fast_1 = (EQep1Regs.QPOSCNT-EQep1Regs.QPOSLAT)*750/3000000; EQep1Regs.QCLR.bit.UTO = 1; }
Measured signals with an external DAC and a scope: