Why can I not tune parameters in external mode in simulink with my arduino uno?

5 Ansichten (letzte 30 Tage)
Hi! I have an arduino uno connected to my computer (with R2017a) whit the added for arduino in simulink. Im trying to adjust some PID parameters in the provided PID simulink block while running in external mode. The problem is that when I change the parameters in the PID controller nothing happens with the control signal. Only when I restart the process the changes take affect. I get no errors, only a warning saying: ''A terminate function is necessary, however the code generation process did not generate a terminate function because the 'Terminate function required' check box is cleared.'' because the stop time is set to inf.

Antworten (1)

Nick Choi
Nick Choi am 3 Okt. 2017
You may not have been able to observe significant changes when you tuned the PID parameters if the output of the system reached the desired value by the time that the gains were changed.
In this case, the PID's error signal would be quite small and this would limit observable effect that tuning a PID gain parameter would have. Enabling resets in the PID block could help make the changes in system behavior more noticeable.
The following documentation page provides useful information on how to configure PID blocks in Simulink: http://www.mathworks.com/help/simulink/slref/pidcontroller.html#br5mqa9-6
  1 Kommentar
Sverre Knutsen
Sverre Knutsen am 8 Okt. 2017
Thanks for the answer! That was not the problem though. I tried to set all parameters to zero in the PID controller and it was still giving the same output (different from zero). I was also feeding the controler with a known error signal so it was not that small. The problem was fixed after I rebuilt the exact same model (as far as I could tell). The only thing I might have changed in the new model was the sampling freq. because I was experiencing some data losses visable in the scope. Maybe the serial port did note cope with it?

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by