iCAx开思网

标题: 【原创】Surfcam MPostwin解釋兼教程 [打印本页]

作者: sinderal    时间: 2003-11-9 15:14
标题: 【原创】Surfcam MPostwin解釋兼教程
在 Surfcam/postlib/mpost/目錄下 會看到粉多
xxxxx.M3 ------------ 代表 銑床三軸的 機器配置文件
xxxxx.M4 ------------ 代表 銑床三軸的 機器配置文件
  
我們挑一個 適當的控制器與機床的 xxxxx.M3 用文本編輯器來修改
作者: sinderal    时间: 2003-11-9 15:30
name YCM FANUC100/200Mi  ------機床與控制器名稱..自己可以定義
  
% 00         ----- 程式開頭與結尾符號 .... 後面用00表示沒有數字與位數
/ 00           ----- Oskip Code 跳開字符  
O >4          ----- O 代碼 4為整數 前零缺省
N >4          ----- N 序號代碼 4為整數 前零缺省
$ 00           ----- 自行設的字符 .... 另有用途
^ 00
& 00
* 00
G >2           ----  G代碼 2為整數 前零缺省
g >2 G        -----  自己設的小g  2為整數 前零缺省, 輸出時 以 大G 取代 小g
X ->4.>3     ----- X代碼 ..前四位後三位, 前零與後零缺省, 負值時有負號  
x ->4.>3 X   
Y ->4.>3
y ->4.>3 Y  ---- 自設小y 前四位後三位, 前零與後零缺省, 負值時有負號 輸出時 以 大Y 取代 小y
Z ->4.>3
z ->4.>3 Z
A ->4.>3
I ->4.>3
J ->4.>3
K ->4.>3
Q ->4>3
R ->4.>3
P >40       ----- P 代碼, 四位 前零不缺省
F >4.1
H >2
D >2
T >2
M >2
S >4
( 00
d >4.>3
e >4.>3
f >4.>3
) 00
  
以上是 位址碼 與 輸出數值設置區塊
作者: sinderal    时间: 2003-11-9 15:38
個個定義與輸出
作者: sinderal    时间: 2003-11-9 15:39

作者: sinderal    时间: 2003-11-9 15:40

作者: sinderal    时间: 2003-11-9 15:42

作者: sinderal    时间: 2003-11-9 15:43

作者: sinderal    时间: 2003-11-9 15:45
有沒有輸出小數點
作者: sinderal    时间: 2003-11-9 15:48
該代碼不輸出只輸出值, 或 輸出在括號裡
作者: sinderal    时间: 2003-11-9 15:50
輸出限制...與錯誤訊息
作者: sinderal    时间: 2003-11-9 15:52
數值 的 乘 與  除
作者: sinderal    时间: 2003-11-9 15:55
分數 與 加
作者: sinderal    时间: 2003-11-9 15:58
數值 要 減 怎麼辦?   
  
先回答出來 加分
作者: sinderal    时间: 2003-11-11 13:25
ModalLetters X Y Z F R                      # 哪些位址碼是缺省l     
  
ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85  # G 碼缺省l     
  
Sequence#s N 0 1 1                  ---        # Char, freq, incr & start           
First#? N                                  --- # Y or N  'Output 1st sequence no.   
Last#? N                                  ---   # Y or N  'Output last sequence no.  
  
HCode X                                  ---   # X or X U  'Horizontal char.        
VCode Y                                  ---  # Y or Y V  'Vertical char.         
Dcode Z                                  ---   # Depth char.                        
FeedCode F                             ---     # Feed rate char.                    
  
Comment ( )                           ----   # Begin End comment char.            
  
Spindle 3 4 5                             ---  # Cw, ccw & stop m codes            
Coolant 8 9 7 61 62 63 64              ---     # Flood, Off, Mist and Thru Spindle M codes            
DComp 41 42 40                           ---   # Left, Right & Cancel m codes      
LComp 43 49                               --  # On & Off codes                     
  
Feed G01                                   --  # Linear move                        
Rapid G00                                  --  # Rapid positioning word  
ArcPlane G 17 18 19                   --    # G19, G18, G17 Arc Plane selection  
ReturnPlane 98 99                       --    # G98 G99 Return Plane selection            
Cw G2                                     --  # Circular move clockwise            
Ccw G3                                   --   # Circular move counter clockwise   
  
Inc/Abs G 91 90                         --    #Inc& Abs char. & values           
   
CtrCode I J K                             --  # I J or R or I J K L                  
Helical? Y                             
Spaces? Y                               --    # Y or N  'Spaces between words      
  
Incremental? Y                         --     # Y or N  'Inc or abs output         
CtrIncremental? Y                     --      # Y or N  'Inc or abs I & J         
ByQuadrants? Y                       --       # Y or N  'Break arcs at quadrants   
  
UppercaseComments? Y               # Y or N 'Require uppercase comments
作者: sinderal    时间: 2003-11-11 13:29
CtrCode I J K 改成 CtrCode R
  
就 輸出 G02/ G03 X Y R
作者: sinderal    时间: 2003-11-11 13:31
鑽孔循環等 定義:
  
Drill                                       # Drilling canned/manual cycle      
G81 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel
  
CSink  
G82 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate] P[Dwell]
end cancel
  
Peck                                        # Pecking canned/manual cycle        
G83 G[RetPlane] X[H] Y[V] Z[D] Q[VBite] R[Vclear] F[FRate]
end cancel
  
Tap                                         # Tapping canned/manual cycle        
if [Rigid] > 0
G93           G93 to lock Z to spindle rotation.
G84 G[RetPlane] X[H] Y[V] Z[D] P[Dwell] R[VClear] F[FRate]
else
G84 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]  
Endif
end cancel
  
LTap                                        # Left handed tapping cycle         
G74 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate] Q[VBite]
end cancel
  
Ream                                        # Reaming canned/manual cycle        
G85 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel
  
Bore                                        # Boring canned/manual cycle         
G86 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel
  
Back                                        # Back boring canned/manual cycle   
G87 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
end cancel
  
Cancel                                      # Cancel a canned/manual cycle      
G80
if [Rigid] > 0   
G94          Unlock Z if w/ rigid tap.
endif
End
作者: sinderal    时间: 2003-11-11 13:44
程序起始
  
StartCode                                   # Start of the program               
%0
O&ltrogram#>
G17 G40 G80 G90
G91 g28 x0 y0 z0
End
作者: sinderal    时间: 2003-11-11 13:46
第一次換刀的時候輸出 定義:
  
1stToolChange                               # First tool change                  
ask <Val1> " If this operation is without Cycle, please enter 1" "1"
N[Block] T[Tool] M6
(0 d[ToolRad] e[ToolDiam] f[corner] )0
M[Direct] S[Speed]
if [Val1] = 1
^0
G0 G[54] X[H] Y[V]
G43 z[D] H[Lcomp]
M[Cool]
else
G0 G[54] X[H] Y[V]
G43 z[D] H[Lcomp]
M[Cool]
endif
End
作者: sinderal    时间: 2003-11-11 14:03
因為要判斷 有 鑽孔循環的 時候 不輸出G5.1 Q1
所以 加了Ask <Val1> 問使用者...內定值 1,  代表 不是 Canned Cycle
  
^0
輸出 G5.1 Q1  
  
偶在後處理配置文件 最後面有一行
replace "d" with "Tool Radius "
replace "e" with "Tool Diam "
replace "f" with "Corner Rad. "
Replace "^" with "G5.1 Q1"
Replace "&" with "G5.1 Q0"
  
(0 d[ToolRad] e[ToolDiam] f[corner] )0  
輸出( 刀具半徑, 刀具直徑, 刀鼻半徑)
作者: sinderal    时间: 2003-11-11 14:06
G0 G[54] X[H] Y[V]  
G43 Z[D] H[Lcomp]  
M[Cool]
  
建議改成
G0 G[Work] X[H] Y[V]  
G43 Z[D] H[Lcomp]  
M[Cool]
  
Work 是 G54 -- G59的變數...後處理的時候 系統會問你 要輸出什麼值
作者: sinderal    时间: 2003-11-11 14:08
進退刀 並輸出 刀徑補正號 G41/G42 D
  
Infeed                                      # Enable cutter comp                 
G[Side] X[H] Y[V] D[DComp] F[FRate]
end
  
Outfeed                                     # Disable cutter comp               
G1 G40 X[H] Y[V]
end
作者: sinderal    时间: 2003-11-11 14:10
其他 換刀
  
ToolChange                                  # Secondary tool changes            
ask <Val1> " If this operation is without Cycle, please enter 1" "1"
&0
M9
G91 g28 x0 y0 z0
N[Block] T[Tool] M6
(0 d[ToolRad] e[ToolDiam] f[corner] )0
M[Direct] S[Speed]
if [Val1] = 1
^0
G<90> G<WORK> G<0> X<H> Y<V>
G43 z[D] H[Lcomp]
M[Cool]
else
G<90> G<WORK> G<0> X<H> Y<V>
G43 z[D] H[Lcomp]
M[Cool]
endif
End
作者: sinderal    时间: 2003-11-11 14:12
有的 機器希望 換刀前先回 換刀位置
  
&0  
M9  
G91 g28 x0 y0 z0  
  
&0  會輸出 G5.1 Q0
作者: sinderal    时间: 2003-11-11 14:13
程序結尾時:
  
EndCode                                     # End of the program                 
&0                                          
M9
g91 g28 z0
M5
M30
%0
End
作者: sinderal    时间: 2003-11-12 12:24
附上這個 後處理機器配置文件
作者: zzhzzhzzh    时间: 2003-11-12 16:34
數值 要 減 怎麼辦?
   
例:
X ->3.>4 Add -10
  
若INC File Value为10,则NC代码输出X0.
作者: sinderal    时间: 2003-11-12 17:16
有用功...加分 
作者: blackbird111    时间: 2003-11-13 01:33
斑竹这样以具体例子讲的方法太好了。
本来偶准备做这件事情,未能完成,惭愧!
功力还是不够,有心修炼,却总有这样那样的事情打扰,冒火!
作者: sinderal    时间: 2003-11-13 11:43
另外, 需要用 增量輸出 G91
  
Incremental? Y --------------------- 一定要設為 Y
CtrIncremental? Y
ByQuadrants? N
  
還有...看下一個
作者: sinderal    时间: 2003-11-13 11:44
1stToolChange
N<Block>
T<Tool>
M<6>
G<0> g<90> G<Work> X<H> Y<V> A<RotAngle>
G<43> Z<D> H<Lcomp> M<Direct> S<Speed>
M<Cool>
G<91>   -----------------------------此處要加
End
作者: sinderal    时间: 2003-11-13 11:48
再下一把換刀時要設
  
ToolChange
M<9>
G<0> g<91> G<28> z<0> M<05>
M<01>
N<Block>
T<Tool>
M<6>
G<90> A<0>    ---------------------------- 至少要設 G90
G<0> G<90> G<Work> X<H> Y<V> A<RotAngle>  --- 此處的A值才是開始的值
G<43> Z<D> H<Lcomp> M<Direct> S<Speed>
M<Cool>
G<91>  ------------- 如果還是 增量 必須加
End
作者: vip    时间: 2003-11-13 17:28
sinderal wrote:
數值 要 減 怎麼辦?    
  
  先回答出來 加分

唉,终于知道什么叫有心无力了。
版主出的这些个题对俺来说简直就是天书~~~
作者: sinderal    时间: 2003-12-30 10:03
經過修正過的後處理




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3