|
iCub-main
|
This document describes the motor-control extensions introduced during the work related to robotology/icub-firmware#615.
The main goals are:
The original velocity-control implementation relied on a trajectory generator, commonly referred to as MinJerk. The input velocity reference was first processed by the trajectory generator before being passed to the subsequent control loops.
This implementation remains available and is referred to as the standard or classic velocity control mode.
The new architecture also supports direct control modes in which the trajectory generator is bypassed. This is useful when the user needs to send a velocity reference directly to the control loop without additional interpolation.
The control chain can be divided into two main levels:
High-level controllers generally run at approximately 1 kHz and include:
Low-level controllers are implemented on the motor-control boards and include:
The final control law is selected through the motor-control configuration files. Different control schemes can be obtained by enabling or disabling branches of the general control structure and by configuring the corresponding PID parameters.
In standard position control, the position reference is processed by the trajectory generator. The generated trajectory is then used by the position controller.
The output of the position controller can be connected to different low-level control modes, such as:
The trajectory generator is enabled in this mode.
Position Direct bypasses the trajectory generator.
The position reference is sent directly to the position controller. A velocity reference can also be sent together with the position reference and used as a feedforward term.
Position Direct can be combined with the following low-level outputs:
The position-direct PID is already available on the EMS board. The associated PID parameters must be correctly exposed through the configuration protocol and YARP configuration pipeline.
Standard velocity control uses the trajectory generator. The velocity reference is interpolated before being sent to the velocity controller.
The velocity controller can generate:
This mode is intended to preserve compatibility with the existing control behavior.
Velocity Direct is the main new YARP 4 control mode.
In this mode:
The mode is intended for applications requiring direct velocity control on the motor-side.
The new YARP interface exposes the direct velocity command through a dedicated interface containing the setVelocity operation.
In 2FOC case: The user configures the PID gains in machine-unit and velocity references have to be in metric unit.
The Velocity Direct mode is explicitly distinguished from the original velocity-control mode.
The Mixed mode accepts both position and velocity references.
The velocity reference can be used as a feedforward component while the position reference is processed by the position controller. The exact behavior depends on the motor-control configuration.
The existing YARP MIXED mode was considered for this purpose. However, the final control law must be defined explicitly at the configuration and firmware levels rather than relying only on the historical behavior of the interface.
The high-level controller can be connected to different low-level output stages.
With PWM output, the controller directly generates a PWM command for the motor.
The current loop is not explicitly included in the configured control chain. However, the 2FOC board can still apply current limiting where required.
This mode is useful when the user needs direct torque-like actuation through PWM.
With current output, the high-level controller generates a current reference.
The current reference is then processed by the internal current loop on the 2FOC board. This provides a cascaded architecture in which the current controller regulates the motor current take into account the Kbemf paramter
This mode is useful when current regulation and torque control are required.
With velocity output, the high-level control generates a velocity reference for a lower-level velocity controller.
This allows the control law to be split across different levels, for example:
or:
The velocity_current output combines a velocity loop and an internal current loop:
The velocity controller generates a current reference, which is then processed by the current loop on the 2FOC board.
The new architecture aims to provide a flexible control structure rather than implementing a separate fixed schema for every possible combination.
The following diagrams summarize the main control-mode combinations.
The diagrams are graphical representations of the control chains implemented across the EMS and 2FOC boards.
These schemes can be adapted to any other embedded board (for example, an AMC-family board), abstracting away where the control loop runs while preserving the control flow.
This configuration includes the MinJerk trajectory generator and supports Position, Velocity, and Mixed high-level modes.
The final output is PWM.
This configuration includes the MinJerk trajectory generator and generates a current reference for the internal current loop.
This configuration includes the MinJerk trajectory generator and generates a velocity reference for the lower-level velocity controller.
This configuration includes:
The velocity_current output mode is already available in the 2FOC board. The configuration protocol must expose and configure it consistently.
In this configuration, the MinJerk trajectory generator is bypassed.
The position reference is processed by the Position Direct PID, which generates a PWM command.
The Position Direct PID is already implemented on the EMS board. Its parameters must be made available through the configuration protocol.
The Position Direct controller generates a current reference, which is processed by the internal current loop.
The control chain is:
The Position Direct controller generates a velocity reference for the lower-level velocity controller.
The control chain is:
A velocity feedforward reference can also be sent together with the position reference when supported by the selected interface and configuration.
This configuration combines Position Direct with a velocity loop and an internal current loop.
The control chain is:
Both the Position Direct PID and the velocity_current output mode must be configured through the complete software and firmware pipeline.
The integration of the new control modes requires YARP 4. Here is the link to the YARP4 change log: https://github.com/robotology/yarp/blob/master/doc/release/v4_0_0.MD
Several YARP interfaces changed their return type from bool to ReturnValue.
Implementations must use:
instead of returning true.
| # | Old Method Name (origin/master) | New Method Name (current) |
|---|---|---|
| 1 | setRefSpeedRaw | setTrajSpeedRaw |
| 2 | setRefSpeedsRaw | setTrajSpeedsRaw |
| 3 | getRefSpeedRaw | getTrajSpeedRaw |
| 4 | getRefSpeedsRaw | getTrajSpeedsRaw |
| 5 | setRefAccelerationRaw | setTrajAccelerationRaw |
| 6 | setRefAccelerationsRaw | setTrajAccelerationsRaw |
| 7 | getRefAccelerationRaw | getTrajAccelerationRaw |
| 8 | getRefAccelerationsRaw | getTrajAccelerationsRaw |
| # | Old Method Name (origin/master) | New Method Name (current) |
|---|---|---|
| 1 | getRefVelocityRaw | getTargetVelocityRaw |
| 2 | getRefVelocitiesRaw | getTargetVelocitiesRaw |
YARP 4 introduces the Velocity Direct control mode.
This mode is distinct from the existing velocity mode:
| Control mode | Trajectory generator | Reference |
|---|---|---|
| Velocity | Enabled | Velocity reference processed by the trajectory generator |
| Velocity Direct | Disabled | Direct velocity reference |
The direct mode is intended for applications where the velocity command must be applied without MinJerk interpolation.
These are the main functions
Important Note: The name getRefVelocityRaw has been repurposed for the new VelocityDirect interface, while in the IVelocityControl2 interface, it has been renamed to getTargetVelocityRaw.
YARP 4 and yarpmotorgui support richer PID information.
A PID can include:
A PIDWithExtraInfo object was introduced to expose additional PID information through setter and getter methods.
The GUI can display the PID description read from the XML configuration file.
Each control mode can be associated with multiple PID parameter sets. The configuration may contain separate PID sets for:
The presence of multiple PID sets does not necessarily mean that the control mode can be switched dynamically at runtime. The active set is selected according to the configured control mode.
the devices of type AnalofSensor have been replaced with MultipleAnalogSensor type
The motor-control XML configuration is extended to distinguish the different control modes and PID types.
The main configuration concepts include:
Every sensors config type has been updated with MultipleAnalogSensor and the respective Wrapper and Remapper with MultipleAnalogServer. (AnalogServer & SkinWrapper ==> multipleanalogsensorsserver)