How to solve the Data Type Mismatch error in Active cell balancing

9 次查看(过去 30 天)
I've developed an Active cell balancing model. The model and scripting file as no error, but while running the simulation, im getting data type error like this
An error ocurred while propagating data type 'Double'. I even attached the model. Can anyone say solution to my data type mismatch error.


Anthony Coadou
Anthony Coadou 2023-1-3
The problem is the size mismatch on port PWM. The block reads:
if SOC2<SOC1
elseif SOC1<SOC2
where s1 and s2 are alternatively assigned values of size 1 (scalar 0) and 2 (vector PWM). The MATLAB Function block tries to infer its output data types first, but fails to do so because of the type mismatch, and throws this cryptic error.
Hope that helps.
  3 个评论
MAHENDRAN A 2023-1-5
Hi Sir,
Actually for the 2 and 3 cell battery active cell balancing models are running and your answers were helping. But according to my project, I need all the cells to equally balanced and then constantly either charging or discharging related to the volatge circuit.
I've developed the model for 4 cell battery model along with logic script function for the model, which Ive attached below. My model is running with the script file I've return. But, the output SOC values is not equally balanced and charging,
Obtained Output
- For 4 cell, the 1st two cells charging separately and 2nd two cells doing separately.
For 6 cell, the 1st 3 ceells and 2nd 3 cells charging separtely, which ive shown in the below files that Ive attached.
I know Ive made mistkes in the scripting file, Can you guide me correcting this scripting function
Expected Solution - The output I'm expecting is that every cell should match at one point and should equally balanced as well as charging upto the stop time.
Fatma GÜZEL 2023-4-17
Hi sir,
Were you able to make any progress on the last subject you wanted to do?
I'm working on the same issue, I'd be glad if you could help.
There is no problem in controlling with PWM, but I still get a double error when I try to control it with PID.


更多回答(0 个)


Help CenterFile Exchange 中查找有关 Schedule Model Components 的更多信息




Community Treasure Hunt

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

Start Hunting!

Translated by