Madara, along with Orochimaru, Tobirama and Kabuto know how Edo Tensei works. Madara learned about this kinjutsu from Tobirama.
So when Obito comes along, why not teach Obito how to do the Edo Tensei, then kill yourself, then Obito resurrects him, then he severs the tie with the caster and...