A central pattern generator (CPG) is a neural microcircuit of cells that are capable of producing rhythmic patterns that underlie motor behaviors such as heartbeat, respiration, and locomotion in animals and humans. These patterns do not require sensory input or external patterned inputs, but rather are an emergent property of the network. Burst firing activity is usually associated with CPG activity. In some cases intrinsically or conditionally bursting pacemaker neurons are thought to be responsible for the rhythm, whereas in other cases the basic pattern generating unit is though to be a half center oscillator in which synaptic escape or release of each oscillator in turn drives the network rhythm. Here we focus both on the mechanisms for robustness in dedicated CPGs and for flexibility in multifunctional CPGs that can produce distinct rhythms, such as swimming versus crawling, and alternation of blood circulation patterns in leeches. Robustness to heterogeneity and noise of individual modes allows for phase constancy under a wide variety of conditions. Flexibility may be attributed to switching between rhythms by input-dependent switching between attractors of the CPG. We will focus on experimental approaches, often using the dynamic clamp, combined with various mathematical and computational techniques for understanding the underlying principles sub-serving pattern generation.