-
Notifications
You must be signed in to change notification settings - Fork 15
Home
Welcome to the sot-torque-control wiki! This repository contains a set of dynamic-graph entities for the implementation of sensor-feedback control of legged robots. In this wiki you can find a description of these entities, which you can see in the image below.
All the entities in sot-torque-control have a command init
that needs to be called to initialize the entity. Typically the init command takes as input the control loop period dt
and other necessary information. Once you are connected to the python terminal on the robot, you can start creating entities and plugging signals. Once your computational graph is ready you can start the computation by using the appropriate script start_dynamic_graph
.
All entities have an extremely useful command to retrieve the list of signals:
displaySignals()
and another command to retrieve the list of commands:
commands()
These will be your best friends for the first few weeks!
The device entity represents the robot. Even if it does not belong to sot-torque-control---but to sot-core---we describe it here because it is fundamental to understand the whole system. The output signals of the device are the sensor measurements (e.g. encoders, IMU, force/torque sensors). The input signal of the device are the motor commands (typically motor currents). When connecting to the python interpreter on the robot the device entity already exists and you can access it through robot.device
.
The main role of this entity is to handle the fact that not all of the robot joints may be controlled by the same controller. For instance, small joints such as wrists, grippers and neck are typically position controlled, whereas the other joints are torque controlled. The input signals of the Control Manager are the control commands computed by all the available controllers (i.e. position and torque controller in the figure above). The output signal is the control command to send to the device. To change the control mode of a joint you can use the command setCtrlMode
(see also commands getCtrlMode
, addCtrlMode
and ctrlModes
). When changing control mode of a joint, to avoid discontinuities, the Control Manager performs a linear interpolation of 1 second between the old and the new control signal. Another key feature of the Control Manager is a safety check: in case the control commands are too large it prints an error message and starts commanding zero current to the device. The maximum control can be changed through the input signal max_current
. The stop of the control can also be triggered by another entity through the input signal emergencyStop
.
This entity implements a simple Proportional-Derivative (PD) joint position control. The input signals are the encoder measurements, the reference joint positions and velocities and the PD gains. The output signal contains the desired motor currents.
This entity implements the joint torque control using a simple linear model for the relationship between motor current, joint torque and joint velocity. This model accounts for:
- viscous friction (proportional to joint velocity)
- Coulomb friction (proportional to the sign of joint velocity)
- a linear relationship between motor current and joint torque (i.e. we neglect the electric pole of the motor transfer function because it is typically much faster than the mechanical motor dynamics)
The main input signals of this entity are the desired joint torques, the estimated joint torques, and the estimated joint velocities. The main output signal contains the desired motor currents.
This entity implements a balance control for the robot based on inverse dynamics. Currently the controller has three tasks:
- Center of Mass (CoM) trajectory tracking
- Joint posture trajectory tracking
- Minimization of tangential forces and moments at the feet
Each task has a weight that determines its (soft) priority with respect to the others. The controller also takes care of having contact forces inside the friction cones and satisfying the torque limits.
The main input signals of this entity are:
- q: robot configuration (including floating base)
- v: robot velocities (including floating base)
- CoM reference trajectory (along with its first two time derivatives)
- joint reference trajectory (along with its first two time derivatives)
Its main output signal contains the desired joint torques.