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.

TMS320F28379D: Servo control

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Hi,

We are developing a servo drive with TMS320F28379D with Biss-c absolute encoder feedback. We have some questions,

  1. We are using TI's position manager library for Biss-C interface and it uses EPWM4 for the clock, how to change that?
  2. Can we have 2 Pulse input interfaces of 2Mhz in CLB, encoder output as "A", "B" pulse train output in CLB, and absolute encoder interface in the same controller, is it feasible? If not, how to proceed; do you have any recommendations; If yes, do you have any references for pulse input and pulse output?
  3. Right now we are using TI's evaluation board for the controller card with TMS320F28379D and custom inverter card but when we go for the final product, we are looking for a somewhat lesser cost controller. Can you suggest an alternative microcontroller that meets the requirements stated above?

Regards,

Kaarthi

  • Kaarthi,

    We are using TI's position manager library for Biss-C interface and it uses EPWM4 for the clock, how to change that?

    Unfortunately the pin functionality is being overridden by the CLB block and this can not be changed without the library source code which is not available at this time.  We are working towards releasing the source later this year (3Quarter or 4Quarter) in the C2000Ware Motor Control SDK.

    Can we have 2 Pulse input interfaces of 2Mhz in CLB, encoder output as "A", "B" pulse train output in CLB, and absolute encoder interface in the same controller, is it feasible? If not, how to proceed; do you have any recommendations; If yes, do you have any references for pulse input and pulse output?

    The C2000Tm Position Manager PTO API Reference Guide may help you here.  The source code is provided for all of the functions. Refer to the documentation for more information: www.ti.com/lit/SPRAC77

    Right now we are using TI's evaluation board for the controller card with TMS320F28379D and custom inverter card but when we go for the final product, we are looking for a somewhat lesser cost controller. Can you suggest an alternative microcontroller that meets the requirements stated above?

    The limitation in processor choice will likely be the number of CLB tiles that you need.  The BiSS encoder interface uses 2 tiles, plus any additional tiles you require.  Some options may be:

    • The F28004x @100 MHz has 4 tiles. 
    • The F28002x @100 MHz has 2 tiles. 
    • The F28003x @120MHz has 4 tiles.
  • Hi,

    Thanks for the reply,

    As you said, TMS320F28379D has 4 CLB tiles and the position manager library uses 2 CLB tiles but I am not able to find which tile is used for this.

    And as mentioned in the document, i am able to import the pto_abs2qep project from C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\libraries\position_sensing\pto\ccs\f2837x, 

    is it possible to change the GPIO pins here?

    -kaarthi

  • The current BiSS-C library uses tile 3 and 4. 

    For the PTO libraries, the source is included.  This includes the CLB configuration as well.  The GPIOs used can be changed. 

    Best Regards

    Lori 

  • Thanks for your help,

    I am able to generate PTO output now.

    Is there any example for implementation of pulse train input(Qep, CwCcw and pulse/direction) in CLB

    Regards,

    Kaarthi

  • Is there any example for implementation of pulse train input(Qep, CwCcw and pulse/direction) in CLB

    Yes, the PTO library has an example of a QEP pulse train input decoder using the CLB. 

    Regards

    Lori

  • Yes, PTO has the qep on clb but I think it is position decoder. If there is example for pulse count and direction mode, it would be very helpful. Or even some documents will also helpful.

    Thanks & Regards,

    Kaarthi

  • Kaarthi,

    The QEP decoder documentation is included in the PTO library doc.  This would be a good starting place.  The QEP decode is a superset of what you are looking for.  The QEP decoder is basically a count being incremented or decremented on each pulse edge based on the previous value on QEP-A and QEP-B compared to the current value of QEP-A/B.

    For a simple pulse count, I would suggest:

    • QEP-A signal is the input, with filtering turned on.  This can be set to pulse on falling, rising or both edges. 
    • This filtered signal would then control the enable mode of the counter.   The direction mode would be tied to increment.
    • The counter would increment by one each time the edge pulse goes high.

    For a pulse count + dir:

    • Do the same with QEP-A to control the enable of the counter
    • To control the direction of the counter, use a look-up table (LUT) to combine the QEP-A pulse with the state of the DIR signal. 

    You may find the C2000 Academy CLB module helpful (module 13). It includes an introduction to the CLB and other resources such as training videos and documentation. 

    Best Regards

    Lori

  • Hi,

    I am able to count the pulse train input and able to count up and down with the help of direction mode. But I am not to count less than 0(since all the registers are uint32).

    Is there any way to count in a negative direction?

    or, is there a way to read FSM.out or Lut.out in software so that i can manually calculate in software to count in the negative?

    Regards,

    kaarthi

  • Hi Kaarthi,

    Lori is out office until later this week. She will get back to you once she's back later this week or early next.

    Best,

    Kevin

  • Kaarthi,

    When a CLB counter decrements below 0 it will underflow.  For example  0x4..0x3..0x2..0x1..0xFFFFFFFF...0xFFFFFFFE etc.   

    For an encoder, the underflow value should correspond to the maximum position that can be measured by the encoder. That is the resolution of the encoder or the number of position increments / lines around the circle.

    For example:

    forward (clockwise) position: 0,1, 2  .... MAX_POSITION-2,. MAX_POSITION -1, MAX_POSITION, 0, 1, 2 .....

    reverse (counter-clockwise) position: .... 3, 2, 1, 0, MAX_POSITION, MAX_POSITION-1, MAX_POSITION-2.  .......... etc... 

    This can be achieved by loading a specific value into the count and resetting the count on specific match events.  In the QepOnClb example this is done using COUNTER_0 match1 and match2.

    If you would like to interpret MAX_POSITION as a negative value you can do this, but it will need to be translated in software. 

    Regards

    Lori

  • Hi Lori,

     Thanks for your reply.

    am actually trying to integrate the pulse train input for position control not an encoder interface.

    So i have to calculate the no of pulses from pulse train as well as direction input.

    I have to work three types of pulse train input, 

    1. Pulse and direction mode - pulse train will be coming at one pin to indicate no of revolution motor should rotate and high or low on pin 2 to indicate direction at which the motor should rotate.
    2. Clockwise and counter clockwise - for pulse train at pin 1 means motor has to rotate in cw and pulse train at pin 2 means motor has to rotate at CCW.
    3. A/B quadratic signal - pulse train will be at both pins with A leading B or A lagging B. So i have to calculate no of pulses as well as direction from this.

    So my questions are,

    I know that we can do this in ecap but that affects cpu performance, so, is there a way to do this in CLB?

    I am able to properly count the no of pulses but i cannot able to find the direction. 

    So even if I can able to read the FSM.OUT or LUT.out, i can place logical equations there and find direction input.

    Can you please help me on this?

    Regards,

    Kaarthi

  • Pulse and direction mode - pulse train will be coming at one pin to indicate no of revolution motor should rotate and high or low on pin 2 to indicate direction at which the motor should rotate.

    The CLB can count the number of pulses.  

    • pulse-train signal is the input to the CLB, with edge filtering turned on.  This can be set to pulse on falling, rising or both edges. 
    • This filtered signal would then control the enable (mode0) of the counter.   
    • The direction mode (mode1) would be tied to increment.
    • The counter would increment by one each time the edge pulse goes high.

    For the 2nd pin, I'm not clear what will need to be done.  The CPU could read the state and act accordingly.  Or the CLB could take in the signal and take some action.  

    Clockwise and counter clockwise - for pulse train at pin 1 means motor has to rotate in cw and pulse train at pin 2 means motor has to rotate at CCW.

    Is this the same as in the 2nd pin in case 1?

    A/B quadratic signal - pulse train will be at both pins with A leading B or A lagging B. So i have to calculate no of pulses as well as direction from this.

    The QepOnClb PTO library example demonstrates how to do this using the CLB. From the A/B input signals, the CLB counts pulses and generates a direction signal.  Depending on what you want to do, the direction signal can be brought out to a pin or used by other CLB logic.  In the QepOnClb example the direction signal controls the increment/decrement of the pulse counter.  Instead you could choose to bring it to a pin using an OUTLUT.  

    Best regards

    Lori  

  • Sorry for the late reply,
    This seems to be a good idea to bring out through a pin and use it further. I will test this and update here.

    Thanks and regards,

    kaarthi