Optimal control for Hamiltonian parameter estimation in non-commuting and bipartite quantum dynamics