The concepts of Model Predictive Control (MPC)¨ and Moving Horizon Estimation (MHE) received wides pread acceptance in both industry and academia. Th is is due to the ability to explicitly define obje ctives and constraints in the framework of dynamic ¨optimization. Those key facts eventually lead to¨ improved control performance. Progress in the area ¨of optimization algorithms and computational hard ware in the last two decades have extended the app licability of numerical optimization to mechatroni cs applications. In particular, the applicability¨ was extended for small-scale systems with time con stants in micro- and millisecond range. Following¨ the success convex quadratic programming (QP) solv ers made in linear MPC, the ideas have been extend ed for nonlinear MPC and MHE. This thesis ai ms to further reduce the gap between academia and¨ industry. With optimized software for nonlinear MP C and MHE and extended problem formulations we can ¨efficiently handle complex nonlinear systems, pos sibly working under nonlinear constraints. We pres ent recent extensions to the ACADO Code Generation ¨Tool (CGT). Once specified, the problem structure ¨is exploited offline by the tool that generates t he tailored code optimized for execution in real-t ime environments. We demonstrate the strength of t he newly developed features of the tool in numeric al simulations and two real-world applications. Our numerical simulations show readiness ¨to effectively treat problems on both short and l ong horizons. For the systems with a few states an d few controls solution times in the microsecond r ange are observed. Our largest test case involves¨ an MPC formulation comprising 33 states, 3 control s, and a prediction horizon of 50 steps. This ¨test case comprises 1800 optimization variables a nd is possible to solve on modern hardware in unde r 50 milliseconds. For another test problem where¨ long prediction horizons are the necessity, we obs erve solution times less than 4 milliseconds in a¨ test case with the horizon of 150 steps. The first experimental study is the application ¨of nonlinear MPC and MHE to a laboratory scale overhead crane. Here we present computational perfor mance of two generations of the ACADO CGT. Using t he original implementation of the tool and only an ¨MPC controller in the first control scenario, we¨ achieved execution times close to 1 millisecond. W ith the recently optimized code, we attained nearl y the same execution times, now with both nonlinea r MHE and the MPC in the loop. In addition, with t he more optimized code we reached average runtimes ¨for the nonlinear MPC three times faster than wit h the original implementation. The aim of th e second real-world application is to validate the ¨computational performance of the auto-generated M HE and MPC solvers on an experimental setup for ro tational start-up of an airborne wind energy syste m. The system model describes complex nonlinear dy namics comprising 27 differential states, 1 algebr aic state and 4 controls. The results confirm that ¨nonlinear MPC formulation with more than 1500 opt imization variables is solved in just less than 5¨ milliseconds reducing the total feedback time to b elow 10 milliseconds.