AGV调试安全防护——超叉保护

AGV调试安全防护

一、超叉保护

1.1背景

增量式电机,断电后位置不保存,所以此处增加SICK拉线编码器作为实时高度获取,为防止线断或被拉扯,在用电机获取的位置值作为校验。

1.2构想思路

1)上电时记录拉线编码器数值H_Last;电机高度(转换过)h_Last;
2)举升到最高处时,得出此时H_Difference=H_Current-H_Last;
h_Difference=h_Current-h_Last;
3)比较拉线差值与电机高度差值,fabs(H_Difference-h_Difference)>10mm;就报超叉报警,否则正常

1.3具体代码实现

在这里插入图片描述

1.4加入该判断的位置

举升任务->自动->轴准备动作(上线后均在)->step=4站台前一点取放货物(放货举升最高处时进行判断)
在这里插入图片描述

1.5具体代码实现

if(!height_record)
{
    height_motor_last = lift_motor_curdis;
	height_encoder_last = lift_CurrentDistance;
	height_record = 1;
}
if(TrapezoidalVelocity_Control(WholeLiftMotor,robot_param.lift_motor.max_distance,&lift_speed,0.01f)){
					float add_motor = fabs(lift_motor_curdis - height_motor_last);
					float add_encoder = fabs(lift_CurrentDistance -     height_encoder_last);
					if(fabs(add_motor - add_encoder) < 10.0f){
						height_record = 0;
						step = 0;
						return 1;
					}else{
						if(Sys_AxisErrorGet(EA_MotorEncoderUnequal) == false){ //举升电机与编码器距离不匹配
							Sys_AxisErrorSet(EA_MotorEncoderUnequal,true);
							Log_Error("axis,height unequal,cmh,%.4f,cml,%.4f,ceh,%.4f,cel,%.4f",lift_motor_curdis,height_motor_last,lift_CurrentDistance,height_encoder_last);
						}
						*status = Axis_Unnatural;
						Axis_Unnatural_flag=3;
					}
				}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值