How to customize a Built-in PID Block?
6 次查看(过去 30 天)
显示 更早的评论
I am using a PID controller in a feedback system. I need to change the gain's multiplication type from element-wise to the matrix. I right clicked on the PID block then from link options, I disabled the link. Now after I looked under the mask, I could change the Gain's multiplication type. but after I save the model and run the simulation again everything goes back to its initial settings like I never applied any change! So my question is How can I customize the PID block in SIMULINK?
2 个评论
Ryan G
2012-10-8
Since you are doing matrix multiplication are you implying that this will have more than 1 input to the PID?
采纳的回答
Arkadiy Turevskiy
2012-10-8
编辑:Arkadiy Turevskiy
2012-10-8
Hello Mike,
At the moment, you won't be able to customize the standard PID block and still retain the automatic tuning functionality. The best workaround I can suggest is creating your own block for implementation, and using the standard block for tuning. Once the gain are tuned using the standard block, you can use them in your customized block. You could probably somewhat automate the process by using block callbacks and variants.
Arkadiy
2 个评论
Arkadiy Turevskiy
2012-10-19
Hello Mike, PID Controller block in Simulink, as well as the PID Tuner, only work on SISO systems. For a MIMO system, you need to specify your controller as a set of SISO PID loops. PID Tuner would not be able to tune a multi-loop design, you will need to use tools from Robust Control Toolbox, like shown in this example.
Arkadiy
更多回答(2 个)
Azzi Abdelmalek
2012-10-4
编辑:Azzi Abdelmalek
2012-10-4
I see your problem, but you can change these setting by code, just after loading your model named 'model.mdl'
set_param('model/PID Controller/Proportional Gain','Multiplication','Matrix(K*u)')
or you can associate this code with your model:
right click on your model- properties-callbacks-init Fcn (copy and paste the code)
10 个评论
Azzi Abdelmalek
2012-10-6
编辑:Azzi Abdelmalek
2012-10-6
I think the setting vanishes just when the simultion start, not after like I said. I suggest to Edit mask of your PID block then unmask it. when you start simulations other errors will occur, asking about:
- output/param (min/max). set them to []
- datatype(etc...) set them to double
save the target of this link
Babak
2012-10-3
You don't want to edit Simulink's Built in blocks.
Instead you want to create your own custom blocks. You could do it with creating an S-function block and creating a mask for it or making a MATLAB based block which runs an m-file.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!