During sleep, the brain undergoes dynamic and structural changes. In Drosophila, such changes have been observed in the central complex, a brain area important for sleep control and navigation. For navigation, the structure and function of the central complex suggest a relationship to ring attractors, networks that model head direction. This raises the question about a similar structure-function relationship for sleep control.Motivated by experimental findings, we develop a ring attractor model that maintains activity at a setpoint in the face of plasticity. In this model, an integrator of sleep drive emerges with a functional role in stabilizing the network. Nevertheless, the network becomes unstable over extended wake time. Therefore, a sleep phase is introduced where autonomous attractor dynamics, related to its activity during wakefulness, reset the network. The proposed integration of sleep and head direction circuits captures features of their neural dynamics observed in flies and mice during wakefulness and sleep.Author SummaryIn Drosophila, the study of sleep and the study of navigation are largely disconnected fields, even though the same brain structures and connected neural circuits are important for the two different functionalities. Motivated by experimental results from both fields, we use theoretical modeling to describe the coupled dynamics of sleep and navigation circuits and propose a rationale for why they interact. The resulting model can incorporate and explain several experimental findings about sleep and navigation in flies and mice. The model is based on a ring attractor network which is combined with plasticity rules that change between sleep and wake phases and shows autonomous dynamics during sleep, reminiscent of observations in the head direction system of mice.