Hello Dear Daniel,
Thanks for the very excellent tutorial on the MBD again, I am currently in PIL lecture of BLDC motor control.
Unfortunately, I encountered the issue shown in the figure below.
I made the following change in the configuration.
And it is still showing the same error. I am just checking if you know a quick fix to this issue. I attached my model as well. Thank you for the help!
Sincerely,
Yujiang Wu
Dear Yujiang,
Accroding to Mr. Popa's instructions, I got the same error in Matlab ver. r2018a.
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Whether I use your work-around (created an .m file with the given scripts) or not, by hitting the simulate button in normal mode, I got the following error:
"An error occurred while calling into the sil or pil target connectivity implementation. Caused by: Too many input arguments"
---------------------------------------------------------------------------------------------------------------------------------------------------------------
By using the .m file with your script; if I change the mode to PIL-simulation then I got another error saying that:
"Detected recursive call to slbuild, which might indicate invalid simultaneous model builds. If only one model build was in progress, and if you previously used dbquit while in the MATLAB debugger or pressed Ctrl-C during the build process, please restart the model build."
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Without your script; if I did the simulation again in PIL-simulation mode then I got a different error as shown below:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Consequently, I would like to know if you or Mr. Popa have an answer to this problem.
Best regards,
Ahmet Halit
Hi aunsal89@gmail.com, yujiangwu
You see that error because starting with R2017a the parameter "ProdEndianess" and a few others are read-only and we are trying to update them in our mbd_pnt_set_pilsil_mode function.
Could you try the attached zip file, which should fix the PIL converter and build?
You have to unzip it over the folder where the toolbox is installed. On my machine it is C:\MBDToolbox\mbdtbx_MPC574xP.
Best regards,
Paul
Dear all,
Also when I tried to run the simulation on an older version Matlab r2015b, I encountered the following error:
I am still looking for a suitable fix for this issue.
Best regards,
Ahmet Halit
Thanks to Mr. Yujiang, I finally got it working. With Matlab ver. r2017b and according to the script mentioned in Yujiang's post, the simulations run perfectlyy. Yet there is still a problem with r2018a and for that I am waiting for the attachment from Mr. Paul Vlase.
I am so sorry that I forgot to attach the zip file.
I updated my last message with the zip file.
Could you try it and tell us if it worked?
In case of Matlab R2018a, could you show us the output of "mex -setup"? I think that PIL is not working on R2018a because the Microsoft Windows SDK 7.1, which is required by our toolbox, is not set up correctly.
Hi Dear Daniel,
I found a workaround. I wrote a script to first configure the ProdHWDeviceType as Customed. Then unify the configuration setting between Parent model and Child model. At the end, I explicitly set the ProdHWDeviceType back as Freescale->32-bit PowerPC. Then if you run PIL directly, it works.
The script is as follows:
open('BLDC_com.slx');
open('PIL_model.slx');
set_param('BLDC_com','ProdHWDeviceType','Specified');
set_param('PIL_model','ProdHWDeviceType','Specified');
set_param('BLDC_com','TargetLangStandard','C99 (ISO)');
set_param('PIL_model','TargetLangStandard','C99 (ISO)');%C89/C90 (ANSI)
set_param('BLDC_com','ProdLargestAtomicInteger','Long');
set_param('PIL_model','ProdLargestAtomicInteger','Long');
set_param('BLDC_com','ProdLargestAtomicFloat','Double');
set_param('PIL_model','ProdLargestAtomicFloat','Double');
set_param('BLDC_com','ProdEndianess','BigEndian');
set_param('PIL_model','ProdEndianess','BigEndian');
set_param('BLDC_com','SuppressErrorStatus','on');
set_param('PIL_model','SuppressErrorStatus','on');
set_param('BLDC_com','ProdHWDeviceType','Freescale->32-bit PowerPC');
set_param('PIL_model','ProdHWDeviceType','Freescale->32-bit PowerPC');
However, I still suspect that there are some bugs within the "mbdtbx_MPC574xP",especially the following protected code.
Please check and make the update if necessary.
Thank you!
Sincerely,
Yujiang Wu
Hi Yujiang,
Can you tell us what MATLAB version are you using ? We wish to confirm the issue you are seeing on the same setup.
Thank you!
Daniel