Adaptive internal model control: Design and stability analysis