how to build a control system with one input and multiple outputs
39 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
hello~
I want to build a system like this. I don't know how to deal with the separate output from modul F
0 Commenti
Risposta accettata
Paul
il 21 Nov 2021
Modificato: Paul
il 21 Nov 2021
Here is one approach (there are others), with simple examples tf's for C, F, and G, that you should be able to adapt to your problem.
The trick is to replicate F so that it has two outputs. One output to add to G and the other to keep as the output of the closed loop system.
% Example data
C = tf(1,[1 0]);
F = tf(1,[1 1]);
G = tf(1,[1 2]);
% Create a new version of F that has two outputs that are the same as each
% other. One output of F will be added to the output of G and the other
% will be retained as the output of the system
Fnew = [F;F];
% Create E
E = parallel(Fnew,G,1,1,2,1);
% E now is 1-input, 2-output. The first output is F, and the other is the
% sum of E and F. Check
E
F
minreal(G+F)
% Now put C in series with E
H = series(C,E)
% Now close the loop using the second output of H
ClosedLoop = feedback(H,1,1,2,-1)
% Hmm, why are the denominators different?
zpk(ClosedLoop)
% Looks like feedback() left some pole/zero cancellations uncancelled.
% This happened because of the lazy way I replicated F.
% It would not have happened if I would have used ss objects throughout,
% which is the preferred approach.
% But we can get rid of them.
ClosedLoop = minreal(ClosedLoop)
% Now we can check each result individually using block diagram algebra
% (not a recommended approach in general)
minreal(F*C/(1+C*(F+G)))
minreal((G+F)*C/(1+C*(F+G)))
3 Commenti
Paul
il 22 Nov 2021
Fnew as two outputs and one input, and G has one output and one input.
In this line
E = parallel(Fnew,G,1,1,2,1) % (Fnew, G, inp1, inp2, out1, out2
inp1 = inp2 = 1, which means that the new input to E is split into the first (only) input of Fnew and the first (only) input of G. out1 = 2 and out2 = 1 means that the sencond output of Fnew and the first (only) output of G are summed together to form the new output of E. The full output of E is the first output of Fnew and the new summed signal. So inp1 and inp2 are the indices of the inputs to Fnew and G respectively that are the new common input to E, and out1 and out2 are the indices of the outputs from Fnew and G that are added to form the new summed output of E. Any other inputs/outputs to/from Fnew and G are retained in E. In this case, the only other input/output retained is the first output from Fnew.
H has one input and two outputs. This command
ClosedLoop = feedback(H,1,1,2,-1) % (sys1, sys2, feedin, feedout, sign)
says to feedback the second (feedout) output of H, into the feedback block (sys2 = 1), and take the output of the feedback block with negative sign (sign = -1) to form the error signal to put into the first (feedin) input of H. Both outputs of H are retained as outputs of ClosedLoop.
Più risposte (1)
Walter Roberson
il 21 Nov 2021
Create Subsystem, then click the right hand edge to Add Port for as many output ports as you need
Or, instead create your subsystem and add Outport blocks; https://www.mathworks.com/help/simulink/slref/outport.html
Vedere anche
Categorie
Scopri di più su General Applications in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!