Grammatical evolution is a perspective branch of the genetic programming. It uses evolutionary algorithm based search engine and Backus - Naur form of domain-specific language grammar specifications to find symbolic expressions. This paper describes an application of this method to the control function synthesis problem. Feed-forward neural network was used as an approximation of the control function, that depends on the object state variables. Two-stage algorithm is presented: grammatical evolution optimizes neural network structure and genetic algorithm tunes weights. Computational experiments were performed on the simple kinematic model of a two-wheel driving mobile robot. Training was performed on a set of initial conditions. Results show that the proposed algorithm is able to successfully synthesize a control function. © 2017 The Authors.