📄 lab1_pllmodel.mdl
字号:
Model { Name "lab1_pllmodel" Version 2.20 SimParamPage Solver SampleTimeColors off InvariantConstants off WideVectorLines off ShowLineWidths off StartTime "0.0" StopTime "samples/fr" Solver ode45 RelTol "1e-3" AbsTol "1e-6" Refine "1" MaxStep "1/fr" InitialStep "auto" FixedStep "1/fr" MaxOrder 5 OutputOption RefineOutputTimes OutputTimes "[]" LoadExternalInput off ExternalInput "[t, u]" SaveTime off TimeSaveName "tout" SaveState off StateSaveName "xout" SaveOutput off OutputSaveName "yout" LoadInitialState off InitialState "xInitial" SaveFinalState off FinalStateName "xFinal" LimitMaxRows off MaxRows "1000" Decimation "1" AlgebraicLoopMsg warning MinStepSizeMsg warning UnconnectedInputMsg warning UnconnectedOutputMsg warning UnconnectedLineMsg warning ConsistencyChecking off ZeroCross on SimulationMode normal RTWSystemTargetFile "grt.tlc" RTWInlineParameters off RTWPlaceOutputsASAP off RTWRetainRTWFile off RTWTemplateMakefile "grt_default_tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off ExtModeMexFile "ext_comm" ExtModeBatchMode off 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 "lab1_pllmodel" Location [251, 203, 1116, 647] Open on ToolBar off StatusBar off ScreenColor yellow PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType Gain Name "1/2pi" Position [635, 120, 665, 150] FontName "helvetica" FontSize 12 Gain "1/(2*pi)" } Block { BlockType Gain Name "PFD gain\n[V/rad]" Position [170, 356, 200, 384] FontName "helvetica" FontSize 12 Gain "Kphi" } Block { BlockType ToWorkspace Name "[V]" Position [480, 58, 520, 72] FontName "helvetica" FontSize 12 VariableName "vtune" Buffer "1e6" Decimation "1" SampleTime "0" } Block { BlockType Fcn Name "divider" Position [680, 350, 725, 380] Orientation left FontName "helvetica" FontSize 12 Expr "u[1]/N" } Block { BlockType ToWorkspace Name "fout\n[Hz]" Position [770, 128, 805, 142] FontName "helvetica" FontSize 12 VariableName "fv" Buffer "1e6" Decimation "1" SampleTime "0" } Block { BlockType Constant Name "fref\n[Hz]" Position [25, 122, 55, 138] FontName "helvetica" FontSize 12 Value "fr" } Block { BlockType Step Name "freq step" Position [25, 190, 55, 220] Time "1000/fr" Before "10e6" After "20e6" } Block { BlockType TransferFcn Name "freq->phase\n[rad/Hz]" Position [580, 347, 610, 393] FontName "helvetica" FontSize 12 Numerator "2*pi" Denominator "[1 0]" } Block { BlockType TransferFcn Name "freq->phase\n[rad/Hz]1" Position [90, 107, 120, 153] FontName "helvetica" FontSize 12 Numerator "2*pi" Denominator "[1 0]" } Block { BlockType TransferFcn Name "integrator +\nphase lead" Position [260, 350, 320, 390] FontName "helvetica" FontSize 12 Numerator "[Tau2 1]" Denominator "[Tau1 0]" } Block { BlockType TransferFcn Name "low-pass\nfilter" Position [365, 350, 425, 390] FontName "helvetica" FontSize 12 Numerator "[1]" Denominator "[Tau3 1]" } Block { BlockType Sum Name "phase\ncomp." Ports [2, 1, 0, 0, 0] Position [120, 358, 140, 382] FontName "helvetica" FontSize 12 Inputs "+-" } Block { BlockType ToWorkspace Name "phase error\n[rad]" Position [295, 53, 330, 67] FontName "helvetica" FontSize 12 VariableName "perr" Buffer "1e6" Decimation "1" SampleTime "0" } Block { BlockType Derivative Name "phase->freq" Position [700, 120, 730, 150] FontName "helvetica" FontSize 12 } Block { BlockType ToWorkspace Name "phi_in\n[rad]" Position [175, 52, 225, 68] FontName "helvetica" FontSize 12 VariableName "phi_ref" Buffer "1e6" Decimation "1" SampleTime "0" } Block { BlockType ToWorkspace Name "phi_out\n[rad]" Position [625, 63, 675, 77] FontName "helvetica" FontSize 12 VariableName "phi_out" Buffer "1e6" Decimation "1" SampleTime "0" } Block { BlockType SubSystem Name "time" Ports [0, 0, 0, 0, 0] Position [17, 364, 63, 397] FontName "helvetica" FontSize 12 ShowPortLabels off MaskType "time" MaskDisplay "disp('Save\\ntime t')" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale System { Name "time" Location [163, 139, 498, 323] Open off ToolBar off StatusBar off ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType Clock Name "Clock" Position [75, 105, 95, 125] DeleteFcn "simclock BlockIsBeingDestroyed" PostSaveFcn "simclock Save" Location [30, 40, 140, 75] } Block { BlockType ToWorkspace Name "To Workspace" Position [165, 107, 215, 123] VariableName "t" Buffer "1e6" Decimation "1" SampleTime "0" } Line { SrcBlock "Clock" SrcPort 1 DstBlock "To Workspace" DstPort 1 } Annotation { Position [147, 77] VerticalAlignment top Text "Save time vector t" } } } Block { BlockType SubSystem Name "vco\n[Hz/V]" Ports [1, 1, 0, 0, 0] Position [500, 345, 540, 385] FontName "helvetica" FontSize 12 ShowPortLabels off MaskType "VCO" MaskDescription "VCO - output [Hz] " MaskPromptString " Sensitivity [Hz/V] | Min. frequency (Vtune=0V)"" [Hz] " MaskStyleString "edit,edit" MaskTunableValueString "on,on" MaskVariables "Kv=@1;fmin=@2;" MaskInitialization " t=0:0.01:1;" MaskDisplay "plot(sin(0:pi/8:2*pi),cos(0:pi/8:2*pi),[-1:1/8:""1]*0.75,sin(0:pi/8:2*pi)*0.5)" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "Kv|10e6" System { Name "vco\n[Hz/V]" Location [58, 80, 630, 442] Open off ToolBar off StatusBar off ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType Inport Name "Vcntrl" Position [85, 115, 105, 135] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Gain Name "Gain" Position [165, 110, 200, 140] Gain "Kv" } Block { BlockType Sum Name "Sum" Ports [2, 1, 0, 0, 0] Position [265, 140, 285, 160] Inputs "++" } Block { BlockType Constant Name "const" Position [145, 188, 175, 212] Value "fmin" } Block { BlockType Outport Name "RF\nfreq" Position [345, 140, 365, 160] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "Sum" SrcPort 1 DstBlock "RF\nfreq" DstPort 1 } Line { SrcBlock "Vcntrl" SrcPort 1 DstBlock "Gain" DstPort 1 } Line { SrcBlock "Gain" SrcPort 1 Points [25, 0; 0, 20] DstBlock "Sum" DstPort 1 } Line { SrcBlock "const" SrcPort 1 Points [35, 0; 0, -45] DstBlock "Sum" DstPort 2 } Annotation { Position [267, 47] VerticalAlignment top ForegroundColor blue Text "Voltage-controlled oscillator\n\nfout = fmi""n + Vin*Kv " } } } Line { SrcBlock "freq->phase\n[rad/Hz]1" SrcPort 1 Points [15, 0] Branch { Points [0, -70] DstBlock "phi_in\n[rad]" DstPort 1 } Branch { Points [55, 0] } } Line { Points [575, 135; 15, 0] Branch { Points [0, -65] DstBlock "phi_out\n[rad]" DstPort 1 } Branch { DstBlock "1/2pi" DstPort 1 } } Line { SrcBlock "phase->freq" SrcPort 1 DstBlock "fout\n[Hz]" DstPort 1 } Line { SrcBlock "1/2pi" SrcPort 1 DstBlock "phase->freq" DstPort 1 } Line { SrcBlock "fref\n[Hz]" SrcPort 1 DstBlock "freq->phase\n[rad/Hz]1" DstPort 1 } Annotation { Position [412, 18] VerticalAlignment top ForegroundColor blue BackgroundColor yellow Text "Integer-N PLL - linear model" FontName "helvetica" FontSize 14 } Annotation { Position [52, 13] VerticalAlignment top ForegroundColor blue BackgroundColor yellow Text "Lab #1" FontName "helvetica" FontSize 14 } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -