Message Boards Message Boards

0
|
7362 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

[?] Avoid problem with Trapezoid Block used for the carrier wave?

Posted 7 years ago

Hi guys,

I haven't posted here before and was unable to find a similar problem using the search function. I am trying to implement a Unipolar PWM strategy for a H-Bridge Inverter. After a very short time the trapezoid block that I am using for the carrier wave ceases to function even though the block is set to run for the duration of the simulation. I have no idea why it is stopping and would love some assistance!

I have attached a screenshot of the block in question and the resultant output. For reference: switchingFreq = 5000, StartTime = 0.

Thank you in advance!

Attachments:
POSTED BY: Daniel Frew
3 Replies

In general you can se such issues when using event generating functions with infinite number of transition points, like integer and mod, in combination with a model without dynamics (the Trapezoid block uses integer). As Neil mentioned, as soon as you add some dynamics to your model the step size control of the solver will kick in to help find all transition points.

POSTED BY: Otto Tronarp

Daniel,

I have seen this issue before. I believe that the problem is that the solver is increasing the step size until it steps over all of your activity and misses it. Your model has no dynamics so the accuracy condition is not being triggered in the solver, the solver responds by taking larger and larger steps. Eventually it steps over all of your activity. (Your triangle waveform is perfect -- I can pick any point in time at random and have the full accuracy of that waveform) You can see this if you check off "All Solver points" in the settings and run the simulation, then do plot properties and under datasets check "show data points". You will now see all your solver points and you can see it jump across regions -- in fact it is likely timed perfectly to hit all the zero points of your triangle waveform. So as far as the solver is concerned, there is no problem (although you miss all the activity!)

To fix the problem do one (or more) of the following:

  1. set your simulation time to better match the dynamics -- i.e. look at a few milliseconds of simulation.
  2. set a maximum step size that is less than the period of the triangle so it must get the triangle waveform.
  3. change to the CVODES solver -- I have found this tends not to jump over predetermined waveforms as much as DASSL does.
  4. don't worry about it until you hook up the inverter model to something dynamic -- at which point the solver must meet accuracy constraints and will adjust the stepsize as needed. (you still might need to set a maximum step size but I think most situations will fix themselves automatically). As an exercise drop a voltage source and a resistor in there and see what happens.

Regards

POSTED BY: Neil Singer
Posted 7 years ago

Thanks so much Neil,

I had thoughts along those lines, but didn't think to try another solver! Thank you again.

POSTED BY: Daniel Frew
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract