Motion control with parameter optimization by genetic algorithm