---
title: Direction-Constrained HQP
url: https://www.emergentmind.com/topics/direction-constrained-hqp
type: topic
---

# Direction-Constrained HQP

A direction-constrained hierarchical quadratic program (HQP) is a multi-level optimization framework that explicitly incorporates directional (angular) constraints into the hierarchy of quadratic programs classically used in robotics, control, and signal processing. The direction-constrained HQP prevents undesirable or abrupt command redirections when task or safety constraints become active, particularly in contexts requiring human-robot interaction (pHRI) or physical constraint enforcement. This article surveys the formal structure, solution methods, algorithmic innovations, and application scenarios of direction-constrained HQP with a focus on physical interaction and efficient computational approaches.

## 1. Standard Hierarchical Quadratic Programming Formulation

HQP is a mechanism for the strict prioritization of multiple, potentially conflicting, equality and inequality task requirements. Task priorities are encoded lexicographically: constraints at higher levels have strictly higher precedence than those below. For $N$ prioritized task levels ($k=1,\ldots,N$), the canonical HQP is:

\[
\min_{u,\,w_1,\ldots,w_N}^{\rm lex} \left(\|w_1\|^2, \ldots, \|w_N\|^2\right)
\]
\[
\text{s.t.} \quad \forall k=1,\ldots, N:
\begin{cases}
A_k u = b_k + w_k, \\
C_k u \leq d_k.
\end{cases}
\]

At each level $k$, $u$ is the control, $A_k$, $b_k$ encode the equality-task (with slack $w_k$ for relaxation), and $C_k$, $d_k$ represent convex inequality-task constraints (e.g., joint limits, collision avoidance). Rather than stacking all levels, HQP typically solves at each $k$ a reduced QP that strictly enforces all higher priority equalities:

\[
\begin{aligned}
&\min_{u_k, w_k} \|w_k\| \\
&\text{s.t.}\;\;
A_{1\to k-1} u_k = A_{1\to k-1} u_{k-1},\;\;
A_k u_k = b_k + w_k,\\
&\qquad
C_{1\to k} u_k \le d_{1\to k}
\end{aligned}
\]

where $A_{1\to k-1}$ denotes the aggregation of all higher-level Jacobians.

## 2. Directional Constraints: Motivation and Formalism

Standard HQP permits the task-space velocity or command $A_k u$ to change direction arbitrarily when close to an active inequality constraint. In the context of smooth pHRI or safety-critical robotics, this can lead to "jerky" or unpredictable behavior that violates human intent. To address this, direction-constrained HQP restricts the maximum allowable angle between the actual command $A_k u$ and its nominal reference $b_k$ via the constraint:

\[
\angle(A_k u,\, b_k) \leq \theta_k
\]

or equivalently,

\[
\frac{(A_k u)^T b_k}{\|A_k u\| \, \|b_k\|} \geq \cos\theta_k
\tag{DC}_k
\]

Here, $0 \leq \theta_k \leq \pi$ is a user-defined angular threshold: $\theta_k=0$ enforces perfect alignment (task scaling), while $\theta_k = \pi$ suppresses the constraint (recovering standard HQP). This form introduces strong nonlinearity due to the normalization, increasing the challenge of direct optimization.

## 3. Two-Subproblem Decomposition and Solution Procedure

To address the non-convexity induced by the angular constraint, the level-$k$ problem is decoupled into two parallel subproblems:

- **Minimum-Error Problem $(P1_k)$:** Minimize $\|A_k u - b_k\|$ over $u$ subject to all previously active equalities and present inequalities. The solution, $\mu_1$, corresponds to classic HQP and yields the smallest task-space error.
- **Minimum-Angle Problem $(P2_k)$:** Minimize the angle $\angle(A_k u, b_k)$ subject to the same constraints. The corresponding solution, $\mu_2$, finds the closest achievable direction to $b_k$ (not necessarily in magnitude), accounting for actuation and safety limits.

The minimum-angle problem admits a closed-form, scaled solution via projection into the feasible subspace, with scale $s$ determined and clamped to the interval compatible with all active inequalities.

After both subproblems are solved with a shared iterative active-set solver on $C_{1\to k} u \leq d_{1\to k}$, the admissible candidates $\mu_1$ and $\mu_2$ are combined via a parameterized convex blend:

\[
u_k(\eta) = \eta \mu_1 + (1-\eta) \mu_2,\qquad 0\le\eta\le1
\]

where $\eta^*$ is chosen as the smallest parameter such that the angle deviation constraint is exactly met:

\[
\angle\left(\eta^* A_k \mu_1 + (1-\eta^*) A_k \mu_2,\, b_k\right) = \theta_k
\]

Tracking error $h(\eta)$ is strictly decreasing in $\eta$, while the directional deviation $\beta(\eta)$ is monotonic or V-shaped, accommodating precise constraint satisfaction through a 1D search in $\eta$.

## 4. Variable Admittance Control under Directional Constraints

For physical HRI, the lowest-priority (level $N$) task typically involves matching robot motion to human-applied forces via admittance control. The classical second-order admittance controller is:

\[
M \dot{v}_a + D v_a = f_{\rm ext}
\]

yielding $v_a \approx D^{-1} f_{\rm ext}$ at steady state. However, proximity to active directional or inequality constraints can induce large mismatches between the desired $v_a$ and achieved end-effector velocity $v = J^E u$. The error $\chi = v_a - v$ may become significant.

Dynamic adjustment of the damping matrix $D(t)$ is introduced to reduce $\chi$, especially near constraint boundaries:

\[
D_i(t) = \max\left\{\kappa_1 \exp\left(\operatorname{sign}(f_{\rm ext,}i) \kappa_2 \chi_i\right),\, D_{\min}\right\}
\]

where $\kappa_1, \kappa_2$ are positive gains and $D_{\min}$ ensures a minimum damping floor. Increased damping inhibits runaway $v_a$ when the operator pushes into a constraint; decreased damping accelerates response when the operator pulls away. This closed-loop regulation improves intent tracking and reduces interaction delays.

## 5. Algorithmic Workflow

Each control cycle in direction-constrained HQP proceeds as follows:

1. Measure the human-applied force $f_{\rm ext}$; update admittance $M \dot{v}_a + D(t) v_a = f_{\rm ext}$.
2. Construct the task hierarchy: t-eq and t-iq constraints for levels $1,\ldots, N-1$, and the interaction task at $N$ with $b_k \equiv v_a$.
3. For $k=1$ to $N$:
   - Initialize the active set $\mathcal S$.
   - Iterate:
     - Solve $(P1_k)$ to obtain $\mu_1$.
     - Solve $(P2_k)$ to obtain $\mu_2$.
     - Update $\mathcal S$ for violated constraints; recompute null spaces as necessary.
     - Prune inactive constraints using KKT conditions on $\mu_1$.
   - Terminate on $\mathcal S$ convergence, merge $(\mu_1, \mu_2)$ via convex-blend to $u_k$.
   - Update null-space projectors.
4. Send $u_N$ to the robot, compute actual $v = J^E u_N$, update $\chi$, and $D(t)$.

This procedure ensures all t-eq and t-iq constraints are satisfied at every priority level, enforces strict bounds on task-space angular deviation, and guarantees smooth, interpretable responses at constraint boundaries.

## 6. Homogeneous Quadratic Programs with Directional Constraints

A broad family of directionally-constrained quadratic programs can be formulated as:

\[
\min_{x \in \mathbb{C}^N} \;\; x^H T x \quad \text{s.t.} \;\; x^H P_i x + 1 \le 0, \;\; i=1,2,3
\]

where each $P_i$ encodes quadratic or angular constraints; $T \succ 0$. By Cholesky decomposition, this reduces to:

\[
\min_{z \in \mathbb{C}^N} z^H z \;\;\; \text{s.t.} \;\; z^H C_i z + 1 \le 0
\]

The KKT conditions lead to a minimum-eigenvalue structure, enabling efficient 1D or 2D search (for up to three constraints) rather than full semidefinite relaxation. Subspace constraints and exact angular bounds, e.g., $\angle(u, a) \leq \theta$, are directly representable in the quadratic form and handled within the same framework by constructing $C_i$ as $-a a^H$ or suitable projections.

For two constraints, the search reduces to a maximum over three candidate points (associated with boundary and intersection conditions), while three constraints require comparing up to seven candidates. For $N$-dimensional variables, the method achieves global optimality at a per-iteration cost of one minimum-eigenvalue computation ($\mathcal{O}(N^3)$), substantially more efficient than SDR approaches ($\mathcal{O}(N^6)$) [1308.0104].

## 7. Application Scenarios and Performance Characteristics

The direction-constrained HQP framework has been extensively evaluated in pHRI scenarios, such as a 7-DOF robotic arm under mixed task and safety constraints. Empirical results demonstrate that:

- **Motion smoothness:** Directional constraints enforce continuous, human-intuitive corrections, eliminating abrupt velocity jumps when constraints activate [$2410.16922$].
- **Task consistency and safety:** The two-subproblem split and coordinated active-set solver guarantee all constraints are respected, even under multi-level prioritization.
- **Reduced interaction delay:** Variable admittance control minimizes velocity mismatches at the constraint boundary, especially during intent reversals.
- **Computational efficiency:** In MIMO relay design and related signal processing HQCQP instances, eigenvalue-based direction-constrained solvers achieve 16x–720x speedup compared to SDR at $>90\%$ accuracy [1308.0104].

These properties make direction-constrained HQP applicable not only to human-robot collaborative control but also to convexified subproblems in communication and estimation.

---

**Summary Table: Key Aspects of Direction-Constrained HQP**

| Feature                     | Standard HQP                   | Direction-Constrained HQP                    |
|-----------------------------|-------------------------------|----------------------------------------------|
| Direction regulation        | None; arbitrary                | Explicit angle-bound at each task level      |
| Subproblem decomposition    | Single QP per priority         | Minimum-error and minimum-angle subproblems  |
| Solution blending           | Not applicable                 | Convex blend enforces angular constraint     |
| Human-robot interaction     | No specific improvement        | Smoother, intention-aligned response         |
| Computational requirement   | QP per level                   | Two parallel subproblems + 1D blend          |

Enforcing angular constraints within the HQP hierarchy delivers robust, interpretable, and efficient solutions to multi-task motion and control problems where constraint-activated direction changes must remain bounded and comprehensible.

Source: https://www.emergentmind.com/topics/direction-constrained-hqp