  Accurate positioning and fast traversal times determine the productivity in
machining applications. This paper demonstrates a hierarchical contour control
implementation for the increase of productivity in positioning systems. The
high-level controller pre-optimizes the input to a low-level cascade
controller, using a contouring predictive control approach. This control
structure requires tuning of multiple parameters. We propose a sample-efficient
joint tuning algorithm, where the performance metrics associated with the full
geometry traversal are modelled as Gaussian processes and used to form the
global cost and the constraints in a constrained Bayesian optimization
algorithm. This approach enables the trade-off between fast traversal, high
tracking accuracy, and suppression of vibrations in the system. The performance
improvement is evaluated numerically when tuning different combinations of
parameters. We demonstrate that jointly tuning the parameters of the contour-
and the low-level controller achieves the best performance in terms of time,
tracking accuracy, and minimization of the vibrations in the system.
