Skip to main content
. Author manuscript; available in PMC: 2021 May 1.
Published in final edited form as: IEEE Trans Med Robot Bionics. 2020 Mar 2;2(2):226–235. doi: 10.1109/TMRB.2020.2977416

TABLE III:

Detailed MPC algorithm.

1 Initialization: j = 0
(1a) Set the convergence tolerance εj.
(1b) Measure q(tk),q˙(tk).
(1c) Use virtual constraint and feedback controller to get hd(τ),h¯(τ), and T1(τ), where τ ∊ [tk, tk + TN].
(1d) Choose initial control trajectory u¯fes(τ)U[tk,tk+TN] where τ ∊ [tk, tk + TN].
(1e) Use u¯fes(τ) and h¯(τ) to obtain τ¯a(τ), therefore, J(j)(tk) where τ ∊ [tk, tk + TN].
2 Optimal Solution Searching:
(2a) Integrate backwards in time to solve for the costates l(j)(τ) by minimizing the Hamiltonian H = Jmpc + lTΦμ that l˙(τ)=H(μ¯,l,u¯fes)μ¯.
(2b) Compute the search direction, a(j)(τ), from the Hamiltonian a(j)(τ)=H(x,l,u¯fes)u¯fes.
(2c) Compute the optimal step size, σ(j), with adaptive setting in [39].
(2d) Update the control trajectory
u¯fes(j+1)(τ)=ψ(u¯fes(j)+σ(j)a(j))
where ψ denotes the constraints.
(2e) Use u¯fes(j+1) to get J(j+l)(tk).
(2f) Check Quit Conditions
(i) quit if |J(j+1)(tk)J(j)(tk)|εj,
(ii) quit if j has exceeded the max iteration limit, Nt,
(iii) otherwise set j = j + 1 and reiterate gradient step from (2a).