How to change the number of batteries in series in the model made by Virtual Vehicle Composer by scripts?
1 次查看(过去 30 天)
显示 更早的评论
Hello!
I'm currently learning this official video: Optimize EV Battery Performance Using Simulation. From the begining I was using 132 batteries in series and the model works well. However, when I trying to change the number of batteries in series by using scripts, the error occurs.
I can fix this problem as shown below:
However, the errors still exists, so I have to do further changes by hand:
Finally it turns out that if I want to change the parameter "PlntBattNumCellSer" which is the number of batteries in series and run the estimation, I have to do 5-6 changes by hand. But the optimization needs to be done by scripts as shown in the video. So can you help me by adding some code in my scripts to run the optimization succesfully just like the video?
The scripts below is what I have by now:
in(1) = in(1).setVariable('PlntBattNumCellSer', Ns);
%% add more code
simout = sim(in(1));
5 个评论
Lorenzo
2024-1-31
Ah right right sorry for that! It seems that the error is caused by a signal mismatch in the BMS control unit. Now without having the model here, it is quite hard to debug it. What might work however, is to "downgrade" the BMS control unit, i.e. getting rid of it altoghether (in case you do not need it). I tried this real quick on 23b (which should have a similar structure). If you notice any difference (I have attached figure so that you can compare to your system) let me know.
I have no idea what kind of modification you applied to your model so my suggestion is that you go back to the original vehicle generated by the Virtual vehicle composer. Once there, you can proceed as follow:
Step 1
Navigate to the Controller Subsystem select the BMS controller block and then click in the Tab Variant Subsystem on “Block Parameters”:
Step 2
This will open a window where you can select/add different BMS systems to the model. One possibility is to not use any BMS at all and this is what we are going for. As shown in the figure below, add the piece of text missing ("No BMS") to enable NoBMS as a possible variant. Click Apply and then OK
Step 3
Now select the variant subsystem again and in the Variant Subsystem Tab select the “NoBMS” option from the drop down menu (see below). Now you have deactivated the BMS controller!
Step 4
Now I will go back to the system who gave you the first error, which in my opnion will be the system "Signals for BMS" contained in the Battery object. Now that we are not using the BMS anymore, we do not need to remodulate the signal going to the BMS every single time. In the system "Signal for BMS" these Gains reference to the variable denoting the number of parallel cells. We do not need them anymore because the signals are not being used anymore (we deactivated the BMS). Therefore, in all gains using the variable (Np or Ns), substitute the variables with some constant value (it does not matter which value since we are not using these signal, it must be an integer)
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Energy Storage 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!