Model { Name "pid1" Version 3.00 SimParamPage "Solver" SampleTimeColors off InvariantConstants off WideVectorLines off ShowLineWidths off ShowPortDataTypes off StartTime "0.0" StopTime "20" 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:35:49 2000" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" ModifiedDateFormat "%" LastModifiedDate "Tue Jan 18 19:40:24 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 "pid1" 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 Inport Name "Iinmod\ninput" Position [125, 190, 145, 210] Orientation "left" ForegroundColor "blue" DropShadow on FontName "Arial" FontSize 14 Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" Interpolate on } Block { BlockType SubSystem Name "Band-Limited\nWhite Noise" Ports [0, 1, 0, 0, 0] Position [365, 295, 405, 325] 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]|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 Step Name "Dist_i" Position [215, 13, 250, 37] BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 Time "10" Before "0" After "1" SampleTime "0" } Block { BlockType Step Name "Dist_o" Position [450, 13, 485, 37] BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 Time "1" Before "0" After "0" SampleTime "0" } Block { BlockType StateSpace Name "HP filter" Position [285, 295, 325, 325] Orientation "left" BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 A "at" B "bt" C "ct" D "dt" X0 "0" MaskType "buttap,lp2hp" MaskDescription "Analog Butterworth high pass filter.\n\n(Requir" "es Signal Processing Toolbox)" MaskHelp "Butterworth high pass filter using MATLAB's but" "ter and lp2hp commands." MaskPromptString "Cutoff frequency (rad/sec):|Order" MaskStyleString "edit,edit" MaskTunableValueString "on,on" MaskCallbackString "|" MaskEnableString "on,on" MaskVisibilityString "on,on" MaskInitialization "[at,bt,ct,dt,w,mag]=filtm('buttap','lp2hp',@1,[" "],20,@2);" MaskDisplay "plot(w,mag)" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "5|4" } Block { BlockType TransferFcn Name "Plant" Position [335, 67, 465, 133] BackgroundColor "yellow" DropShadow on FontName "Arial" FontSize 14 Numerator "1" Denominator "[1 3 3 1]" } Block { BlockType Step Name "Ref" Position [35, 83, 70, 107] BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 Time "0" Before "0" After "1" SampleTime "0" } Block { BlockType Scope Name "Scope1" Ports [1, 0, 0, 0, 0] Position [695, 64, 735, 116] BackgroundColor "green" DropShadow on ShowName off FontName "Arial" FontSize 14 Floating off Location [464, 280, 795, 594] Open on NumInputPorts "1" TickLabels "on" ZoomMode "on" List { ListType AxesTitles axes1 "%" } Grid "on" TimeRange "20.000000" YMin "-2" YMax "2" SaveToWorkspace off SaveName "ScopeData" DataFormat "Matrix" LimitMaxRows on MaxRows "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType SubSystem Name "Subsystem" Ports [1, 1, 0, 0, 0] Position [190, 70, 240, 150] ForegroundColor "red" DropShadow on ShowName off FontName "Arial" FontSize 14 ShowPortLabels off MaskType "PID" MaskDescription "PID" MaskPromptString "Prop gain:|Integral time:|Derivative time:|Deri" "vative time constant:" MaskStyleString "edit,edit,edit,edit" MaskTunableValueString "on,on,on,on" MaskCallbackString "|||" MaskEnableString "on,on,on,on" MaskVisibilityString "on,on,on,on" MaskVariables "Kp=@1;Tr=@2;Td=@3;tau_D=@4;" MaskDisplay "disp('PID')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "4.8|1.81|0.45|0.045" System { Name "Subsystem" Location [155, 32767, 412, 32767] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on Block { BlockType Inport Name "in_1" Position [15, 125, 35, 145] Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" Interpolate on } Block { BlockType TransferFcn Name "Mode D" Position [70, 195, 165, 255] ForegroundColor "red" DropShadow on FontName "helvetica18" Numerator "[Kp*Td 0]" Denominator "[tau_D 1]" } Block { BlockType TransferFcn Name "Mode I" Position [90, 111, 165, 159] ForegroundColor "red" DropShadow on FontName "helvetica18" Numerator "[Kp]" Denominator "[Tr 0]" } Block { BlockType Gain Name "Mode P" Position [105, 38, 155, 82] ForegroundColor "red" DropShadow on FontName "helvetica18" Gain "Kp" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum4" Ports [3, 1, 0, 0, 0] Position [205, 113, 225, 157] ForegroundColor "red" DropShadow on ShowName off FontName "helvetica18" IconShape "rectangular" Inputs "+++" SaturateOnIntegerOverflow on } Block { BlockType Outport Name "out_1" Position [240, 125, 260, 145] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "in_1" SrcPort 1 Points [14, 0] Branch { Points [0, 90] DstBlock "Mode D" DstPort 1 } Branch { Points [15, 0] Branch { DstBlock "Mode I" DstPort 1 } Branch { Points [0, -75] DstBlock "Mode P" DstPort 1 } } } Line { SrcBlock "Mode D" SrcPort 1 Points [15, 0; 0, -75] DstBlock "Sum4" DstPort 3 } Line { SrcBlock "Mode P" SrcPort 1 Points [25, 0; 0, 60] DstBlock "Sum4" DstPort 1 } Line { SrcBlock "Mode I" SrcPort 1 DstBlock "Sum4" DstPort 2 } Line { SrcBlock "Sum4" SrcPort 1 DstBlock "out_1" DstPort 1 } } } Block { BlockType Sum Name "Sum" Ports [3, 1, 0, 0, 0] Position [140, 86, 165, 134] ForegroundColor "red" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "+-+" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum1" Ports [2, 1, 0, 0, 0] Position [525, 70, 545, 110] BackgroundColor "yellow" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "++" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum2" Ports [2, 1, 0, 0, 0] Position [165, 261, 185, 299] Orientation "left" BackgroundColor "yellow" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "++" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum3" Ports [2, 1, 0, 0, 0] Position [295, 81, 315, 119] BackgroundColor "yellow" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "++" SaturateOnIntegerOverflow on } Block { BlockType ToWorkspace Name "plant output" Position [675, 162, 720, 188] BackgroundColor "green" DropShadow on ShowName off FontName "Arial" FontSize 14 VariableName "y" Buffer "6000" Decimation "1" SampleTime "0" SaveFormat "Matrix" } Block { BlockType Outport Name "linmod\noutput" Position [685, 220, 705, 240] ForegroundColor "green" DropShadow on FontName "Arial" FontSize 14 Port "1" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "Plant" SrcPort 1 DstBlock "Sum1" DstPort 2 } Line { SrcBlock "Ref" SrcPort 1 DstBlock "Sum" DstPort 1 } Line { SrcBlock "Sum1" SrcPort 1 Points [95, 0] Branch { DstBlock "Scope1" DstPort 1 } Branch { Points [-25, 0; 0, 85; 25, 0] Branch { DstBlock "plant output" DstPort 1 } Branch { Points [-25, 0; 0, 55; 35, 0] Branch { Points [-35, 0; 0, 40] DstBlock "Sum2" DstPort 1 } Branch { DstBlock "linmod\noutput" DstPort 1 } } } } Line { SrcBlock "Dist_o" SrcPort 1 Points [20, 0] DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Sum3" SrcPort 1 DstBlock "Plant" DstPort 1 } Line { SrcBlock "Dist_i" SrcPort 1 Points [25, 0] DstBlock "Sum3" DstPort 1 } Line { SrcBlock "Subsystem" SrcPort 1 DstBlock "Sum3" DstPort 2 } Line { SrcBlock "Iinmod\ninput" SrcPort 1 Points [-20, 0; 0, -75] DstBlock "Sum" DstPort 3 } Line { SrcBlock "Sum" SrcPort 1 DstBlock "Subsystem" DstPort 1 } Line { SrcBlock "HP filter" SrcPort 1 Points [-45, 0; 0, -20] DstBlock "Sum2" DstPort 2 } Line { SrcBlock "Sum2" SrcPort 1 Points [-70, 0; 0, -170] DstBlock "Sum" DstPort 2 } Line { SrcBlock "Band-Limited\nWhite Noise" SrcPort 1 DstBlock "HP filter" DstPort 1 } Annotation { Position [382, 372] VerticalAlignment "top" ForegroundColor "blue" Text "PID CONTROL TUNED USING ZIEGLER - NICHOLS OSCIL" "LATING METHOD" DropShadow on FontName "Arial" FontSize 14 } } }