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.

TMS320F280049C: Synchronised Sawtooth (Ramp) Generation

Part Number: TMS320F280049C
Other Parts Discussed in Thread: TMDSHSECDOCK, , C2000WARE

Hello everyone,



I am building a custom control for my project. I am using the TMS320F280049C along with TMDSHSECDOCK. Additionally, I am using PSIM with SimCoder (F28004X Target) to build the blocks, simulate and export the code to CSS. 

I need to have the comparator sawtooth signal synchronized with an input AC signal. Therefore I cannot use the PWM block defined in PSIM>SimCoder.

Does anyone know a way to build a synchronised ramp in order to make my own comparator? Either by programming in CCS or by integration in PSIM.

Awaiting your answer. 

Regards, 

Denys

  • Hi Denys,

    Thanks for your patience.

    I'll get back to you as soon as I have more information.

    Regards,

    Hadi

  • Hi Hadi, waiting for your answer.  Regards, Denys

  • Hi Denys,

    The only synchronization signal for ramp generator is  EPWMSYNCPER, which comes from EPWM module. A good solution would probably be to use an internal comparator and DAC with your sine wave against 1.65V threshold.

    You can scale down your sine wave for ADC as follows (assume the amplitude of your sinewave is 3.3V) :

    3.3V sine wave = 3.3V to ADC

    0V sine wave = 1.65V to ADC

    -3.3V sine wave = 0V to ADC

    Then you can use the time-base submodule in EPWM to generate EPWMSYNCPER.

    A better solution would be using another comparator and do a comparison of sine waveform with reference 1.65V, and then pass the output of the comparator to EPWM module to generate EPWMSYNCPER. 

    Regards,

    Hadi 

  • Hi Hadi, I appreciate your answer. 

    I have read about the EPWMSYNCPER on the manual. There is any example or may you have some on how setup the synchronisation with EPWMSYNCPER?

    Moreover, I would appreciate if there is some additional info/examples on how to implement it with PSIM SimCoder since the software simplifies a lot the programming.

    Regards, 

    Denys

  • Hi Denys,

    There is an example for EPWM synchronization in your C2000Ware directory (epwm_ex3_synchronization):

    C2000Ware_5_00_00_00\driverlib\f28004x\examples\epwm

    Regarding PSIM SimCoder, TI doesn't provide any example or guide how to use it.

    Regards,

    Hadi