If you're coming from Universal Robots, you might be looking for something like zero_ftsensor() in Fairino LUA. The good news: it's possible. The bad news: the relevant functions are not fully documented in the official LUA manual.

Reading force sensor values in LUA

Use the function FT_GetForceTorqueRCS() to read force/torque values in the Robot Coordinate System:

local fx, fy, fz, tx, ty, tz = FT_GetForceTorqueRCS()
print("Force X:", fx, " Y:", fy, " Z:", fz)
print("Torque X:", tx, " Y:", ty, " Z:", tz)

These values correspond to what you see in the WebApp force sensor display panel.

Manual zero compensation

If your firmware version doesn't have a built-in auto-zero, implement it yourself:

-- Step 1: Read the offset at a known "zero" position
-- (robot stationary, no external forces)
local ox, oy, oz, otx, oty, otz = FT_GetForceTorqueRCS()

-- Step 2: In your main loop, subtract the offset
while true do
  local fx, fy, fz, tx, ty, tz = FT_GetForceTorqueRCS()
  local fx_zeroed = fx - ox
  local fy_zeroed = fy - oy
  local fz_zeroed = fz - oz
  local tx_zeroed = tx - otx
  local ty_zeroed = ty - oty
  local tz_zeroed = tz - otz

  -- Use the zeroed values for your application logic
  -- e.g. force-controlled insertion, surface following, etc.
end

How to discover undocumented functions

The official LUA manual doesn't cover all available functions. Community members have discovered functions using these tricks:

  1. WebApp code editor autocomplete: Start typing a prefix (e.g. FT_, Get, Set) in the Programming UI and browse the autocomplete suggestions
  2. Python SDK as reference: The Python SDK documentation is often more complete than the LUA manual. Many SDK functions have LUA equivalents with similar names.
  3. Trial and error: Functions found via autocomplete may not be documented but they work. Test them carefully.

Useful undocumented functions found by the community

  • FT_GetForceTorqueRCS() — force/torque in robot coordinate system
  • GetActualJointPosRadian() — joint positions in radians (not degrees)
  • GetWObjOffset(n) — returns work object coordinate offsets: x, y, z = GetWObjOffset(1)

Important: LUA vs SDK behavior differences

Some functions behave differently between LUA and the Python SDK:

  • GetRobotTeachingPoint() → returns 0.0 in LUA but correct values via Python SDK
  • PointTableUpdateLua() → different function signature between v3.8.7 (two arguments) and v3.9.2 (one argument: filename only)
  • Some functions work on the real robot but not in the SIMmachine simulator

Always test in your actual target environment.

Force sensor + welding handle

Note: the Force Sensor and Welding Handle cannot be used simultaneously in the default configuration. If you need both, configure via the "Combination Device" menu in the WebApp settings.