Generating a double pulse PWM pattern on a TI C2000 based F280039C LaunchPad

I need to generate a typical double-pulse pattern [used for dynamic charazterisation] on a given Pin of my F280039C board.

The pulse I want.

I can use the C2000 PWM block to generatea fixed duty cycle PWM pattern which is not what I want. I have tried to configure the Pin as a GPIO and issue pulse pattern [as far as I know there isn’t a signal builder function in PLECS, so I used it within PLECS Blockset and generated the pattern in Simulink signal editor, but unfortunately C2000 GPIO block does not interface with the signal outport block]. I tried to configure the Pin as an ePWM but so far I can only generate a fixed duty cycle PWM where I set the duty cycle via a constant block.

My schematic.

The PWM waveform generated across GPIO0.

Any technique to help with this would be greatly appreciated. Thanks.

Can you share any information on the needed duration of these pulses?

Thank you for getting back. Ideally, I would like control over the duration of pulses for my testing. The pulse durations, would however, be in the microsecond range from around 5us to say 50us or even 100us.

Hi Zizzi,
We are working on creating a custom block for you to use that will feature this functionality. We will keep you updated for when this is ready. Thanks!

1 Like

Hello Zizzi,

I’ve attached a model demonstrating your desired functionality to this message!

To configure this model:

  • Go to Simulation → Simulation parameters… → Initialization
  • Update PulseDur1, RestPeriod, and PulseDur2 to your desired pulse durations and rest period duration
  • Update Tdisc such that the PWM period (PulseDur1 + RestPeriod) is a clean multiple of it. For example, if the PWM period is 50 microseconds, Tdisc values of 50 microseconds, 25 microseconds, 10 microseconds are valid. Note that around 10 microseconds is the minimum valid selection for this value.
  • If the second pulse duration is longer than the first pulse duration plus the rest period, read the notes in the initialization script for handling this case.

To use this model:

  • Program the model to your 280039 LaunchPad
  • Connect to the LaunchPad via external mode
  • Double click on the “Burst Switch” to send out the double pulse burst (the switch icon should go from the lower connection point to the higher one)
  • Double click on the “Burst Switch” again to reset (the switch icon should go from the higher connection point to the lower one)
  • The “Burst Switch” can then be clicked again to send another burst. Repeat as much as you want!

If you have any questions about using this model, let us know! I hope this serves your purpose well.
pwm-double-pulse-simple.plecs (23.2 KB)

1 Like

Thank you very much. This looks excellent. I will give it a try and share my feedback. Looking at it apparently, this model essentially generates a variable modulation index vector which is fed as input to the C2000 ePWM block.
Just as a general suggestion, I think it would be great if PLECS offered a native double pulse generator for use within the simulation environment itself (apart from the one as above, which couples to the C2000 hardware) as it would be really handy for running preliminary characterisation tests in PLECS especially since PLECS offers access to a ton of manufacturer thermal models. Granted, the tests won’t be super accurate like SPICE based models, but it would be really handy to get started with that.
Thank You once again for putting in the effort.