Model-based control for robots has increasingly been dependent on optimization-based methods like Differential Dynamic Programming and iterative LQR (iLQR). These methods can form the basis of Model-Predictive Control (MPC), which is commonly used for controlling legged robots. Computing the partial derivatives of the dynamics is often the most expensive part of these algorithms, regardless of whether analytical methods, Finite Difference, Automatic Differentiation (AD), or Chain-Rule accumulation is used. Since the second-order derivatives of dynamics result in tensor computations, they are often ignored, leading to the use of iLQR, instead of the full second-order DDP method. In this paper, we present analytical methods to compute the second-order derivatives of inverse and forward dynamics for open-chain rigid-body systems with multi-DoF joints and fixed/floating bases. An extensive comparison of accuracy and run-time performance with AD and other methods is provided, including the consideration of code-generation techniques in C/C++ to speed up the computations. For the 36 DoF ATLAS humanoid, the second-order Inverse, and the Forward dynamics derivatives take approx 200 mu s, and approx 2.1 ms respectively, resulting in a 3x speedup over the AD approach.
翻译:基于模型的机器人控制日益依赖于微分动态规划(DDP)和迭代LQR(iLQR)等优化方法。这些方法可作为模型预测控制(MPC)的基础,广泛应用于腿式机器人控制。无论采用解析法、有限差分法、自动微分(AD)还是链式法则累积,动力学偏导数的计算通常是此类算法中最耗时的部分。由于动力学二阶导数涉及张量计算,常被忽略,导致实际使用iLQR而非完整的二阶DDP方法。本文提出了一种解析方法,用于计算具有多自由度关节及固定/浮动基座的开链刚体系统逆动力学与正向动力学的二阶导数。我们全面对比了该方法与自动微分及其他方法的精度和运行性能,并探讨了利用C/C++代码生成技术加速计算的效果。针对36自由度的ATLAS人形机器人,其逆动力学二阶导数计算约需200微秒,正向动力学二阶导数约需2.1毫秒,相比自动微分方法实现了3倍加速。