A construction of commutative rings of differential operators