top of page
/**
* @brief collision guarding
* @param [in] flag 0- turn off collision guarding, 1- turn on collision guarding
* @param [in] sensor_id Force sensor number.
* @param [in] select Whether to detect collision in six degrees of freedom, 0-no detection, 1-detection.
* @param [in] ft collision force/torque, fx,fy,fz,tx,ty,tz
* @param [in] max_threshold max_threshold
* @param [in] min_threshold min_threshold
* @note Force/torque detection range: (ft-min_threshold, ft+max_threshold)
* @return Error code
*/
int FT_Guard(int flag, int sensor_id, int[] select, ForceTorque ft, double[] max_threshold, double[] min_threshold);
12.20. Collision Guard Code Example
private void btnFTGuard_Click(object sender, EventArgs e)
{
int company = 24, device = 0, softversion = 0, bus = 1;
robot.FT_SetConfig(company, device, softversion, bus);
Thread.Sleep(1000);
robot.FT_GetConfig(ref company, ref device, ref softversion, ref bus);
Console.WriteLine($"FT config: {company}, {device}, {softversion}, {bus}");
Thread.Sleep(1000);
robot.FT_Activate(0);
Thread.Sleep(1000);
robot.FT_Activate(1);
Thread.Sleep(1000);
Thread.Sleep(1000);
robot.FT_SetZero(0);
Thread.Sleep(1000);
byte sensor_id = 1;
int[] select = { 1, 1, 1, 1, 1, 1 };
double[] max_threshold = { 10.0f, 10.0f, 10.0f, 10.0f, 10.0f, 10.0f };
double[] min_threshold = { 5.0f, 5.0f, 5.0f, 5.0f, 5.0f, 5.0f };
ForceTorque ft = new ForceTorque();
DescPose desc_p1 = new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833);
DescPose desc_p2 = new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869);
DescPose desc_p3 = new DescPose(-327.622, 402.230, 320.402, -178.067, 2.127, -46.207);
robot.FT_Guard(1, sensor_id, select, ft, max_threshold, min_threshold);
robot.MoveCart( desc_p1, 0, 0, 100.0f, 100.0f, 100.0f, -1.0f, -1);
robot.MoveCart( desc_p2, 0, 0, 100.0f, 100.0f, 100.0f, -1.0f, -1);
robot.MoveCart( desc_p3, 0, 0, 100.0f, 100.0f, 100.0f, -1.0f, -1);
robot.FT_Guard(0, sensor_id, select, ft, max_threshold, min_threshold);
}
12.21. Constant force control
New in version C#SDK-V1.1.9: Web-3.8.7
/**
* @brief Constant Force Control
* @param [in] flag 0-Disable constant force control, 1-Enable constant force control
* @param [in] sensor_id Force sensor ID
* @param [in] select Select whether to detect collision for the six degrees of freedom, 0-Do not detect, 1-Detect
* @param [in] ft Collision force/torque, fx,fy,fz,tx,ty,tz
* @param [in] ft_pid Force PID parameters, torque PID parameters
* @param [in] adj_sign Adaptive start/stop control, 0-Disable, 1-Enable
* @param [in] ILC_sign ILC start/stop control, 0-Stop, 1-Training, 2-Operation
* @param [in] max_dis Maximum adjustment distance, unit mm
* @param [in] max_ang Maximum adjustment angle, unit deg
* @param [in] M rx, ry mass parameters [0.1-10], default 2
* @param [in] B rx, ry damping parameters [0.1-50], default 8
* @param [in] threshold rx, ry activation thresholds [0-10], default 0.2
* @param [in] adjustCoeff rx, ry torque adjustment coefficients [0-1], default 1
* @param [in] polishRadio Polishing radius, unit mm
* @param [in] filter_Sign Filter enable flag 0-Off; 1-On, default off
* @param [in] posAdapt_sign Pose compliance enable flag 0-Off; 1-On, default off
* @param [in] isNoBlock Blocking flag, 0-Blocking; 1-Non-blocking
* @return Error code
*/
public int FT_Control(byte flag, int sensor_id, byte[] select, ForceTorque ft, float[] ft_pid,byte adj_sign, byte ILC_sign, float max_dis, float max_ang,double[] M, double[] B, double[] threshold, double[] adjustCoeff,double polishRadio, int filter_Sign, int posAdapt_sign, int isNoBlock)
12.22. Constant force control with damping code example
New in version C#SDK-V1.1.9: Web-3.8.7
public void TestFTControlWithAdjustCoeff()
{
int rtn;
int sensor_id = 10;
byte[] select = new byte[6] { 0, 0, 1, 0, 0, 0 };
float[] ft_pid = new float[6] { 0.0008f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
byte adj_sign = 0;
byte ILC_sign = 0;
float max_dis = 1000.0f;
float max_ang = 20.0f;
ForceTorque ft = new ForceTorque();
ft.fz = -10.0f;
ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
JointPos j1 = new JointPos(80.765f, -98.795f, 106.548f, -97.734f, -89.999f, 94.842f);
JointPos j2 = new JointPos(43.067f, -84.429f, 92.620f, -98.175f, -90.011f, 57.144f);
DescPose desc_p1 = new DescPose(5.009f, -547.463f, 262.053f, -179.999f, -0.019f, 75.923f);
DescPose desc_p2 = new DescPose(-347.966f, -547.463f, 262.048f, -180.000f, -0.019f, 75.923f);
DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
double[] M = new double[2] { 2.0, 2.0 };
double[] B = new double[2] { 15.0, 15.0 };
double[] threshold = new double[2] { 1.0, 1.0 };
double[] adjustCoeff = new double[2] { 1.0, 0.8 };
double polishRadio = 0.0;
int filter_Sign = 0;
int posAdapt_sign = 1;
int isNoBlock = 0;
while (true)
{
rtn = robot.FT_Control(1, sensor_id, select, ft, ft_pid, adj_sign, ILC_sign, max_dis, max_ang, M, B, threshold, adjustCoeff, 0, 0, 1, 0);
Console.WriteLine($"FT_Control start rtn is {rtn}");
robot.MoveL(j1, desc_p1, 1, 0, 100, 100, 100, -1, 0, epos, 0, 0, offset_pos, 0, 0, 10);
robot.MoveL(j2, desc_p2, 1, 0, 100, 100, 100, -1, 0, epos, 0, 0, offset_pos, 0, 0, 10);
rtn = robot.FT_Control(0, sensor_id, select, ft, ft_pid, adj_sign, ILC_sign, max_dis, max_ang, M, B, threshold, adjustCoeff, 0, 0, 1, 0);
Console.WriteLine($"FT_Control end rtn is {rtn}");
}
}
12.23. Rotational Insertion
/**
* @brief Rotational Insertion
* @param [in] rcs Reference coordinate system, 0 - Tool coordinate system, 1 - Base coordinate system
* @param [in] angVelRot Rotational angular velocity, unit deg/s
* @param [in] ft Force/Torque threshold, fx,fy,fz,tx,ty,tz, range [0~100]
* @param [in] max_angle Maximum rotation angle, unit deg
* @param [in] orn Force/Torque direction, 1 - Along Z-axis direction, 2 - Around Z-axis direction
* @param [in] max_angAcc Maximum rotational acceleration, unit deg/s^2, currently unused, default is 0
* @param [in] rotorn Rotation direction, 1 - Clockwise, 2 - Counterclockwise
* @param [in] strategy Processing strategy for undetected force/torque, 0 - Error; 1 - Warning, continue motion
* @return Error code
*/
public int FT_RotInsertion(int rcs, double angVelRot, double ft, double max_angle, int orn, double max_angAcc, int rotorn, int strategy)
bottom of page