This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMDSHVMTRPFCKIT: TMDSHVMTRPFCKIT

Part Number: TMDSHVMTRPFCKIT
Other Parts Discussed in Thread: TMS320F28069M, C2000WARE

Tool/software: Code Composer Studio

Hello,

I am writing regarding an issue to measure motor speed by using encoder (AEAT-601B

Incremental Magnetic Encoder). I am working on TMDSHVMTRPFCKIT with TMS320F28069M. There is eQEP module on the board read the encoder signal. I have done GPIO, register configuration. I have to do few scaling of UPPS and CPPS for UPEVENT and QCLK. Good things I am computing speed on code by encoder as following: (speed = Fixed position/ Time between up event) equation and there is no overflow. But there are lower time counting and higher speed computation than what I am expecting.

 

I am feeling that it is about regarding time issue. But not sure what is it?

 

Can I have your suggestions please?

 

Thanks

Kind Regards

Tajrin

  • I apologize Tajrin, I don't understand your question. Are you trying to figure out how to calculate motor speed (RPM) from the encoder?

    Sean
  • Hi Sean,

    Thanks for your reply. Sorry for late reply. I am sorry for previous brief description. No I already calculate speed in rpm. I am working for low speed. But what I am expecting it is  not showing in the output. Such as I am going to operate motor 1.5 Hz which is 75 rpm. But I am always getting more value than 75 rpm and time count value always less than my expectation. I have checked with manual calculation on time count for predicted speed.

    Not sure where is the wrong? 

    Thanks 

    Regards

    Tajrin

  • Tajrin

    Have you had a chance to try these examples in C2000Ware?

    C:\ti\c2000\C2000Ware_1_00_05_00\device_support\f2806x\examples\c28\eqep_freqcal
    C:\ti\c2000\C2000Ware_1_00_05_00\device_support\f2806x\examples\c28\eqep_pos_speed

    These examples will be a good starting point to help narrow down an issue you might be seeing when you try to set up the eQEP drivers yourself

    Sean
  • Hi,

    I have started my initial code with the help of example C:\ti\c2000\C2000Ware_1_00_05_00\device_support\f2806x\examples\c28\eqep_pos_speed. But unfrotunately, I have found few issues:

    Issue 1: Capture unit: There is always variable up event coming for constant speed. It looks any parameter from decoder drives the up event to changes. It does not follow any periodic order for constant speed. Hoever, it does changes for variable speed.

    Issue 2: Position counter latch:
    There is an issue with position counter latch. It always reset by hardware itself which is operated by capture timer. So, position latch counter is not reliable register to calculate speed.

    Issue 3: Encoder Resolution: for quadrature mode, it expected that 4 edges are counting where as it seems like its counting 1/2 of the expected pules per revolution. It’s countng 2 edges /rev and it looks rising edge for QA and falling edges for QB. like an example

    Encoder pulses per revolution (ppr) = 250
    Expected pules for quadrature mode = 1000 pulses
    At 5 Hz, 5 turns per seconds.
    At 1 Hz expected pulses = 1000 pulses
    At 5 Hz expected pulses = 5x 1000 = 5000 pulses
    expected 500 pules at 10 sample rate.
    Measured =250 ±30



    Thanks

    Tajrin
  • Hi Tajrin,

    Have you referenced section 7.5 "eQEP Edge Capture Unit" in the TRM already?

    http://www.ti.com/lit/spruh18

    The UPEVENT should be dependent on QCAPCTL[UPPS], prescaling QCLK.

    Can you further explain issue #2 for me? What do you mean it's always being reset by hardware?

    I believe you'll need to make some changes to the POSSPEED struct that's used in the eqep_pos_speed example. See the POSSPEED_DEFAULTS definition in the Example_posspeed.h file for the configuration being used by default.

    Could you check that 2x resolution is set, register bit QDECCTL.bit.XCR=0. That may be the reason for seeing the 1/2 pulses per revolution.

    Best,

    Kevin

  • Hi Tajrin,

    Were you able to resolve your issue? I'm going to go ahead and close this thread.

    Best,
    Kevin
  • Hi kevin,

    I didn't resolve the problem yet. yes I have followed chapter Enhanced QEP (eQEP) Module (SPRUH18). I have checked prescaling based on the xls sheet provide in the example eqep_pos_speed by TI. i think prescaling is ok since I haven't found any overflow. i got overflow before prscaling.

    Issue 2: I don't know it looks like it is resetted anyway.

    I have changed few things for register initialization. such as I have set QEPCTL.bit PCRM =01 instead of 00.

    I have set the register bit QDECCTL.bit.XCR=0 which is Quadrature count mode.


    Thanks

    Kind Regards

    Tajrin
  • Hi Tajrin,

    What rpm are you seeing? 1.5 Hz should equate to 90 rpm.

    Can you share more of your SW configuration? If you're building off of the eqep_pos_speed example and using the functions/structure within it can you share the below:

    1. Share your POSSPEED_Init(void) function

    2. Share your POSSPEED structure initialization

    Also are you measuring using qep_posspeed.SpeedRpm_fr or qep_posspeed.SpeedRpm_pr?

    Best,
    Kevin