Cheap Electric Motor Speed Control ($10, 4HP, Arduino, PWM)
by Undead_Engineering in Workshop > Electric Vehicles
9685 Views, 70 Favorites, 0 Comments
Cheap Electric Motor Speed Control ($10, 4HP, Arduino, PWM)
![IMG_4994.JPG](/proxy/?url=https://content.instructables.com/FJL/W8UB/I2VLGQM5/FJLW8UBI2VLGQM5.jpg&filename=IMG_4994.JPG)
![E Pod 7, Electric car, Arduino PWM controller test 2](/proxy/?url=https://content.instructables.com/F8L/VBV2/I2VLGYI9/F8LVBV2I2VLGYI9.jpg&filename=E Pod 7, Electric car, Arduino PWM controller test 2)
I am building the worlds most efficient production electric car. Please see the website at the link below.
I want this car to be inexpensive so everyone can afford one. For this reason I am designing and building my own cheap electric motor controller. My design is to use about 10 Mosfets with PWM controlled by an Arduino to efficiently control the speed of the 10 to 20 hp motor for the car.
This first section I tested has two Mosfets on the same heat sink. I was able to test it up to 20 amp and the Mosfets only heated up to 47C. If I increase the voltage to 48V at 20A I could control 1.3HP. This controller would be perfect for a large electric bicycle or small electric motorcycle and only costs about $10 in parts.
Parts list
Controller (I used an Arduino Mega but you can use a timer switch or other micro-controller)
2 Mosfets (I used N-channel 60Volts 30Amps FQP30N06L)
Diodes (I used 4 1N5404)
Head sink (I used a large finned aluminum heat sink)
Computer fan (I used a 12V .16A PC fan)
Wire (I used 18g but 16 or 14 would be better for the high amps, 22g for signal)
Busbar
Connecting Components
![IMG_4984.JPG](/proxy/?url=https://content.instructables.com/F40/WYM7/I2VLGIXR/F40WYM7I2VLGIXR.jpg&filename=IMG_4984.JPG)
![IMG_4952.JPG](/proxy/?url=https://content.instructables.com/FS1/Z7R2/I2VLGHD1/FS1Z7R2I2VLGHD1.jpg&filename=IMG_4952.JPG)
![IMG_4953.JPG](/proxy/?url=https://content.instructables.com/F9T/OBET/I2VLGHDH/F9TOBETI2VLGHDH.jpg&filename=IMG_4953.JPG)
![IMG_4954.JPG](/proxy/?url=https://content.instructables.com/F44/18X2/I2VLGHEY/F4418X2I2VLGHEY.jpg&filename=IMG_4954.JPG)
![IMG_4948.JPG](/proxy/?url=https://content.instructables.com/F1J/9P4I/I2VLGHBH/F1J9P4II2VLGHBH.jpg&filename=IMG_4948.JPG)
![IMG_4946.JPG](/proxy/?url=https://content.instructables.com/FQI/Q018/I2VLGHAX/FQIQ018I2VLGHAX.jpg&filename=IMG_4946.JPG)
![IMG_4985.JPG](/proxy/?url=https://content.instructables.com/F3X/957S/I2VLGQLO/F3X957SI2VLGQLO.jpg&filename=IMG_4985.JPG)
First I soldered wires to the Mosfet leads. I bent them apart carefully so that I had space to solder.
On the gate pin I soldered a 22g wire. On the drain and source I soldered 18g wire. I put heat shrink tubing over any exposed parts all the way up to the Mosfet.
I then connected the gates, sources and drains of both Mosfets. I connected them on the busbar. I attached a 22g wire to the drain on the bus bar. The gate and drain wires were connected to a bread board. A 1k resistor was used as a pull down resistor to discharge the gate when I was not powered. The gate was then connected to digital pin 13 on the Arduino. The drain was connected to the Arduino GND pin.
Then I connect a potentiometer to the Arduino to control the speed as well as an LCD screen (optional).
I bolted the Mosfets to the heat sink after applying some thermal paste to their backs.
Arduino and Program
![IMG_4996.JPG](/proxy/?url=https://content.instructables.com/FQF/1HIG/I2VLGQNL/FQF1HIGI2VLGQNL.jpg&filename=IMG_4996.JPG)
![IMG_4995.JPG](/proxy/?url=https://content.instructables.com/FP1/2JMZ/I2VLGQN0/FP12JMZI2VLGQN0.jpg&filename=IMG_4995.JPG)
I used the Arduino digital pin 13 because it does PWM at about 1,000hz. The sound with most motors is pretty annoying but the frequency can be change if you want.
The program is very easy.
Just take in a variable from the analog pin measuring the pot. Then use this value to change the PWM duty cycle. Below is a small example of the program. The Pot uses the Arduinos 5 volt pin. The wiper on the Arduino has a voltage drop between 0 are 5 as you rotate it. The analog read function takes the voltage drop. We use this in the AnalogWrite function that will create the PWM pulses.
int PWM=13
AnalogRead(Pot);
AnalogWrite(PWM, Pot/4);
Testing the Controller
![IMG_4926.JPG](/proxy/?url=https://content.instructables.com/F0E/JFRE/I2VLGHA6/F0EJFREI2VLGHA6.jpg&filename=IMG_4926.JPG)
![IMG_4997.JPG](/proxy/?url=https://content.instructables.com/FI2/IZ0X/I2VLGQP3/FI2IZ0XI2VLGQP3.jpg&filename=IMG_4997.JPG)
![IMG_4972.JPG](/proxy/?url=https://content.instructables.com/F4A/064O/I2VLGHFN/F4A064OI2VLGHFN.jpg&filename=IMG_4972.JPG)
![IMG_4976.JPG](/proxy/?url=https://content.instructables.com/FCV/8EAL/I2VLGHIY/FCV8EALI2VLGHIY.jpg&filename=IMG_4976.JPG)
I mounted a temperature gauge on one of the Mosfets and tested many different currents and monitored the temperature. I was able to run 17A for a long time and the temperature was stable at 47C. The max current was over 20A. I don't have any large motors so I used 4 12V motor and 4 light bulbs in parallel as the load. When I get my larger motor and build the larger battery pack I will start testing the larger controller for 10 to 20 Hp.
I used homemade lithium ion batteries to test my controller. I used 8 cells in parallel and up to 5 sets in series for 20V using 40 cells.
While testing around 20A I noticed my cells were getting very hot and had significant voltage sag.