This project came to life as a project in control class. It is supposed to discharge a battery at a constant current or power via an mosfet. It got a USB connection which allows the control via an virtual serial port. This function is not implemented due to time restrictions.
The constant current discharge hower works, but needs to be set to a fixed value by hardcoding it into the program.
The controller is a PI controller, and a logarithmic function in order to linearize the mosfet.