Control of a robotic arm: Application to on-surface 3D-printing