Model { Name "phase_detector" 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 Created "Tue Jan 10 11:22:41 2006" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "USER" ModifiedDateFormat "%" LastModifiedDate "Mon May 12 21:41:05 2008" 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 "ode4" SolverMode "Auto" StartTime "0.0" StopTime "10" MaxOrder 5 MaxStep "auto" MinStep "auto" MaxNumMinSteps "-1" InitialStep "auto" FixedStep "0.001" RelTol "1e-6" 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 on 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 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 } Block { BlockType Derivative } Block { BlockType Display Format "short" Decimation "10" Floating off SampleTime "-1" } Block { BlockType Inport Port "1" PortDimensions "-1" SampleTime "-1" ShowAdditionalParam off LatchInput off 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" ZeroCross on } Block { BlockType MATLABFcn MATLABFcn "sin" OutputDimensions "-1" OutputSignalType "auto" Output1D on } Block { BlockType Mux Inputs "4" DisplayOption "none" } Block { BlockType Outport Port "1" OutputWhenDisabled "held" InitialOutput "[]" } Block { BlockType Sin SineType "Time based" Amplitude "1" Bias "0" Frequency "1" Phase "0" Samples "10" Offset "0" SampleTime "-1" VectorParams1D on } Block { BlockType Step Time "1" Before "0" After "1" SampleTime "-1" VectorParams1D on ZeroCross on } Block { BlockType SubSystem ShowPortLabels on Permissions "ReadWrite" RTWSystemCode "Auto" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" SimViewingDevice off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" } 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 ToWorkspace VariableName "simulink_output" MaxDataPoints "1000" Decimation "1" SampleTime "0" } Block { BlockType TransferFcn Numerator "[1]" Denominator "[1 2 1]" AbsoluteTolerance "auto" Realization "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 "phase_detector" Location [384, 87, 1144, 451] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType Display Name "Display" Ports [1] Position [630, 65, 720, 95] Decimation "1" } Block { BlockType Integrator Name "Integrator" Ports [1, 1] Position [335, 275, 365, 305] } Block { BlockType Sin Name "LOCAL OSC" Position [205, 190, 235, 220] SineType "Time based" Frequency "2*pi*1" SampleTime "0" } Block { BlockType SubSystem Name "Phase Detector" Ports [3, 3] Position [450, 164, 575, 246] TreatAsAtomicUnit off System { Name "Phase Detector" Location [111, 299, 743, 545] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "86" Block { BlockType Inport Name "REMOTE" Position [50, 68, 80, 82] } Block { BlockType Inport Name "LOCAL" Position [50, 228, 80, 242] Port "2" } Block { BlockType Inport Name "time" Position [40, 133, 70, 147] Port "3" } Block { BlockType SubSystem Name "Averaging" Ports [2, 1] Position [245, 55, 310, 90] TreatAsAtomicUnit off System { Name "Averaging" Location [552, 384, 1050, 684] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In1" Position [60, 103, 90, 117] } Block { BlockType Inport Name "time" Position [70, 168, 100, 182] Port "2" } Block { BlockType MATLABFcn Name "Averaging Function" Position [230, 115, 290, 145] MATLABFcn "rata2" } Block { BlockType Integrator Name "Integrator" Ports [1, 1] Position [140, 95, 170, 125] } Block { BlockType TransferFcn Name "LPF" Position [310, 112, 370, 148] Denominator "[0.2 1]" } Block { BlockType Mux Name "Mux" Ports [2, 1] Position [190, 93, 195, 162] ShowName off Inputs "2" DisplayOption "bar" } Block { BlockType Outport Name "Out1" Position [430, 123, 460, 137] } Line { SrcBlock "In1" SrcPort 1 DstBlock "Integrator" DstPort 1 } Line { SrcBlock "time" SrcPort 1 Points [45, 0; 0, -30] DstBlock "Mux" DstPort 2 } Line { SrcBlock "Integrator" SrcPort 1 DstBlock "Mux" DstPort 1 } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Averaging Function" DstPort 1 } Line { SrcBlock "Averaging Function" SrcPort 1 DstBlock "LPF" DstPort 1 } Line { SrcBlock "LPF" SrcPort 1 DstBlock "Out1" DstPort 1 } } } Block { BlockType SubSystem Name "Averaging1" Ports [2, 1] Position [260, 225, 325, 260] TreatAsAtomicUnit off System { Name "Averaging1" Location [448, 415, 946, 715] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In1" Position [60, 103, 90, 117] } Block { BlockType Inport Name "time" Position [70, 168, 100, 182] Port "2" } Block { BlockType MATLABFcn Name "Averaging Functiojn" Position [235, 115, 295, 145] MATLABFcn "rata2" } Block { BlockType Integrator Name "Integrator" Ports [1, 1] Position [140, 95, 170, 125] } Block { BlockType TransferFcn Name "LPF" Position [335, 112, 395, 148] Denominator "[0.2 1]" } Block { BlockType Mux Name "Mux" Ports [2, 1] Position [190, 93, 195, 162] ShowName off Inputs "2" DisplayOption "bar" } Block { BlockType Outport Name "Out1" Position [430, 123, 460, 137] } Line { SrcBlock "In1" SrcPort 1 DstBlock "Integrator" DstPort 1 } Line { SrcBlock "time" SrcPort 1 Points [45, 0; 0, -30] DstBlock "Mux" DstPort 2 } Line { SrcBlock "Integrator" SrcPort 1 DstBlock "Mux" DstPort 1 } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Averaging Functiojn" DstPort 1 } Line { SrcBlock "Averaging Functiojn" SrcPort 1 DstBlock "LPF" DstPort 1 } Line { SrcBlock "LPF" SrcPort 1 DstBlock "Out1" DstPort 1 } } } Block { BlockType Derivative Name "Differentiator" Position [125, 60, 155, 90] } Block { BlockType Derivative Name "Differentiator1" Position [125, 220, 155, 250] } Block { BlockType TransferFcn Name "LPF" Position [485, 127, 545, 163] Denominator "[0.001 1]" } Block { BlockType TransferFcn Name "LPF1" Position [565, 127, 625, 163] Denominator "[1 1]" } Block { BlockType Abs Name "Rectifier" Position [180, 60, 210, 90] } Block { BlockType Abs Name "Rectifier1" Position [185, 220, 215, 250] } Block { BlockType Sum Name "Sum" Ports [2, 1] Position [440, 135, 460, 155] ShowName off IconShape "round" Inputs "+-" InputSameDT off OutDataTypeMode "Inherit via internal rule" } Block { BlockType TransferFcn Name "constant k" Position [350, 57, 410, 93] Denominator "[4]" } Block { BlockType TransferFcn Name "constant k1" Position [360, 227, 420, 263] Denominator "[4]" } Block { BlockType Outport Name "output" Position [665, 138, 695, 152] } Block { BlockType Outport Name "remote" Position [505, 68, 535, 82] Port "2" } Block { BlockType Outport Name "local" Position [500, 238, 530, 252] Port "3" } Line { SrcBlock "time" SrcPort 1 Points [155, 0] Branch { DstBlock "Averaging" DstPort 2 } Branch { Points [0, 110] DstBlock "Averaging1" DstPort 2 } } Line { SrcBlock "Differentiator" SrcPort 1 DstBlock "Rectifier" DstPort 1 } Line { SrcBlock "Differentiator1" SrcPort 1 DstBlock "Rectifier1" DstPort 1 } Line { SrcBlock "Sum" SrcPort 1 DstBlock "LPF" DstPort 1 } Line { SrcBlock "Rectifier" SrcPort 1 Points [10, 0; 0, -10] DstBlock "Averaging" DstPort 1 } Line { SrcBlock "Averaging" SrcPort 1 DstBlock "constant k" DstPort 1 } Line { SrcBlock "Rectifier1" SrcPort 1 DstBlock "Averaging1" DstPort 1 } Line { SrcBlock "Averaging1" SrcPort 1 DstBlock "constant k1" DstPort 1 } Line { SrcBlock "LPF" SrcPort 1 DstBlock "LPF1" DstPort 1 } Line { SrcBlock "REMOTE" SrcPort 1 DstBlock "Differentiator" DstPort 1 } Line { SrcBlock "LOCAL" SrcPort 1 DstBlock "Differentiator1" DstPort 1 } Line { SrcBlock "constant k" SrcPort 1 Points [35, 0] Branch { DstBlock "remote" DstPort 1 } Branch { DstBlock "Sum" DstPort 1 } } Line { SrcBlock "constant k1" SrcPort 1 Points [25, 0] Branch { DstBlock "local" DstPort 1 } Branch { DstBlock "Sum" DstPort 2 } } Line { SrcBlock "LPF1" SrcPort 1 DstBlock "output" DstPort 1 } Annotation { Position [534, 187] } } } Block { BlockType Sin Name "REMOTE OSC" Position [205, 115, 235, 145] SineType "Time based" Frequency "2*pi*(0.9)" SampleTime "0" } Block { BlockType Step Name "Step" Position [270, 275, 300, 305] Time "0" SampleTime "0" } Block { BlockType ToWorkspace Name "To Workspace" Position [440, 275, 500, 305] ShowName off VariableName "time" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Block { BlockType ToWorkspace Name "To Workspace1" Position [630, 115, 690, 145] ShowName off VariableName "output" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Block { BlockType ToWorkspace Name "To Workspace2" Position [630, 190, 690, 220] ShowName off VariableName "remote" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Block { BlockType ToWorkspace Name "To Workspace3" Position [630, 230, 690, 260] ShowName off VariableName "local" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Line { SrcBlock "Step" SrcPort 1 DstBlock "Integrator" DstPort 1 } Line { SrcBlock "Integrator" SrcPort 1 Points [20, 0] Branch { DstBlock "To Workspace" DstPort 1 } Branch { Points [0, -60] DstBlock "Phase Detector" DstPort 3 } } Line { SrcBlock "Phase Detector" SrcPort 1 Points [15, 0; 0, -50] Branch { Points [0, -50] DstBlock "Display" DstPort 1 } Branch { DstBlock "To Workspace1" DstPort 1 } } Line { SrcBlock "Phase Detector" SrcPort 2 DstBlock "To Workspace2" DstPort 1 } Line { SrcBlock "Phase Detector" SrcPort 3 Points [0, 15] DstBlock "To Workspace3" DstPort 1 } Line { SrcBlock "REMOTE OSC" SrcPort 1 Points [95, 0; 0, 50] DstBlock "Phase Detector" DstPort 1 } Line { SrcBlock "LOCAL OSC" SrcPort 1 DstBlock "Phase Detector" DstPort 2 } } }