Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/extras/ControlLoop.m4

raw
1 .PS
2 # ControlLoop.m4
3 # https://tex.stackexchange.com/questions/636839/how-to-draw-multi-blocks-block-diagram
4 gen_init
5 scale = 25.4
6
7 boxwid = 18
8 boxrad = 3
9 define summer { $1: circle diam 10 fill_(0.8)
10 { line from $1.ne to $1.sw; line from $1.nw to $1.se }
11 { "$+$" at $1.nw rjust } }
12
13 TPG: box ht 22 shaded "Peach" "Transient" "Profile" "Generator"
14 arrow <- left_ 8 from TPG.w "r" above
15 arrow right_ 10 from TPG.e+(0,TPG.ht/4) "$r_1$" above
16 summer(S1)
17 line right_ 10 from TPG.e+(0,-TPG.ht/4) "$r_2$" above
18 arrow right_ S1.diam
19 summer(S2)
20 arrow right_ 10 from S2.e "$e_2$" above
21 arrow from S1.e to (Here,S1) "$e_1$" above
22 NLSF: box ht 22 "Nonlinear" "State Error" "Feedback" shaded "lime" \
23 with .w at (Here,TPG)
24 arrow right_ 10 "$u_o$" below
25 summer(S3)
26 {ESO: box ht 30 shaded "Goldenrod" "Extended" "State" "Observer" \
27 with .w at (Here.x+5,NLSF.s.y-15) }
28 arrow right_ 40
29 P: box ht 15 shaded "blue!50!white!50" "Plant"
30 arrow right_ 10 "$y$" above
31 arrow <- right_ 10 from ESO.e+(0,-ESO.ht/4) "$y$" above
32 line to (2nd last arrow,Here) then to 2nd last arrow
33 arrow <- right_ 10 from ESO.e+(0,ESO.ht/4) "$u$" above; corner
34 line to (Here,P)
35 for_(1,3,1,
36 `arrow from ESO.w+(0,ESO.ht*(m4x-2)/3) left_ ESO.w.x-S`'m4x.x then to S`'m4x.s
37 "$z_`'m4x$" at last arrow.start-(5,0) above
38 "$-$" at last arrow.end rjust below ')
39
40 .PE