Cheap Electric Motor Speed Control ($10, 4HP, Arduino, PWM)
by Undead_Engineering in Workshop > Electric Vehicles
9736 Views, 70 Favorites, 0 Comments
Cheap Electric Motor Speed Control ($10, 4HP, Arduino, PWM)
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
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
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
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.