How to change the number of batteries in series in the model made by Virtual Vehicle Composer by scripts?

1 Ansicht (letzte 30 Tage)
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 Kommentare
Lorenzo
Lorenzo am 31 Jan. 2024
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)

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Energy Storage finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by