Problem with simulink neural network predictive controller

whenevr i use a defined example of the predictive controller it works well in simulink but when i try to use my model as plant model to generate data its showing the following error:
"Error using nnident (line 1608)
Too many return arguments are specified. Specify only one.
Error in nncontrolutil (line 19)
feval(command,varargin{:}); - Show complete stack trace
Error while evaluating UIControl Callback."
I thought the problems might be with my modela and replaced it entirely with the given example of "cstr" model but still the same problem
Then i tried to replace one of the predefined model with mine own but still the same problem persists
Can anyone please help me out here?
thankyou

1 Comment

hi aman,
im also facing the same issue ,
have you resolved it..?
please let me know whats the solution.

Sign in to comment.

Answers (2)

For a new Simulink model, Matlab 2019b, in configuration Parameters /Data Import/Export has ticked for default an additional variable “Single simulation output -> out”. A solution is disactivate this option.
All the best

6 Comments

thanks a lot Dorin , it worked
Thanks Dorin you saved another life:)
Hello,
I face thesame issue and after deactivating the 'single simulation output", thesame errro message still pop up
I am struck with the same problem so did you manage to figure something out?
  • I tried to come up with a simple test example and copied almost everything from the MATLAB example (mrefroboarm) but as with you, it didn't work --> see the attached files
  • I also thought it might be about the file format. The example is a .mdl file however saving it to a directory, Simulink automatically chooses the .slx format. However saving it afterwards as a .mdl file doesn't seem to have an effect on the problem.
  • The suggested change in the settings for me also didn't have an effect on the problem.
Best,
Daniel
Hi Daniel,
You need to deactivate the “'single simulation output",” and from the training model, in your case “model.mdl”. This is the model which generate the data for the nn training. Please see the attachment.
Regards,
Dorin
Hi Dorin,
That's a good point that I had overseen before, to deactivate the tick in both files.
Thanks a lot

Sign in to comment.

Hi there again,
Firstly, I want to mention that I got confused as this forum entry is about the NN Predictive Controller however I was looking for the Model Reference Controller. Google led me here when I pasted my error message in so I guess the workaround that I applied may be also helpful here:
  • I first saved the example and also the corresponding plant model which were provided by Matlab as a separated file (I choose the names MRC_for_plant.mdl and plant.mdl)
  • Then I removed the given plant and replaced it by one of my desire in the MRC_for_plant.mdl and in the plant.mdl file
Now it seems to be working for my use case. I'm not quite sure if that is what you @aman hari have tried for the NN Predictive Controller? It seems to me that the example provided by Matlab requires some special settings as @Dorin pointed out which however may or may not be activated, varying from user to user (the settings Dorin suggested didn't work for me).
Btw., I attached my files so let me know if they work for you.
Best,
Daniel

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Asked:

on 12 Jul 2019

Commented:

on 5 Nov 2021

Community Treasure Hunt

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

Start Hunting!