MOVE ENCODER(3)

NAME
MOTOR_LEVEL_CONTROL, MOVE_ENCODER, SET_MTORQUE, SET_ENCODER, SET_MTORQUE_BIAS -- RCI CHG macros to move the robot at the motor level.

USAGE
#include <rci.h>

MOTOR_LEVEL_CONTROL(rbt)
   RCI_RBT *rbt;

MOVE_ENCODER(rbt, enc, jnt)
   RCI_RBT *rbt;
   int enc, jnt;

SET_MTORQUE(rbt, tor, jnt)
   RCI_RBT *rbt;
   float tor;
   int jnt;

SET_ENCODER(rbt, enc, jnt)
   RCI_RBT *rbt;
   int enc, jnt;

SET_MTORQUE_BIAS(rbt, tor, jnts)
   RCI_RBT *rbt;
   float tor;
   int jnt;

ARGUMENTS

rbt --
    Pointer to RCI robot structure.

enc --
    Encoder value.

jnt --
    Robot joint number.

tor --
    Motor shaft torque or force value, Newton-meters or Newtons.

DESCRIPTION
This is a set of CHG macros that post motor-level commands to the robot interface. Motor-level refers to joint operation directly at the acuator/encoder level, before the gear train. Hence positions are specified by encoder values rather than joint values, and requested torques are reduced by the appropriate gear ratio. It should be noted that there may also be gear couplings between the joint and motor levels, as is commonly the case with robot wrists: moving a single actuator at the motor level may cause more than one joint to move, and vice versa.

These macros may be called from any part of an RCI program. The RCI interface must first be placed into motor-level mode, using the MOTOR_LEVEL_CONTROL() macro, before the other macros will be accepted.

MOTOR_LEVEL_CONTROL() puts the robot interface into motor-level mode, requiring that only motor-level motion commands be issued to the robot during the same and subsequent control cycles. The controlLevel field of the HOW structure is set to MOTOR_LEVEL.

MOVE_ENCODER() instructs the robot to move the joint specified by jnt to the encoder value specified by enc during the next control cycle. The requested value is written into the encSet field of the HOW structure.

SET_MTORQUE() instructs the robot to put the joint specified by jnt into torque mode with a force specified by tor. The requested value is written into the mtorqueSet field of the HOW structure. The joints which are currently in torque mode are indicated by a bitmask in the torqueMode field.

SET_ENCODER() instructs the robot to explicitly set the value for the joint specified by jnt to the value enc; this is mainly of interest when calibrating the robot. The set value is written into the encSet field of the HOW structure.

SET_MTORQUE_BIAS() instructs the robot to add a feedforward bias current to the control output for the joint indicated by jnt. The set value will be written into the mtorqueBias field of the HOW structure. This bias current will normally not have any effect when the joint is in torque mode.

Each motion command will override all previous motion commands given to the same joint during the same cycle.

DIAGNOSTICS
Errors will result in an abort condition. Defined abort conditions include:

EBadCmd --
    One of the above commands was requested with the interface not in motor-level mode, or a command was requested that is not currently supported.

EReqPos --
    The requested encoder value was out of range.

EReqVel --
    The velocity resulting from the request would exceed limits.

EReqTor --
    The requested torque exceeds limits.

The limit and range checking can be switched on or off with the SET_CHECKING() macro.

SEE ALSO
CHG(3), HOW(3), MOVE_ANGLE(3), SET_CHECKING(3).