We trained a planar, musculoskeletal model actuated by 18 Hill-type musculotendon actuators to walk by optimizing the parameters of a gait controller based on an objective function that sought to minimize metabolic cost, avoid falling and injury, and stabilize the head. The gait controller computed muscle excitations, u(t), for a musculoskeletal model to generate a forward simulation. Sensory feedback, based on the model’s muscle and joint states, was used in a feedback loop with the gait controller. The objective function quantified the performance of each simulation, and a Covariance Matrix Adaptation Evolutionary Strategy (CMA-ES) optimization method updated the values of the variables in the optimization problem.