class
PositionToCurrentControllerPosition-to-Current Controller with Friction Compensation and TN-Curve Limiting.
The PositionToCurrentController implements a position control strategy that directly computes motor current commands from position errors. This approach is particularly useful for robots where direct current control provides better performance than traditional position control cascades, especially in applications requiring precise force/torque control or friction compensation.
The controller implements a proportional position control law with Coulomb friction feedforward compensation and dynamic current limiting based on motor torque-speed (TN) characteristics:
where:
- is the output current [A]
- is the proportional gain [Nm/rad]
- is the reference position [rad]
- is the feedback position [rad]
- is the Coulomb friction compensation [Nm]
- is the feedback velocity [rad/s]
- is the gear reduction ratio (motor-to-joint)
- is the motor torque constant [Nm/A]
- is the velocity-dependent current limit [A]
Friction Compensation
The controller includes feedforward Coulomb friction compensation that adds a torque in the direction of motion to counteract coulomb friction effects:
where:
- is the Coulomb friction constant [Nm]
- is the velocity threshold for friction activation [rad/s]
This helps improve tracking accuracy, especially at low velocities where friction effects are dominant.
Dynamic Current Limiting (TN-Curve)
The controller implements velocity-dependent current limiting based on motor torque-speed characteristics to prevent motor overheating and ensure safe operation:
- Constant Region ( ):
- Linear Falloff ( ):
- No-Load Speed ( ):
where:
- is the rated speed at which current limiting begins [rad/s]
- is the no-load speed where current becomes zero [rad/s]
- is the slope of the linear region
- is the intercept
Base classes
-
template<class _Input, class _Output>class BipedalLocomotion::System::Advanceable<PositionToCurrentControllerInput, Eigen::VectorXd>
- Basic class that represents a discrete system.
Constructors, destructors, conversion operators
- PositionToCurrentController()
- Default constructor.
- ~PositionToCurrentController() virtual
- Default destructor.
Public functions
- auto advance() -> bool override
- Advance the controller.
-
auto initialize(std::weak_ptr<const ParametersHandler::
IParametersHandler> handler) -> bool override - Initialize the advanceable.
- auto setInput(const PositionToCurrentControllerInput& input) -> bool override
- Set the input of the port.
- auto getOutput() const -> Eigen::VectorXd& override
- Get the output of the controller.
- auto isOutputValid() const -> bool override
- Check if the output is valid.
Function documentation
bool BipedalLocomotion:: JointLevelControllers:: PositionToCurrentController:: advance() override
Advance the controller.
Returns | The output of the controller |
---|
bool BipedalLocomotion:: JointLevelControllers:: PositionToCurrentController:: initialize(std::weak_ptr<const ParametersHandler:: IParametersHandler> handler) override
Initialize the advanceable.
Parameters | |
---|---|
handler | A weak pointer to the parameters handler |
Returns | True if the initialization is successful. |
Furthermore, the following optional parameters are supported:
Group Name | Description | Mandatory |
---|---|---|
current_limit | An element for each joint contained in the joints_list parameter. Current limit for each joint [A] | No |
coulomb_friction | An element for each joint contained in the joints_list parameter. Coulomb friction for each joint [Nm] | No |
activation_velocity | An element for each joint contained in the joints_list parameter. Friction activation velocity [rad/s] | No |
rated_speed | An element for each joint contained in the joints_list parameter. Rated speed for each joint [rad/s] | No |
no_load_speed | An element for each joint contained in the joints_list parameter. No-load speed for each joint [rad/s] | No |
bool BipedalLocomotion:: JointLevelControllers:: PositionToCurrentController:: setInput(const PositionToCurrentControllerInput& input) override
Set the input of the port.
Parameters | |
---|---|
input | the input of the controller |
Returns | True in case of success and false otherwise |
Eigen::VectorXd& BipedalLocomotion:: JointLevelControllers:: PositionToCurrentController:: getOutput() const override
Get the output of the controller.
Returns | The output of the controller |
---|
bool BipedalLocomotion:: JointLevelControllers:: PositionToCurrentController:: isOutputValid() const override
Check if the output is valid.
Returns | True if the output is valid, false otherwise |
---|