ICubInterfaceGui specifications

From Wiki for iCub and Friends
Jump to: navigation, search

This page is an open discussion page to decide the major features of the forecoming iCubInterfaceGui.


Information sent by control boards on the CAN bus

We here describe what kind of information can be currently retrieved from the control boards. This information is usually sent on the CAN bus either by polling messages or broadcasted periodically after sending a suitable request.

Broadcast Messages

BCAST_STATUS

The broadcast message (analogous to CAN_GET_ERROR_STATUS) has a more complex structure since it contains more information. A complete description of the broadcast status message (BCAST_STATUS) is available CAN_BCAST Specifications: here. In the following table we summarize the available information as it is represented in the CanBusMotionControl.cpp file:

variable name @ CanBusMotionControl.cpp description
isFaultOk -> overall status of the Fault pins
isFaultUndervoltage -> the power supply voltage is below the minimum
isFaultOverload -> an hardware fault was triggered by the current operational amplifier
isOverCurrent -> current exceeds the maximum allowed value
isFaultExternal -> external fault was pressed
isHallSensorError -> brushless Hall effect sensor error
isAbsEncoderError -> reading error in the absolute position sensor
isCanTxOverflow -> buffer overflow in trasmission
isCanBusOff -> CAN bus off error
isCanTxError -> CAN bus transmission error
isCanRxError -> CAN bus receive error
isCanRxOverrun -> CAN bus overrun
isMainLoopOverflow -> DSP couldn't finish the control loop in time (typically 1ms)
isOverTempCh -> high temperature from the temperature sensor
isTempErrorCh -> troubles in reading the temperature sensor

CAN_BCAST_POSITION

This message contains the position of the joint (i.e. the associated encoder reading)

CAN_BCAST_PID_VAL (and duty cycle)

This message contains the duty cycle (typically between -1333 and 1333), practically the voltage applied to the motor. The message also contains a very similar value, the PID value as computed by the DSP (duty cycle and PID value might differ since there are some constraints on the dynamics of the duty cycle signal, e.g. cannot be increased too rapidly).

CAN_BCAST_CURRENT (and PID error)

This message contains the current supplied to the motor (i.e. a rough estimation of the motor torque). It also contains the PID error, i.e. the difference between the desired and actual joint position.

Polling messages

CURRENT_BOARD_TYPE

This messages is a polling message which can sent to a control board in order to receive information about the firmware version, the firmware revision, the build number and current control board can address (see also here to know how to associate firmware versions and can addresses). Can addresses can be easily changed by using the canLoader20 gui.

CAN_GET_ADDITIONAL_INFO

This polling message can be used to retrieve from a control board the information which has been stored on the board. This information can be easily stored on the board using the CanLoader20 gui.

CAN_GET_CONTROL_MODE

This polling message can be used to retrieve the current control board mode of operation. At the moment the available control modes are the following:

control mode name description
MODE_IDLE -> no pwm enabled
MODE_POSITION -> position control
MODE_VELOCITY -> velocity control
MODE_TORQUE -> torque control (generates a given joint level torque)
MODE_IMPEDANCE -> impedance control (generates a given stiffness around an equilibrium point)
MODE_CALIB_ABS_POS_SENS -> calibrate joint using an absolute position sensor
MODE_CALIB_HARD_STOPS -> calibrate joint using hardware limit
MODE_HANDLE_HARD_STOPS -> trying to get out from an hardware limit
MODE_MARGIN_REACHED -> trying to get within limits when the margin to limits is too small
MODE_OPENLOOP -> receiving PWM values via canbus

At the moment the number of control modes is evolving quite rapidly (due to recent force control development) so this list might get easily outdated pretty soon.

CAN_MOTION_DONE

This polling message can be used to ask a control board if one of its axes has completed the trajectory generation for a given movement. Even if the message is currently polling, the possibility of transforming it into a broadcast message should be considered.

CAN_GET_ENCODER_POSITION

This polling message is obsolete since it has been recently substituted by a broadcast message (activated with a proper canbus message and activated in the iCubInterface by simply changing the proper entry in the control board config file). The message is used to ask a control board the current position of its axes.

CAN_GET_ENCODER_VELOCITY

This polling message is obsolete since it has been recently substituted by a broadcast message (activated with a proper canbus message and activated in the iCubInterface by simply changing the proper entry in the control board config file). The message is used to ask a control board the current velocity.

CAN_GET_DESIRED_POSITION

This polling message is used to ask a control board the current reference position.

CAN_GET_DESIRED_VELOCITY

This polling message has a double meaning depending on the control mode. If the control mode is MODE_POSITION then the control board will give the current velocity used in the trajectory generation. If the control mode is MODE_VELOCITY then the control board will give the current reference velocity.

CAN_GET_DESIRED_ACCELER

This polling message can be used in MODE_VELOCITY and retrieves from the control board the desired acceleration used when reaching a commanded velocity.

CAN_GET_DESIRED_TORQUE

This polling message can be used in MODE_TORQUE and retrieves from the control board the torque reference.

CAN_GET_P_GAIN

This polling message can be used to retrieve the control board proportional gain.

CAN_GET_D_GAIN

This polling message can be used to retrieve the control board derivative gain.

CAN_GET_I_GAIN

This polling message can be used to retrieve the control board integral gain.

CAN_GET_ERROR_STATUS

This polling message is obsolete since it has been recently substituted by a more complete broadcast message (activated with a proper canbus message and activated in the iCubInterface by simply changing the proper entry in the control board config file). The message is used to ask a control board its error status and the reply has the following meaning:

#define ERROR_NONE				0			/* no error, all ok */
#define ERROR_UNSPECIFIED			1			/* generic error */
#define ERROR_MODE				2			/* mode error, can't apply command in current mode */
#define ERROR_FMT				3			/* format error, command in wrong format */
#define ERROR_SEND				4			/* can't send answer back */

BCAST_STATUS

The broadcast message (analogous to CAN_GET_ERROR_STATUS) has a more complex structure since it contains more information. A complete description of the broadcast status message (BCAST_STATUS) is available CAN_BCAST Specifications: here. In the following table we summarize the available information as it is represented in the CanBusMotionControl.cpp file:

variable name @ CanBusMotionControl.cpp description
isFaultOk -> overall status of the Fault pins
isFaultUndervoltage -> the power supply voltage is below the minimum
isFaultOverload -> an hardware fault was triggered by the current operational amplifier
isOverCurrent -> current exceeds the maximum allowed value
isFaultExternal -> external fault was pressed
isHallSensorError -> brushless Hall effect sensor error
isAbsEncoderError -> reading error in the absolute position sensor
isCanTxOverflow -> buffer overflow in trasmission
isCanBusOff -> CAN bus off error
isCanTxError -> CAN bus transmission error
isCanRxError -> CAN bus receive error
isCanRxOverrun -> CAN bus overrun
isMainLoopOverflow -> DSP couldn't finish the control loop in time (typically 1ms)
isOverTempCh -> high temperature from the temperature sensor
isTempErrorCh -> troubles in reading the temperature sensor

CAN_GET_PID_OUTPUT

This polling message is obsolete since it has been recently substituted by a broadcast message (activated with a proper canbus message and activated in the iCubInterface by simply changing the proper entry in the control board config file). The message is used to ask a control board the applied PID value.

CAN_GET_PID_ERROR

This polling message is obsolete since it has been recently substituted by a broadcast message (activated with a proper canbus message and activated in the iCubInterface by simply changing the proper entry in the control board config file). The message is used to ask a control board tracking error (i.e. the difference between desired and current position).

CAN_GET_MIN_POSITION & CAN_GET_MAX_POSITION

Polling messages to get the limits applied to the axes ranges.

CAN_GET_MAX_VELOCITY

Polling messages to get maximum allowed velocity when in MODE_VELOCITY.

CAN_GET_POS_PID

Polling message to get (in an atomic message) the information about the PID used in the position control. Practically, the control board replies with a unique message which contains the following information:

CAN_GET_P_GAIN    //proportional gain
CAN_GET_D_GAIN    //derivative   gain
CAN_GET_I_GAIN	   //integral     gain		
CAN_GET_SCALE	   //scale factor (shifts by 2^-SCALE all the gains)				

CAN_GET_POS_PIDLIMITS

Polling message to get (in an atomic message) the remaining information about the PID used in the position control. Practically, the control board replies with a unique message which contains the following information:

CAN_GET_ILIM_GAIN //integral limit, i.e. maximum value for the integral
CAN_GET_OFFSET    //PWM offset added to the PID

CAN_GET_TORQUE_PID

Similar to CAN_GET_POS_PID but related to the torque control PID.

CAN_GET_TORQUE_PIDLIMITS

Similar to CAN_GET_POS_PIDLIMITS but related to the torque control PID.

CAN_GET_TLIM

Polling message to get the limit on the PWM.