Library { Name "pidLibrary" Version 7.1 MdlSubVersion 0 SavedCharacterEncoding "windows-1252" LibraryType "BlockLibrary" SaveDefaultBlockParams on SampleTimeColors off LibraryLinkDisplay "none" WideLines off ShowLineDimensions off ShowPortDataTypes off ShowLoopsOnError on IgnoreBidirectionalLines off ShowStorageClass off ShowTestPointIcons on ShowSignalResolutionIcons on ShowViewerIcons on SortedOrder off ExecutionContextIcon off ShowLinearizationAnnotations on ScopeRefreshTime 0.035000 OverrideScopeRefreshTime on DisableAllScopes off BlockNameDataTip off BlockParametersDataTip off BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off Created "Tue Dec 11 09:50:24 2007" Creator "sethp" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "sethp" ModifiedDateFormat "%" LastModifiedDate "Mon Mar 03 22:06:54 2008" RTWModifiedTimeStamp 0 ModelVersionFormat "1.%" ConfigurationManager "None" SimulationMode "normal" LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on covSaveCumulativeToWorkspaceVar on CovSaveSingleToWorkspaceVar on CovCumulativeReport off CovReportOnPause on CovModelRefEnable "Off" ExtModeBatchMode off ExtModeEnableFloating on ExtModeTrigType "manual" ExtModeTrigMode "normal" ExtModeTrigPort "1" ExtModeTrigElement "any" ExtModeTrigDuration 1000 ExtModeTrigDurationFloating "auto" ExtModeTrigHoldOff 0 ExtModeTrigDelay 0 ExtModeTrigDirection "rising" ExtModeTrigLevel 0 ExtModeArchiveMode "off" ExtModeAutoIncOneShot off ExtModeIncDirWhenArm off ExtModeAddSuffixToVar off ExtModeWriteAllDataToWs off ExtModeArmWhenConnect on ExtModeSkipDownloadWhenConnect off ExtModeLogAll on ExtModeAutoUpdateStatusClock on ShowModelReferenceBlockVersion off ShowModelReferenceBlockIO off BlockDefaults { Orientation "right" ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Arial" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on } BlockParameterDefaults { Block { BlockType Derivative LinearizePole "inf" } Block { BlockType DiscreteIntegrator IntegratorMethod "Integration: Forward Euler" gainval "1.0" ExternalReset "none" InitialConditionSource "internal" InitialCondition "0" InitialConditionMode "State and output" SampleTime "1" OutMin "[]" OutMax "[]" OutDataTypeMode "Inherit via internal rule" OutDataType "fixdt(1,16,0)" OutScaling "[]" OutDataTypeStr "Inherit: Inherit via internal rule" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow off LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off IgnoreLimit off StateMustResolveToSignalObject off RTWStateStorageClass "Auto" } Block { BlockType Gain Gain "1" Multiplication "Element-wise(K.*u)" ParamMin "[]" ParamMax "[]" ParameterDataTypeMode "Same as input" ParameterDataType "fixdt(1,16,0)" ParameterScalingMode "Best Precision: Matrix-wise" ParameterScaling "[]" ParamDataTypeStr "Inherit: Same as input" OutMin "[]" OutMax "[]" OutDataTypeMode "Same as input" OutDataType "fixdt(1,16,0)" OutScaling "[]" OutDataTypeStr "Inherit: Same as input" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Inport Port "1" UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" OutMin "[]" OutMax "[]" DataType "auto" OutDataType "fixdt(1,16,0)" OutScaling "[]" OutDataTypeStr "Inherit: auto" SignalType "auto" SamplingMode "auto" LatchByDelayingOutsideSignal off LatchByCopyingInsideSignal off Interpolate on } Block { BlockType Integrator ExternalReset "none" InitialConditionSource "internal" InitialCondition "0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" IgnoreLimit off ZeroCross on ContinuousStateAttributes "''" } Block { BlockType Mux Inputs "4" DisplayOption "none" UseBusObject off BusObject "BusObject" NonVirtualBus off } Block { BlockType Outport Port "1" UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" OutMin "[]" OutMax "[]" DataType "auto" OutDataType "fixdt(1,16,0)" OutScaling "[]" OutDataTypeStr "Inherit: auto" SignalType "auto" SamplingMode "auto" OutputWhenDisabled "held" InitialOutput "[]" } Block { BlockType Reference } Block { BlockType "S-Function" FunctionName "system" SFunctionModules "''" PortCounts "[]" SFunctionDeploymentMode off } Block { BlockType SubSystem ShowPortLabels "FromPortIcon" Permissions "ReadWrite" PermitHierarchicalResolution "All" TreatAsAtomicUnit off CheckFcnCallInpInsideContextMsg off SystemSampleTime "-1" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" SimViewingDevice off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" } Block { BlockType Sum IconShape "rectangular" Inputs "++" CollapseMode "All dimensions" CollapseDim "1" InputSameDT on AccumDataTypeStr "Inherit: Inherit via internal rule" OutMin "[]" OutMax "[]" OutDataTypeMode "Same as first input" OutDataType "fixdt(1,16,0)" OutScaling "[]" OutDataTypeStr "Inherit: Same as first input" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType UnitDelay X0 "0" SampleTime "1" StateMustResolveToSignalObject off RTWStateStorageClass "Auto" } } AnnotationDefaults { HorizontalAlignment "center" VerticalAlignment "middle" ForegroundColor "black" BackgroundColor "white" DropShadow off FontName "Arial" FontSize 10 FontWeight "normal" FontAngle "normal" UseDisplayTextAsClickCallback off } LineDefaults { FontName "Arial" FontSize 9 FontWeight "normal" FontAngle "normal" } System { Name "pidLibrary" Location [480, 85, 794, 409] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType SubSystem Name "Continuous PI \nController" Ports [1, 1] Position [75, 220, 120, 250] MinAlgLoopOccurrences off PropExecContextOutsideSubsystem off RTWSystemCode "Auto" FunctionWithSeparateData off Opaque off RequestExecContextInheritance off MaskHideContents off MaskType "Continuous PI Controller" MaskDescription "Enter Proportional(P), Integral(I) terms.\n\nP + I/s" MaskPromptString "Proportional:|Integral:" MaskStyleString "edit,edit" MaskTunableValueString "on,on" MaskCallbackString "|" MaskEnableString "on,on" MaskVisibilityString "on,on" MaskToolTipString "on,on" MaskVarAliasString "," MaskVariables "P=@1;I=@2;" MaskDisplay "disp('PI (s)')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "1|1" MaskTabNameString "," System { Name "Continuous PI \nController" Location [433, 403, 931, 703] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Inport Name "U" Position [50, 88, 80, 102] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Derivative Name "Derivative" Position [170, 130, 200, 160] } Block { BlockType Gain Name "Gain" Position [290, 75, 335, 115] Gain "[P, I, D]" Multiplication "Matrix(K*u)" ParameterDataTypeMode "Inherit via internal rule" ParameterDataType "sfix(16)" ParameterScaling "2^0" ParamDataTypeStr "Inherit: Inherit via internal rule" OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" OutDataTypeStr "Inherit: Inherit via internal rule" SaturateOnIntegerOverflow off } Block { BlockType Integrator Name "Integrator" Ports [1, 1] Position [170, 80, 200, 110] } Block { BlockType Mux Name "Mux" Ports [3, 1] Position [260, 18, 265, 172] ShowName off Inputs "3" DisplayOption "bar" } Block { BlockType Outport Name "Y" Position [365, 88, 395, 102] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Y" DstPort 1 } Line { SrcBlock "Derivative" SrcPort 1 DstBlock "Mux" DstPort 3 } Line { SrcBlock "Integrator" SrcPort 1 DstBlock "Mux" DstPort 2 } Line { SrcBlock "U" SrcPort 1 Points [15, 0] Branch { Points [0, -50] DstBlock "Mux" DstPort 1 } Branch { Points [0, 50] DstBlock "Derivative" DstPort 1 } Branch { DstBlock "Integrator" DstPort 1 } } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Gain" DstPort 1 } } } Block { BlockType SubSystem Name "Continuous PID \nController" Ports [1, 1] Position [75, 35, 120, 65] MinAlgLoopOccurrences off PropExecContextOutsideSubsystem off RTWSystemCode "Auto" FunctionWithSeparateData off Opaque off RequestExecContextInheritance off MaskHideContents off MaskType "Continuous PID Controller" MaskDescription "Enter Proportional(P), Integral(I), and Derivative(D) terms.\n\nP + I/s + Ds" MaskHelp "This block implements a PID controller where parameters are entered for the Proportional, Integral and Derivative terms. Unmask this block to see how it works. The derivative term is implemented using a true derivative block." MaskPromptString "Proportional:|Integral:|Derivative:" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskToolTipString "on,on,on" MaskVarAliasString ",," MaskVariables "P=@1;I=@2;D=@3;" MaskDisplay "disp('PID (s)')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "1|1|0" MaskTabNameString ",," System { Name "Continuous PID \nController" Location [433, 403, 931, 703] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Inport Name "U" Position [50, 88, 80, 102] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Derivative Name "Derivative" Position [170, 130, 200, 160] } Block { BlockType Gain Name "Gain" Position [290, 75, 335, 115] Gain "[P, I, D]" Multiplication "Matrix(K*u)" ParameterDataTypeMode "Inherit via internal rule" ParameterDataType "sfix(16)" ParameterScaling "2^0" ParamDataTypeStr "Inherit: Inherit via internal rule" OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" OutDataTypeStr "Inherit: Inherit via internal rule" SaturateOnIntegerOverflow off } Block { BlockType Integrator Name "Integrator" Ports [1, 1] Position [170, 80, 200, 110] } Block { BlockType Mux Name "Mux" Ports [3, 1] Position [260, 18, 265, 172] ShowName off Inputs "3" DisplayOption "bar" } Block { BlockType Outport Name "Y" Position [365, 88, 395, 102] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Gain" DstPort 1 } Line { SrcBlock "U" SrcPort 1 Points [15, 0] Branch { DstBlock "Integrator" DstPort 1 } Branch { Points [0, 50] DstBlock "Derivative" DstPort 1 } Branch { Points [0, -50] DstBlock "Mux" DstPort 1 } } Line { SrcBlock "Integrator" SrcPort 1 DstBlock "Mux" DstPort 2 } Line { SrcBlock "Derivative" SrcPort 1 DstBlock "Mux" DstPort 3 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Y" DstPort 1 } } } Block { BlockType SubSystem Name "Continuous PID \nController\n(with Approximate\nDerivative)" Ports [1, 1] Position [75, 115, 120, 145] MinAlgLoopOccurrences off PropExecContextOutsideSubsystem off RTWSystemCode "Auto" FunctionWithSeparateData off Opaque off RequestExecContextInheritance off MaskHideContents off MaskType "PID Controller w/ Approx Deriv" MaskDescription "Enter Proportional(P), Integral(I), and Derivative(D) and divisor (N) terms.\n\nP+I/s+Ds/(1/Ns+1)" MaskHelp "This block implements a PID controller where parameters are entered for the Proportional, Integral and Derivative and divisor terms. Unmask this block to see how it works. The derivative term is implemented using an s/(s/N +1) transfer function block. Making N large can create a \"stiff\" system." MaskPromptString "Proportional:|Integral:|Derivative:|Derivative divisor(N):" MaskStyleString "edit,edit,edit,edit" MaskTunableValueString "on,on,on,on" MaskCallbackString "|||" MaskEnableString "on,on,on,on" MaskVisibilityString "on,on,on,on" MaskToolTipString "on,on,on,on" MaskVarAliasString ",,," MaskVariables "P=@1;I=@2;D=@3;N=@4;" MaskDisplay "disp('PID (s)')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "1|1|0|100" MaskTabNameString ",,," System { Name "Continuous PID \nController\n(with Approximate\nDerivative)" Location [70, 117, 594, 486] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Inport Name "e" Position [55, 115, 75, 135] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Gain Name "Derivative\nDivisor" Position [255, 177, 300, 203] Gain "N" ParameterDataType "sfix(16)" ParameterScaling "2^0" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Gain Name "Derivative\nGain" Position [125, 177, 170, 203] Gain "D" ParameterDataType "sfix(16)" ParameterScaling "2^0" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Integrator Name "Filter" Ports [1, 1] Position [260, 235, 290, 265] Orientation "left" } Block { BlockType Gain Name "Integral\nGain" Position [130, 111, 175, 139] Gain "I" ParameterDataType "sfix(16)" ParameterScaling "2^0" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Integrator Name "Integrator" Ports [1, 1] Position [265, 110, 295, 140] } Block { BlockType Gain Name "Proportional\nGain" Position [130, 47, 170, 73] Gain "P" ParameterDataType "sfix(16)" ParameterScaling "2^0" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Sum Name "Sum" Ports [3, 1] Position [345, 110, 375, 140] ShowName off IconShape "round" Inputs "+++" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Sum Name "Sum1" Ports [2, 1] Position [195, 175, 225, 205] ShowName off IconShape "round" Inputs "|+-" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Outport Name "u" Position [405, 115, 425, 135] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" InitialOutput "0" } Line { SrcBlock "Filter" SrcPort 1 Points [-45, 0] DstBlock "Sum1" DstPort 2 } Line { SrcBlock "Derivative\nDivisor" SrcPort 1 Points [55, 0] Branch { DstBlock "Sum" DstPort 3 } Branch { Points [0, 60] DstBlock "Filter" DstPort 1 } } Line { SrcBlock "Derivative\nGain" SrcPort 1 DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Sum1" SrcPort 1 DstBlock "Derivative\nDivisor" DstPort 1 } Line { SrcBlock "Integral\nGain" SrcPort 1 DstBlock "Integrator" DstPort 1 } Line { SrcBlock "Sum" SrcPort 1 DstBlock "u" DstPort 1 } Line { SrcBlock "e" SrcPort 1 Points [15, 0] Branch { Points [0, -65] DstBlock "Proportional\nGain" DstPort 1 } Branch { DstBlock "Integral\nGain" DstPort 1 } Branch { Points [0, 65] DstBlock "Derivative\nGain" DstPort 1 } } Line { SrcBlock "Integrator" SrcPort 1 DstBlock "Sum" DstPort 2 } Line { SrcBlock "Proportional\nGain" SrcPort 1 Points [185, 0] DstBlock "Sum" DstPort 1 } } } Block { BlockType SubSystem Name "Discrete PI \nController" Ports [1, 1] Position [200, 220, 245, 250] MinAlgLoopOccurrences off PropExecContextOutsideSubsystem off RTWSystemCode "Auto" FunctionWithSeparateData off Opaque off RequestExecContextInheritance off MaskHideContents off MaskType "Discrete PI Controller" MaskDescription "Enter Proportional(P), Integral(I) terms. Set the sample time (ts) for the discrete integrator.\n" MaskPromptString "Proportional:| Integral:|Sample Time:" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskToolTipString "on,on,on" MaskVarAliasString ",," MaskVariables "P=@1;I=@2;ts=@3;" MaskDisplay "disp('PI (z)')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "1|1|1" MaskTabNameString ",," System { Name "Discrete PI \nController" Location [526, 396, 1024, 696] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Inport Name "U" Position [50, 88, 80, 102] IconDisplay "Port number" SampleTime "ts" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType DiscreteIntegrator Name "Discrete-Time\nIntegrator" Ports [1, 1] Position [165, 119, 200, 151] IntegratorMethod "Integration: Forward Euler" ExternalReset "none" InitialConditionSource "internal" SampleTime "ts" OutDataType "sfix(16)" OutScaling "2^0" ICPrevOutput "DiscIntNeverNeededParam" ICPrevScaledInput "DiscIntNeverNeededParam" } Block { BlockType Gain Name "Gain" Position [290, 80, 335, 120] Gain "[P, I]" Multiplication "Matrix(K*u)" ParameterDataTypeMode "Inherit via internal rule" ParameterDataType "sfix(16)" ParameterScaling "2^0" ParamDataTypeStr "Inherit: Inherit via internal rule" OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" OutDataTypeStr "Inherit: Inherit via internal rule" SaturateOnIntegerOverflow off SampleTime "ts" } Block { BlockType Mux Name "Mux" Ports [2, 1] Position [260, 20, 265, 175] ShowName off Inputs "2" DisplayOption "bar" } Block { BlockType Outport Name "Y" Position [365, 93, 395, 107] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Gain" DstPort 1 } Line { SrcBlock "U" SrcPort 1 Points [15, 0] Branch { Points [0, 40] DstBlock "Discrete-Time\nIntegrator" DstPort 1 } Branch { Points [0, -35] DstBlock "Mux" DstPort 1 } } Line { SrcBlock "Discrete-Time\nIntegrator" SrcPort 1 DstBlock "Mux" DstPort 2 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Y" DstPort 1 } } } Block { BlockType SubSystem Name "Discrete PID \nController" Ports [1, 1] Position [200, 35, 245, 65] MinAlgLoopOccurrences off PropExecContextOutsideSubsystem off RTWSystemCode "Auto" FunctionWithSeparateData off Opaque off RequestExecContextInheritance off MaskHideContents off MaskType "Discrete PID Controller" MaskDescription "Enter Proportional(P), Integral(I), and Derivative(D) terms. Set the sample time (ts) for the discrete integrator.\n" MaskHelp "This block implements a PID controller where parameters are entered for the Proportional, Integral and Derivative terms. Unmask this block to see how it works. The derivative term is implemented using a discrete integrator and derivative block." MaskPromptString "Proportional:| Integral:|Derivative:|Sample Time:" MaskStyleString "edit,edit,edit,edit" MaskTunableValueString "on,on,on,on" MaskCallbackString "|||" MaskEnableString "on,on,on,on" MaskVisibilityString "on,on,on,on" MaskToolTipString "on,on,on,on" MaskVarAliasString ",,," MaskVariables "P=@1;I=@2;D=@3;ts=@4;" MaskDisplay "disp('PID (z)')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "1|1|0|1" MaskTabNameString ",,," System { Name "Discrete PID \nController" Location [526, 396, 1024, 696] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Inport Name "U" Position [50, 88, 80, 102] IconDisplay "Port number" SampleTime "ts" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Reference Name "Discrete Derivative" Ports [1, 1] Position [125, 127, 185, 163] SourceBlock "simulink/Discrete/Discrete Derivative" SourceType "Discrete Derivative" ShowPortLabels "FromPortIcon" SystemSampleTime "-1" FunctionWithSeparateData off RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" gainval "1.0" ICPrevScaledInput "0.0" OutMin "[]" OutMax "[]" OutDataTypeStr "Inherit: Inherit via internal rule" OutputDataTypeScalingMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^-10" LockScale off RndMeth "Floor" DoSatur off } Block { BlockType DiscreteIntegrator Name "Discrete-Time\nIntegrator" Ports [1, 1] Position [200, 79, 235, 111] IntegratorMethod "Integration: Forward Euler" ExternalReset "none" InitialConditionSource "internal" SampleTime "ts" OutDataType "sfix(16)" OutScaling "2^0" ICPrevOutput "DiscIntNeverNeededParam" ICPrevScaledInput "DiscIntNeverNeededParam" } Block { BlockType Gain Name "Gain" Position [290, 75, 335, 115] Gain "[P, I, D]" Multiplication "Matrix(K*u)" ParameterDataTypeMode "Inherit via internal rule" ParameterDataType "sfix(16)" ParameterScaling "2^0" ParamDataTypeStr "Inherit: Inherit via internal rule" OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" OutDataTypeStr "Inherit: Inherit via internal rule" SaturateOnIntegerOverflow off SampleTime "ts" } Block { BlockType Mux Name "Mux" Ports [3, 1] Position [260, 18, 265, 172] ShowName off Inputs "3" DisplayOption "bar" } Block { BlockType Outport Name "Y" Position [365, 88, 395, 102] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Y" DstPort 1 } Line { SrcBlock "Discrete Derivative" SrcPort 1 DstBlock "Mux" DstPort 3 } Line { SrcBlock "Discrete-Time\nIntegrator" SrcPort 1 DstBlock "Mux" DstPort 2 } Line { SrcBlock "U" SrcPort 1 Points [15, 0] Branch { Points [0, -50] DstBlock "Mux" DstPort 1 } Branch { Points [0, 50] DstBlock "Discrete Derivative" DstPort 1 } Branch { DstBlock "Discrete-Time\nIntegrator" DstPort 1 } } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Gain" DstPort 1 } } } } }