Inconsistency between the original waveform and the waveform after Analog Input

Dear PLECS Community,

Hello. I am currently using RT-BOX to perform a grid-connected experiment in PLECS. In my setup, I use Analog Output and Analog Input blocks to transmit the grid voltage and current signals.Since my grid-connected experiment has not been successful, I started to investigate the possible causes step by step. First, I built a very simple closed-loop test to verify whether the analog input/output chain is working properly.In this test:I generated a sine wave with:amplitude = 100,frequency = 2π×50pi (50 Hz),The sine wave is sent to an Analog Output block.Then the signal is connected back through an Analog Input block and observed using a Scope.The Analog Output and Analog Input channels are correctly matched.The Analog Output scaling is set to Iacm.K.The Analog Input scaling is set to 1/Iacm.K.However, after passing through the Analog Output/Input chain, the measured waveform becomes a staircase-like waveform instead of remaining sinusoidal.Could anyone please help me understand why the waveform after Analog Input is different from the original sine wave?Any advice or suggestions would be greatly appreciated. Thank you very much for your help.

In the figure:the staircase waveform is the signal after Analog Input,the sinusoidal waveform is the original signal before Analog Output.

The following diagram illustrates the connection setup of the simple closed-loop experiment.

Hi runxinYan,

The RT Box analog output range is configurable and supports the following ranges:

  • [0, 5]
  • [0, 10]
  • [-5, 5]
  • [-10, 10]

If the scaled value of the signal exceeds the analog output capabilities of the RT Box, the output will saturate at the configured maximum or minimum voltage.

For example, if your hardware is configured for a range of [-5, 5] and Iacm.K = 0.1, then:

  • an input of 100 will be scaled to 10 V
  • the analog output will then saturate and clip to 5 V
  • when scaled back, this becomes 5 / 0.1 = 50

Also note that the analog inputs themselves have defined voltage ranges and can similarly saturate if exceeded.

In short, I would recommend revisiting your scaling factors while accounting for the analog output hardware limitations.

You can also model this behavior directly in simulation by configuring the minimum and maximum output voltage parameters of the Analog Out block (or by setting even more restrictive limits if desired).

Thank you very much for your explanation. It was very helpful to me.

I am sorry to bother you again. After the issue you previously answered, I have adjusted the input and output ranges of the analog signals to ensure that the input values stay within the allowable limits.Specifically, the voltage range of the RT‑BOX is known to be [-10, 10] V. In my setup, the output voltage is approximately 156 V. With Vacm.K = 0.00983406678,Vacm.O=0, the corresponding analog output voltage is 1.53411441768 V, which is well within the range. However, the output voltage waveform is still not a pure sine wave.

To verify the correctness of the scale and offset settings for the analog input and output, I applied a sine wave with the same amplitude as the actual output voltage. The sine wave passed through the same analog input/output chain, and I observed the resulting waveform using a scope. Strangely, with the same parameter settings, the sine wave remained a sine wave after passing through the analog I/O. Yet, the captured voltage waveform (from the actual system) is not sinusoidal.

The voltage after the analog input/output is shown in the figure.

The parameter settings of the sine wave and the waveform after passing through the analog input/output are shown in the figure.

I would greatly appreciate your help and insights. Thank you very much for your time and assistance.

Hi,

Could you please provide a simplified model that reproduces the issue? It would make it much easier to understand and debug what is happening.

Based only on the waveforms you have posted, my best guess is that there may be an issue with the voltage scaling configuration. However, without the model it is difficult to determine the root cause with confidence.

Hope this helps.

Hi,
I’m truly sorry for not replying to your message sooner. Due to some personal matters, I was unable to respond in a timely manner.
I’m happy to let you know that the issue has now been resolved. Thank you very much for your help and understanding.
Once again, I sincerely apologize for the delay and any inconvenience this may have caused.