PWM(Variable) synchronize issue

Hello:
I use PWM(Variable) for the switches of secondary side and the basic PWM1 for the primary side, however when i change modes for PWM(Variable) is no problem, but what if i want to change PWM1, the PWM(Variable) output signals will also change based on it, if there’s any other ways to change PWM1 but didn’t affect PWM(Variable) output? with RTBox 3 I have two launch pads 28069, should i create two ctrl submodules and make them synchronize or easier ways to solve this issue?

Best regards,

NPC-DAB.plecs (411.1 KB)

I’m sorry your question is not clear. What “modes” are you changing? What are you changing about PWM1?

I will note your PWM1 and PWM (Variable) blocks use the same PWM channels so you model will not work due to resource conflicts. Each PWM channel must be unique.

With RTBox 3 I have two launch pads 28069, should i create two ctrl submodules and make them synchronize or easier ways to solve this issue?

It is easier to synchronize PWMs within one C2000 device so I would not consider using two devices unless necessary.


Here I use multiport signal switch to change phase shift of PWM (Variable), I want to do the same thing on PWM1, there might be two problems, one is for the plant, digital input channels may not enough if i use two PWM (Variable) like the second picture since it demands complementary outputs automatically, and another is the second PWM (Variable) outputs will also change based on it, which is not the result i want.

one is for the plant, digital input channels may not enough if i use two PWM (Variable) like the second picture since it demands complementary outputs automatically

You want to use 8 ePWM channels. For the 28069 ePWM1-6 complementary pairs and ePWM7B are mapped to LaunchPad headers. With the 28069 you cannot directly assign the ePWM outputs to GPIO, but newer processors allow assigning the pins to different GPIO in the Target configuration. I’m not sure with your LaunchPad board you can map the desired number of IOs, let alone interface them to the RT Box. This is independent of using complementary signals or not.

In your RT Box model you are using a logical NOT on the PWM input signals which will not work in real-time. I suggest review the RT Box tutorials as this shows a misundertanding of how the RT Box PWM sensing works including PWM Capture and sub-cycle averaging.

second PWM (Variable) outputs will also change based on it, which is not the result i want.

I do not believe this is the case, but have not tested it. You can use a single PWM Variable block to ensure all channels are synchronized to the the first “main” channel.

you’re right. I’ve tried two launchpads on RTBox 3 since I want to use 8 ePWM channels while Ctrl1 for primary side and Ctrl for secondary side, the output voltage in offline will enter steady state, however in external mode will be like a sinusoidal waveform, why will be the difference like this and probably s solution to solve it?

Best regards,
test1.plecs (308.3 KB)

There are two potential issues:

  1. If your PWMs are not synchronized across the boards, then they will slowly drift apart as the have independent clocks. You need to synchronize the two.
  2. The RT Box model of this system may not have a sufficiently small time-step to model the phase-shifted DAB control (<16 samples per switching period at the 6usec step size you have assigned). You may want to optimize your model to reduce the step size or consider time-scaling. You can also use the FlexArray solver if you have the RT Box 2/3.

Thank you for the suggestions, I found the external sync this block and thought it may work for synchronization for two boards however I didn’t find the block to “catch” the synchronization output on the first board, should I try another way?

best regards,
(2 CTRL 1 by 1)NPC-DAB.plecs (316.8 KB)

The “External Sync” block is the appropriate signal to “catch” the synchronization pulse. The External Sync block’s output is wired to the sync input of a PWM block.

if the “External Sync” block is the appropriate signal to “catch” the synchronization pulse, which block should I use in Ctrl to wire the line to external sync in Ctrl1(based on different boards) if I want other PWM clocks to follow PWM(Variable)1?