Hello, I’m working on OBC converter model, that is already working in normal simulation. Now I want to test it on RT Box 1 using external TI C2000 as controling device. After switching starts I get a commutation error which I think may be connected to cutting current from inductor or something like that. In the log console there are specified different topologies but there is no way for me to find which part of model it is. Previously I had shoot-through issue which I already fixed. I uploaded my model, thank you for any suggestions.
OBC_RTBox.plecs (385.0 KB)
Illegal transition often can be akin to a state-space discontinuity. I suspect that the current through your filter inductors is interrupted.
I’d like to point out that given the labeling of your gate drive signals, I believe you have the InvC terminal of your LCL filter connected to the neutral-phase half-bridge (sn1 & sn2). The similarly, the neutral output of your LCL is connected to the phase C half-bridge.
Lastly, for your DAB stage you should use the Nanostep implementation from the PLECS library. This will be a more accurate model and will also reduce the step size of your simulation.
Thank you for your suggestions.
I see that in nanostep DAB implementation there are no thermal options like in for example sub-cycle average full bridge.
Is there any way for me to find what topology 52_0 refers to? For example looking through compiled RTBox code or any logs?
Also I wanted to include pre-charge circuit but obviously extra breakers add to switch count and Plecs coder is permanently stuck at Analyzing transitions.
I also tried variable resistors but they are not supported on RT Box. Is there any other method for implementing pre-charge or is it simply not worth it because the model is constantly working and pre-charge would only work once?
Is there any way for me to find what topology 52_0 refers to? For example looking through compiled RTBox code or any logs?
There is not a straightforward way. You can isolate the issue to the PFC/DAB/battery by adding / removing the parts of your schematic. Again this is something pretty fundamental to the model operation. Is it driven by an event or does it occur randomly? Also, addressing the excessive overruns might be beneficial.
I see that in nanostep DAB implementation there are no thermal options like in for example sub-cycle average full bridge.
That’s correct, however the electrical model will be significantly more accurate unless you’re switching at a relatively low frequency. Plus you’ll have a smaller time step when using the Nanostep configuration as it runs on the FPGA, freeing up the CPU core.
Is real-time thermal modeling a requirement for your testing? Can you emulate a thermal sensor say through either control or a power based look-up table? If the electrical model is less accurate then will the thermal data be meaningful? Perhaps it’s something best analyzed in offline simulations, such that your real-time model is optimal, as real-time thermal modeling on the RT Box 1 will be quite slow since you can’t allocate the thermal analysis to another CPU core, as is done on the RT Box 2/3.
Also I wanted to include pre-charge circuit but obviously extra breakers add to switch count and Plecs coder is permanently stuck at Analyzing transitions. I also tried variable resistors but they are not supported on RT Box. Is there any other method for implementing pre-charge or is it simply not worth it because the model is constantly working and pre-charge would only work once?
This is a question of your testing goals. If you are testing the pre-charge functionality and startup sequence then you surely need to model it. If you are just testing closed loop control, then it is not necessary.
The Breaker component’s codegen representation is more complex than the Switch component. If you are just testing pre-charge (and not discharge) then you can use the Switch component which should facilitate code generation. If you must use the breaker or require even more than three breakers, you can also try the “Non-Ideal switch” configuration for the breaker.
I have done some more tests and divided my circuit between grid and LCL filter and now every variation compiles very fast. I think I will focus only on real time control with RT Box but I’m still curious about the setup I uploaded this time. There are just breakers in all 4 lines controled by constant block that is set to 1. Even without any external signals RT Box returns error at the very beginning of the simulation. The error states: Illegal transition conditions in forced commutation for topology 1_0. Or if I remove neutral phase breaker: Topology 0_0. I tried different resistor setups to divide currents but with no luck. On friday I can try if adding delays between switches changes anything.
OBC_RTBox_test.plecs (395.4 KB)
Thanks for the update. I will comment that setting the Coder + Switch Model (CPU Code Generation) parameter to Non-Ideal for your breakers may eliminate the need for your isolation. Non-Ideal switches do not contribute to the total number of switching combinations and so code generation should be quite quick. Again you can also use the Switch component, which is modeled as just one Switch instead of two like the Breaker, to reduce the number of switching combinations. The difference between the components is when interrupting currents - the Switch will open instantaneously while the Breaker will only open upon a zero crossing. For a pre-charge circuit modeling both might not be necessary. Lastly, I don’t believe you need a breaker on the neutral as there will be zero current if the phase breakers are open.
As for why the model raises an error, I believe it is has to due with potential current imbalances in your circuit that can arise due to floating point errors not having a path. Adding resistances in parallel with just one phase breaker (and the neutral breaker if you keep it in the circuit) will eliminate the error.
Hello again.
I found a model setup that works properly and now I’m continuing my work on control loop. However I found another bug. When I delete neutral wire connection between filter and converter leg I get a following error:
“Unexpected event: multiple transition conditions for a switch are identically true. Please report this error to support@plexim.com.”
And for me this seems like normal 3 wire setup so I’m writing this follow up with attached model. Thank you for you help.
OBC_RTBox.plecs (397.1 KB)
Glad to hear you have a solution that is working properly. Thank you for reporting that error. You cannot leave the output connection of one of the half-bridges electrically isolated and you will have to delete the component or comment it out.