Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

How can I make the load to rise/ fall at particular time while performing real time simulation in RT box 1?

0 votes
188 views
1)  I am making a control system to deal with the transient load. So, I have to increase the load ( resistive load, or taking current source as load ) during the simulation. In offline mode, I use a step-up signal to increase the load at a particular time. How can I perform it while doing real-time simulation in the RT box 1?

2) Under the "Coder Options", in the "external mode" section. What's the rule to keep the values of " number of samples" and " decimation " to increase the scope time?
asked Oct 27 by Kabi (21 points)

2 Answers

+1 vote
 
Best answer

To create events that occur on the RT Box in real-time there are a few options:

  1. Create a periodic disturbance.  For example, by using a Pulse Generator block opposed to a Step block the disturbance is not tied to any particular time during the simulation.  This is used in many demo models.
  2. Have the change be externally triggered.  For example, if you are using one of the pre-designed interface board use one of the DIP switches to change a digital input.  That digital input can then be used in conjunction with a Signal Switch to choose between different values.  For offline simulation, you can route a Step block to the appropriate digital input port.
  3. Manually change the value using inlined parameters and the external mode.

Regarding the scope time, the total scope capture time in seconds is simply the product of the discretization step size, the number of samples, and the decimation.

answered Oct 28 by Bryan Lieblick (326 points)
selected Nov 16 by Kabi
+1 vote
It is also fine to use the step block in a realtime simulation. You may get an initial error that this block uses the absolute time, but this can be turned into a warning (or silenced completely) in the coder options.

The use of absolute time in the step block is not a problem: The danger with absolute time is that the floating point number becomes larger and larger over time and therefore the resolution is more and more reduced. Since the step block only compares to a single, fixed time stamp it will work as expected.
answered Oct 30 by Oliver Schwartz (315 points)
Great points Oliver!
...