Analogwrite and motor controller

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Analogwrite and motor controller

Postby keith.liu » Tue May 15, 2012 5:36 am

Hi all,

I'm new to Arduino. I'm trying to start my first Arduino project which aims to control a 0.8kW motor simply by a few buttons.

I have been reading the Arduino Cookbook published by O'reilly and try to understand the attached circuit it recommends. Before start purchasing hardware and components, I should resolve the 2 questions below first:

1. according to the attached circuit, I don't understand how Analogwrite() command could control the speed of the motor. Correct me if I'm wrong: the Analogwrite() would generate signal with a fixed frequency to the transistor, and I don't understand how the signal control the power that motor receives which determine the motor speed.
2. Since I'm going to use a 0.8k W motor, I'm sure I need a shield. However, would the attach circuit still valid/practical? would I need a relay, or anything else?

I would appreciate any comments. Thank you so much!!

keith
Attachments
circuit.png
circuit.png (35.11 KiB) Viewed 527 times
keith.liu
 
Posts: 2
Joined: Tue May 15, 2012 5:19 am

Re: Analogwrite and motor controller

Postby adafruit_support_bill » Tue May 15, 2012 6:07 am

1. according to the attached circuit, I don't understand how Analogwrite() command could control the speed of the motor. Correct me if I'm wrong: the Analogwrite() would generate signal with a fixed frequency to the transistor, and I don't understand how the signal control the power that motor receives which determine the motor speed.

Analog write generates a signal with a fixed frequency, but a varying duty-cycle (i.e. the percentage of time it spends in the "ON" state). The transistor uses that signal to switch power to the motor and the motor speed is proportional to the duty cycle.
Code: Select all
2. Since I'm going to use a 0.8k W motor, I'm sure I need a shield. However, would the attach circuit still valid/practical? would I need a relay, or anything else?

You don't mention the voltage, but 800 watts is too much for the Adafruit motor shields. If it is one of the 36v electric scooter motors, you will need a driver capable of at least 23A. The attached circuit could be beefed up with higher-capacity switching transistors & heat sinks, but it will not give you direction control - and it has no fuses for safety either. 22A is is a lot of current to be working with. I would recommend investing in a controller designed to handle such currents. The MegaMoto unit from RobotPower works with an Arduino and handles up to 25A: http://www.robotpower.com/catalog/
User avatar
adafruit_support_bill
 
Posts: 16072
Joined: Sat Feb 07, 2009 9:11 am

Re: Analogwrite and motor controller

Postby keith.liu » Wed May 16, 2012 1:26 am

Thanks for your advise it gives me big hints!

I should really consider a motor at 250 - 500W with perhaps 24V battery, and try it out with the MegaMoto shield you suggested. What I want to do ultermately is to build a sensor-based electric scooter for me and my son!

Thanks for reminding me about the fuses, heat sink and scaling up the transistor. As a start, I decided to make the motor turns only to one direction, so the circuit should be fine.

Great, i think the next step is to refine the diagram with your suggestion (adding fuses etc) and do the boring calculations (get the right numbers for the transistor, capacitor, etc)!

Please let me post further question in the future. Thanks for your help again!
keith.liu
 
Posts: 2
Joined: Tue May 15, 2012 5:19 am

Re: Analogwrite and motor controller

Postby adafruit_support_bill » Wed May 16, 2012 5:30 am

You are welcome to post any time. Post photos of your scooter too!

If you are building your own motor controller, you might want to review the OSMC (Open Source Motor Control) project: http://www.robotpower.com/osmc_info/
User avatar
adafruit_support_bill
 
Posts: 16072
Joined: Sat Feb 07, 2009 9:11 am


Return to Arduino

Who is online

Users browsing this forum: No registered users and 7 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [108]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[31]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[34]
LCDs & Displays[48]
Components & Parts[70]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[111]
 
Wireless[14]
Cables[62]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]