###### Abstract  
The optimal methods for the synthesis of mechanisms in rehabilitation usually require solving constrained optimization problems. Metaheuristic algorithms are frequently used to solve these problems with the inclusion of Constraint-Handling Techniques (CHTs). Nevertheless, the most used CHTs in the synthesis of mechanisms, such as penalty function and feasibility rules, generally prioritize the search for feasible regions over the minimization of the objective function, and it notably influences the exploration and exploitation of the algorithm such that it could induce in the premature convergence to the local minimum and thus the solution quality could deteriorate. In this work, a Neuronal Constraint-Handling (NCH) technique is proposed and its performance is studied in the solution of mechanism synthesis for rehabilitation. The NCH technique uses a neural network to search for the fittest solutions into the feasible and the infeasible region to pass them to the next generation of the evolutionary process of the Differential Evolution (DE) algorithm and consequently improve the obtained solution quality. Two synthesis problems with four-bar and cam-linkage mechanisms are the study cases for developing lower-limb rehabilitation routines. The NCH is compared with four state-of-the-art constraint-handling techniques (penalty function, feasibility rules, stochastic ranking, \(\epsilon\)-constrained method) included into four representative metaheuristic algorithms. The trace package is used for both the algorithm settings and neuronal network training to fairly and meaningfully compare through statistics to confirm the overall performance. The statistical results confirm that, despite changes in the rehabilitation trajectories, the proposal presents the best overall performance among selected algorithms in the studied synthesis problems for rehabilitation, followed by penalty function and feasibility rule. os 2022  
Numerical methods are frequently used to solve complex problems in the optimal synthesis of mechanisms. These can be classified into indirect and direct search methods [9]. The indirect search methods require derivatives of both the objective function and constraints presenting issues when the optimization problem is non-continuous and in the case of highly nonlinear spaces (the obtained solutions converge to the initial guessing). The most popular indirect search method to solve optimal synthesis problems is the Sequential Quadratic Programming (SQP) [10; 11; 12; 13; 14]. Otherwise, the direct search methods do not require a derivative of the objective function and constraints, and the solutions are obtained heuristically [15] allowing for searching for solutions in highly nonlinear or discontinuous spaces. The direct search methods such as metaheuristic algorithms are currently used to solve the synthesis of mechanisms problems because they are based on a set of solutions called population such that the initial guessing does not influence the obtained solutions. The metaheuristic algorithms are inspired in biological systems as the Genetic Algorithm (GA) [16], Differential Evolution (DE), Malaga University and Mechanism Synthesis Algorithm (MUMSA) [17], in social phenomena as the Particle Swarm Optimization (PSO) [18], inspired by musical composition as the Harmony Search (HS) [19] or in physics as the Inclined Planes Optimization (IPO) [20]. Among these algorithms, GA, DE, PSO, and MUMSA are usually implemented to solve synthesis problems, finding better solutions than indirect search methods in the synthesis of mechanisms [3; 7; 21; 22; 23]. On the other hand, the original versions of metaheuristic algorithms solve unconstrained optimization problems. Nevertheless, the mechanism synthesis problems are formulated as optimization problems with inequality constraints requiring not only the selection of optimizers that search in high nonlinearity objective space, but also the ways of finding into the complex search shapes enclosed by constraints.