Matlab to C++: real-time algorithms for robot arms

Hexagon models the kinematics, dynamics and deformation of its robot arms in Matlab. TEQABLE ported the algorithms to C++ and raised their performance by a factor of 80, enough for real-time control on the target platform.

Situation
Hexagon is a world-leading manufacturer of high-precision robot arms and improves them continuously. New compensation strategies are modelled in Matlab. For control on the target platform, though, the algorithms have to run far faster than in the model.
Goal
Port the Matlab calculations of the various robot arm models to C++, accurate to ten decimal places and fast enough for the real-time demands of the control, and so prove feasibility on the target platform.
Solution
TEQABLE transferred the software classes one to one and strictly object-oriented to C++, based on the Eigen library. Verification rests on the sample-based, multiply iterative calculations of the Matlab model: regression tests compare the Matlab and the C++ implementation in a co-simulation.
Because the C++ code follows the structure of the Matlab model, later changes to the original algorithm are easy to carry over at the corresponding place.
Outcome
- Algorithms 80 times faster than in Matlab
- Feasibility of real-time control on the target platform proven
- Accuracy to ten decimal places, checked by co-simulation against the Matlab model
- C++ classes one to one with the Matlab model, so changes to the algorithm are easy to carry over

Cornel Studach
Partner