FAQFAQ   GalleryGallery   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   Forum RSS Feed   Hacked Gadgets Main Site 

Programmed motor control application questions

 
Post new topic   Reply to topic    Hacked Gadgets Forum Index -> Electronic Help
View previous topic :: View next topic  
Author Message
walter23
Newbie


Joined: 24 Feb 2009
Posts: 1

PostPosted: Tue Feb 24, 2009 2:26 am    Post subject: Programmed motor control application questions Reply with quote

I'm trying to learn how to build the following device (which sounds pretty simple in principle), and I'd appreciate any advice you can give - I'm not really sure what to learn and what sorts of systems to focus on: which microcontroller platform would be best, how to interface it to the specific inputs & outputs I have in mind, etc. I'm a novice here, but I have some basic electronics knowledge and I can program just fine Smile I just don't know how to assemble hardware that I can program to accomplish a relatively simple physical task!

Anyway, the application:

I need a simple system to run two or three programs of simple pre-set movements (probably with stepper motors) on a 2D stage (probably moved about with lead screw / worm drives, but that's an open question at the moment). The programs will probably have dedicated push buttons; e.g. hit button 1 and you execute program 1. There will probably just be three of them, plus maybe an abort button.

Think of this as almost a CNC device, but 2D and without any complex programs and no connection to a controller computer. I basically just need it to scan over an area and perform a simple action at each position. The action will be the activation of an external device which can be accomplished with some kind of switch to close an external circuit (maybe a relay, or maybe there's something better)? The programming will be very simple as outlined by this pseudocode:

while X < maxX:
( while Y < maxY:
goto X,Y
activate_an_external_device
Y = Y + Yincrement)
X = X + Xincrement

The main program loop would wait for button presses and then set up a different set of X,Y, maxX, maxY and increment values then run that movement loop. I'm not too worried about sorting out the details of the motion, as once I figure out how to setup the circuits and the programming syntax I can work out the details of stuff like conversions from stepper motor activations (pulses?) to actual linear travel distances, speed & delays, etc... no worries there.

Anyway, my questions are:

1. Should I look for dedicated stepper motor controllers or is it more economical given my simple application to write code to drive the motor directly from the microcontroller which also houses the main program loops?

2. What PIC chip (or other microcontroller?) would be best suited to my simple application?

3. The motors need to move approximately a 1.5 pound load horizontally and vertically, but over very small travel distances (the boundaries are on the order of 15 cm or less). Does this load requirement impact my selection of controller & motor combination? Obviously I need the right kind of torque. How does this impact my power supply options? I'd ideally like this to be completely self contained. If I need a large battery to run a motor with enough torque maybe I should just forget about a microcontroller and run the thing from my laptop with a USB stepper motor interface like the CNC people use?

In short, the outputs are: 2 motors for X,Y positioning (I assume stepper motors for precise control). 1 relay or something to activate the external device.

The inputs are: most likely a couple of home position switches so the device can reset itself to a zero position. Three push button switches, each one of which activates a program, plus an abort switch (I guess this could be omitted and the program could test for any switch press during an active run and interpret that as an abort command).

This is as far as my knowledge goes right now! Can someone point me in the right direction? Remember that I'm a bit of an electronics moron, even recommendations for a good book on circuit design would be useful.. but I'm not planning to be a serious electronics hobbyist and if I can accomplish this without have to spend too much time digging into circuit design principles I'll be perfectly happy. That may sound kind of lame but I really just have this one very specific application and I don't much care how I accomplish it as long as it's inexpensive and reasonably quick. I don't mind devoting a few weekends to it though, and in fact I expect to.
Back to top
View user's profile Send private message

Alan
Site Admin


Joined: 29 Jan 2006
Posts: 1399
Location: Winnipeg, MB

PostPosted: Wed Mar 04, 2009 3:19 pm    Post subject: Re: Programmed motor control application questions Reply with quote

walter23 wrote:
I'm trying to learn how to build the following device (which sounds pretty simple in principle), and I'd appreciate any advice you can give - I'm not really sure what to learn and what sorts of systems to focus on: which microcontroller platform would be best, how to interface it to the specific inputs & outputs I have in mind, etc. I'm a novice here, but I have some basic electronics knowledge and I can program just fine Smile I just don't know how to assemble hardware that I can program to accomplish a relatively simple physical task!

Anyway, the application:

I need a simple system to run two or three programs of simple pre-set movements (probably with stepper motors) on a 2D stage (probably moved about with lead screw / worm drives, but that's an open question at the moment). The programs will probably have dedicated push buttons; e.g. hit button 1 and you execute program 1. There will probably just be three of them, plus maybe an abort button.

Think of this as almost a CNC device, but 2D and without any complex programs and no connection to a controller computer. I basically just need it to scan over an area and perform a simple action at each position. The action will be the activation of an external device which can be accomplished with some kind of switch to close an external circuit (maybe a relay, or maybe there's something better)? The programming will be very simple as outlined by this pseudocode:

while X < maxX:
( while Y < maxY:
goto X,Y
activate_an_external_device
Y = Y + Yincrement)
X = X + Xincrement

The main program loop would wait for button presses and then set up a different set of X,Y, maxX, maxY and increment values then run that movement loop. I'm not too worried about sorting out the details of the motion, as once I figure out how to setup the circuits and the programming syntax I can work out the details of stuff like conversions from stepper motor activations (pulses?) to actual linear travel distances, speed & delays, etc... no worries there.

Anyway, my questions are:

1. Should I look for dedicated stepper motor controllers or is it more economical given my simple application to write code to drive the motor directly from the microcontroller which also houses the main program loops?

2. What PIC chip (or other microcontroller?) would be best suited to my simple application?

3. The motors need to move approximately a 1.5 pound load horizontally and vertically, but over very small travel distances (the boundaries are on the order of 15 cm or less). Does this load requirement impact my selection of controller & motor combination? Obviously I need the right kind of torque. How does this impact my power supply options? I'd ideally like this to be completely self contained. If I need a large battery to run a motor with enough torque maybe I should just forget about a microcontroller and run the thing from my laptop with a USB stepper motor interface like the CNC people use?

In short, the outputs are: 2 motors for X,Y positioning (I assume stepper motors for precise control). 1 relay or something to activate the external device.

The inputs are: most likely a couple of home position switches so the device can reset itself to a zero position. Three push button switches, each one of which activates a program, plus an abort switch (I guess this could be omitted and the program could test for any switch press during an active run and interpret that as an abort command).

This is as far as my knowledge goes right now! Can someone point me in the right direction? Remember that I'm a bit of an electronics moron, even recommendations for a good book on circuit design would be useful.. but I'm not planning to be a serious electronics hobbyist and if I can accomplish this without have to spend too much time digging into circuit design principles I'll be perfectly happy. That may sound kind of lame but I really just have this one very specific application and I don't much care how I accomplish it as long as it's inexpensive and reasonably quick. I don't mind devoting a few weekends to it though, and in fact I expect to.


Sounds like an interesting challenge. Since you need to move a fairly heavy load you could make your own unipolar stepper controller but if budget is not a concern you could just purchase a controller and feed it step controls from a microcontroller.

Almost any controller will handle this challenge. Since you don't need any analog I would go with the PIC 16f628, it is cheap and powerful enough for this challenge.

Motor selection will depend on what type of lead screw is used, more turns per inch would mean it would move slowly but be easier for a smaller motor to turn.

Have a look at some of the threads over at CNC Zone, these guys live this type of application every day. Smile
http://www.cnczone.com/
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Hacked Gadgets Forum Index -> Electronic Help All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group