pmsg_test_w.mdl
来自「永磁同步发电机控制」· MDL 代码 · 共 2,438 行 · 第 1/5 页
MDL
2,438 行
SrcBlock "Sum"
SrcPort 1
Points [0, 0; 60, 0]
Branch {
Points [0, 165; 80, 0]
DstBlock "Sum2"
DstPort 2
}
Branch {
Points [30, 0; 0, 50]
DstBlock "Mux"
DstPort 1
}
}
Line {
SrcBlock "Sum2"
SrcPort 1
DstBlock "Mux"
DstPort 3
}
Line {
SrcBlock "Sum1"
SrcPort 1
Points [0, 0; 90, 0]
Branch {
Points [0, -25]
DstBlock "Mux"
DstPort 2
}
Branch {
DstBlock "Sum2"
DstPort 1
}
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Xabc(P-P)"
DstPort 1
}
Line {
SrcBlock "Xabc(L-L)"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
}
}
Block {
BlockType Mux
Name "Mux1"
Ports [2, 1]
Position [410, 563, 415, 632]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Mux
Name "Mux4"
Ports [2, 1]
Position [420, 468, 425, 537]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType SubSystem
Name "PMSG"
Ports [2, 4]
Position [185, 202, 220, 358]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
MaskDescription "PMSG"
MaskPromptString "Ld|Lq|Rs|pole pairs|flux linkage|inertial|frict"
"ion"
MaskStyleString "edit,edit,edit,edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on,on,on,on"
MaskCallbackString "||||||"
MaskEnableString "on,on,on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on,on,on"
MaskToolTipString "on,on,on,on,on,on,on"
MaskVarAliasString ",,,,,,"
MaskVariables "Ld=@1;Lq=@2;Rs=@3;P=@4;Bf=@5;J=@6;B=@7;"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "(0.036+0.0583)/(22.5*2*pi/2)|(0.036+0.127)/(22."
"5*2*pi/2)|0.00665|30|5.98|8e3 |0"
MaskTabNameString ",,,,,,"
System {
Name "PMSG"
Location [-8, 80, 1004, 682]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Inport
Name "w"
Position [440, 465, 460, 485]
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "Iabc"
Position [15, 68, 45, 82]
Port "2"
IconDisplay "Port number"
}
Block {
BlockType Constant
Name "Constant"
Position [320, 320, 350, 350]
Value "Bf"
VectorParams1D on
SamplingMode "Sample based"
OutDataTypeMode "Inherit from 'Constant value'"
OutDataType "sfix(16)"
ConRadixGroup "Use specified scaling"
OutScaling "2^0"
SampleTime "inf"
FramePeriod "inf"
}
Block {
BlockType Constant
Name "Constant1"
Position [750, 221, 780, 239]
ShowName off
Value "0"
VectorParams1D on
SamplingMode "Sample based"
OutDataTypeMode "Inherit from 'Constant value'"
OutDataType "sfix(16)"
ConRadixGroup "Use specified scaling"
OutScaling "2^0"
SampleTime "inf"
FramePeriod "inf"
}
Block {
BlockType Constant
Name "Constant2"
Position [695, 325, 725, 355]
Value "0"
VectorParams1D on
SamplingMode "Sample based"
OutDataTypeMode "Inherit from 'Constant value'"
OutDataType "sfix(16)"
ConRadixGroup "Use specified scaling"
OutScaling "2^0"
SampleTime "inf"
FramePeriod "inf"
}
Block {
BlockType Constant
Name "Constant3"
Position [700, 406, 730, 424]
ShowName off
Value "0"
VectorParams1D on
SamplingMode "Sample based"
OutDataTypeMode "Inherit from 'Constant value'"
OutDataType "sfix(16)"
ConRadixGroup "Use specified scaling"
OutScaling "2^0"
SampleTime "inf"
FramePeriod "inf"
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 3]
Position [90, 146, 95, 184]
BackgroundColor "black"
ShowName off
Outputs "3"
DisplayOption "bar"
}
Block {
BlockType Reference
Name "Discrete Derivative"
Ports [1, 1]
Position [370, 61, 405, 89]
ShowName off
SourceBlock "simulink/Discrete/Discrete Derivative"
SourceType "Discrete Derivative"
ShowPortLabels on
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
gainval "1.0"
ICPrevScaledInput "0.0"
OutputDataTypeScalingMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
LockScale off
RndMeth "Floor"
DoSatur off
}
Block {
BlockType Reference
Name "Discrete Derivative1"
Ports [1, 1]
Position [355, 156, 390, 184]
ShowName off
SourceBlock "simulink/Discrete/Discrete Derivative"
SourceType "Discrete Derivative"
ShowPortLabels on
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
gainval "1.0"
ICPrevScaledInput "0.0"
OutputDataTypeScalingMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
LockScale off
RndMeth "Floor"
DoSatur off
}
Block {
BlockType DiscreteIntegrator
Name "Discrete-Time\nIntegrator1"
Ports [1, 1]
Position [600, 463, 620, 487]
ShowName off
IntegratorMethod "Integration: Forward Euler"
ExternalReset "none"
InitialConditionSource "internal"
SampleTime "Ts_Power"
IgnoreLimit off
ICPrevOutput "DiscIntNeverNeededParam"
ICPrevScaledInput "DiscIntNeverNeededParam"
}
Block {
BlockType Product
Name "Divide"
Ports [2, 1]
Position [415, 246, 445, 279]
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 [425, 116, 455, 149]
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 [420, 296, 450, 329]
ShowName off
Inputs "**"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
RndMeth "Floor"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain"
Position [550, 462, 575, 488]
ShowName off
Gain "P"
}
Block {
BlockType Gain
Name "Gain1"
Position [380, 16, 435, 44]
ShowName off
Gain "Rs"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain10"
Position [310, 240, 365, 270]
ShowName off
Gain "Ld"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain2"
Position [455, 75, 510, 105]
ShowName off
Gain "Ld"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain4"
Position [440, 160, 495, 190]
ShowName off
Gain "Lq"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain5"
Position [410, 201, 465, 229]
ShowName off
Gain "Rs"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain9"
Position [305, 95, 360, 125]
ShowName off
Gain "Lq"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Goto
Name "Goto"
Position [870, 390, 910, 420]
GotoTag "sincos"
TagVisibility "global"
}
Block {
BlockType Mux
Name "Mux"
Ports [3, 1]
Position [805, 176, 810, 214]
ShowName off
Inputs "3"
DisplayOption "bar"
}
Block {
BlockType Mux
Name "Mux1"
Ports [3, 1]
Position [805, 353, 810, 427]
ShowName off
Inputs "3"
DisplayOption "bar"
}
Block {
BlockType Mux
Name "Mux2"
Ports [2, 1]
Position [820, 251, 825, 324]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Mux
Name "Mux3"
Ports [2, 1]
Position [175, 281, 180, 319]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Selector
Name "Selector4"
Ports [1, 1]
Position [915, 477, 940, 503]
ShowName off
InputPortWidth "3"
}
Block {
BlockType Sum
Name "Subtract1"
Ports [3, 1]
Position [550, 35, 565, 145]
ShowName off
Inputs "--+"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Subtract2"
Ports [4, 1]
Position [550, 162, 565, 318]
ShowName off
Inputs "---+"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Fcn
Name "Te "
Position [80, 409, 260, 431]
Expr "1.5*P*(Bf*u(1)+(Ld-Lq)*u(1)*u(2))"
}
Block {
BlockType Terminator
Name "Terminator"
Position [125, 235, 135, 255]
ShowName off
}
Block {
BlockType Trigonometry
Name "Trigonometric\nFunction"
Ports [1, 1]
Position [750, 257, 785, 283]
ShowName off
}
Block {
BlockType Trigonometry
Name "Trigonometric\nFunction1"
Ports [1, 1]
Position [750, 292, 785, 318]
ShowName off
Operator "cos"
}
Block {
BlockType Scope
Name "VaIa_A"
Ports [2]
Position [720, 83, 760, 132]
ForegroundColor "darkGreen"
Floating off
Location [5, 56, 1029, 741]
Open off
NumInputPorts "2"
ZoomMode "xonly"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
axes2 "%<SignalLabel>"
}
TimeRange "0.07000000000000001"
YMin "0~0"
YMax "250~300"
SaveName "VaIa_A2"
DataFormat "StructureWithTime"
LimitDataPoints off
SampleInput on
SampleTime "Ts_Power"
}
Block {
BlockType Scope
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?