Model { Name "fxlimitcycle" Version 5.0 SaveDefaultBlockParams on SampleTimeColors off LibraryLinkDisplay "none" WideLines off ShowLineDimensions off ShowPortDataTypes off ShowLoopsOnError on IgnoreBidirectionalLines off ShowStorageClass off ExecutionOrder off RecordCoverage off CovPath "/" CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on covSaveCumulativeToWorkspaceVar on CovSaveSingleToWorkspaceVar on CovCumulativeVarName "covCumulativeData" CovCumulativeReport off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" MinMaxOverflowArchiveMode "Overwrite" BlockNameDataTip off BlockParametersDataTip off BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off PreSaveFcn ";fxptdlg('presave_cb',bdroot);" CloseFcn ";fxptdlg('close_cb',bdroot);" InitFcn ";fxptdlg('simInit_cb',bdroot);" StartFcn ";fxptdlg('sim_cb',bdroot);" StopFcn ";fxptdlg('store_cb',bdroot);" Created "Sat May 04 19:52:31 2002" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "Nicolas Tsapatsoulis" ModifiedDateFormat "%" LastModifiedDate "Sat Mar 11 15:27:01 2006" ModelVersionFormat "1.%" ConfigurationManager "None" SimParamPage "Solver" LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" AccelSystemTargetFile "accel.tlc" AccelTemplateMakefile "accel_default_tmf" AccelMakeCommand "make_rtw" TryForcingSFcnDF off ExtModeMexFile "ext_comm" ExtModeBatchMode off ExtModeTrigType "manual" ExtModeTrigMode "normal" 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 on ExtModeSkipDownloadWhenConnect off ExtModeLogAll on ExtModeAutoUpdateStatusClock on BufferReuse on RTWExpressionDepthLimit 5 SimulationMode "normal" Solver "FixedStepDiscrete" SolverMode "Auto" StartTime "0.0" StopTime "0.055" MaxOrder 5 MaxStep "auto" MinStep "auto" MaxNumMinSteps "-1" InitialStep "auto" FixedStep "1/1000" RelTol "1e-3" AbsTol "auto" OutputOption "RefineOutputTimes" OutputTimes "[]" Refine "1" LoadExternalInput off ExternalInput "[t, u]" LoadInitialState off InitialState "xInitial" SaveTime on TimeSaveName "tout" SaveState off StateSaveName "xout" SaveOutput on OutputSaveName "yout" SaveFinalState off FinalStateName "xFinal" SaveFormat "Array" Decimation "1" LimitDataPoints on MaxDataPoints "1000" SignalLoggingName "sigsOut" ConsistencyChecking "none" ArrayBoundsChecking "none" AlgebraicLoopMsg "warning" BlockPriorityViolationMsg "warning" MinStepSizeMsg "warning" InheritedTsInSrcMsg "warning" DiscreteInheritContinuousMsg "warning" MultiTaskRateTransMsg "error" SingleTaskRateTransMsg "none" CheckForMatrixSingularity "none" IntegerOverflowMsg "warning" Int32ToFloatConvMsg "warning" ParameterDowncastMsg "error" ParameterOverflowMsg "error" ParameterPrecisionLossMsg "warning" UnderSpecifiedDataTypeMsg "none" UnnecessaryDatatypeConvMsg "none" VectorMatrixConversionMsg "none" InvalidFcnCallConnMsg "error" SignalLabelMismatchMsg "none" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" SfunCompatibilityCheckMsg "none" RTWInlineParameters off BlockReductionOpt on BooleanDataType off ConditionallyExecuteInputs on ParameterPooling on OptimizeBlockIOStorage on ZeroCross on AssertionControl "UseLocalSettings" ProdHWDeviceType "Microprocessor" ProdHWWordLengths "8,16,32,32" RTWSystemTargetFile "grt.tlc" RTWTemplateMakefile "grt_default_tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off RTWRetainRTWFile off TLCProfiler off TLCDebug off TLCCoverage off TLCAssertion off RTWOptions "-aEnforceIntegerDowncast=1 -aExtMode=0 -aExtModeTes" "ting=0 -aFoldNonRolledExpr=1 -aForceParamTrailComments=0 -aGenerateComments=1" " -aGenerateReport=0 -aIgnoreCustomStorageClasses=1 -aIncDataTypeInIds=0 -aInc" "HierarchyInIds=0 -aInlineInvariantSignals=0 -aInlinedPrmAccess=\"Literals\" -" "aLocalBlockOutputs=1 -aLogVarNameModifier=\"rt_\" -aMaxRTWIdLen=31 -aPrefixMo" "delToSubsysFcnNames=1 -aRTWVerbose=1 -aRollThreshold=5 -aShowEliminatedStatem" "ents=0" BlockDefaults { Orientation "right" ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Helvetica" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on } BlockParameterDefaults { Block { BlockType Gain Gain "1" Multiplication "Element-wise(K.*u)" ShowAdditionalParam off 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 } 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 "S-Function" FunctionName "system" PortCounts "[]" SFunctionModules "''" } Block { BlockType Step Time "1" Before "0" After "1" SampleTime "-1" VectorParams1D on ZeroCross on } Block { BlockType Sum IconShape "rectangular" Inputs "++" ShowAdditionalParam off InputSameDT on OutDataTypeMode "Same as first input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on } Block { BlockType UnitDelay X0 "0" SampleTime "1" RTWStateStorageClass "Auto" } } 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 "fxlimitcycle" Location [0, 0, 752, 385] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "125" ReportName "simulink-default.rpt" Block { BlockType Sum Name "Add" Ports [2, 1] Position [155, 35, 195, 75] ShowAdditionalParam on InputSameDT off OutDataTypeMode "Specify via dialog" OutDataType "sfrac(16)" OutScaling "2^-2" SaturateOnIntegerOverflow off } Block { BlockType Scope Name "Comparison 1" Ports [1] Position [445, 38, 475, 72] Location [6, 350, 1034, 690] Open on NumInputPorts "1" TickLabels "on" ZoomMode "yonly" List { ListType AxesTitles axes1 "%" } List { ListType SelectedSignals axes1 "" } TimeRange "0.055" YMin "-0.3" YMax "0.5" DataFormat "StructureWithTime" } Block { BlockType Reference Name "FixPt to Dbl1" Ports [1, 1] Position [365, 36, 410, 74] SourceBlock "fixpt_lib_4/Data Type/Gateway Out" SourceType "Fixed-Point Gateway Out" OutRealWorld "Real World Value" OutBuiltInType "double" RndMeth "Nearest" DoSatur off } Block { BlockType Gain Name "Gain" Position [170, 125, 210, 165] Orientation "left" NamePlacement "alternate" Gain "-0.7" ShowAdditionalParam on ParameterDataTypeMode "Specify via dialog" ParameterDataType "sfrac(8)" ParameterScalingMode "Use specified scaling" ParameterScaling "2^-2" OutDataTypeMode "Specify via dialog" OutDataType "sfrac(8)" OutScaling "2^-2" SaturateOnIntegerOverflow off } Block { BlockType Gain Name "Gain1" Position [75, 24, 105, 66] NamePlacement "alternate" Gain "0.3" ShowAdditionalParam on ParameterDataTypeMode "Specify via dialog" ParameterDataType "sfrac(8)" ParameterScaling "2^-15" OutDataTypeMode "Specify via dialog" OutDataType "sfrac(8)" OutScaling "2^-10" SaturateOnIntegerOverflow off } Block { BlockType Step Name "Step" Position [25, 30, 55, 60] Time "0" SampleTime "1/1000" } Block { BlockType UnitDelay Name "Unit Delay" Position [275, 35, 315, 75] X0 "0.0" SampleTime "-1" } Line { SrcBlock "Add" SrcPort 1 DstBlock "Unit Delay" DstPort 1 } Line { SrcBlock "Unit Delay" SrcPort 1 Points [15, 0] Branch { DstBlock "FixPt to Dbl1" DstPort 1 } Branch { Points [0, 90] DstBlock "Gain" DstPort 1 } } Line { SrcBlock "Gain" SrcPort 1 Points [-35, 0; 0, -80] DstBlock "Add" DstPort 2 } Line { SrcBlock "FixPt to Dbl1" SrcPort 1 DstBlock "Comparison 1" DstPort 1 } Line { SrcBlock "Step" SrcPort 1 DstBlock "Gain1" DstPort 1 } Line { SrcBlock "Gain1" SrcPort 1 DstBlock "Add" DstPort 1 } Annotation { Name "This exercise demonstrate the limit cycle effec" "t\nThe exercise is an extension from the IIR filter example in Chapter 2, exc" "ept that\nthe IIR filter is implemented as an HPF, by changing the coefficien" "t to -0.75.\nAll the blocks are implemented in sfrac(8) precision.\nA constan" "t voltage of 0.5 is input into the IIR filter, and the output oscillates bet" "ween 0.062 to 0.078\nRemedy : The oscillation will stop if a higher precision" " is used (such as Q.15)\nChange the coefficient back to 0.75. \nNote that a l" "owpass filter will not result in any oscillation. WHy?\nThis is because the L" "PF filtered out the limitcycle oscillation (~500Hz in this case)" Position [256, 232] } } }