\input manualMacros.tex
\manBegin
\manPageInfo{RCI Reference Manual}{}{}
\manTitle{MOVE ANGLE}{3}
\manSection{NAME}
{\rightskip=0ptplus1fil
{\tt \manName{JOINT_LEVEL_CONTROL}},
{\tt \manName{MOVE_ANGLE}},
{\tt \manName{SET_JTORQUE}},
{\tt \manName{SET_ANGLE}},
{\tt \manName{SET_JTORQUE_BIAS}} --
RCI {\it CHG} macros to move the robot at the joint level.

}
\manSection{USAGE}
\cverbatim
#include <rci.h>

JOINT_LEVEL_CONTROL(rbt)
   RCI_RBT *rbt;

MOVE_ANGLE(rbt, ang, jnt)
   RCI_RBT *rbt;
   float ang;
   int jnt;

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

SET_ANGLE(rbt, ang, jnt)
   RCI_RBT *rbt;
   float ang;
   int jnt;

SET_JTORQUE_BIAS(rbt, tor, jnt)
   RCI_RBT *rbt;
   float tor;
   int jnt;
@endcverbatim
\manSection{ARGUMENTS}
\manItem{{\tt rbt} --}
Pointer to RCI robot structure.
\manItem{{\tt ang} --}
Joint value (radians or millimeters).
\manItem{{\tt jnt} --}
Robot joint number.
\manItem{{\tt tor} --}
Joint force value (Newton-meters or Newtons).
\manSection{DESCRIPTION}
This is a set of {\it CHG} macros that post joint-level commands to the
robot interface. 
{\it Joint-level} refers to joint operation
at the level {\it after} the gear train. Joint control directly
at the {\it actuator} level is achieved using 
the {\it motor-level} commands described in {\tt move_encoder(3)}.

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

{\tt JOINT_LEVEL_CONTROL()} puts the robot interface into
joint-level mode, requiring that only joint-level motion
commands be issued
to the robot during the same and subsequent control cycles.
The {\tt controlLevel} field of the {\tt HOW} structure is set
to {\tt JOINT_LEVEL}.

{\tt MOVE_ANGLE()} instructs the robot to move the joint
specified by {\tt jnt} to the value specified by {\tt ang}
during the next control cycle.
The requested value is written into
the {\tt angSet} field of the {\tt HOW} structure.

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

{\tt SET_ANGLE()} instructs the robot to explicitly set the value for the
joint specified by {\tt jnt} to the value {\tt ang};
this is mainly of interest when calibrating the robot. It is not
supported on the PUMA robot.
The set value is written into
the {\tt angSet} field of the {\tt HOW} structure.

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

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

\manSection{DIAGNOSTICS}
Errors will result in an abort condition. Defined error conditions include:

\manItem{{\tt EBadCmd} --}
One of the above commands was requested with the interface not in 
joint-level mode, or a command was requested that is not currently
supported. 

\manItem{{\tt EReqPos} --}
The requested angle value was out of range.

\manItem{{\tt EReqVel} --}
The velocity resulting from the request would exceed limits.

\manItem{{\tt EReqTor} --}
The requested torque exceeds limits.

The limit and range checking can be switched on or off with the
{\tt SET_CHECKING()} macro.
\manSection{SEE ALSO}
\raggedright
{\tt CHG(3)}, {\tt HOW(3)}, {\tt MOVE_ENCODER(3)}, {\tt SET_CHECKING(3)}.
\manEnd
\end
