reset_workpiece_weight()
Features
This function initializes the weight data of the material to initialize the algorithm before measuring the weight of the material.
Before measuring the weight of the workpiece, correct the residual error caused by external forces to zero. This will eliminate any residual error in advance, allowing for accurate measurement of the workpiece weight in the future.
주의
In the Non-FTS A & E model, this function cannot be used.
This function does not reset the workpiece weight set by the set_workpiece_weight function. It is a command used to eliminate residual error before measuring the workpiece weight with the get_workpiece_weight function.
The corrected residual error value will be lost when the program is terminated.
Return
| Value | Description |
|---|---|
0 | Success |
Negative value | Error |
Exception
| Exception | Description |
|---|---|
DR_Error (DR_ERROR_RUNTIME) | C extension module error occurred |
DR_Error (DR_ERROR_STOP) | Program terminated forcefully |
Example
set_tool("2kg") # Actual tool weight is 2.2kg, set tool weight is 2kg
reset_workpiece_weight() # Initialize the residual error of 0.2kg before measuring the workpiece weight
movel([0, 0, -200, 0, 0, 0], v=30, a=30, ref=DR_TOOL, mod=DR_MV_MOD_REL) # Move to the position to grab the workpiece
set_modbus_output("gripper", DR_ON) # Grab the workpiece
movel([0, 0, 200, 0, 0, 0], v=30, a=30, ref=DR_TOOL, mod=DR_MV_MOD_REL) # Move to the position to measure the workpiece
weight = get_workpiece_weight() # Actual added workpiece weight is 2kg, measured workpiece weight is 2kg
set_workpiece_weight(weight, add_up=DR_ADD) # Total set workpiece weight is 6kg