How can I charge an Android phone while it's controlling my 3D printer?
See elsewhere on StackExchange:


Electronics:


Can an Android tablet serve as USB Host and be charged simultaneously through a single port?

Android Enthusiasts


Using an OTG cable while charging
USB charging in host mode [duplicate]



You certainly can charge whilst in host mode, but some re-wiring will be required.

From the SE.Electronics link


  Apparently it is possible to charge the Host-Device! -->
  http://en.wikipedia.org/wiki/USB_On-The-Go
  
  Under "OTG Micro Plugs" it says that a USB OTG cable with a 36.5 kΩ
  resistor between Pin 4 (I suppose its pin 4) and Pin 5 allows you to
  connect a B-Device (Slave) and (!) a Charger to the Smartphone/Tablet.
  The Phone and the B-Device can be supplied by the external power
  source.
  
  USB-Power Specifications:
  http://www.usb.org/developers/devclass_docs/batt_charging_1_1.zip


and 


  I just sifted through the docs because I didn't trust Wikipedia's implicit data on which of the three resistances I should use. Here you can find the official Battery Charging v1.2 Spec and Adopters Agreement: usb.org/developers/docs/devclass_docs In this case you want 124kΩ, because you want the OTG device (=tablet) to be the A device (=host). 


Here are the schematics: