build example codes

This commit is contained in:
2024-11-01 10:00:36 +08:00
parent b0592a0a35
commit 2d09e81740
10 changed files with 116 additions and 169 deletions
Binary file not shown.
+113 -166
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<MillingCourse ApiVersion="3.1.166.0"> <MillingCourse ApiVersion="3.1.236.0">
<MillingEquipment> <MillingEquipment>
<MachiningEquipment> <MachiningEquipment>
<SolidMachiningChain> <SolidMachiningChain>
@@ -27,98 +27,6 @@
</SpindleSpeedToTorque--RPM-to-Nm> </SpindleSpeedToTorque--RPM-to-Nm>
</SpindleCapability> </SpindleCapability>
</SpindleCapability> </SpindleCapability>
<StickMachiningTool>
<Note>T1</Note>
<Holder>
<StickHolder>
<Cylindroid LongitudeNum="12">
<PairZr>(0,10)</PairZr>
<PairZr>(30,10)</PairZr>
</Cylindroid>
<Note></Note>
</StickHolder>
</Holder>
<Cutter>
<MillingCutter>
<ShaperProfile>
<AptProfile>
<Apt>
<ColumnApt>
<D>12</D>
<Rc>0.5</Rc>
<FluteH>20</FluteH>
</ColumnApt>
</Apt>
</AptProfile>
</ShaperProfile>
<InnerBeamProfile>
<FluteDependentRatioProfile>
<!--<ConstRatioProfile>
<RadiusRatio>0.56</RadiusRatio>
</ConstRatioProfile>-->
</FluteDependentRatioProfile>
</InnerBeamProfile>
<UpperBeamGeom>
<TransformationGeom>
<Transformer />
<Geom>
<Cylindroid LongitudeNum="12">
<PairZr>(20,6)</PairZr>
<PairZr>(75,6)</PairZr>
</Cylindroid>
</Geom>
</TransformationGeom>
</UpperBeamGeom>
<LinearResolution_mm>0.5</LinearResolution_mm>
<AngleResolution_deg>15</AngleResolution_deg>
<FluteContourTray>
<UniformContourTray>
<TrackNum>3</TrackNum>
<BaselineOneContour>
<FluteContour>
<SetupAngle_deg>0</SetupAngle_deg>
<BaseSideContour>
<ConstHelixSideContour>
<Helix_deg>50</Helix_deg>
<RadialRakeAngle_deg>15</RadialRakeAngle_deg>
<RadialReliefAngle_deg>5</RadialReliefAngle_deg>
</ConstHelixSideContour>
</BaseSideContour>
<BaseBottomContour>
<SlideBottomContour>
<AxialRakeAngle_deg>50</AxialRakeAngle_deg>
<DiskAngle_deg>1.5</DiskAngle_deg>
<EccentricAngle_deg>15</EccentricAngle_deg>
<CutterLengthOnBottomProjection_mm>5</CutterLengthOnBottomProjection_mm>
<OuterRadius_mm>5.5</OuterRadius_mm>
</SlideBottomContour>
</BaseBottomContour>
</FluteContour>
</BaselineOneContour>
</UniformContourTray>
</FluteContourTray>
<BodyMaterial>
<XmlSource>WC-Co6-800nm.CutterMaterial</XmlSource>
</BodyMaterial>
<CoatingMaterial />
<CutterMass_g>7</CutterMass_g>
<HoneRadius_um>20</HoneRadius_um>
<MillingCutterOptLimit>
<MillingCutterOptLimit>
<EnableOpt>true</EnableOpt>
<YieldingSafetyFactor>3</YieldingSafetyFactor>
<EnableLimitByMinimumUncutChipThickness>true</EnableLimitByMinimumUncutChipThickness>
<MinFeedPerTooth_mm>0</MinFeedPerTooth_mm>
<MaxFeedPerTooth_mm>999</MaxFeedPerTooth_mm>
</MillingCutterOptLimit>
</MillingCutterOptLimit>
</MillingCutter>
</Cutter>
<PreservedDistanceBetweenFluteAndSpindleNose_mm>8</PreservedDistanceBetweenFluteAndSpindleNose_mm>
<ObservationAnchorReference>HolderAnc</ObservationAnchorReference>
<RelativeHeightFromObservationAnchor_mm>0</RelativeHeightFromObservationAnchor_mm>
<ObservationRingRadius_mm>0</ObservationRingRadius_mm>
</StickMachiningTool>
<Fixture> <Fixture>
<Fixture> <Fixture>
<Solid> <Solid>
@@ -139,7 +47,7 @@
</Fixture> </Fixture>
<Workpiece> <Workpiece>
<Workpiece> <Workpiece>
<InitResolution>0.5</InitResolution> <InitResolution>0.125</InitResolution>
<RawGeom> <RawGeom>
<TransformationGeom> <TransformationGeom>
<Transformer> <Transformer>
@@ -228,7 +136,7 @@
</Geom> </Geom>
</TransformationGeom> </TransformationGeom>
</UpperBeamGeom> </UpperBeamGeom>
<LinearResolution_mm>0.03125</LinearResolution_mm> <LinearResolution_mm>0.0625</LinearResolution_mm>
<AngleResolution_deg>15</AngleResolution_deg> <AngleResolution_deg>15</AngleResolution_deg>
<FluteContourTray> <FluteContourTray>
<UniformContourTray> <UniformContourTray>
@@ -262,6 +170,7 @@
<CoatingMaterial /> <CoatingMaterial />
<CutterMass_g>7</CutterMass_g> <CutterMass_g>7</CutterMass_g>
<HoneRadius_um>20</HoneRadius_um> <HoneRadius_um>20</HoneRadius_um>
<ReliefAngle_deg>5</ReliefAngle_deg>
<MillingCutterOptLimit> <MillingCutterOptLimit>
<MillingCutterOptLimit> <MillingCutterOptLimit>
<EnableOpt>true</EnableOpt> <EnableOpt>true</EnableOpt>
@@ -341,22 +250,72 @@
<RootListCommand> <RootListCommand>
<ListCommand> <ListCommand>
<CommandEntryList> <CommandEntryList>
<CommandEntry IsEnabled="true"> <CommandEntry IsEnabled="false">
<Command> <Command>
<ScriptCommand> <ScriptCommand>
<ScriptTitle>一般設定</ScriptTitle> <ScriptTitle>範例 1-1 執行NC檔案</ScriptTitle>
<ScriptText>DispCacheMb = 260; //顯示暫存大小 <ScriptText>RunNcFile("NC/circle.ptp");
MachiningResolution = 0.25; //仿真解析度 RunNcFile("NC/drill_slot.ptp");
EnableCollisionDetection = true; //碰撞檢測開啟 RunNcFile("NC/side.ptp");
EnablePauseOnCollision = false; //檢測碰撞不暫停</ScriptText> RunNcFile("NC/slide.ptp");</ScriptText>
<IsSimpleMode>true</IsSimpleMode>
</ScriptCommand> </ScriptCommand>
</Command> </Command>
</CommandEntry> </CommandEntry>
<CommandEntry IsEnabled="true"> <CommandEntry IsEnabled="true">
<Command> <Command>
<ScriptCommand> <ScriptCommand>
<ScriptTitle>進給率優化設定</ScriptTitle> <ScriptTitle>範例 1-2 基礎設定 及 執行NC檔案</ScriptTitle>
<ScriptText>OptEnableInterpolation = true; //是否要重新插補,增加路徑線段加減速 <ScriptText>////一般設定////
DispCache_Mb = 1260; //GRAM暫存空間 (Mb)
MachiningResolution_mm = 0.125; //仿真解析度 (mm)
MachiningMotionResolution = FeedPerCycle;
EnableCollisionDetection = true; //是否啟用碰撞檢測開啟
EnablePauseOnCollision = false; //是否啟用碰撞發生時暫停
////執行NC檔案////
RunNcFile("NC/circle.ptp");
RunNcFile("NC/drill_slot.ptp");
RunNcFile("NC/side.ptp");
RunNcFile("NC/slide.ptp");</ScriptText>
<IsSimpleMode>true</IsSimpleMode>
</ScriptCommand>
</Command>
</CommandEntry>
<CommandEntry IsEnabled="false">
<Command>
<ScriptCommand>
<ScriptTitle>範例 1-3 穿插設定於NC檔案間</ScriptTitle>
<ScriptText>////一般設定////
DispCache_Mb = 260; //GRAM暫存空間 (Mb)
MachiningResolution_mm = 1.0; //仿真解析度 (mm)
MachiningMotionResolution = FeedPerCycle;
EnableCollisionDetection = true; //是否啟用碰撞檢測開啟
EnablePauseOnCollision = false; //是否啟用碰撞發生時暫停
RunNcFile("NC/circle.ptp");
EnableCollisionDetection = false;
RunNcFile("NC/drill_slot.ptp");
MachiningResolution_mm = 1.0/8;
RunNcFile("NC/side.ptp");
RunNcFile("NC/slide.ptp");</ScriptText>
<IsSimpleMode>true</IsSimpleMode>
</ScriptCommand>
</Command>
</CommandEntry>
<CommandEntry IsEnabled="false">
<Command>
<ScriptCommand>
<ScriptTitle>範例 2-1 優化NC</ScriptTitle>
<ScriptText>////一般設定////
DispCache_Mb = 260; //GRAM暫存空間 (Mb)
MachiningResolution_mm = 1.0; //仿真解析度 (mm)
MachiningMotionResolution = FeedPerCycle;
EnableCollisionDetection = false; //是否啟用碰撞檢測開啟
EnablePauseOnCollision = false; //是否啟用碰撞發生時暫停
////NC優化設定////
OptEnableInterpolation = true; //是否要重新插補,增加路徑線段加減速
OptRapidFeed_mmdmin = 4000; //無切削區域進給 OptRapidFeed_mmdmin = 4000; //無切削區域進給
OptMinFeedrate_mmdmin = 100; //有切削區域最小進給 OptMinFeedrate_mmdmin = 100; //有切削區域最小進給
OptMaxFeedrate_mmdmin = 4000; //有切削區域最大進給 OptMaxFeedrate_mmdmin = 4000; //有切削區域最大進給
@@ -365,40 +324,59 @@ OptExtendedPreDistance_mm = 3; //有切削區域等效計算的前長度
OptExtendedPostDistance_mm = 2; //有切削區域等效計算的後長度 OptExtendedPostDistance_mm = 2; //有切削區域等效計算的後長度
OptSpindlePowerSafetyFactor = 1.5; //主軸功率安全係數 OptSpindlePowerSafetyFactor = 1.5; //主軸功率安全係數
OptSpindleTorqueSafetyFactor = 1.5; //主軸扭力安全係數 OptSpindleTorqueSafetyFactor = 1.5; //主軸扭力安全係數
OptPreferedForce_N = double.PositiveInfinity; //優化目標力</ScriptText> OptPreferedForce_N = double.PositiveInfinity; //優化目標力
////執行NC檔案////
RunNcFile("NC/circle.ptp");
RunNcFile("NC/drill_slot.ptp");
RunNcFile("NC/side.ptp");
RunNcFile("NC/slide.ptp");
OptimizeToFiles("Cache/Opt-[NcName]"); //優化NC檔並以路徑樣板輸出
</ScriptText>
<IsSimpleMode>true</IsSimpleMode>
</ScriptCommand>
</Command>
</CommandEntry>
<CommandEntry IsEnabled="false">
<Command>
<ScriptCommand>
<ScriptTitle>範例 3 其他各式指令</ScriptTitle>
<ScriptText>////一般設定////
DispCache_Mb = 260; //GRAM暫存空間 (Mb)
MachiningResolution_mm = 1.0; //仿真解析度 (mm)
MachiningMotionResolution = FeedPerCycle;
EnableCollisionDetection = false; //是否啟用碰撞檢測開啟
EnablePauseOnCollision = false; //是否啟用碰撞發生時暫停
WriteRuntimeGeom("Cache/init.wct"); //寫入暫存檔
////執行NC檔案////
RunNcFile("NC/circle.ptp");
RunNcFile("NC/drill_slot.ptp");
RunNcFile("NC/side.ptp");
RunNcFile("NC/slide.ptp");
WriteRuntimeGeom("Cache/finish.wct"); //寫入暫存檔
WriteRuntimeGeomToStl("Cache/finish.stl",0)
WriteStepFiles("Cache/[NcName].step.csv");
WriteShotFiles("Cache/[NcName].shot.csv", 1);
</ScriptText>
<IsSimpleMode>true</IsSimpleMode>
</ScriptCommand> </ScriptCommand>
</Command> </Command>
</CommandEntry> </CommandEntry>
<CommandEntry IsEnabled="true"> <CommandEntry IsEnabled="true">
<Command> <Command>
<NcFileListCommand> <ScriptCommand>
<File>NC/circle.ptp</File> <ScriptTitle>範例 4 補充腳本</ScriptTitle>
<File>NC/drill_slot.ptp</File> <ScriptText>////一般設定////
<File>NC/side.ptp</File> DispCache_Mb = 2260; //GRAM暫存空間 (Mb)
<File>NC/slide.ptp</File>
</NcFileListCommand> WriteRuntimeGeom("Cache/finish-2.wct"); //寫入暫存檔
</Command> Diff(1); //執行和成品誤差比對</ScriptText>
</CommandEntry> <IsSimpleMode>true</IsSimpleMode>
<CommandEntry IsEnabled="true"> </ScriptCommand>
<Command>
<OptimizeToFilesCommand>
<RelFileTemplate>Cache/Opt-[NcName]</RelFileTemplate>
</OptimizeToFilesCommand>
</Command>
</CommandEntry>
<CommandEntry IsEnabled="true">
<Command>
<WriteShotFilesCommand>
<RelFileTemplate>Cache/[NcName].shot.csv</RelFileTemplate>
<TimeResolution_ms>1</TimeResolution_ms>
</WriteShotFilesCommand>
</Command>
</CommandEntry>
<CommandEntry IsEnabled="false">
<Command>
<GeomDiffCommand>
<DetectRadius_mm>1</DetectRadius_mm>
</GeomDiffCommand>
</Command> </Command>
</CommandEntry> </CommandEntry>
</CommandEntryList> </CommandEntryList>
@@ -417,9 +395,9 @@ OptPreferedForce_N = double.PositiveInfinity; //優化目標力</ScriptText>
<EnableAdvancedPhysics>true</EnableAdvancedPhysics> <EnableAdvancedPhysics>true</EnableAdvancedPhysics>
<EnableExternalEvaluation>true</EnableExternalEvaluation> <EnableExternalEvaluation>true</EnableExternalEvaluation>
<EnableDeflectionTransformation>false</EnableDeflectionTransformation> <EnableDeflectionTransformation>false</EnableDeflectionTransformation>
<NcResolution> <MachiningMotionResolution>
<FeedPerCycleNcResolution /> <FeedPerCycleMachiningMotionResolution />
</NcResolution> </MachiningMotionResolution>
</MillingActRunnerConfig> </MillingActRunnerConfig>
</MillingActRunnerConfig> </MillingActRunnerConfig>
<InspectingKey>MaxTipDeflectionOnToolRunningCoordinate_um.Y</InspectingKey> <InspectingKey>MaxTipDeflectionOnToolRunningCoordinate_um.Y</InspectingKey>
@@ -596,39 +574,8 @@ OptPreferedForce_N = double.PositiveInfinity; //優化目標力</ScriptText>
</ItemConfigDictionary> </ItemConfigDictionary>
</ClStripChartConfig> </ClStripChartConfig>
</ClStripChartConfig> </ClStripChartConfig>
<NcOptOption>
<EnableOpt>true</EnableOpt>
<EnableOptFeedrate>true</EnableOptFeedrate>
<EnableDepthSplition>true</EnableDepthSplition>
<ExtendedPreDistance_mm>3</ExtendedPreDistance_mm>
<ExtendedPostDistance_mm>2</ExtendedPostDistance_mm>
<EnableInterpolation>true</EnableInterpolation>
<MinFeedrate_mmdmin>100</MinFeedrate_mmdmin>
<MaxFeedrate_mmdmin>4000.0000000000005</MaxFeedrate_mmdmin>
<RapidFeed_mmdmin>4000</RapidFeed_mmdmin>
<MaxAcceleration_mmds2>10</MaxAcceleration_mmds2>
<PreferedForce_N>INF</PreferedForce_N>
<SpindleTorqueSafetyFactor>1.5</SpindleTorqueSafetyFactor>
<SpindlePowerSafetyFactor>1.5</SpindlePowerSafetyFactor>
<CompensationMask>0</CompensationMask>
</NcOptOption>
</MillingGuide> </MillingGuide>
</MillingGuide> </MillingGuide>
<NcOptProc /> <NcOptProc />
<DispCacheMb>260</DispCacheMb> <DispCacheMb>260</DispCacheMb>
<MillingTraining>
<IsFxEnabled>true</IsFxEnabled>
<IsFyEnabled>true</IsFyEnabled>
<IsFzEnabled>true</IsFzEnabled>
<IsMxEnabled>false</IsMxEnabled>
<IsMyEnabled>false</IsMyEnabled>
<IsMzEnabled>false</IsMzEnabled>
<ForceOutlierRatio>2</ForceOutlierRatio>
<LeadParaTemplate>
<RakeFaceCuttingPara />
</LeadParaTemplate>
<ResultParaTemplate>
<RakeFaceCuttingPara />
</ResultParaTemplate>
</MillingTraining>
</MillingCourse> </MillingCourse>
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+3 -3
View File
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<GeneralXyzabcMachineTool> <GeneralXyzabcMachineTool>
<Name>PMC_B1</Name> <Name>PMC_B1</Name>
<Note /> <Note></Note>
<XyzabcChain> <XyzabcChain>
<CodeXyzabcChain> <CodeXyzabcChain>
<ChainCode>[O][Y][X][C][w];[O][Z][B][S][t]</ChainCode> <ChainCode>[O][Y][X][C][w];[O][Z][B][S][t]</ChainCode>
<IsVertical>true</IsVertical> <IsVertical>true</IsVertical>
<TransformerX> <TransformerX>
<DynamicTranslation Axis="(-1, 0, 0)" Len="103.4" /> <DynamicTranslation Axis="(-1, 0, 0)" Len="0" />
</TransformerX> </TransformerX>
<TransformerY> <TransformerY>
<DynamicTranslation Axis="(0, -1, 0)" Len="-109.553" /> <DynamicTranslation Axis="(0, -1, 0)" Len="0" />
</TransformerY> </TransformerY>
<TransformerZ> <TransformerZ>
<DynamicTranslation Axis="(0, 0, 1)" Len="0" /> <DynamicTranslation Axis="(0, 0, 1)" Len="0" />
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.