PWM Controller

The PWM Controller is the electronics portion of the motor controller.

The block diagram of the PWM Controller is shown below:

The PWM Controller has two DC power supply regulators, i.e. 5V and an isolated 12V power supply. The Accelerator voltage (0V to 5V) is fed to the PWM Micro Processor. The resulting PWM signal is connected to the Opto-coupler 1 input to provide isolation from the EV high voltage battery. The Opto-coupler 1 output is supplied to the MOSFET gate driver circuit. The PWM pulses are shaped and amplified here to drive the ten MOSFETs. A Temperature sensor is connected to the PWM Micro Processor. If the temperature is too high on the Mosfet Heatsinks, the PWM signals to the Mosfets will be zeroed. An over current signal is also supplied from the Current Sensor Circuit to the PWM Micro Processor. When over current occurs the PWM signals to the Mosfets will be disabled for a fixed period. (e.g. one second).

The Power Supply circuit is shown below:

The PWM Micro Processor circuit is depicted in the next picture:

The PWM Micro Processor is based on the ATmega8 processor.

The program is written in Basic Language. The listing is given below.

PWM Controller Software Listing :

The program was created and compiled with BASCOM AVR and the programmer used is the USB-ISP programmer, both available from

The heatsink temperature of the MOSFETs is measured with the aid of a temperature sensor IC. The output of this sensor is fed to the PWM Micro Processor which will stop the PWM signals going to the MOSFET gates until the temperature returns to normal. The software can be set for a safe temperature.

The Opto-Coupler1 and MOSFET driver circuits are shown below:

A safety relay is provided to ensure that when the Accelerator voltage is zero, the MOSFET gate voltage is also zero.

This no-clutch conversion requires large current when the motor RPM is low. (low EMF). Due to the PWM technique used the peak currents through the MOSFETs will be proportional to the PWM ratio. (large current x 10 for the first accelerator posision). (There are 10 Accelerator positions.). Therefore, to prevent over current on the Mosfets, the software program fixes the PWM ratio for the first three Accelerator positions to 1/4. This prevents the peak current to exceed 4 times the required current. T1 and T2 is in the ratio of 1 to 4 as shown below.

This PWM ratio is too high for smooth take-off and therefore the software program will switch this PWM signal on and off at a ratio of T3/T4 as shown in the picture. This ratio is varied from 1/4 to 1/2 to 3/4 for the first three accelerator posisions and then normal PWM control for the rest of the Accelerator positions.

The PWM frequency is 8 kHz and the T3-T4 frequency is 50 Hz.

The picture below shows a preliminary layout on Vero-Board. (All options implemented)