
242 Appendix D: The SIMSCAPE Modeling Environment Tutorial
In first place we have to collect all components necessary to build the PID
controller from the Foundations Library. Afterwards, we will connect the selected
components to implement the physical components diagram, also changing the
parameters of these components if it is necessary. Finally the system is simulated
by selecting the appropriate solver options.
Therefore, as first step, we open a new component model, dragging the
constitutive components of the physical components diagram from each one of the
components libraries where they are included (fig. D.5).
As second step, we connect these components following the desired connection
pattern as indicated in the PID electronic circuit (fig. D.6). Possibly, it will be
necessary to flip or rotate some components or to derive some pickoff points.
Afterward, in a third step we have to change the component’s parameters
according to the values defined in the original PID electronic circuit if it is necessary,
adding optionally labels both to identify the signals transferred between components
or to name specific components (fig. D.7). Component parameters can also be
defined from the MATLAB workspace and used in SIMSCAPE. In this case we have
assigned the resistors, capacitors, gains, and ramp slope values as
>> R1=153.85*10^3;
>> R2=153.85*10^3;
>> R3=10*10^3;
>> R4=197.1*10^3;
>> C1=10*10^-6;
>> C2=10*10^-6;
>> ramp_slope=0.1;
Fig. D.5 Building process for the PID circuit (step 1)