Assistance with adapting DAB for RTBox HIL

Hi there,

I am trying to adapt the plant of my DAB for controller HIL. I am using the DAB component found in the component library and the offline simulation runs but when I tried to build to RTBox1 I get the error: The secondary terminals of dual_active_bridge/DAB Plant/DAB1 must be connected directly to a capacitor or voltage source.

However, when I remove any resistors that were connected along with the capacitor (C1 and C3) (see image), I am able to build to RTBox, but I get the red error light. Upon trying to run offline simulation again, I get a new error caused by the missing resistor: State discontinuity after switching.
The voltage across capacitor dual_active_bridge/DAB Plant/C3 is forced to jump from 800 to 0.

How can I solve this issue?

Thanks for all your help!

Hi Alyssa,

If you are able to share the model file that reproduces the error, it would make it much easier for us to determine what is happening.

Additionally, could you please let us know which versions of PLECS and the RT Box Target Support Package (TSP) you are using?

Hi Munadir,

I am using PLECS Version 5.0.4, and RTBox TSP 4.07. I attached the model as well. Thank you very much for your help.

dual_active_bridge.plecs (419.1 KB)

Hi Alyssa,

It appears that the high-side and low-side PWMs (S14/S23 and S58/S67) are being turned on at the same time.

The PWM module starts in its inactive state. In your model, since the PWM polarity is configured as active low (i.e., the active state corresponds to logic 0), the inactive state causes both the high-side and low-side outputs to be driven high simultaneously, resulting in the error.

If I change the PWM polarity to active high, the simulation runs without any errors.

From the way your model is configured, I believe you intended the PWM outputs to be active high, but perhaps I’m missing something. Is there a particular reason you configured the PWM polarity as active low?

Hope this helps!

Hi Munadir,

I must have accidentally configured the PWM to be active low. The offline simulation all works now!

However, I can successfully build to RTBox1, but the blue ‘Running’ LED is not turning on and the red ‘Error’ LED is on instead. How can I see what the cause of the error is? It is not an issue with the RTBox since it works properly for other models.

Thank you!

You can also view more details about the error by opening the RT Box web interface.

Go to:

Coder Options → Target → Open Web Interface

Then navigate to the Diagnostics tab, which may provide additional information about the cause of the error.

I see, the issue is that my FPGA version (4.0.6) must match the application library version (4.0.7). Is there a way to upgrade the FPGA version or is my only option to downgrade the application library version? I cannot seem to find any documentation on the FPGA version.

Great, at least you’ve narrowed down the issue!

Are you able to follow the automated firmware upgrade procedure described here?

This will update the firmware on the RT Box to match the version of the RT Box TSP installed on your system.

Let me know if that resolves the issue.

Hi Munadir,

It worked! Thank you so much for your help! I have one more question though: My model works properly in offline simulation, but when I build to RTBox and c2000, my output voltage drops to 0 and there is no power transfer at all. The switching signals are also present but they aren’t the perfect square waves from offline simulation due to the PWM capture. Do you have any idea why it isn’t working online? I double-checked my scales and offsets and everything I could think of and cannot find anything amiss. The image with the imperfect PWM is the online version. I also attached my model again as it has some changes.

Thanks once again,

Alyssa

dual_active_bridge.plecs (411.9 KB)

Hello,

I had a quick look at your model, and my primary concern is that the 100 kHz control execution rate is likely too high for the TI MCU.

When I attempt to connect to the MCU using External Mode, I receive an overrun error, which indicates that the control task is not able to complete its execution within the allotted time. As a result, I am unable to run the model in real time.

I would recommend lowering the control task execution rate. Typically, the control task is executed at the switching frequency or lower. In your model, however, the controller is running at 100 kHz, which is 5× the switching frequency. This is not a typical configuration.

I also noticed that you are downsampling the measurements back to 20 kHz before they are used by the controller. This raises the question of why the controller needs to execute at 100 kHz if it is only receiving new measurement data every 20 kHz.

I would recommend reducing the control task rate, retuning your controller and seeing if that resolves the overrun issue.

Oh I see I must have forgotten to remove the x5. I got it to wok now and I also had to reduce the discretization step size in the coder.

Thank you for all your help! Have a good day