Model { Name "sldemo_hardstop" Version 6.2 MdlSubVersion 0 GraphicalInterface { NumRootInports 0 NumRootOutports 4 Outport { BusObject "" BusOutputAsStruct "off" SignalName "X" Name "X" } Outport { BusObject "" BusOutputAsStruct "off" Name "Against Limit" } Outport { BusObject "" BusOutputAsStruct "off" Name "F_fr" } Outport { BusObject "" BusOutputAsStruct "off" Name "Stuck" } ParameterArgumentNames "" ComputedModelVersion "1.43" NumModelReferences 0 NumTestPointedSignals 0 } Description "Friction Model with Hard Stops\n\nThis demonstratio" "n shows one way to model friction in Simulink. The two integrators in \nthe m" "odel calculate the velocity and position of the system, which is then used in" " \nthe Friction Model to calculate the friction force. \n\nRunning the simula" "tion shows the initial condition response on the Scope. " SavedCharacterEncoding "US-ASCII" SaveDefaultBlockParams on SampleTimeColors off LibraryLinkDisplay "none" WideLines off ShowLineDimensions off ShowPortDataTypes off ShowLoopsOnError on IgnoreBidirectionalLines off ShowStorageClass off ShowTestPointIcons on ShowViewerIcons on SortedOrder off ExecutionContextIcon off ShowLinearizationAnnotations on RecordCoverage off CovPath "/" CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on covSaveCumulativeToWorkspaceVar on CovSaveSingleToWorkspaceVar on CovCumulativeVarName "covCumulativeData" CovCumulativeReport off CovReportOnPause on ScopeRefreshTime 0.035000 OverrideScopeRefreshTime on DisableAllScopes off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" MinMaxOverflowArchiveMode "Overwrite" BlockNameDataTip off BlockParametersDataTip on BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off StartFcn "set_param('sldemo_hardstop/Scope','Open','on');" Created "Fri Aug 21 11:16:20 1998" Creator "The MathWorks Inc." UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "batserve" ModifiedDateFormat "%" LastModifiedDate "Sat Jan 22 19:09:20 2005" ModelVersionFormat "1.%" ConfigurationManager "none" LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" AccelSystemTargetFile "accel.tlc" AccelTemplateMakefile "accel_default_tmf" AccelMakeCommand "make_rtw" TryForcingSFcnDF off ExtModeBatchMode off ExtModeEnableFloating on ExtModeTrigType "manual" ExtModeTrigMode "oneshot" 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 off ExtModeSkipDownloadWhenConnect off ExtModeLogAll on ExtModeAutoUpdateStatusClock off BufferReuse on StrictBusMsg "None" ProdHWDeviceType "32-bit Generic" ShowModelReferenceBlockVersion off ShowModelReferenceBlockIO off Array { Type "Handle" Dimension 1 Simulink.ConfigSet { $ObjectID 1 Version "1.1.0" Array { Type "Handle" Dimension 7 Simulink.SolverCC { $ObjectID 2 Version "1.1.0" StartTime "0.0" StopTime "2.0" AbsTol "1e-6" FixedStep "auto" InitialStep "auto" MaxNumMinSteps "-1" MaxOrder 5 ExtrapolationOrder 4 NumberNewtonIterations 1 MaxStep "auto" MinStep "auto" RelTol "1e-6" SolverMode "SingleTasking" Solver "ode45" SolverName "ode45" ZeroCrossControl "UseLocalSettings" AlgebraicLoopSolver "TrustRegion" SolverResetMethod "Fast" PositivePriorityOrder off AutoInsertRateTranBlk off SampleTimeConstraint "Unconstrained" RateTranMode "Deterministic" } Simulink.DataIOCC { $ObjectID 3 Version "1.1.0" Decimation "1" ExternalInput "[]" FinalStateName "xFinal" InitialState "[]" LimitDataPoints off MaxDataPoints "1000" LoadExternalInput off LoadInitialState off SaveFinalState off SaveFormat "StructureWithTime" SaveOutput on SaveState on SignalLogging on SaveTime on StateSaveName "xout" TimeSaveName "tout" OutputSaveName "yout" SignalLoggingName "logsout" OutputOption "RefineOutputTimes" OutputTimes "[]" Refine "4" } Simulink.OptimizationCC { $ObjectID 4 Array { Type "Cell" Dimension 5 Cell "ZeroExternalMemoryAtStartup" Cell "ZeroInternalMemoryAtStartup" Cell "InitFltsAndDblsToZero" Cell "OptimizeModelRefInitCode" Cell "NoFixptDivByZeroProtection" PropName "DisabledProps" } Version "1.1.0" BlockReduction on BooleanDataType on ConditionallyExecuteInputs on InlineParams off InlineInvariantSignals on OptimizeBlockIOStorage on BufferReuse on EnforceIntegerDowncast on ExpressionFolding on FoldNonRolledExpr on LocalBlockOutputs on ParameterPooling on RollThreshold 5 SystemCodeInlineAuto off StateBitsets off DataBitsets off UseTempVars off ZeroExternalMemoryAtStartup on ZeroInternalMemoryAtStartup on InitFltsAndDblsToZero on NoFixptDivByZeroProtection off EfficientFloat2IntCast off OptimizeModelRefInitCode off LifeSpan "inf" BufferReusableBoundary off } Simulink.DebuggingCC { $ObjectID 5 Version "1.1.0" RTPrefix "error" ConsistencyChecking "none" ArrayBoundsChecking "none" SignalInfNanChecking "none" AlgebraicLoopMsg "warning" ArtificialAlgebraicLoopMsg "warning" CheckSSInitialOutputMsg on CheckExecutionContextPreStartOutputMsg off CheckExecutionContextRuntimeOutputMsg off SignalResolutionControl "TryResolveAllWithWarning" BlockPriorityViolationMsg "warning" MinStepSizeMsg "warning" SolverPrmCheckMsg "none" InheritedTsInSrcMsg "warning" DiscreteInheritContinuousMsg "warning" MultiTaskDSMMsg "warning" MultiTaskRateTransMsg "error" SingleTaskRateTransMsg "none" TasksWithSamePriorityMsg "warning" CheckMatrixSingularityMsg "none" IntegerOverflowMsg "none" Int32ToFloatConvMsg "warning" ParameterDowncastMsg "error" ParameterOverflowMsg "error" ParameterPrecisionLossMsg "warning" UnderSpecifiedDataTypeMsg "none" UnnecessaryDatatypeConvMsg "none" VectorMatrixConversionMsg "none" InvalidFcnCallConnMsg "error" FcnCallInpInsideContextMsg "Use local settings" SignalLabelMismatchMsg "none" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" SFcnCompatibilityMsg "none" UniqueDataStoreMsg "none" BusObjectLabelMismatch "none" RootOutportRequireBusObject "warning" AssertControl "UseLocalSettings" EnableOverflowDetection off ModelReferenceIOMsg "none" ModelReferenceVersionMismatchMessage "none" ModelReferenceIOMismatchMessage "none" ModelReferenceCSMismatchMessage "none" ModelReferenceSimTargetVerbose off UnknownTsInhSupMsg "warning" ModelReferenceDataLoggingMessage "warning" ModelReferenceSymbolNameMessage "warning" ModelReferenceExtraNoncontSigs "error" } Simulink.HardwareCC { $ObjectID 6 Version "1.1.0" ProdBitPerChar 8 ProdBitPerShort 16 ProdBitPerInt 32 ProdBitPerLong 32 ProdIntDivRoundTo "Undefined" ProdEndianess "Unspecified" ProdWordSize 32 ProdShiftRightIntArith on ProdHWDeviceType "32-bit Generic" TargetBitPerChar 8 TargetBitPerShort 16 TargetBitPerInt 32 TargetBitPerLong 32 TargetShiftRightIntArith on TargetIntDivRoundTo "Undefined" TargetEndianess "Unspecified" TargetWordSize 32 TargetTypeEmulationWarnSuppressLevel 0 TargetPreprocMaxBitsSint 32 TargetPreprocMaxBitsUint 32 TargetHWDeviceType "Specified" TargetUnknown on ProdEqTarget on } Simulink.ModelReferenceCC { $ObjectID 7 Version "1.1.0" UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange" CheckModelReferenceTargetMessage "error" ModelReferenceNumInstancesAllowed "Multi" ModelReferencePassRootInputsByReference on ModelReferenceMinAlgLoopOccurrences off } Simulink.RTWCC { $BackupClass "Simulink.RTWCC" $ObjectID 8 Array { Type "Cell" Dimension 1 Cell "IncludeHyperlinkInReport" PropName "DisabledProps" } Version "1.1.0" SystemTargetFile "grt.tlc" GenCodeOnly off MakeCommand "make_rtw" TemplateMakefile "grt_default_tmf" Description "Generic Real-Time Target" GenerateReport off SaveLog off RTWVerbose on RetainRTWFile off ProfileTLC off TLCDebug off TLCCoverage off TLCAssert off ProcessScriptMode "Default" ConfigurationMode "Optimized" ConfigAtBuild off IncludeHyperlinkInReport off LaunchReport off TargetLang "C" Array { Type "Handle" Dimension 2 Simulink.CodeAppCC { $ObjectID 9 Array { Type "Cell" Dimension 9 Cell "IgnoreCustomStorageClasses" Cell "InsertBlockDesc" Cell "SFDataObjDesc" Cell "SimulinkDataObjDesc" Cell "DefineNamingRule" Cell "SignalNamingRule" Cell "ParamNamingRule" Cell "InlinedPrmAccess" Cell "CustomSymbolStr" PropName "DisabledProps" } Version "1.1.0" ForceParamTrailComments off GenerateComments on IgnoreCustomStorageClasses on IncHierarchyInIds off MaxIdLength 31 PreserveName off PreserveNameWithParent off ShowEliminatedStatement off IncAutoGenComments off SimulinkDataObjDesc off SFDataObjDesc off IncDataTypeInIds off PrefixModelToSubsysFcnNames on CustomSymbolStr "$R$N$M" MangleLength 1 DefineNamingRule "None" ParamNamingRule "None" SignalNamingRule "None" InsertBlockDesc off SimulinkBlockComments on EnableCustomComments off InlinedPrmAccess "Literals" ReqsInCode off } Simulink.GRTTargetCC { $BackupClass "Simulink.TargetCC" $ObjectID 10 Array { Type "Cell" Dimension 12 Cell "IncludeMdlTerminateFcn" Cell "CombineOutputUpdateFcns" Cell "SuppressErrorStatus" Cell "ERTCustomFileBanners" Cell "GenerateSampleERTMain" Cell "MultiInstanceERTCode" Cell "PurelyIntegerCode" Cell "SupportNonFinite" Cell "SupportComplex" Cell "SupportAbsoluteTime" Cell "SupportContinuousTime" Cell "SupportNonInlinedSFcns" PropName "DisabledProps" } Version "1.1.0" TargetFcnLib "ansi_tfl_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off IsPILTarget off ModelReferenceCompliant on IncludeMdlTerminateFcn on CombineOutputUpdateFcns off SuppressErrorStatus off IncludeFileDelimiter "Auto" ERTCustomFileBanners off SupportAbsoluteTime on LogVarNameModifier "rt_" MatFileLogging on MultiInstanceERTCode off SupportNonFinite on SupportComplex on PurelyIntegerCode off SupportContinuousTime on SupportNonInlinedSFcns on ExtMode off ExtModeStaticAlloc off ExtModeTesting off ExtModeStaticAllocSize 1000000 ExtModeTransport 0 ExtModeMexFile "ext_comm" RTWCAPISignals off RTWCAPIParams off RTWCAPIStates off GenerateASAP2 off } PropName "Components" } } PropName "Components" } Name "Configuration" SimulationMode "normal" CurrentDlgPage "Solver" } PropName "ConfigurationSets" } Simulink.ConfigSet { $PropName "ActiveConfigurationSet" $ObjectID 1 } BlockDefaults { Orientation "right" ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Helvetica" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on } BlockParameterDefaults { Block { BlockType Abs SaturateOnIntegerOverflow on ZeroCross on SampleTime "-1" } Block { BlockType Constant Value "1" VectorParams1D on OutDataTypeMode "Inherit from 'Constant value'" OutDataType "sfix(16)" ConRadixGroup "Use specified scaling" OutScaling "2^0" SampleTime "inf" } Block { BlockType DataTypeConversion OutDataTypeMode "Inherit via back propagation" OutDataType "sfix(16)" OutScaling "2^0" LockScale off ConvertRealWorld "Real World Value (RWV)" RndMeth "Zero" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType From IconDisplay "Tag" } Block { BlockType Gain Gain "1" Multiplication "Element-wise(K.*u)" ParameterDataTypeMode "Same as input" ParameterDataType "sfix(16)" ParameterScalingMode "Best Precision: Matrix-wise" ParameterScaling "2^0" OutDataTypeMode "Same as input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Goto IconDisplay "Tag" } Block { BlockType HitCross HitCrossingOffset "0" HitCrossingDirection "either" ShowOutputPort on ZeroCross on SampleTime "-1" } Block { BlockType InitialCondition Value "1" SampleTime "-1" } Block { BlockType Inport UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" Interpolate on } Block { BlockType InportShadow UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" 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 } Block { BlockType Logic Operator "AND" Inputs "2" AllPortsSameDT on OutDataTypeMode "Logical (see Configuration Parameters: Optimiza" "tion)" LogicDataType "uint(8)" SampleTime "-1" } Block { BlockType MinMax Function "min" Inputs "1" InputSameDT on OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on ZeroCross on SampleTime "-1" } Block { BlockType Outport Port "1" UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" OutputWhenDisabled "held" InitialOutput "[]" } Block { BlockType Product Inputs "2" Multiplication "Element-wise(.*)" InputSameDT on OutDataTypeMode "Same as first input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Zero" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Reference } Block { BlockType Scope Floating off ModelBased off TickLabels "OneTimeTick" ZoomMode "on" Grid "on" TimeRange "auto" YMin "-5" YMax "5" SaveToWorkspace off SaveName "ScopeData" LimitDataPoints on MaxDataPoints "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType Signum ZeroCross on SampleTime "-1" } Block { BlockType SubSystem ShowPortLabels on Permissions "ReadWrite" PermitHierarchicalResolution "All" SystemSampleTime "-1" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" SimViewingDevice off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" } Block { BlockType Sum IconShape "rectangular" Inputs "++" InputSameDT on OutDataTypeMode "Same as first input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Switch Criteria "u2 >= Threshold" Threshold "0" InputSameDT on OutDataTypeMode "Inherit via internal rule" RndMeth "Floor" SaturateOnIntegerOverflow on ZeroCross on SampleTime "-1" } } 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 "sldemo_hardstop" Location [68, 198, 783, 810] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType Integrator Name "Force to\nVelocity" Ports [3, 1, 0, 0, 1] Position [415, 390, 470, 450] ExternalReset "rising" InitialConditionSource "external" ShowStatePort on IgnoreLimit off Port { PortNumber 1 Name "V" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" ShowSigGenPortName on } } Block { BlockType SubSystem Name "Friction Model" Ports [4, 2] Position [235, 108, 355, 297] Orientation "left" BackgroundColor "red" FontSize 12 TreatAsAtomicUnit off MinAlgLoopOccurrences off RTWSystemCode "Auto" MaskDisplay "port_label('input',1,'F (N)','texmode','on')\np" "ort_label('input',2,'Velocity (m/s)','texmode','on')\nport_label('input',3,'V" "elState (m/s)','texmode','on')\nport_label('input',4,'Fn (N)','texmode','on')" "\nport_label('output',1,'Ff (N)','texmode','on')\nport_label('output',2,'Stuc" "kFLAG','texmode','on')\n" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "Friction Model" Location [595, 317, 1172, 791] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "Force" Position [50, 116, 85, 134] Port "1" IconDisplay "Port number" LatchInput off } Block { BlockType Inport Name "Velocity" Position [50, 341, 85, 359] Port "2" IconDisplay "Port number" LatchInput off } Block { BlockType Inport Name "Velocity_stateport" Position [50, 236, 85, 254] Port "3" IconDisplay "Port number" LatchInput off } Block { BlockType Inport Name "Fn2" Position [50, 396, 85, 414] Port "4" IconDisplay "Port number" LatchInput off } Block { BlockType Abs Name "Abs" Position [180, 78, 210, 112] } Block { BlockType InportShadow Name "Fn1" Position [50, 41, 85, 59] Port "4" IconDisplay "Port number" LatchInput off } Block { BlockType HitCross Name "Hit \nCrossing" Ports [1, 1] Position [250, 230, 280, 260] HitCrossingDirection "either" } Block { BlockType MinMax Name "Min" Ports [2, 1] Position [250, 27, 280, 118] Function "min" Inputs "2" } Block { BlockType Product Name "Product1" Ports [2, 1] Position [345, 100, 375, 135] RndMeth "Floor" } Block { BlockType Product Name "Product2" Ports [2, 1] Position [250, 361, 280, 394] RndMeth "Floor" } Block { BlockType Signum Name "Sign1" Position [180, 136, 210, 164] } Block { BlockType Signum Name "Sign2" Position [165, 334, 195, 366] } Block { BlockType Switch Name "Switch" Position [430, 221, 460, 269] Criteria "u2 ~= 0" Threshold "0.5" SaturateOnIntegerOverflow off } Block { BlockType Gain Name "mu_kinetic" Position [120, 385, 165, 425] Gain "0.4" ParameterDataTypeMode "Inherit via internal rule" OutDataTypeMode "Inherit via internal rule" SaturateOnIntegerOverflow off } Block { BlockType Gain Name "mu_static" Position [115, 30, 160, 70] Gain "0.8" ParameterDataTypeMode "Inherit via internal rule" OutDataTypeMode "Inherit via internal rule" SaturateOnIntegerOverflow off } Block { BlockType Outport Name "F_fr" Position [490, 237, 520, 253] IconDisplay "Port number" BusOutputAsStruct off InitialOutput "0" } Block { BlockType Outport Name "Stuck" Position [315, 295, 345, 310] Orientation "down" Port "2" IconDisplay "Port number" BusOutputAsStruct off InitialOutput "0" } Line { SrcBlock "Hit \nCrossing" SrcPort 1 Points [-15, 0; 60, 0] Branch { DstBlock "Stuck" DstPort 1 } Branch { DstBlock "Switch" DstPort 2 } } Line { SrcBlock "Product2" SrcPort 1 Points [110, 0; 0, -120] DstBlock "Switch" DstPort 3 } Line { SrcBlock "Fn2" SrcPort 1 DstBlock "mu_kinetic" DstPort 1 } Line { SrcBlock "Velocity" SrcPort 1 DstBlock "Sign2" DstPort 1 } Line { SrcBlock "Switch" SrcPort 1 DstBlock "F_fr" DstPort 1 } Line { SrcBlock "Velocity_stateport" SrcPort 1 DstBlock "Hit \nCrossing" DstPort 1 } Line { SrcBlock "Product1" SrcPort 1 Points [15, 0; 0, 110] DstBlock "Switch" DstPort 1 } Line { SrcBlock "Force" SrcPort 1 Points [0, 0; 50, 0] Branch { Points [0, -30] DstBlock "Abs" DstPort 1 } Branch { Points [0, 25] DstBlock "Sign1" DstPort 1 } } Line { SrcBlock "Abs" SrcPort 1 DstBlock "Min" DstPort 2 } Line { SrcBlock "Fn1" SrcPort 1 DstBlock "mu_static" DstPort 1 } Line { SrcBlock "Min" SrcPort 1 Points [30, 0; 0, 35] DstBlock "Product1" DstPort 1 } Line { SrcBlock "Sign1" SrcPort 1 Points [100, 0; 0, -25] DstBlock "Product1" DstPort 2 } Line { SrcBlock "Sign2" SrcPort 1 Points [15, 0; 0, 20] DstBlock "Product2" DstPort 1 } Line { SrcBlock "mu_static" SrcPort 1 DstBlock "Min" DstPort 1 } Line { SrcBlock "mu_kinetic" SrcPort 1 Points [45, 0; 0, -20] DstBlock "Product2" DstPort 2 } Annotation { Name "Use direct state access to\nbreak algebraic" " loop" Position [168, 231] } } } Block { BlockType From Name "From" Position [230, 432, 275, 448] NamePlacement "alternate" CloseFcn "tagdialog Close" GotoTag "Stuck" } Block { BlockType Goto Name "Goto" Position [115, 242, 160, 258] Orientation "left" GotoTag "Stuck" TagVisibility "local" } Block { BlockType InitialCondition Name "IC" Position [340, 489, 370, 521] Value "100" } Block { BlockType Gain Name "Kspring" Position [505, 63, 560, 107] Orientation "left" Gain "-100" Port { PortNumber 1 Name "Fspring" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" ShowSigGenPortName on } } Block { BlockType SubSystem Name "More Info" Ports [] Position [600, 15, 624, 38] DropShadow on ShowName off TreatAsAtomicUnit off MinAlgLoopOccurrences off RTWSystemCode "Auto" MaskDisplay "disp('?')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "More Info" Location [70, 50, 716, 474] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Reference Name "Model Info" Ports [] Position [15, 19, 610, 408] ShowName off FontName "Arial" SourceBlock "simulink/Model-Wide\nUtilities/Model Info" SourceType "CMBlock" ShowPortLabels "on" InitialBlockCM "none" BlockCM "None" Frame "on" DisplayStringWithTags "Model Description:\n-------------------\n\n" "%" MaskDisplayString "Model Description:\\n-------------------\\n" "\\nFriction Model with Hard Stops\\n\\nThis demonstration shows one way to mo" "del friction in Simulink. The two integrators in \\nthe model calculate the v" "elocity and position of the system, which is then used in \\nthe Friction Mod" "el to calculate the friction force. \\n\\nRunning the simulation shows the in" "itial condition response on the Scope. " HorizontalTextAlignment "Left" LeftAlignmentValue "0.02" SourceBlockDiagram "sldemo_hardstop" TagMaxNumber "20" } } } Block { BlockType Constant Name "Normal Force" Position [380, 259, 420, 281] Orientation "left" Value "100" } Block { BlockType Constant Name "Reset Velocity\nat non-zero time" Position [265, 493, 300, 517] Value "0" } Block { BlockType Logic Name "ResetLogic" Ports [2, 1] Position [310, 430, 355, 465] Operator "OR" } Block { BlockType Scope Name "Scope" Ports [1] Position [650, 66, 680, 104] Location [703, 143, 1094, 407] Open off NumInputPorts "1" TickLabels "on" List { ListType AxesTitles axes1 "%" } YMin "-4" YMax "6" DataFormat "Array" } Block { BlockType Sum Name "Sum" Ports [2, 1] Position [110, 380, 140, 420] NamePlacement "alternate" ShowName off Inputs "-+" } Block { BlockType Integrator Name "Velocity to\nPosition" Ports [1, 2] Position [525, 390, 580, 450] AttributesFormatString "Xo = %" InitialCondition "-0.5" LimitOutput on UpperSaturationLimit "5.5" LowerSaturationLimit "-3.5" ShowSaturationPort on IgnoreLimit off Port { PortNumber 1 Name "X" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" ShowSigGenPortName on } } Block { BlockType DataTypeConversion Name "cast" Position [415, 553, 465, 567] Orientation "left" OutDataTypeMode "boolean" } Block { BlockType Outport Name "X" Position [650, 398, 680, 412] BackgroundColor "lightBlue" NamePlacement "alternate" IconDisplay "Port number" BusOutputAsStruct off InitialOutput "0" } Block { BlockType Outport Name "Against\nLimit" Position [650, 428, 680, 442] BackgroundColor "lightBlue" Port "2" IconDisplay "Port number" BusOutputAsStruct off InitialOutput "0" } Block { BlockType Outport Name "F_fr" Position [172, 120, 198, 135] Orientation "up" BackgroundColor "lightBlue" NamePlacement "alternate" Port "3" IconDisplay "Port number" BusOutputAsStruct off InitialOutput "0" } Block { BlockType Outport Name "Stuck" Position [172, 210, 198, 225] Orientation "up" BackgroundColor "lightBlue" NamePlacement "alternate" Port "4" IconDisplay "Port number" BusOutputAsStruct off InitialOutput "0" } Line { Name "X" Labels [0, 0] SrcBlock "Velocity to\nPosition" SrcPort 1 Points [0, 0; 25, 0] Branch { DstBlock "X" DstPort 1 } Branch { Points [0, -320] Branch { DstBlock "Kspring" DstPort 1 } Branch { DstBlock "Scope" DstPort 1 } } } Line { SrcBlock "Velocity to\nPosition" SrcPort 2 Points [0, 0; 25, 0] Branch { Points [0, 125] DstBlock "cast" DstPort 1 } Branch { DstBlock "Against\nLimit" DstPort 1 } } Line { SrcBlock "Reset Velocity\nat non-zero time" SrcPort 1 DstBlock "IC" DstPort 1 } Line { SrcBlock "Sum" SrcPort 1 DstBlock "Force to\nVelocity" DstPort 1 } Line { Name "V" Labels [0, 0] SrcBlock "Force to\nVelocity" SrcPort 1 Points [-5, 0; 25, 0] Branch { Points [0, 0] DstBlock "Velocity to\nPosition" DstPort 1 } Branch { Points [0, -240] DstBlock "Friction Model" DstPort 2 } } Line { SrcBlock "Normal Force" SrcPort 1 DstBlock "Friction Model" DstPort 4 } Line { SrcBlock "ResetLogic" SrcPort 1 Points [15, 0; 0, -30] DstBlock "Force to\nVelocity" DstPort 2 } Line { SrcBlock "Friction Model" SrcPort 1 Points [-45, 0] Branch { Points [-110, 0; 0, 235] DstBlock "Sum" DstPort 1 } Branch { DstBlock "F_fr" DstPort 1 } } Line { Name "Fspring" Labels [0, 0] SrcBlock "Kspring" SrcPort 1 Points [0, 0; -55, 0] Branch { Points [-390, 0; 0, 325] DstBlock "Sum" DstPort 2 } Branch { Points [0, 50] DstBlock "Friction Model" DstPort 1 } } Line { SrcBlock "IC" SrcPort 1 Points [15, 0; 0, -65] DstBlock "Force to\nVelocity" DstPort 3 } Line { SrcBlock "Friction Model" SrcPort 2 Points [-45, 0] Branch { DstBlock "Goto" DstPort 1 } Branch { DstBlock "Stuck" DstPort 1 } } Line { SrcBlock "cast" SrcPort 1 Points [-180, 0; 0, -105] DstBlock "ResetLogic" DstPort 2 } Line { SrcBlock "From" SrcPort 1 DstBlock "ResetLogic" DstPort 1 } Line { SrcBlock "Force to\nVelocity" SrcPort state Points [0, -160] DstBlock "Friction Model" DstPort 3 } Annotation { Name "Friction Model with Hard Stops" Position [300, 31] FontName "Arial" FontSize 16 FontWeight "bold" } } }