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.

TMS320F28335: eQEP example question

Part Number: TMS320F28335
Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE

Hi

How the control timer can differs from eQEP unit timer? I'm confused. is the position calculated using the eQEP unit time? or it is calculated using control system timer?

Also is there any complete sample code for position and speed measurements for PMSM motor control with 377D?

Thanks

  • I'm not sure what you mean by control timer? The unit timer is clocked by SYSCLKOUT and generates a periodic time out event. You can use this event to cause an interrupt (that you could use to perform a velocity calculation for example) and latch several of the counters of the eQEP.

    Please see the eQEP reference guide for more details: www.ti.com/.../sprug05

    You can do a search of the development_kits folder in controlSUITE to find a few examples that use the eQEP module. They don't necessarily use the 377D, but the eQEP module doesn't change much across devices, so they should still be helpful to reference.

    Whitney
  • Hi,

    Basically like other control peripherals eQEP receives SYSCLK and then unit timer runs at SYSCLK / PRESCALER( if used). Now coming to your question, first of all Unit timer value is useful to calculate the speed of the motor rather than the position. Position can be read directly anytime by reading QPOSCNT register. As described in TRM, 

                              speed = (P(t) - P(t-1)) / t

      Here P(t) -> Position counter value after unit time, P(t-1)-> Position counter value at start,  t-> Unit time period

     Unit time period (t) can be configured using QUPRD register. Thus if configured , position counter value can be latched automatically after every unit time. Please look at examples to calculate "Speed and Position Measurement" in C2000ware for F28377D.