problem with Schottky Diode in motor controller circuit
You probably need to add a couple of diodes so that forward current can come from either the battery or the supply but reverse current (i.e. that generated by the motor) only goes to the battery.

If you had a better schematic we could more easily help.