PID Controller Architectures
PID Controller Architectures
lsys = TransferFunctionModel[Unevaluated[{{(1/1 + 1.2s + 3s^2)}}], s, SamplingPeriod -> None, SystemsModelLabels -> None];
spResponseTFM[arch_] := PIDTune[lsys, arch, "ReferenceOutput"]
spResponsePlot[arch_] := Plot[Evaluate@{OutputResponse[spResponseTFM[arch], UnitStep[t - 5], {t, 0, 50}], UnitStep[t - 5]}, {t, 0, 50}, PlotRange -> All, Exclusions -> None]spResponsePlot["P"]spResponsePlot["PI"]spResponsePlot["PID"]spResponsePlot["PD"]spResponsePlot["PFD"]spResponsePlot["PIFD"]plot[ctype_, ticks_] := Show[{Plot[UnitStep[t - 5], {t, 0, 50}, Exclusions -> None, PlotStyle -> RandomChoice[ColorData[3, "ColorList"]]], Plot[Evaluate[OutputResponse[PIDTune[lsys, ctype, "ReferenceOutput"], UnitStep[t - 5], {t, 5, 50}]], {t, 0, 50}, PlotRange -> All, PlotStyle -> RandomChoice[ColorData[3, "ColorList"]]]}, PlotRange -> All, PlotLabel -> ctype, Ticks -> ticks]Grid[Partition[plot[#, None]& /@ {"P", "PI", "PID", "PD", "PFD", "PIFD"}, 3]]