Pages: [1]   Go Down
Author Topic: (RPM) output 1600 pulses = 1 RPM  (Read 667 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey Guys,

I am working with a Stepped Motor connected on arduino pin. i am wondering how i can used analog input with potentiometer to speed up the motor out 1600 pulses = 1 RPM. and display the "RPM" on Serial Communication?   smiley-roll-blue


How is that? smiley-grin

Darwin.



Logged

Copenhagen, Denmark
Offline Offline
Edison Member
*
Karma: 32
Posts: 1206
Have you testrun your INO file today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The usual Stepper library is blocking, that is, it will not continue until it has given the number of steps.

The solution is a loop that closely resembles the "BlinkwithoutDelay" example. Instead of togging pin13 you call step(1) whenever the "millis()-timer" differnece exceeds the timing threshold. In the loop you also do a an analog read on every pass and calculate an updated value for the timing threshold.

Do not call Serial.print on every pass. This takes too much time. Only call it every 1000 millisec (which means you have another section with another timer that triggers once a second - have a look at  Blink Two LED without delay)

Enjoy
Logged

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1024
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How is your stepper connected? how does your driver work? need a few more details.
Logged

0
Offline Offline
Shannon Member
****
Karma: 201
Posts: 11744
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Provide _all_ the details you have...  The exact motor (datasheet link if possible), its driver (datasheet link if possible), power supply, how its all connected (full circuit diagram is possible).

When you say "1600 pulses = 1RPM" do you actually mean "1600 pulses per revolution" ?  And its not clear if you want to change this ratio, provide more pulses per second, or what...  You perhaps should break down your problem into separate issues (analogRead and potentiometer is one, driving the motor is another).
Logged

[ I won't respond to messages, use the forum please ]

Pages: [1]   Go Up
Jump to: