top of page
12.1. Force Sensor Configuration
/**
* @brief Configuring force sensors
* @param [in] company Force Sensor Manufacturer, 17 - Quintessence Technologies
* @param [in] device device number, not used, default is 0
* @param [in] softvesion software version number, not used, the default is 0
* @param [in] bus device hangs on the end of the bus position, do not use, the default is 0
* @return Error code
*/
int FT_SetConfig(int company, int device, int softvesion, int bus);
12.2. Get the force transducer configuration
/**
* @brief Get force sensor configuration
* @param [out] deviceID force sensor number
* @param [out] company Force Sensor Manufacturer,, Force Sensor Manufacturer, 17-Kunwei Technology, 19-Aerospace 11th Academy, 20-ATI Sensors, 21-Zhongke MiDot, 22-Weihang Minxin
* @param [out] device device number, Kunwei (0-KWR75B), Aisino Eleven (0-MCS6A-200-4), ATI (0-AXIA80 -M8), Zhongke MiDot (0-MST2010), Weihang Minxin (0-WHC6L-YB-10A)
* @param [out] softvesion software version number, not used, the default is 0
* @return Error code
*/
int FT_GetConfig(ref int deviceID, ref int company, ref int device, ref int softvesion);
12.3. Force sensor activation
/**
* @brief Force sensor activation
* @param [in] act 0-reset, 1-activate
* @return Error code.
*/
int FT_Activate(byte act).
12.4. Force Transducer Zeroing
/**
* @brief Force sensor zeroing
* @param [in] act 0-remove zero, 1-zero correction
* @return Error code
*/
int FT_SetZero(byte act).
12.5. Set the force transducer reference coordinate system
/**
* @brief Set the force sensor reference coordinate system.
* @param [in] ref 0-tool coordinate system, 1-base coordinate system
* @return Error code.
*/
int FT_SetRCS(byte type).
12.6. Set the force transducer lower load weight
/**
* @brief Set the load weight under the force sensor.
* @param [in] weight load weight kg
* @return Error code.
*/
int SetForceSensorPayLoad(double weight);
12.7. Set the force sensor payload center of mass
/**
* @brief Setting the center of mass of a load under a force sensor.
* @param [in] x load center of mass x mm
* @param [in] y load center of mass y mm
* @param [in] z load center of mass z mm
* @return Error code
*/
int SetForceSensorPayLoadCog(double x, double y, double z);
12.8. Get the force sensor pay load weight
/**
* @brief Get the load weight under the force sensor.
* @param [in] weight load weight kg
* @return Error code.
*/
int GetForceSensorPayLoad(ref double weight).
12.9. Get force sensor payload center of mass
/**
* @brief Get the center of mass of the load under the force transducer.
* @param [out] x load center of mass x mm
* @param [out] y load center of mass y mm
* @param [out] z load center of mass z mm
* @return Error code
*/
int GetForceSensorPayLoadCog(ref double x, ref double y, ref double z);
12.10. Automatic zeroing of the force sensor.
/**
* @brief Force sensor auto-zero
* @param [out] weight Sensor mass kg
* @param [out] pos sensor center of mass mm
* @return Error code
*/
int ForceSensorAutoComputeLoad(ref double weight, ref DescTran pos);
12.11. Get force/torque data in reference coordinate system.
/**
* @brief Get force/torque data in reference coordinate system.
* @param [out] ft force/torque, fx,fy,fz,tx,ty,tz
* @return Error code
*/
int FT_GetForceTorqueRCS(byte flag, ref ForceTorque ft);
12.12. Get force sensor raw force/torque data
/**
* @brief Get force sensor raw force/torque data.
* @param [out] ft force/torque, fx,fy,fz,tx,ty,tz
* @return Error code.
*/
int FT_GetForceTorqueOrigin(byte flag, ref ForceTorque ft);
12.13. Force Transducer Configuration and Auto-Zero Code Example
private void button54_Click(object sender, EventArgs e)
{
int company = 24;
int device = 0;
int softversion = 0;
int bus = 1;
int index = 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);
ForceTorque ft = new ForceTorque(0, 0, 0, 0, 0, 0);
robot.FT_GetForceTorqueOrigin(0, ref ft);
Console.WriteLine($"ft origin:{ft.fx},{ft.fy},{ft.fz},{ft.tx},{ft.ty},{ft.tz}");
robot.FT_SetZero(1);
Thread.Sleep(1000);
DescPose ftCoord = new DescPose(0, 0, 0, 0, 0, 0);
robot.FT_SetRCS(0, ftCoord);
robot.SetForceSensorPayLoad(0.824);
robot.SetForceSensorPayLoadCog(0.778, 2.554, 48.765);
double weight = 0;
double x = 0, y = 0, z = 0;
robot.GetForceSensorPayLoad(ref weight);
robot.GetForceSensorPayLoadCog(ref x, ref y, ref z);
Console.WriteLine($"the FT load is {weight}, {x} {y} {z}");
robot.SetForceSensorPayLoad(0);
robot.SetForceSensorPayLoadCog(0, 0, 0);
double computeWeight = 0;
DescTran tran = new DescTran(0, 0, 0);
robot.ForceSensorAutoComputeLoad(ref weight, ref tran);
Console.WriteLine($"the result is weight {weight} pos is {tran.x} {tran.y} {tran.z}");
}
12.14. Load Weight Recognition Record
/**
* @brief Load weight recognition record.
* @param [in] id Sensor coordinate system number in the range [1~14].
* @return Error code.
*/
int FT_PdIdenRecord(int id).
12.15. Load weight recognition calculation
/**
* @brief Load Weight Recognition Calculation
* @param [out] weight Weight of load in kg.
* @return Error code
*/
int FT_PdIdenCompute(ref double weight).
12.16. Load center of mass identification record
/**
* @brief Load center-of-mass identification record.
* @param [in] id Sensor coordinate system number, range [1~14].
* @param [in] index point number, range [1~3].
* @return Error code
*/
int FT_PdCogIdenRecord(int id, int index).
12.17. Load center of mass identification calculation
/**
* @brief Load center of mass identification calculation.
* @param [out] cog load center of mass in mm.
* @return Error code.
*/
int FT_PdCogIdenCompute(ref DescTran cog);
12.18. Force Transducer Load Recognition Code Example
private void btnFTPdCog_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);
ForceTorque ft = new ForceTorque(0,0,0,0,0,0);
robot.FT_GetForceTorqueOrigin(0, ref ft);
Console.WriteLine($"ft origin: {ft.fx}, {ft.fy}, {ft.fz}, {ft.tx}, {ft.ty}, {ft.tz}");
robot.FT_SetZero(1);
Thread.Sleep(1000);
DescPose tcoord = new DescPose(0, 0, 35.0, 0, 0, 0);
robot.SetToolCoord(10, tcoord, 1, 0, 0, 0);
robot.FT_PdIdenRecord(10);
Thread.Sleep(1000);
double weight = 0.0f;
robot.FT_PdIdenCompute(ref weight);
Console.WriteLine($"payload weight: {weight}");
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.MoveCart( desc_p1, 0, 0, 100.0f, 100.0f, 100.0f, -1.0f, -1);
Thread.Sleep(1000);
robot.FT_PdCogIdenRecord(10, 1);
robot.MoveCart( desc_p2, 0, 0, 100.0f, 100.0f, 100.0f, -1.0f, -1);
Thread.Sleep(1000);
robot.FT_PdCogIdenRecord(10, 2);
robot.MoveCart( desc_p3, 0, 0, 100.0f, 100.0f, 100.0f, -1.0f, -1);
Thread.Sleep(1000);
robot.FT_PdCogIdenRecord(10, 3);
DescTran cog = new DescTran(0,0,0);
robot.FT_PdCogIdenCompute(ref cog);
Console.WriteLine($"cog: {cog.x}, {cog.y}, {cog.z}");
}
bottom of page