schematic and software for brushed dc motor control