General tracking control of arbitrary N-level quantum systems using piecewise time-independent potentials