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.

TMS320F280049: CMPSS: positive ramp generator for low DAC

Part Number: TMS320F280049


Hello,

I am aware that none of the C2000 DSPs has a positive ramp generator for the low DAC of the CMPSS module.

However, I would like to implement this feature for bi-directional peak current control. My question is, is there an easy way to 'artificially' generate this ramp for the low-side DAC of the CMPSS using other modules of the DSP (F28004X in my case)?

I was thinking that maybe with the DMA module, I could repeatedly send the DAC values from a look-up vector that contains the ramp, however, I thought afterwards that it would not be possible to synchronize the initial value of the ramp with the start of my main PWM.

Then I thought that maybe the CLB module could be used for this purpose, but it is significantly more complicated and before diving in, i was wondering if it is worth trying it or if there are some examples from TI or someone that has done something similar.

If there are any other suggestions on how to implement it, all are welcome.

Thank you very much.

  • And just to clarify, I would like to implement this ramp in hardware (i.e. without CPU intervention). Hence my desire of using DMA or CLB block to accomplish it.

  • Hello Jorge,

    Thank you for your patience.

    As your device has access to DAC through DMA, you can use a look-up table to generate the ramp. For synchronization you can use EPWM as a trigger source.

    Regards,

    Hadi

  • Hi Hadi,

    Thank you very much for your response.

    That is what i thought in the beginning. However, i see a flaw in this approach. Here my explanation:

    Let's say that the PWM that i want to trip with the CMPSS module has a frequency of 50 KHz. Now, if I want a ramp in the low side DAC, as you say, I could send values from a look-up table with the DMA. For that, lets say i use a PWM with 5MHz (100 times the frequency), to trigger the DMA bursts, so that for each burst, i send a new value to the low DAC of the CMPSS. 

    So far, everything is fine. The problem is that there is not a way to synchronize the first value of the look-up table with the beginning of my main PWM (50 KHz). I mean, I could send a ramp that has the same period of my main pwm, but its initial value would not be in phase with my PWM. I dont know if I could explain it properly.

    Added to this problem, I dont have only 1 main pwm, i have 3 pwm's of the same frequency but phase shifted 1/3 of the period by each other, which complicates things...

    Best regards,

    Jorge.

  • Hi Jorge,

    Thank you for your thorough explanation. 

    I'm looking into your question and get back to you shortly.

    Regards,

    Hadi

  • Hi Jorge,

    I really appreciate your patience.

    In terms of synchronization, we should figure out how to implement ramp and main PWM synchronously. First thing I need to know is the starting point of main PWM, and how it is generated so we can use it for triggering DMA.

    Regards,

    Hadi

  • Hello Hadi,

    Thank you for your help. I am not sure exactly if I understand what you need to know, but I will give you some pwm settings and hope that is what you needed:

    - I have 3 main PWM (EPWM1, 2 and 3). All of them with a frequency of 50 KHz.

    - The PWM is of the triangular form (timer counts UP and DOWN)

    - EPWM1 generates SYNCOUT when count reaches zero, and EPWM 2 and 3 are synchronize to EPWM1 with a 120 and 240 degree phase shift respectively.

    - All of them have the cycle-by-cycle trip function enabled, and each of these PWM is connected to a different CMPSS module.

    - I need the CMPSS ramp to ramp up during the PWM cycle and then reset in the next PWM to its initial value.

    The problem that I see with using the main PWM as trigger for the DMA, is that, because I need 3 DMA  channels (one for each PWM/CMPSS), one of the channels would take the whole DMA bandwidth, wouldn't it?

    Best regards,

    Jorge

  • Hello Jorge,

    I appreciate your patience so far. I know your time is valuable, and I’m doing everything I can to get to the bottom of this for you.

    Please give me more time to discuss this with other experts.

    Thanks,

    Hadi

  • Hello Jorge,

    Thank you for being patient with me as I go through this issue.

    As per our conversation, you can use DMA to transfer the lookup table value to DAC. For generating three phase-shifted PWM, you just need to use one channel of DMA for your main PWM. For two others, you can add offset and load them to DAC through DMA,  which can happen in one cycle. 

    In terms of synchronization, you can use EPWM for triggering DMA.

    Please let me know if you have any question.

    Regards,

    Hadi