Go to the source code of this file.
|
| void | mcl_hybrid_ctrl_init (mcl_hybrid_ctrl_cfg_t *cfg) |
| | Initialize hybrid control parameters with default values. More...
|
| |
| void | mcl_hybrid_ctrl_step (const mcl_hybrid_ctrl_cfg_t *cfg, mcl_hybrid_ctrl_state_t *state) |
| | Execute one step of hybrid control. More...
|
| |
| static void | mcl_hybrid_ctrl_set_kp (mcl_hybrid_ctrl_cfg_t *cfg, float kp) |
| | Set position stiffness gain. More...
|
| |
| static void | mcl_hybrid_ctrl_set_kd (mcl_hybrid_ctrl_cfg_t *cfg, float kd) |
| | Set damping gain. More...
|
| |
| static void | mcl_hybrid_ctrl_set_tau_ff (mcl_hybrid_ctrl_cfg_t *cfg, float tau_ff) |
| | Set feedforward torque. More...
|
| |
| static void | mcl_hybrid_ctrl_set_position (mcl_hybrid_ctrl_cfg_t *cfg, float q_des) |
| | Set desired position. More...
|
| |
| static void | mcl_hybrid_ctrl_set_velocity (mcl_hybrid_ctrl_cfg_t *cfg, float dq_des) |
| | Set desired velocity. More...
|
| |
| static void | mcl_hybrid_ctrl_set_limits (mcl_hybrid_ctrl_cfg_t *cfg, float tau_min, float tau_max) |
| | Set output torque limits. More...
|
| |
| static void | mcl_hybrid_ctrl_set_speed_filter (mcl_hybrid_ctrl_cfg_t *cfg, float lpf_alpha, float deadzone) |
| | Set speed filter parameters. More...
|
| |
| static void | mcl_hybrid_ctrl_set_params (mcl_hybrid_ctrl_cfg_t *cfg, float kp, float kd, float tau_ff) |
| | Set all parameters at once. More...
|
| |
| static void | mcl_hybrid_ctrl_set_trajectory (mcl_hybrid_ctrl_cfg_t *cfg, float q_des, float dq_des) |
| | Set desired trajectory. More...
|
| |
| static float | mcl_hybrid_ctrl_get_torque (const mcl_hybrid_ctrl_state_t *state) |
| | Get output torque. More...
|
| |
| static float | mcl_hybrid_ctrl_get_pos_error (const mcl_hybrid_ctrl_state_t *state) |
| | Get position error. More...
|
| |
| static float | mcl_hybrid_ctrl_get_vel_error (const mcl_hybrid_ctrl_state_t *state) |
| | Get velocity error. More...
|
| |
◆ mcl_hybrid_ctrl_get_pos_error()
Get position error.
- Parameters
-
| state | Pointer to state structure |
- Returns
- Position error (rad)
◆ mcl_hybrid_ctrl_get_torque()
Get output torque.
- Parameters
-
| state | Pointer to state structure |
- Returns
- Output torque (N*m)
◆ mcl_hybrid_ctrl_get_vel_error()
Get velocity error.
- Parameters
-
| state | Pointer to state structure |
- Returns
- Velocity error (rad/s)
◆ mcl_hybrid_ctrl_init()
Initialize hybrid control parameters with default values.
Default values:
- kp = 0.0 N*m/rad
- kd = 0.0 N*m*s/rad
- tau_ff = 0.0 N*m
- q_des = 0.0 rad
- dq_des = 0.0 rad/s
- tau_max = 0.0 N*m (no limit)
- tau_min = 0.0 N*m (no limit)
- speed_lpf_alpha = 0.0 (disabled)
- speed_deadzone = 0.0 (disabled)
- Parameters
-
| cfg | Pointer to configuration structure |
◆ mcl_hybrid_ctrl_set_kd()
Set damping gain.
- Parameters
-
| cfg | Pointer to configuration structure |
| kd | Damping gain (N*m*s/rad) |
◆ mcl_hybrid_ctrl_set_kp()
Set position stiffness gain.
- Parameters
-
| cfg | Pointer to configuration structure |
| kp | Position stiffness gain (N*m/rad) Higher value = stiffer, faster response Lower value = more compliant, softer |
◆ mcl_hybrid_ctrl_set_limits()
Set output torque limits.
- Parameters
-
| cfg | Pointer to configuration structure |
| tau_min | Minimum output torque (N*m) |
| tau_max | Maximum output torque (N*m) |
◆ mcl_hybrid_ctrl_set_params()
Set all parameters at once.
- Parameters
-
| cfg | Pointer to configuration structure |
| kp | Position stiffness gain (N*m/rad) |
| kd | Damping gain (N*m*s/rad) |
| tau_ff | Feedforward torque (N*m) |
◆ mcl_hybrid_ctrl_set_position()
Set desired position.
- Parameters
-
| cfg | Pointer to configuration structure |
| q_des | Desired joint position (rad) |
◆ mcl_hybrid_ctrl_set_speed_filter()
| static void mcl_hybrid_ctrl_set_speed_filter |
( |
mcl_hybrid_ctrl_cfg_t * |
cfg, |
|
|
float |
lpf_alpha, |
|
|
float |
deadzone |
|
) |
| |
|
inlinestatic |
Set speed filter parameters.
- Parameters
-
| cfg | Pointer to configuration structure |
| lpf_alpha | Low-pass filter coefficient (0-1), 0 = disabled Smaller value = stronger filtering (e.g., 0.05 for 95% old + 5% new) |
| deadzone | Speed deadzone (rad/s), speed within [-deadzone, +deadzone] will be set to 0 |
◆ mcl_hybrid_ctrl_set_tau_ff()
Set feedforward torque.
- Parameters
-
| cfg | Pointer to configuration structure |
| tau_ff | Feedforward torque (N*m) Used for gravity compensation, friction compensation, etc. |
◆ mcl_hybrid_ctrl_set_trajectory()
Set desired trajectory.
- Parameters
-
| cfg | Pointer to configuration structure |
| q_des | Desired position (rad) |
| dq_des | Desired velocity (rad/s) |
◆ mcl_hybrid_ctrl_set_velocity()
Set desired velocity.
- Parameters
-
| cfg | Pointer to configuration structure |
| dq_des | Desired joint velocity (rad/s) Typically 0 for position holding |
◆ mcl_hybrid_ctrl_step()
Execute one step of hybrid control.
Control law: tau = tau_ff + kp * (q_des - q_actual) + kd * (dq_des - dq_actual)
- Parameters
-
| cfg | Pointer to configuration structure (input) |
| state | Pointer to state structure (input/output) Input: q_actual, dq_actual Output: tau_output, pos_error, vel_error |
Implements hybrid force-position control algorithm: tau = tau_ff + kp * (q_des - q) + kd * (dq_des - dq)
This is essentially a PD controller with feedforward torque, providing impedance/compliance control suitable for:
- Robot joint control
- Servo system control
- Force-sensitive manipulation
- Compliant interaction with environment