📄 im_scalarcontrol.mdl
字号:
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"
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 RealImagToComplex
Input "Real and imag"
ConstantPart "0"
SampleTime "-1"
}
Block {
BlockType Scope
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 "-1"
}
Block {
BlockType "S-Function"
FunctionName "system"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType Step
Time "1"
Before "0"
After "1"
SampleTime "-1"
VectorParams1D on
ZeroCross on
}
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"
}
Block {
BlockType Terminator
}
Block {
BlockType Trigonometry
Operator "sin"
OutputSignalType "auto"
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 "IM_ScalarCtl_adv_exercise"
Location [2, 78, 1005, 701]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Fcn
Name "(Abs Speed Error)%"
Position [1035, 500, 1095, 530]
Expr "(u(2)-u(1))"
}
Block {
BlockType Fcn
Name "(Rel Speed Error)%"
Position [1035, 440, 1095, 470]
Expr "(u(2)-u(1))/u(2)*100"
}
Block {
BlockType Gain
Name "2pi"
Position [210, 215, 250, 245]
Gain "2*pi"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "60/p"
Position [105, 150, 145, 180]
Gain "60/p"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Display
Name "Abs n err"
Ports [1]
Position [1005, 620, 1095, 650]
Orientation "left"
Decimation "1"
Lockdown off
}
Block {
BlockType SubSystem
Name "Cal Vol Mag"
Ports [1, 1]
Position [340, 313, 420, 347]
BackgroundColor "green"
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskHideContents off
System {
Name "Cal Vol Mag"
Location [540, 471, 1094, 645]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "f_in"
Position [25, 48, 55, 62]
IconDisplay "Port number"
}
Block {
BlockType Gain
Name "Vol Magnitude"
Position [200, 29, 305, 81]
Gain "sqrt(2)*Vs0/fR"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Outport
Name "|V|"
Position [405, 48, 435, 62]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "f_in"
SrcPort 1
DstBlock "Vol Magnitude"
DstPort 1
}
Line {
SrcBlock "Vol Magnitude"
SrcPort 1
DstBlock "|V|"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Cal Vol Mag \n(Rs Compensated)"
Ports [4, 1]
Position [340, 369, 420, 441]
BackgroundColor "green"
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskHideContents off
System {
Name "Cal Vol Mag \n(Rs Compensated)"
Location [170, 267, 1197, 778]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "f_in"
Position [35, 113, 65, 127]
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "ia_measu"
Position [35, 313, 65, 327]
Port "2"
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "ib_measu"
Position [35, 343, 65, 357]
Port "3"
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "theta_s"
Position [35, 173, 65, 187]
Port "4"
IconDisplay "Port number"
}
Block {
BlockType Outport
Name "|V|"
Position [955, 163, 985, 177]
IconDisplay "Port number"
BusOutputAsStruct off
}
}
}
Block {
BlockType SubSystem
Name "Cal stator flux"
Ports [4, 2]
Position [715, 17, 795, 133]
BackgroundColor "cyan"
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskHideContents off
System {
Name "Cal stator flux"
Location [156, 84, 1157, 749]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "fs_in"
Position [25, 283, 55, 297]
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "Uab"
Position [25, 233, 55, 247]
NamePlacement "alternate"
Port "2"
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "iab"
Position [25, 358, 55, 372]
Port "3"
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "theta_s"
Position [30, 543, 60, 557]
Port "4"
IconDisplay "Port number"
}
Block {
BlockType Fcn
Name "Agl shift 1"
Position [610, 385, 670, 415]
Expr "u(1)-2*pi*(u(1)>pi)"
}
Block {
BlockType Fcn
Name "Agl shift 2"
Position [610, 440, 670, 470]
Expr "u(1)-2*pi*(u(1)>pi)"
}
Block {
BlockType Gain
Name "Cal Omega"
Position [90, 273, 140, 307]
Gain "2*pi"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Fcn
Name "Cal PF angle"
Position [490, 440, 550, 470]
Expr "u(1)-u(2)+2*pi*((u(1)-u(2))<0)"
}
Block {
BlockType Fcn
Name "Cal agl (Us, Use)"
Position [490, 385, 550, 415]
Expr "u(1)-u(2)+2*pi*((u(1)-u(2))<0)"
}
Block {
BlockType ComplexToMagnitudeAngle
Name "Complex to\nMagnitude-Angle"
Ports [1, 2]
Position [375, 223, 405, 252]
ShowName off
Output "Magnitude and angle"
}
Block {
BlockType ComplexToMagnitudeAngle
Name "Complex to\nMagnitude-Angle1"
Ports [1, 2]
Position [315, 388, 345, 417]
ShowName off
Output "Magnitude and angle"
}
Block {
BlockType ComplexToMagnitudeAngle
Name "Complex to\nMagnitude-Angle3"
Ports [1, 2]
Position [315, 348, 345, 377]
ShowName off
Output "Magnitude and angle"
}
Block {
BlockType ComplexToRealImag
Name "Complex to\nReal-Imag"
Ports [1, 2]
Position [375, 13, 430, 117]
ShowName off
Output "Real and imag"
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 2]
Position [95, 221, 100, 259]
BackgroundColor "black"
ShowName off
Outputs "2"
DisplayOption "bar"
}
Block {
BlockType Demux
Name "Demux1"
Ports [1, 2]
Position [95, 346, 100, 384]
BackgroundColor "black"
ShowName off
Outputs "2"
DisplayOption "bar"
}
Block {
BlockType Derivative
Name "Derivative"
Position [460, 580, 490, 610]
Orientation "left"
BackgroundColor "yellow"
NamePlacement "alternate"
ShowName off
}
Block {
BlockType Display
Name "Display"
Ports [1]
Position [845, 468, 940, 512]
ShowName off
Decimation "1"
Lockdown off
}
Block {
BlockType Product
Name "Divide"
Ports [2, 1]
Position [500, 199, 535, 321]
ShowName off
Inputs "*/"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
RndMeth "Floor"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Divide1"
Ports [2, 1]
Position [710, 31, 740, 64]
ShowName off
Inputs "*/"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
RndMeth "Floor"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Divide2"
Ports [2, 1]
Position [710, 81, 740, 114]
ShowName off
Inputs "*/"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
RndMeth "Floor"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain1"
Position [770, 427, 820, 463]
ShowName off
Gain "180/pi"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain2"
Position [190, 348, 240, 382]
ShowName off
Gain "Rs"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain3"
Position [380, 346, 420, 364]
ShowName off
Gain "1/Rs"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Display
Name "Mag. of current vector"
Ports [1]
Position [490, 343, 580, 367]
NamePlacement "alternate"
Decimation "1"
Lockdown off
}
Block {
BlockType Display
Name "Mag. of voltage vector Use"
Ports [1]
Position [730, 148, 820, 172]
NamePlacement "alternate"
Decimation "1"
Lockdown off
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [460, 436, 465, 474]
ShowName off
Inputs "2"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -