Dear Sir, I am working on 3 Phase AC Induction Motor in which I coupled a QEP Encoder. I have to use only two lines of encoder because in actual motor there is only two line to measure the speed.
The Encoder having 1024 Lines. I have taken the existing example code and I changed some of the variables according to my requirement as below: Base RPM = 3000, QEP lines = 1024.
I fed these two signal to control card and runs the code but what I observed that the RPM speed is varying more them 50 rpm. I am not getting the stable speed at all.
Please suggest me that what would be the best configuration for an eQEP module for me.
Is this the hardware issue or my sampling is wrong. I also send the configuration I did.
// .9999 / 4096 converted to IQ26 fixed point format
#define MECH_SCALER 16383
// 2 pole pairs in this example
#define POLE_PAIRS 3
// Angular offset between encoder and Phase A
#define CAL_ANGLE 0
// See Equation 5 in eqep_ex2_calculation.c (4096*3000)
#define SPEED_SCALER ((((uint64_t)32 * DEVICE_SYSCLK_FREQ / 64) * 60) / (12288000))
// Base/max rpm is 6000rpm
#define BASE_RPM 3000
void initEQEP(void)
{
//
// Configure the decoder for quadrature count mode
//
EQEP_setDecoderConfig(EQEP1_BASE, (EQEP_CONFIG_1X_RESOLUTION |EQEP_CONFIG_QUADRATURE |EQEP_CONFIG_NO_SWAP));
EQEP_setEmulationMode(EQEP1_BASE, EQEP_EMULATIONMODE_RUNFREE);
//
// Configure the position counter to reset on an index event
//
EQEP_setPositionCounterConfig(EQEP1_BASE, EQEP_POSITION_RESET_IDX,0xFFFFFFFF);
//
// Enable the unit timer, setting the frequency to 50 Hz
//
EQEP_enableUnitTimer(EQEP1_BASE, (DEVICE_SYSCLK_FREQ / 50));
//
// Configure the position counter to be latched on a unit time out
//
EQEP_setLatchMode(EQEP1_BASE, EQEP_LATCH_UNIT_TIME_OUT);
//
// Enable the eQEP1 module
//
EQEP_enableModule(EQEP1_BASE);
//
// Configure and enable the edge-capture unit. The capture clock divider is
// SYSCLKOUT/64. The unit-position event divider is QCLK/32.
//
EQEP_setCaptureConfig(EQEP1_BASE, EQEP_CAPTURE_CLK_DIV_64,EQEP_UNIT_POS_EVNT_DIV_32);
EQEP_enableCapture(EQEP1_BASE);
}