SIGforum.com    Main Page  Hop To Forum Categories  The Lounge    Can you help me with an Arduino-driven stepper motor?
Go
New
Find
Notify
Tools
Reply
  
Can you help me with an Arduino-driven stepper motor? Login/Join 
Member
Picture of vthoky
posted
Good evening, all. I've been handed a project that involves a small stepper motor (probably a NEMA 23, bipolar) and a "cradle," for lack of a better description.

The motor's job will be to rock this cradle, so to speak, smoothly between +30° and -30° at some stated rate (degrees per second, I guess? steps per second?), for some period each day. The rate and the time period may end up being variable. In order to keep the end user from having to reprogram for the variables, I think the rate could be controlled by a potentiometer (analog input), and the time could be set using a timer such as Automation Direct's MS4SM series.

Basic example:
* Start at "position zero"
* rotate at one degree/step per second to +30°.
* pause for 1 second
* rotate back to zero and then to -30°.
* pause for 1 second
* rotate back to zero
* repeat for 30 minutes, ending at position zero.

I have a stepper driver on order, but prior to it getting here I have wondered if I can run this using an Arduino. I have an Arduino on hand, and at least one Seeed Studios motor shield. I have a stepper on hand. I have a power supply. What I don't have is experience programming Arduino or using steppers.

Anyone here used an Arduino with a stepper before? Can you help me? Thank you very much.




God bless America.
 
Posts: 14047 | Location: Frog Level Yacht Club | Registered: July 15, 2007Reply With QuoteReport This Post
Shaman
Picture of ScreamingCockatoo
posted Hide Post
You'll need an encoder somewhere.





He who fights with monsters might take care lest he thereby become a monster.
 
Posts: 39895 | Location: Atop the cockatoo tree | Registered: July 27, 2002Reply With QuoteReport This Post
The success of a solution usually depends upon your point of view
posted Hide Post
Is this an existing design you are trying to automate or is it something new you are designing?

How is the motor's output applied to the cradle and what weight are you dealing with in the cradle and the cradle's contents?

SC is correct that you will need an encoder to do it the way you stated it unless you go with a bunch of sensors instead and then you'll need a PLC to run it.



“We truly live in a wondrous age of stupid.” - 83v45magna

"I think it's important that people understand free speech doesn't mean free from consequences societally or politically or culturally."
-Pranjit Kalita, founder and CIO of Birkoa Capital Management

 
Posts: 3923 | Location: Jacksonville, FL | Registered: September 10, 2010Reply With QuoteReport This Post
Member
posted Hide Post
Arduino's & NEMA stepper motors power most 3D printers. There's a ton of code samples, hell, if you bought a $10 chinese RAMPS, you could probably load 3D printer firmware & just do it in gcode (steps/mm converted to steps per degree)
How accurate do you need the 30*? endstops or just commanding the motor to move X steps would negate the need & complexity of an encoder.
 
Posts: 3340 | Location: IN | Registered: January 12, 2007Reply With QuoteReport This Post
Member
Picture of vthoky
posted Hide Post
Spinzone:
The design exists, I just have to duplicate it. Thing is, I can't get my hands on an original, so duplicating is much more difficult to do.

The output shaft will go directly to the cradle's pivot point, sort of a "direct drive" mechanism. I don't have a weight calculation yet, for two reasons: 1) my client hasn't given me the parts that go in the cradle yet, and 2) as a result, I still need to design the cradle. As a wild guess, I don't believe it will weigh even 5 pounds.

Snidera:
I'm hoping the simplicity you imply is available. If the 30° accuracy isn't terribly precise then with a 200-pulse stepper I think I could simply give it 17 pulses in each direction.
(360/200 = 1.8 --> 30/1.8 = ~17)
I'm beginning to wonder now how smoothly I can make it travel, though. I don't need for those pulses to be "jumpy."

This message has been edited. Last edited by: vthoky,




God bless America.
 
Posts: 14047 | Location: Frog Level Yacht Club | Registered: July 15, 2007Reply With QuoteReport This Post
Legalize the Constitution
Picture of TMats
posted Hide Post
Probably not [laughing out loud]


_______________________________________________________
despite them
 
Posts: 13683 | Location: Wyoming | Registered: January 10, 2008Reply With QuoteReport This Post
Cold Ass Honkey
Picture of Sig Vicious
posted Hide Post
If the 'steps' were reliably repeatable in degrees of rotation per pulse you could use a timer that was capable of resetting itself (possibly one with two dials, or knobs, for setting ON time and OFF time) then use a counter to keep track of the number of pulses (degrees of rotation) until it counts out, resets itself, and changes direction.
This would allow adjustments to be made with a minimum of training.
However, if it tends to gain (or lose) counts at end-of-travel, then you will need to add switches or the aforementioned encoder.
'


------------------------------
Never fully gruntled.
 
Posts: 2181 | Location: OR-ee-GUN | Registered: December 18, 2005Reply With QuoteReport This Post
  Powered by Social Strata  
 

SIGforum.com    Main Page  Hop To Forum Categories  The Lounge    Can you help me with an Arduino-driven stepper motor?

© SIGforum 2024