Fairino Servo Commands (SDK)

Fairino Servo Commands (SDK)

Servo commands, while being intimidating and complex at first, are a low level way to control your robot while getting precise movements and are ideal for low level control and accuracy.

When using these servo commands with the SDK, you may notice a lot of variables, some of which you don't understand or care about. You can actually ignore these for most cases and only give the necessary arguments. A minimal example of a single ServoJ call can look like this:
            robot.ServoJ(joint_pos, epos, vel=20)
Where joint_pos is just a target joint position formatted as an array. As long as the target joint values are all within 1mm of the current joint values, it will make a successful command.
     

The following are requirements for Servo commands to work using the Python SDK:
ServoCart():
1) Description position (target position represented by a 6 value array representing 3D coordinates).
       2) Extended axis position (epos)
      3) Velocity.


ServoJ():
1) Description position
      2) Velocity
      3) Acceleration.

Below are some of the frequently asked questions on how to make these work as well as a couple of small examples.

Q: Why do my ServoCart()/ServoJ() commands look jerky?


A: Jerky Servo commands are often due to improper command time or command frequency 

      These commands cannot be made at a frequency outside of 60hz -  1000 hz (1ms - 16ms between each command).
Command time is not needed for either command to run and as long as there is a 1-16ms sleep after each command call, it will work. Below are examples of each.

 
ServoJ loop example:
epos = [0.0, 0.0, 0.0, 0.0]
er, joint_pos = robot.GetActualJointPosDegree()
for i in range(70):
        robot.ServoJ(joint_pos, epos, vel=20)
        joint_pos[0] -= 0.5
        time.sleep(0.008)
 
EXAMPLE USING SERVO CART TO PROBE  A SURFACE WITH A FORCE SENSOR:
while(True):
                force = robot.FT_GetForceTorqueRCS()[1]
                fz = force[2]
                if(abs(fz) > 1):
                    break
                robot.ServoCart(1, [0,0, -0.1, 0, 0, 0], vel=20, acc=20)
                time.sleep(0.008)

Q: When running my Servo commands, I get "joint command speed command error". What does this mean and how do I fix it?

A:
The command speed joint error occurs when you send a ServoCart or ServoJ command with target values that are too large per step. For example, ServoJ calls need a maximum change of 1 deg per joint per call. So for example, if you send a ServoJ with more than a 1 degree difference on any joint, it will return that error.


    • Related Articles

    • 3D Object Mapping using Force Sensor & Servo Cart (Python SDK)

      This article contains code for mapping and visualizing an object from probing the target **PLEASE NOTE THIS CODE IS MEANT AS AN EXAMPLE/TEMPLATE AND SHOULD NOT BE RAN!!! USE THIS TO CREATE MODIFICATIONS TO ENSURE SAFETY AND COMPATABILITY WITH YOUR ...
    • Fairino FAQ

      Q: How do I connect my DH gripper to my Fairino? A: Follow the instructions linked here ...
    • How to update Fairino Robot Software

      Step 1) - Navigate to the Fairino documentation page here - Use the version select button in the bottom right to select the target software version you wish to migrate to (please note the compatibility table below): Current Version Maximum Upgradable ...
    • Connecting an XJC Force/Torque Sensor to Fairino Cobot

      This article will cover the steps needed to connect your XJC force/torque sensor to the end of a Fairino Cobot arm Hardware required: - 1 XJC force sensor - 1 Fairino Cobot - 1 computer with ethernet connection to Control box/button box OR 1 teach ...
    • Setting Collision Level

      Fairino Collision detection sensitivity The Fairino robotic arms are Cobots, meaning they are meant to work around people safely. A key to accomplishing this is the "Collision detection" setting. This article will cover how to set the collision level ...