SHARE POST HEIDENHAIN TNC CONVERSATIONAL 5-AXIS MILL
MÁY GIA CÔNG 5 TRỤC HEIDENHAIN TNC CONVERSATIONALlioosjery 发表于 2025-4-12 22:12
the encryption system may be changed because of you, due to the unlocking of the PSB
加密系统可能 ...
只要肯出钱,闲鱼破解的一大堆 以上都是psb内容 谢谢分享 谢谢分享 谢谢分享
slicense : "Silver Bullet"
# --------------------------------------------------------------------------
# Date and time formats#Security!
# --------------------------------------------------------------------------
fmt 5 datecode # Date code
fmt 5 expcode # Exp code
fmt 5 daysleft # Days left
ssecmonth : "WARNING-POST IS TIMED TO EXPIRE THIS MONTH"
ssecweek : "WARNING-POST IS TIMED TO EXPIRE THIS WEEK"
ssectom : "WARNING-POST IS TIMED TO EXPIRE TOMORROW"
ssectod : "WARNING-POST IS TIMED TO EXPIRE TODAY"
ssecurity : "ERROR-POST HAS EXPIRED"
psecurity # Post security#Security!
expcode = 31130 # YYMMDD
datecode = year$*10000 + month$*100 + day$
daysleft = expcode - datecode
if daysleft <= 31,
[
#if daysleft > 7, result = mprint(ssecmonth,1)
if daysleft > 1 & daysleft <= 7, result = mprint(ssecweek,1)
if daysleft = 1, result = mprint(ssectom,1)
if daysleft = 0, result = mprint(ssectod,1)
if daysleft < 0,
[
result = mprint(ssecurity,1)
exitpost$
]
]
psimcheck
if not(sim_no$ = 28506) & sim_type$ <> 2,
[
result = mprint(ssimerror, 1)
exitpost$
]
pq$ #Setup post based on switch settings
#psecurity
#psimcheck
#if stagetool = one, bldnxtool = one
#Rotaxtyp = 1 sets initial matrix to top
#Rotaxtyp = -2 sets initial matrix to front
#if vmc, rotaxtyp = one
#else, rotaxtyp = -2
rotaxtyp$ = three# Toolplane positioning
#axisx = vequ(aaxisx) # Rotate caxis thru ANUT to find VNUT - B-Axis in Y+ direction
#vnutx = rotv(-anut, caxisx) #(the A axis vector) - B-Axis in Y+ direction
#axisx = vequ(aaxisx) # Rotate caxis thru ANUT to find VNUT - B-Axis in Y+ direction
#vnutx = rotv(anut, caxisx) #(the A axis vector) - B-Axis in Y- direction
axisx$ = vequ(aaxisx) # Rotate caxis thru ANUT to find VNUT - B-Axis in Y+ direction
vnutx = rotv(-anut, baxisx) #(the A axis vector) - B-Axis in Y+Z- direction
#Shut off rotary axis if, Q164. Enable Rotary Axis button? n
#if ucase(sq164) = strn, rot_on_x = zero
if arctype$ = one | arctype$ = four,
[
result = newfs(two, i$)
result = newfs(two, j$)
result = newfs(two, k$)
]
else,
[
result = newfs(three, i$)
result = newfs(three, j$)
result = newfs(three, k$)
]
pheader$ #Call before start of file
if met_tool$ = one, #Metric constants and variable adjustments
[
ltol$ = ltol_m
vtol$ = vtol_m
maxfeedpm = maxfeedpm_m
xm91 = xm91_m
ym91 = ym91_m
zm91 = zm91_m
]
sav_spc = spaces$
n$ = 0
seqinc$ = 1
pn, "BEGIN PGM ", *sprogname$,*smetric, peob, e$
pn, "; PROGRAM NAME- ", *sprogname$,peob, e$
pn, "; DATE=DD-MM-YY - ", date$, " TIME=HH:MM - ", time$, peob, e$
pn, "; POST LICENSE-", *slicense, peob, e$
pn, ";", peob, e$
if stck_ht$ <> 0 | stck_wdth$ <> 0 | stck_thck$ <>0, pstockdef
sav_rot_on_x = rot_on_x
rot_on_x = 0
prv_workofs$ = c9k
pstockdef #Stock definition
if stck_crnr$ = 0,
[
blk_xmin = stck_x$ - stck_ht$/2
blk_ymin = stck_y$ - stck_wdth$/2
]
if stck_crnr$ = 1 | stck_crnr$ = 5,
[
blk_xmin = stck_x$
blk_ymin = stck_y$ - stck_wdth$
]
if stck_crnr$ = 2 | stck_crnr$ = 6,
[
blk_xmin = stck_x$ - stck_ht$
blk_ymin = stck_y$ - stck_wdth$
]
if stck_crnr$ = 3 | stck_crnr$ = 7,
[
blk_xmin = stck_x$ - stck_ht$
blk_ymin = stck_y$
]
if stck_crnr$ = 4 | stck_crnr$ = 8,
[
blk_xmin = stck_x$
blk_ymin = stck_y$
]
if stck_crnr$ <= 4, blk_zmin = stck_z$ - stck_thck$
else, blk_zmin = stck_z$
blk_xmax = blk_xmin + stck_ht$
blk_ymax = blk_ymin + stck_wdth$
blk_zmax = blk_zmin + stck_thck$
if stck_ht$ > 0,
[
pbld, pn, "BLK FORM 0.1", *sgplane, *blk_xmin, *blk_ymin, *blk_zmin, peob, e$
pbld, pn, "BLK FORM 0.2", *blk_xmax, *blk_ymax, *blk_zmax, peob, e$
]
pxyzcout #Map coordinates
if rot_on_x,
[
if cuttype = zero, pxyzcout0 #Toolplane Positioning
if cuttype = one, pxyzcout1 #Axis Substitution
if cuttype = two, pxyzcout2 #Polar Conversion
if cuttype = three, pxyzcout3 #Simulatneous 4 and 5 axis (Multi-axis)
if rot_sign = one, csav = -csav#Flips rotary sign
if tilt_sign = one, asav = -asav #Flips tilt sign
if mr_rt_actv <> two,
[
paouttilt
pcoutrev
if index, pindxcalc
pfcalc
]
else, feed = fr_pos$
]
else,
[
xabs = vequ(x$)
feed = fr_pos$
]
pxyzcout0 #Toolplane Positioning
pfliparcs
#Map points for non top toolplane
mmtx1 = matt(m1$)# Transpose current toolplane matrix
if gnci$ > 1, xrot = vmap(x$, mmtx1)# Map points to top toolplane
else, xrot = vmap(xnci$, mmtx1)# Map points to top toolplane
cycle10x = vequ(xnci$)
#~firstpoint, e
#if mi8 & gcode <> 100,
if mi8$ & firstpoint,
[
x_drill = x$
y_drill = y$
firstang = atan2(y_drill, x_drill) #this is based on current toolplane
#~firstang
]
if opcode$ = 16,
[
drl_init_xrot =vmap(drl_init_x$, mmtx1)
drl_ref_xrot =vmap(drl_ref_x$, mmtx1)
drl_tos_xrot =vmap(drl_tos_x$, mmtx1)
drl_depth_xrot =vmap(drl_depth_x$, mmtx1)
]
#u = vmap(u, mmtx1) # Map points to top toolplane
i$ = vmap(i$, mmtx1)# Map points to top toolplane
#if vtoolz < -0.000001,
#[
#result = mprint(saxislim)
#";", saxislim, peob, e
#exitpost
#]
vtoolx_rot = vequ(vtoolx$)
vtoolx_nut = vequ(vtoolx$)
vtoolx_ret = vequ(vtoolx$)
de = (1-vtoolz_rot) / sin(anut)
cosa = (rb-de)/rb
if cosa >=1, cosa =1 # These tests keep COSA in range for ACOS
if cosa <= -1, cosa = -1
if tilt_dir = 0, a$ = -acos(cosa)
if tilt_dir = 1, a$ = acos(cosa)
axisx$ = vequ(vnutx) # VTX is the spindle vector after it has
vtx = rotv(a$, caxisx) # been rotated thru A, while C=0
a2 = atan2(vty, vtx) # Find direction of VTX in
a3 = atan2(vtooly_rot, vtoolx_rot) # VTOOL dir. in X,Y plane
c$ = a3 - a2
if vtoolx_rot = 0 & vtooly_rot = 0 & vtoolz_rot = 1, c$ = twist# About rotary axis
#Coordinate tracking for datum *not* at rotary centres / no CYCLE 19
#axisx = vequ(caxisx)
#xrot = rotp(-c,xrot)
#if arctype = 1, i = rotp(-c,i)
#else, i = rotv(-c,i)
#vtoolx_nut = rotv(-c,vtoolx_rot)
#axisx = vequ(vnutx)
#ptfixx = vequ(pt_origx)
#xrot = rotp(-a,xrot)
#if arctype = 1, i = rotp(-a,i)
#else, i = rotv(-a,i)
#vtoolx_nut = rotv(-a,vtoolx_nut)
csav = c$
asav = a$
#cg80 = atan2(-vtoolx_rot, vtooly_rot)# A neg pref
cg80 = atan2(vtoolx_rot, -vtooly_rot)# A pos pref
if vtoolx_rot = 0 & vtooly_rot = 0 & (vtoolz_rot = 0 | vtoolz_rot = 1 | vtoolz_rot = -1), cg80 = twist
axisx$ = vequ(caxisx)
ptfixx$ = vequ(pt_origx)
xrot = rotp(-cg80,xrot)
if opcode$ = 16,
[
drl_init_xrot = rotp(-cg80,drl_init_xrot)
drl_ref_xrot = rotp(-cg80,drl_ref_xrot)
drl_tos_xrot = rotp(-cg80,drl_tos_xrot)
drl_depth_xrot = rotp(-cg80,drl_depth_xrot)
]
if arctype$ = 1, i$ = rotp(-cg80,i$)
else, i$ = rotv(-cg80,i$)
vtoolx_rot = rotv(-cg80,vtoolx_rot)
#if cg80 > 180, cg80 = cg80 - 360
bg80 = 0# B0 pref
#bg80 = 180# B180 pref
#axisx = vequ(baxisx)
#ptfixx = vequ(pt_origx)
#xrot = rotp(-bg80,xrot)
#if arctype = 1, i = rotp(-bg80,i)
#else, i = rotv(-bg80,i)
#vtoolx_rot = rotv(-bg80,vtoolx_rot)
#ag80 = -atan2(vtooly_rot, vtoolz_rot) # A neg pref
ag80 = atan2(-vtooly_rot, vtoolz_rot) # A pos pref
axisx$ = vequ(aaxisx)
ptfixx$ = vequ(pt_origx)
if opcode$ = 16,
[
drl_init_xrot = rotp(-ag80,drl_init_xrot)
drl_ref_xrot = rotp(-ag80,drl_ref_xrot)
drl_tos_xrot = rotp(-ag80,drl_tos_xrot)
drl_depth_xrot = rotp(-ag80,drl_depth_xrot)
]
xrot = rotp(-ag80,xrot)
if arctype$ = 1, i$ = rotp(-ag80,i$)
else, i$ = rotv(-ag80,i$)
vtoolx_rot = rotv(-ag80,vtoolx_rot)
if opcode$ = 16 & toolchng <> 1 & toolchng0 <> 1, xabs = vequ(drl_depth_xrot)
else, xabs = vequ(xrot)
pxyzcout1 #Axis substitution
result = mprint(saxissub)
";", saxissub, peob, e$
exitpost$
pxyzcout2 #polar interpolation
result = mprint(saxissub)
";", saxissub, peob, e$
exitpost$
pxyzcout3 #Multisurf rotary axis motion
#Map points for non top toolplane
mmtx1 = matt(m1$)# Transpose current toolplane matrix
x$ = vmap(xnci$, mmtx1)# Map points to top toolplane
u$ = vmap(u$, mmtx1) # Map points to top toolplane
vtoolx_rot = vmap(vtoolx$, mmtx1)# Map points to top toolplane
vtoolx_ret = vequ(vtoolx_rot)
vtoolx_nut = vequ(vtoolx_rot)
#if vtoolz_rot < -0.000001,
#[
#result = mprint(saxislim)
#";", saxislim, peob, e
#exitpost
#]
de = (1-vtoolz_rot) / sin(anut)
cosa = (rb-de)/rb
if cosa >=1, cosa =1 # These tests keep COSA in range for ACOS
if cosa <= -1, cosa = -1
if tilt_dir = 0, a$ = -acos(cosa)
if tilt_dir = 1, a$ = acos(cosa)
axisx$ = vequ(vnutx) # VTX is the spindle vector after it has
vtx = rotv(a$, caxisx) # been rotated thru A, while C=0
a2 = atan2(vty, vtx) # Find direction of VTX in
a3 = atan2(vtooly_rot, vtoolx_rot) # VTOOL dir. in X,Y plane
c$ = a3 - a2
#if vtoolx_rot = 0 & vtooly_rot = 0 & (vtoolz_rot = 0 | vtoolz_rot = 1),
if vtoolz_rot = 1,
[
if firstmove = 1 | mill5$ = 0 | op_id$ <> last_op_id, c$ = 0
else,
[
if rot_sign = 0, c$ = prv_csav
else, c$ = -prv_csav
]
]
#Coordinate tracking for datum *not* at rotary centres
#e.g. M114?
#axisx = vequ(caxisx)
#x = rotp(-c,x)
#vtoolx_nut = rotv(-c,vtoolx_rot)
#axisx = vequ(vnutx)
#x = rotp(-a,x)
#vtoolx_nut = rotv(-a,vtoolx_nut)
csav = c$
asav = a$
ag80 = 0
bg80 = 0
cg80 = 0
xabs = vequ(x$)
pfliparcs # Flip G18/G19 plane arcs
#Angle calcs copied from pxyzcout0
vtoolx_rot = vequ(vtoolx$)
#cg80 = atan2(-vtoolx_rot, vtooly_rot)# A neg pref
cg80 = atan2(vtoolx_rot, -vtooly_rot)# A pos pref standard
if vtoolx_rot = 0 & vtooly_rot = 0 & (vtoolz_rot = 0 | vtoolz_rot = 1 | vtoolz_rot = -1), cg80 = 0
axisx$ = vequ(caxisx)
ptfixx$ = vequ(pt_origx)
testmtx1 = rotv(-cg80,m1$)
testmtx4 = rotv(-cg80,m4$)
testmtx7 = rotv(-cg80,m7$)
vtoolx_rot = rotv(-cg80,vtoolx_rot)
#if cg80 > 180, cg80 = cg80 - 360
bg80 = 0# B0 pref
#bg80 = 180# B180 pref
#axisx = vequ(baxisx)
#ptfixx = vequ(pt_origx)
#testmtx1 = rotv(-bg80,testmtx1)
#testmtx4 = rotv(-bg80,testmtx4)
#testmtx7 = rotv(-bg80,testmtx7)
#vtoolx_rot = rotv(-bg80,vtoolx_rot)
#ag80 = -atan2(vtooly_rot, vtoolz_rot) # A neg pref
ag80 = atan2(-vtooly_rot, vtoolz_rot) # A pos pref standard
axisx$ = vequ(aaxisx)
ptfixx$ = vequ(pt_origx)
testmtx1 = rotv(-ag80,testmtx1)
testmtx4 = rotv(-ag80,testmtx4)
testmtx7 = rotv(-ag80,testmtx7)
vtoolx_rot = rotv(-ag80,vtoolx_rot)
if tlplnno$ = 1, # Top
[
ag80 = 0
bg80 = 0
cg80 = 0
testmtx1 =mteq(m1$)
]
twist = atan2(testmtx2,testmtx1)
if fmtrnd(twist) = 0,
[
sg02 = strg02
sg03 = strg03
sg17 = strg17
sg18 = strg18
sg19 = strg19
]
if fmtrnd(twist) = 90,
[
if plane$ = 0,
[
sg02 = strg02
sg03 = strg03
]
if plane$ = 1,
[
sg02 = strg02
sg03 = strg03
]
if plane$ = 2,
[
sg02 = strg03
sg03 = strg02
]
sg17 = strg17
sg18 = strg19
sg19 = strg18
]
if fmtrnd(twist) = 180,
[
if plane$ = 0,
[
sg02 = strg02
sg03 = strg03
]
if plane$ = 1,
[
sg02 = strg03
sg03 = strg02
]
if plane$ = 2,
[
sg02 = strg03
sg03 = strg02
]
sg17 = strg17
sg18 = strg18
sg19 = strg19
]
if fmtrnd(twist) = 270,
[
if plane$ = 0,
[
sg02 = strg02
sg03 = strg03
]
if plane$ = 1,
[
sg02 = strg03
sg03 = strg02
]
if plane$ = 2,
[
sg02 = strg02
sg03 = strg03
]
sg17 = strg17
sg18 = strg19
sg19 = strg18
]
if fmtrnd(twist) <> 0 & fmtrnd(twist) <> 90 & fmtrnd(twist) <> 180 & fmtrnd(twist) <> 270 & plane$ > 0,
[
sg02 = strg02
sg03 = strg03
sg17 = strg17
sg18 = strg18
sg19 = strg19
linarc$ = 1
]
if plane$ <> prv_plane$, prv_gcode$ = c9k
paouttilt #Tilt axis calculation
adelta = asav - prv_asav
aabs = asav
#if fmtrnd(aabs) >= 360, aabs = aabs - 360
#if fmtrnd(aabs) < 0, aabs = aabs + 360
!asav
pcoutrev #Rotary axis revolution calculation (Modify for wind-up)
cdelta = csav - prv_csav
# attempt to flip tilt_dir
#if abs(cdelta) > 170 & abs(cdelta) <= ctol & firstmove = 0 & mill5 = 1 & gcode = 1 & toolchng = 0 & toolchng0 = 0,
#[
#if tilt_dir = 0, tilt_dir = 1
#else, tilt_dir = 0
#x = vequ(xnci)
#pxyzcout3
#if rot_sign = one, csav = -csav#Flips rotary sign
#if tilt_sign = one, asav = -asav #Flips tilt sign
#paouttilt
#cdelta = csav - prv_csav
#]
if firstmove & csav < 0,
[
rev = 1
cdelta = 0
]
while abs(cdelta) > ctol, #If motion exceeds ctol, add wind-up
[
if cdelta > zero,
[
rev = rev - one
cdelta = cdelta - 360
]
else,
[
rev = rev + one
cdelta = cdelta + 360
]
]
if cuttype <> one, cabs = rev * 360 + csav
else, cabs = sav_rev * 360 + csav
if (cuttype = zero | opcode$ = 3 | opcode$ = 16 | gcode$ = 0) & one_rev = one,
[
while fmtrnd(cabs) >= 360,
[
cabs = cabs - 360
rev = rev - 1
]
while fmtrnd(cabs) < 0,
[
cabs = cabs + 360
rev = rev + 1
]
if abs(cdelta) >= 0.0005, prv_cabs = c9k
]
!csav
pindxcalc #Index move calculations, direction is shortest
#Check if in tolerance
cdelta = frac(abs(csav)/ctable)
if cdelta > ixtol & cdelta < 1-ixtol,
result = mprint(sindxerror)
cdelta = prvcabs - cabs
#Phase shift delta 10 revolutions, check odd/even
if frac(int((cdelta + 3600)/180)/two), indx_mc = one
else, indx_mc = zero
#Set range 0-360
indx_out = csav
while indx_out < 0, indx_out = indx_out + 360
while indx_out > 360, indx_out = indx_out - 360
#Feedrate calculations
pfcalc #Feedrate calculations, gcode 0 does not evaluate
if gcode$ <> zero,
[
#if fmtrnd(cabs) = prvcabs | index, pfcalc_u_min
if (abs(fmtrnd(aabs)-prvaabs) <= 0.001 & abs(fmtrnd(cabs)-prvcabs) <= 0.001) | index | not(rot_feed), pfcalc_u_min
else,
[
if cuttype = one & (cutpos2$ <= one | cutpos2$ = four), pfcalc_u_min
else, pfclc_deg_inv
]
if ipr_type <> prv_ipr_type, prv_feed = c9k
]
pfcalc_u_min #Feedrate unit/min
ipr_type = zero
feed = fr_pos$
if feed > maxfeedpm, feed = maxfeedpm
prvfrdeg = feed
if feed <> sav_fr, sav_frplunge = feed
pfclc_deg_inv #Feedrate deg/min
circum = zabs * two * pi$ # for Rotary4ax only
circuma = tilt_arm * two * pi$# Tilt arm - circumference
if cuttype = 1, circumc = circum
else, circumc = rotary_arm * two * pi$# Rotary arm - circumference
if circum = zero, circum = c9k #Don't allow Zero
if circuma = zero, circuma = c9k #Don't allow Zero
if circumc = zero, circumc = c9k #Don't allow Zero
ldelta = sqrt((xabs-prv_xabs)^2+(yabs-prv_yabs)^2+(zabs-prv_zabs)^2)
cdelta = sqrt((((abs(cabs - prvcabs))/360)*circumc)^2+(((abs(aabs - prvaabs))/360)*circuma)^2) # Span Length
if ldelta = zero, cldelta = cdelta
else, cldelta = sqrt(cdelta^two + ldelta^two)
if cldelta = zero, cldelta = c9k
if use_frinv,
[
#Feedrate inverse calculation
ipr_type = two
result = force(feed, feed) #Always force feed
frinv = fr_pos$/cldelta
if rot_feed & opcode$ <> 3 & opcode$ <> 16,
[
if frinv > maxfrinv, frinv = maxfrinv
feed = frinv
]
]
else,
[
#Feedrate deg/min control and calculation
ipr_type = zero#Change to ipr_type = one to force new DPM
if circuma > circumc & circuma <> c9k, circum = circuma# Set feed conservatively
else, circum = circumc
#circum = (circuma+circumc)/two # Set based on average
frdeg = abs(cdelta/cldelta) * abs(fr_pos$ * (360/circum))
if abs(frdeg - prvfrdeg) > frdegstp | ipr_type <> prv_ipr_type,
[
#Control output of frdeg
if rot_feed & opcode$ <> 3 & opcode$ <> 16,
[
prvfrdeg = frdeg
feed = frdeg
]
]
if frdeg > maxfrdeg, feed = maxfrdeg
]
#Incremental calculations
ps_inc_calc #Incremental calculations, start
xia = fmtrnd(xabs)
yia = fmtrnd(yabs)
zia = fmtrnd(zabs)
xinc = vsub (xia, prv_xia)
ps_cinc_calc
ps_ainc_calc
ps_cinc_calc #Incremental calculations, start rotary
cia = fmtrnd(cabs)
cinc = cia - prv_cia
ps_ainc_calc #Incremental calculations, start rotary
aia = fmtrnd(aabs)
ainc = aia - prv_aia
pe_inc_calc #Incremental calculations, end
prvcabs = fmtrnd(cabs) #Avoid updating until called explicitly
prvaabs = fmtrnd(aabs) #Avoid updating until called explicitly
!xia, !yia, !zia, !cia, !aia
!x$, !y$, !z$
楼主 刚刚有个帖子没下载到 强众右强中瘦 发表于 2025-4-12 20:32
slicense : "Silver Bullet"
# ------------------------------------------------------------ ...
the encryption system may be changed because of you, due to the unlocking of the PSB
加密系统可能会因为你而改变,由于PSB的解锁
页:
[1]
2