找回密码
 立即注册

QQ登录

只需一步,快速开始

微信扫码登录

搜索
楼主: julianwss

[求助] 队友们,DRILL攻牙报警,MAKING不会,有董的,帮我改下可以吗

[复制链接]

3

主题

121

回帖

387

积分

二级士官

积分
387
 楼主| 发表于 6 天前 | 显示全部楼层
tombai691019 发表于 2025-8-29 19:21
这是判断正牙反牙攻丝,判断三种机器类型,判断是否输出Q值的代码吧。

对的,但是在DRILL模块报警,manking下不会

3

主题

115

回帖

3807

积分

中尉

积分
3807
发表于 5 天前 | 显示全部楼层
报警信息也要拿出来啊

3

主题

121

回帖

387

积分

二级士官

积分
387
 楼主| 发表于 5 天前 | 显示全部楼层
像风一样飞 发表于 2025-8-30 07:53
报警信息也要拿出来啊

报警这个出错
105.png

3

主题

121

回帖

387

积分

二级士官

积分
387
 楼主| 发表于 5 天前 | 显示全部楼层
像风一样飞 发表于 2025-8-30 07:53
报警信息也要拿出来啊

# Use this command to determine and output proper plane code
# when G17/18/19 is used in the cycle definition.
#
# <04-15-08 gsl> - Add initialization for protection
# <03-06-08 gsl> - Declare needed global variables
# <02-28-08 gsl> - Make use of mom_spindle_axis
# <06-22-09 gsl> - Call PB_CMD_set_principal_axis
#

  #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  # This option can be set to 1, if the address of cycle's
  # principal axis needs to be suppressed. (Ex. Siemens controller)
  #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   set suppress_principal_axis 0


  #++++++++++++++++++++++++++++++++++++++++++++++++++++++
  # This option can be set to 1, if the plane code needs
  # to be forced out @ the start of every set of cycles.
  #++++++++++++++++++++++++++++++++++++++++++++++++++++++
   set force_plane_code 0

global mom_cycle_spindle_axis afterG68 afterG68_A afterG68_C drill_G682
global mom_out_angle_pos dpp_ge roaAMA roaAMC dri_A
global mom_sys_adjust_code dri_C G80_A_C
global mom_tool_pitch h_d_wa out_G69
global mom_prev_out_angle_pos
global mom_kin_machine_type
global mom_pos
global dpp_ge
global mom_cycle_rapid_to_pos mom_cycle_rapid_to
global mom_cycle_retract_to_pos mom_cycle_retract_to
global mom_cycle_feed_to_pos mom_cycle_feed_to
global mom_out_angle_pos
global mom_cycle_feed_to_pos
global mom_mcs_goto
global mom_prev_pos un_cl
global mom_prev_out_angle_pos
global mom_kin_machine_type
global save_mom_kin_machine_type
global mom_tool_axis drill_angle
global mom_result no_G682 dri_A_C_Z roaA_A roaC_C roaA_C
set dri_A [format "%.3f" $mom_out_angle_pos(0)]
set dri_C [format "%.3f" $mom_out_angle_pos(1)]
set G80_A_C 0
set drill_angle 0

   PB_CMD_set_principal_axis


   switch $mom_cycle_spindle_axis {
      0 {
         set principal_axis X
      }
      1 {
         set principal_axis Y
      }
      2 {
         set principal_axis Z
      }
      default {
         set principal_axis ""
      }
   }


   if { $suppress_principal_axis && [string length $principal_axis] > 0 } {
      MOM_suppress once $principal_axis
   }


   if { $force_plane_code } {
      global cycle_init_flag

      if { [info exists cycle_init_flag] && [string match "TRUE" $cycle_init_flag] } {
         MOM_force once G_plane
      }
   }

# 钻孔坐标位置:
if { $roaA_A == 1 || $roaC_C == 1 } {
if { [format "%.3f" $mom_out_angle_pos(0)] != 0 } {
if {[format "%.3f" $mom_cycle_retract_to_pos(2)] > $dri_A_C_Z} {
MOM_output_literal "Z[format "%.3f" $mom_cycle_retract_to_pos(2)]"
}
}
set roaA_A 0
set roaC_C 0
}

if { $roaA_C == 1 } {
if { [format "%.3f" $mom_out_angle_pos(0)] != 0 } {
MOM_output_literal "output_MAX_Z"
}
set roaA_C 0
}

if {$afterG68 == 1} {
if {[format "%.3f" $mom_out_angle_pos(0)] != $afterG68_A} {
MOM_do_template output_caxis_unclamp1
}
if {[format "%.3f" $mom_out_angle_pos(1)] != $afterG68_C} {
#MOM_do_template output_caxis_unclamp2
}
if {[format "%.3f" $mom_out_angle_pos(0)] != $afterG68_A || [format "%.3f" $mom_out_angle_pos(1)] != $afterG68_C} {
if {[format "%.3f" $mom_out_angle_pos(0)] == 0.0} {
MOM_output_literal "output_MAX_Z"
MOM_do_template move_stop_time
#MOM_force once X Y
MOM_do_template machine_axis_A_C_Drill
MOM_do_template output_clamp1 ;# 如果前面加“#”,第四轴就不会频繁出现夹紧命令(钻孔)。
#MOM_do_template output_clamp2 ;# 如果前面加“#”,第五轴就不会频繁出现夹紧命令(钻孔)。
} else {
MOM_do_template move_stop_time
#MOM_force once X Y
MOM_do_template machine_axis_A_C_Drill
MOM_do_template output_clamp1 ;# 如果前面加“#”,第四轴就不会频繁出现夹紧命令(钻孔)。
#MOM_do_template output_clamp2 ;# 如果前面加“#”,第五轴就不会频繁出现夹紧命令(钻孔)。
}
}

set afterG68 0
}


3

主题

121

回帖

387

积分

二级士官

积分
387
 楼主| 发表于 5 天前 | 显示全部楼层
像风一样飞 发表于 2025-8-30 07:53
报警信息也要拿出来啊

是不是这一串变量引起的

3

主题

115

回帖

3807

积分

中尉

积分
3807
发表于 5 天前 | 显示全部楼层
报警显示找不到C轴的值,这是刀轴矢量报警,看你后处理名字是个四轴后处理,应该是用3+2套的,可以试一下把set dri_C 前面加个#,还有涉及到第五轴的行内容改一下,即屏蔽或删除第五轴的信息试试。实在不行就把你的后处理传上来,大家谁有空可以帮你改一下。

10

主题

288

回帖

6431

积分

上尉

积分
6431
发表于 5 天前 | 显示全部楼层
能把编程好的部件发出来吗?

3

主题

121

回帖

387

积分

二级士官

积分
387
 楼主| 发表于 5 天前 | 显示全部楼层
xlyou 发表于 2025-8-30 11:23
能把编程好的部件发出来吗?

自己画的,这边删错了变量

3

主题

121

回帖

387

积分

二级士官

积分
387
 楼主| 发表于 5 天前 | 显示全部楼层
像风一样飞 发表于 2025-8-30 10:58
报警显示找不到C轴的值,这是刀轴矢量报警,看你后处理名字是个四轴后处理,应该是用3+2套的,可以试一下把 ...

网上下载的,学习的后处理,想把M29S,和自动判断提取出来,结果出错了

fanuc_general_4AXIS.rar

85.15 KB, 下载次数: 2, 下载积分: G币 -1

21

主题

301

回帖

8739

积分

少校

积分
8739
发表于 5 天前 | 显示全部楼层
julianwss 发表于 2025-8-30 15:19
网上下载的,学习的后处理,想把M29S,和自动判断提取出来,结果出错了
...

你发出来这个后处理是谁在XLYOU坛友前面分享过的4轴后处理基础上改的,里面加了点东西,没什么新东西。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

咨询QQ:1359218528|发帖须知!|Archiver|手机版|小黑屋|UG爱好者论坛 ( 京ICP备10217105号-2 )

GMT+8, 2025-9-4 22:18

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表