RobotStudio event

How to program force with OnRobot tools


we have a GoFa robot which I am trying to program a specific thing. I am new to robot programming and programming in general. I have been trying different things but now I need help.

We have a OnRobot force sensor mounted on our robot with a gripper. What I want the robot to do is to go down in Z-axis until a value is reached. Example 20N then the robot stops. Then only way to get the updated force values is to write OR_HEX_GET; so it doesn't update in real time until that command is called. This is what I want the program to do.
1. Go down in Z-axis until a force value is reached which is numeric.
2. Save that robot position in a variable robottarget.
3. From the saved robottarget go offset in Y axis 90mm.

Number 2 and 3 I think I can solve but number 1 I have no clue.

All help I can get with this is appreciated.


  • Jorge
    Jorge ✭✭
    Hi, I never make some thing like that. But You can try to this:

    1) the force value should connected to a Analog input.
    2) Create a Analog interruption (ISignalIA) to the Analog input.
    3) In trap asocciated to ISignalAI check value. If value is higher some limit, change a persistence bool variable
    4) Use SearchL instruccion to move, using PERS Value as condition.
    5). When SearchL gets the change of Pers variable, SearchPoint parameter of SearchL you have a robtarget with the position where the SearchL instruccion gets the change.
    6) Move to SearchPoint robotarget, because the robot can be a little bit far away.
    7) Make a Move with a offset.


    Jorge Turiel

  • Robero
    Hi, thanks for your reply. The force sensor can't be connected to Analog input since it's connected through EthernetDevice. When I write Or_Hex_Get; then I get the updated values. So somehow I need to write a Code that it always updates the values while the robot goes down in Z-axis. 
  • Tompanhuhu
    Use a for loop, move down 1mm (or less?) Each loop and read current sensor value. When you have reached your value just use crobt to get current robtarget and return out from your search proc. 
    Or put everything in a function that return a robtarget.

    If no result is found when forloop is complete do error handling :) 
    Systemintegrator - Web / C# / Rapid / Robotstudio

    If I helped, please press Vote Up  :smile:
  • Robero
    Hi, I tried to do like you suggested Tompanhuhu. But then the robot is a little bit janky when going down and stops every milimeter for just a ver very short time. I solved it with a MoveL command and had the zone value to z20 or something so the pointer could read ahead. Then I made a while loop always sending the command OR_Hex_Get; while going down in Z axis. To stop the robot I used Stopmove; and clearpath;
  • Siepen
    What about a background Task? You could OR_Hex_Get; there and set a Sim Output when Force is reached. Which could trigger a Interrupt.