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

조회 수: 11 (최근 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일
Hello,
The problem is the size mismatch on port PWM. The block reads:
if SOC2<SOC1
s1=PWM;
s2=0;
elseif SOC1<SOC2
s1=0;
s2=PWM;
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.
Anthony
  댓글 수: 3
MAHENDRAN A
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
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에서 Naming Conventions에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by