Looking at the design of the EMW charger, and particularly the way it now uses an optocoupler to measure input mains voltage, made me think of a possibly equally cheap, but much more accurate, way to implement this function. Basically, a voltage-to-PWM circuit could drive an oprocoupler with a PWM signal proportional to voltage, and then on the isolated control side, the PWM can be filtered to an analog signal which can be read by an A/D converter, or the pulse width itself could be read and converted to a voltage reading by the microcontroller.
Here is a discussion of a simple circuit using a 555 timer:
http://www.mycircuits9.com/2013/04/pulse-width-modulation-pwm-555-timer-ic.html
The illustration shows a sinusoidal AC signal which is converted to PWM with a carrier signal generated separately (could be another 555). An AC signal of variable frequency and voltage could be generated by analog means (or a sine table in an EPROM driven by a variable clock and into a DAC). A single phase or three or more phases could be produced at whatever phase angle is desired. Then the PWM signals could be used to drive the IGBTs or MOSFETs of a motor controller.
Here is a discussion of a simple circuit using a 555 timer:
http://www.mycircuits9.com/2013/04/pulse-width-modulation-pwm-555-timer-ic.html
The illustration shows a sinusoidal AC signal which is converted to PWM with a carrier signal generated separately (could be another 555). An AC signal of variable frequency and voltage could be generated by analog means (or a sine table in an EPROM driven by a variable clock and into a DAC). A single phase or three or more phases could be produced at whatever phase angle is desired. Then the PWM signals could be used to drive the IGBTs or MOSFETs of a motor controller.