Pages: [1]   Go Down
Author Topic: Control motor speed?  (Read 4792 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,

I am very new to Arduino and I am in need of some help. I have a project for school that requires me to use a motor, to raise a platform, that will controlled by Arduino. I was curious if I could vary the speed of my motor? By this I am referring to starting at zero, ramping up to a specific speed at a moderate pace, and then slowing down to zero. I guess the easiest way to explain this is hooking up my motor to a potentiometer and moving it from off, to on, then back off again. Similar to driving miss daisy and not a rocket type of deal if you get what I'm saying. The potentiometer would be my preferred method if I could touch the board, but it has to be autonomous. Any help would be greatly appreciated! smiley

Thank you all very much,

JensAl.
Logged

New Jersey
Online Online
Faraday Member
**
Karma: 67
Posts: 3701
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

PWM is another way to achieve what you're looking for - take a look at analogWrite.
Logged

The Netherlands
Offline Offline
Edison Member
*
Karma: 50
Posts: 1673
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

PWM is superior to that potentiometer you mentioned.

Ramping up/down from/to 0 will not work like you are expecting at the moment.
It's almost impossible to predict where you will end up, but i can tell you your range will be much less than 0 - 100 (%).

I'd build a test platform and do some tests to find the best values for your application.
Logged

Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello JensAI,

Hmm.. controlling the speed of a direct current motor ( DC motor ) is of an average difficult ( at least if you want to make it really cool ).

What you can do to make it simplier is to send a PWM ( pulse width module ) to an analogOutput so it can control the speed rate of a switch. Then the switch could to turn the motor on and off


Best regards!
Logged

The Netherlands
Offline Offline
Edison Member
*
Karma: 50
Posts: 1673
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote from: Michel_NABR
What you can do to make it simplier is to send a PWM ( pulse width module ) to an analogOutput so it can control the speed rate of a switch. Then the switch could to turn the motor on and off

I don't follow this.
You like to send a pulse width modulated control signal to a switch so that switch switches slower, or what ?

What kind of switch do you have in mind that could be controlled this way ?
Please replace the word "switch" by the correct word of the component you have in mind.
I do agree any motor should not be connected directly to an Arduino pin, and assuming this is known by JensAl is a mistake.
Logged

Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry if i didn't explain it clearly.
What i mean is that JensAI should only use a PWM to control the switching frequency of a BJT (per example BC549 - general use).
The circuit  should be something like the figure attached. ( I'm sorry for HORRIBLE draw. I'm just too tired to turn on my pc and create the schematic  smiley-razz )

As the PWM goes to 100% the motor speed is at it's maximum. As the PWM goes down, so does the motor speed, until it completly stops if your PWM is zero.


ps.: BJT's are semi-conductors that can be used as a switch. Easy to find at eletronic stores (at least here in my city  smiley ).

ps2: Be sure to simulate your circuit before and check the datasheet.

ps3.: I can suggest ORCAD software for simulating (may be a bit complex for a new user but there are plently videos teaching how to use it) and i think it has student version.

You could even try one of the Demo's of Matlab's Simulink, if you or your school have the license. It's  easy to do this using Simulink with the Arduino package.

However if you got a few dollars and access to Google's Play Store, there is another option: Droid Tesla app. It's pretty easy to use and understand.


* image1.jpg (122.11 KB, 889x367 - viewed 394 times.)
Logged

Selah, Washington
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

JensAl,
What is your motor voltage and amperage? If it is less then 24v dc and 1amp you can use one of the many motor shields
based on the L293 chip. Or make your own H-bridge with transitors or mosfets which will allow you to have any voltage
or amperage. tehn you control these with PWM output which gives reversible direction control, and allows you to slowly
ramp up the speed if you need to.
Logged

Johannesburg. UTC+2
Online Online
Faraday Member
**
Karma: 99
Posts: 4416
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The circuit  should be something like the figure attached.

Not really, because the load's on the wrong side of the NPN transistor  smiley-cool

You should consider limit switches too: "bump" switches at the top and bottom of the travel to make sure it switches off and doesn't sit forever trying to grind its way through the end of the system.

The mechanical side of this project might be tricky: how are you going to get the motor to move the platform?- usual approach is some kind of travelling nut on a threaded rod, rod turned by the motor.

Edit: something like this...
« Last Edit: November 02, 2013, 01:19:20 am by JimboZA » Logged

The Elders of the Internet know who I am
I'm on LinkedIn: http://www.linkedin.com/in/jimbrownza

Selah, Washington
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

JensAl,
Another idea is have you thought of using a stepper motor. Using a stepper with a threaded rod as JimboZA mentioned
 is how most CNC and 3D Printers move there components around with great accuracy. I have not used them yet but
 there are plenty of examples of code around to give you a idea of how to work it.
Logged

Pages: [1]   Go Up
Jump to: