Model { Name "pidemp" Version 3.00 SimParamPage "Solver" SampleTimeColors off InvariantConstants off WideVectorLines off ShowLineWidths off ShowPortDataTypes off StartTime "0.0" StopTime "100" SolverMode "SingleTasking" Solver "ode45" RelTol "1e-3" AbsTol "1e-3" Refine "1" MaxStep ".010" InitialStep "auto" FixedStep "auto" MaxOrder 5 OutputOption "RefineOutputTimes" OutputTimes "[]" LoadExternalInput off ExternalInput "[t, u]" SaveTime on TimeSaveName "t" SaveState off StateSaveName "xout" SaveOutput off OutputSaveName "yout" LoadInitialState off InitialState "xInitial" SaveFinalState off FinalStateName "xFinal" SaveFormat "Matrix" LimitMaxRows off MaxRows "1000" Decimation "1" AlgebraicLoopMsg "warning" MinStepSizeMsg "warning" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" InheritedTsInSrcMsg "warning" IntegerOverflowMsg "warning" UnnecessaryDatatypeConvMsg "none" Int32ToFloatConvMsg "warning" SignalLabelMismatchMsg "none" ConsistencyChecking "off" ZeroCross on SimulationMode "normal" BlockDataTips on BlockParametersDataTip on BlockAttributesDataTip off BlockPortWidthsDataTip off BlockDescriptionStringDataTip off BlockMaskParametersDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off OptimizeBlockIOStorage on BufferReuse on BooleanDataType off RTWSystemTargetFile "grt.tlc" RTWInlineParameters off RTWRetainRTWFile off RTWTemplateMakefile "grt_default_tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off ExtModeMexFile "ext_comm" ExtModeBatchMode off ExtModeTrigType "manual" ExtModeTrigMode "oneshot" ExtModeTrigPort "1" ExtModeTrigElement "any" ExtModeTrigDuration 1000 ExtModeTrigHoldOff 0 ExtModeTrigDelay 0 ExtModeTrigDirection "rising" ExtModeTrigLevel 0 ExtModeArchiveMode "off" ExtModeAutoIncOneShot off ExtModeIncDirWhenArm off ExtModeAddSuffixToVar off ExtModeWriteAllDataToWs off ExtModeArmWhenConnect off Created "Tue Jan 18 19:40:42 2000" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" ModifiedDateFormat "%" LastModifiedDate "Tue Jan 18 19:42:40 2000" ModelVersionFormat "1.%" ConfigurationManager "none" BlockDefaults { Orientation "right" ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Helvetica" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on } AnnotationDefaults { HorizontalAlignment "center" VerticalAlignment "middle" ForegroundColor "black" BackgroundColor "white" DropShadow off FontName "Helvetica" FontSize 10 FontWeight "normal" FontAngle "normal" } LineDefaults { FontName "Helvetica" FontSize 9 FontWeight "normal" FontAngle "normal" } System { Name "pidemp" Location [2, 74, 802, 560] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on ReportName "simulink-default.rpt" Block { BlockType StateSpace Name "BP Filter " Position [380, 299, 420, 331] Orientation "left" BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 A "at" B "bt" C "ct" D "dt" X0 "0" MaskType "buttap,lp2bp" MaskDescription "Analog Butterworth band pass filter.\n\n(Requir" "es Signal Processing Toolbox)" MaskHelp "Butterworth band pass filter using MATLAB's but" "ter and lp2bp command." MaskPromptString "Center frequency (rad/sec)|Bandwidth (rad/sec):" "|Order" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskInitialization "[at,bt,ct,dt,w,mag]=filtm('buttap','lp2bp',@1,@" "2,50,@3);" MaskDisplay "plot(w,mag)" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "2|2|4" } Block { BlockType SubSystem Name "Band-Limited\nWhite Noise" Ports [0, 1, 0, 0, 0] Position [520, 303, 550, 327] Orientation "left" BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 ShowPortLabels off MaskType "Continuous White Noise." MaskDescription "White noise for continuous (s-domain) systems." "\nBand-limited using zero-order-hold." MaskHelp "Implemented using white noise into Zero-Order H" "old block. The seed and power can be vectors of the same length to produce a " "vector of white noise sources. For faster simulation, set sample time to the " "highest value possible but in accordance with the fastest dynamics of system." MaskPromptString "Noise Power:|Sample Time:|Seed" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskInitialization "Cov = @1; Ts = @2; seed = @3; r = rand(1,12); r" "2 = [r(1),r;r,r(12)]; t =[1:13;1:13];" MaskDisplay "plot(t(:),r2(:))" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "[0.1]|0.1|[23341]" System { Name "Band-Limited\nWhite Noise" Location [56, 339, 341, 468] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "cyan" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on Block { BlockType Gain Name "Gain" Position [155, 31, 195, 69] Gain "[sqrt(Cov)]/[sqrt(Ts)]" SaturateOnIntegerOverflow on } Block { BlockType RandomNumber Name "White Noise" Position [25, 40, 45, 60] Mean "0" Variance "1" Seed "seed" SampleTime "0" } Block { BlockType ZeroOrderHold Name "Zero-Order\nHold" Position [85, 34, 120, 66] SampleTime "Ts" } Block { BlockType Outport Name "Out_1" Position [230, 40, 250, 60] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "White Noise" SrcPort 1 DstBlock "Zero-Order\nHold" DstPort 1 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Out_1" DstPort 1 } Line { SrcBlock "Zero-Order\nHold" SrcPort 1 DstBlock "Gain" DstPort 1 } } } Block { BlockType Gain Name "Kp" Position [170, 130, 235, 170] ForegroundColor "red" DropShadow on NamePlacement "alternate" CopyFcn "slideg Copy" DeleteFcn "slideg DeleteBlock" LoadFcn "slideg Load" NameChangeFcn "slideg NameChange" OpenFcn "slideg Open" ParentCloseFcn "slideg ParentClose" FontName "Arial" FontSize 14 Gain "0.2" SaturateOnIntegerOverflow on MaskPromptString "Low|Gain|High" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskDisplay "disp('0.2')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "0|0.2|5" } Block { BlockType Scope Name "Osc-u" Ports [1, 0, 0, 0, 0] Position [335, 17, 375, 63] BackgroundColor "green" DropShadow on FontName "Arial" FontSize 14 Floating off Location [411, 595, 825, 796] Open off NumInputPorts "1" TickLabels "on" ZoomMode "on" List { ListType AxesTitles axes1 "%" } Grid "on" TimeRange "100.000000" YMin "-2.000000" YMax "2.000000" SaveToWorkspace off SaveName "ScopeData" DataFormat "Matrix" LimitMaxRows on MaxRows "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType Scope Name "Osc-y" Ports [1, 0, 0, 0, 0] Position [655, 42, 695, 88] BackgroundColor "green" DropShadow on FontName "Arial" FontSize 14 Floating off Location [372, 354, 786, 555] Open off NumInputPorts "1" TickLabels "on" ZoomMode "on" List { ListType AxesTitles axes1 "%" } Grid "on" TimeRange "100.000000" YMin "-2" YMax "2" SaveToWorkspace off SaveName "ScopeData" DataFormat "Matrix" LimitMaxRows on MaxRows "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType Step Name "Ref" Position [40, 128, 70, 152] BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 Time "10" Before "0" After "2" SampleTime "0" } Block { BlockType SubSystem Name "Subsystem" Ports [1, 1, 0, 0, 0] Position [410, 113, 485, 187] BackgroundColor "yellow" DropShadow on ShowName off FontName "Arial" FontSize 14 ShowPortLabels off MaskType "buttap" MaskDescription "Analog Butterworth low pass filter.\n\n(Require" "s Signal Processing Toolbox)" MaskHelp "Butterworth low pass filter using MATLAB's butt" "er command." MaskPromptString "Lower limit saturation value|Upper limit satura" "tion value|Cutoff frequency (rad/sec)|Order" MaskStyleString "edit,edit,edit,edit" MaskTunableValueString "on,on,on,on" MaskCallbackString "|||" MaskEnableString "on,on,on,on" MaskVisibilityString "on,on,on,on" MaskVariables "lows=@1;upps=@2;bw=@3;ord=@4;" MaskInitialization "[z,p,k]=buttap(ord); z=bw*z; p=bw*p; k=real(pro" "d(-p)); [num,den]=zp2tf(z,p,k); w=logspace(log10(bw/10),log10(10*bw),20); h=f" "reqs(num,den,w);" MaskDisplay "plot(20*log10(w),20*log10(abs(h)))" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "-10|10|1|3" System { Name "Subsystem" Location [182, 156, 502, 395] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "yellow" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on Block { BlockType Inport Name "in_1" Position [15, 85, 35, 105] ForegroundColor "blue" DropShadow on FontName "Arial" FontSize 14 Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" Interpolate on } Block { BlockType ZeroPole Name "Analog Butterworth\nLP Filter" Position [160, 73, 220, 117] DropShadow on FontName "Arial" FontSize 14 Zeros "z" Poles "p" Gain "k" } Block { BlockType Saturate Name "Saturation" Position [60, 75, 110, 115] DropShadow on ShowName off FontName "Arial" FontSize 14 UpperLimit "upps" LowerLimit "lows" } Block { BlockType Outport Name "out_1" Position [265, 85, 285, 105] ForegroundColor "green" DropShadow on FontName "Arial" FontSize 14 Port "1" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "Saturation" SrcPort 1 DstBlock "Analog Butterworth\nLP Filter" DstPort 1 } Line { SrcBlock "in_1" SrcPort 1 DstBlock "Saturation" DstPort 1 } Line { SrcBlock "Analog Butterworth\nLP Filter" SrcPort 1 DstBlock "out_1" DstPort 1 } } } Block { BlockType Sum Name "Sum3" Ports [2, 1, 0, 0, 0] Position [250, 251, 270, 289] Orientation "left" BackgroundColor "yellow" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "++" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum4" Ports [2, 1, 0, 0, 0] Position [110, 131, 130, 169] ForegroundColor "red" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "+-" SaturateOnIntegerOverflow on } Block { BlockType ToWorkspace Name "controller output" Position [320, 181, 360, 209] BackgroundColor "green" DropShadow on ShowName off FontName "Arial" FontSize 14 VariableName "u" Buffer "10000" Decimation "1" SampleTime "0" SaveFormat "Matrix" } Block { BlockType ToWorkspace Name "measurement noise" Position [225, 326, 265, 354] Orientation "left" BackgroundColor "green" DropShadow on ShowName off FontName "Arial" FontSize 14 VariableName "n" Buffer "10000" Decimation "1" SampleTime "0" SaveFormat "Matrix" } Block { BlockType ToWorkspace Name "plant output" Position [655, 156, 695, 184] BackgroundColor "green" DropShadow on ShowName off FontName "Arial" FontSize 14 VariableName "y" Buffer "10000" Decimation "1" SampleTime "0" SaveFormat "Matrix" } Line { SrcBlock "Sum4" SrcPort 1 DstBlock "Kp" DstPort 1 } Line { SrcBlock "Ref" SrcPort 1 DstBlock "Sum4" DstPort 1 } Line { SrcBlock "Band-Limited\nWhite Noise" SrcPort 1 DstBlock "BP Filter " DstPort 1 } Line { SrcBlock "Subsystem" SrcPort 1 Points [110, 0] Branch { Points [0, -85] DstBlock "Osc-y" DstPort 1 } Branch { Points [15, 0; 0, 20] Branch { Points [0, 90] DstBlock "Sum3" DstPort 1 } Branch { DstBlock "plant output" DstPort 1 } } } Line { SrcBlock "BP Filter " SrcPort 1 Points [-52, 0] Branch { Points [-18, 0; 0, -35] DstBlock "Sum3" DstPort 2 } Branch { Points [0, 25] DstBlock "measurement noise" DstPort 1 } } Line { SrcBlock "Kp" SrcPort 1 Points [53, 0] Branch { Points [10, 0] Branch { DstBlock "Subsystem" DstPort 1 } Branch { Points [0, -110] DstBlock "Osc-u" DstPort 1 } } Branch { Points [0, 45] DstBlock "controller output" DstPort 1 } } Line { SrcBlock "Sum3" SrcPort 1 Points [-162, 0; 0, -110] DstBlock "Sum4" DstPort 2 } Annotation { Position [407, 387] VerticalAlignment "top" ForegroundColor "blue" Text "LOOP TO APPLY ZIEGLER-NICHOLS TUNING OSCILLATIO" "N METHOD \nFOR AN UNKNOWN STABLE PLANT" DropShadow on FontName "Arial" FontSize 14 } Annotation { Position [427, 437] VerticalAlignment "top" ForegroundColor "red" Text "TO CHANGE THE GAIN DOUBLE CLIK ON THE (SLIDING" " GAIN) BLOCK Kp" DropShadow on FontName "Arial" FontSize 14 } } }