I need to rotate a circular device and index it at predetermined angles, hold for a few seconds, and move to the next. The problem comes in where I need some level of feedback or confidence that the positions are met before my other operations take place. I was originally targeting a simple stepper motor. The problem is, as you know, no feedback. Now, I am guessing there are some smart ways through current OL detection, etc but there will still need to be a homing routine and still a level of unknown.
I started looking around and finding DC servo motors pretty cheap. Simply apply a voltage until the proper encoder position is detected, drop power to motor, etc. I am betting I am under estimating encoder A/D though. I am most familiar with analog output optical encoders. Obviously do not need 2000-4000 lines for this! My positions are about every 24* with a repeatability of .5*, motor speed not to exceed 30rpm. That might be a pulse train of 500hz back to a controller
I am really hoping to use only a couple channels of an encoder and do everything from the Arduino chip. Anything more just seems like WAY overkill for this project. I am already having a hard time floating. I know from the CNC world that encoder feedback usuallyrequires a separate card that does nothing but process encoder data and send positional commands to the control. I am hoping to avoid that unless I am taking the hard road by doing that.
Index a motor with Arduino
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Index a motor with Arduino
If there are not too many positions, you might consider using an optical slot sensor at each position.
-
- Posts: 7
- Joined: Thu Oct 04, 2012 4:00 pm
Re: Index a motor with Arduino
I was looking at exactly that. My only reserve in that method is I would have to buy another sensor and custom make a corresponding index wheel which would essentially mount on the back of the motor and act the same as an encoder. I guess that is why I started thinking more about the encoder. Just seems I would be doing a "K mart" build by using the optical interrupt as opposed to an encoder.
however, I have the means the make the custom wheel if that will really help dump this down.
Is there possible another sensor I could use if I could add magnets or something at each position on the actual rotating device? I am really trying to keep this simple and this would eliminate the need for a custom wheel. I would have to machine in each of the position holes anyway so it would be nothing to add some type of tab, magnet hole, etc at each index angle. There will likely be a total of 15 positions.
however, I have the means the make the custom wheel if that will really help dump this down.
Is there possible another sensor I could use if I could add magnets or something at each position on the actual rotating device? I am really trying to keep this simple and this would eliminate the need for a custom wheel. I would have to machine in each of the position holes anyway so it would be nothing to add some type of tab, magnet hole, etc at each index angle. There will likely be a total of 15 positions.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Index a motor with Arduino
Knowing a bit more about the application would make it easier to offer advice. If you can attach tabs/flags to the device, you could use a single slot sensor. Alternately, you could paint or glue black & white targets to the device and use a reflective optical sensor. Magnets and a hall sensor might work too if the diameter of the rotating device is large enough. (All these sensors will give you better angular precision the further they are from the axis.)
Currently on a similar project (rotary sample carousel for a medical instrument) I have a geared stepper and a slot sensor with a 'home' flag. It is 'homed' at startup and the stepper is over-specced by a safe margin to guarantee no lost steps in normal operation.
Currently on a similar project (rotary sample carousel for a medical instrument) I have a geared stepper and a slot sensor with a 'home' flag. It is 'homed' at startup and the stepper is over-specced by a safe margin to guarantee no lost steps in normal operation.
-
- Posts: 7
- Joined: Thu Oct 04, 2012 4:00 pm
Re: Index a motor with Arduino
I would say my device is very similar in design. For a mental image, just imagine a record player where I need to stop the record at determined angles, constantly. As mentioned though, adding flags will further complicate this design so I would prefer something maybe a touch easier if I can get away with it. However, it is hard to argue the $2.50 sensor and some simple tabs.
In your design, it sounds like you home the device every rev but what about other failure conditions that could halt rotation or miss steps? If I use something that verifies position at every angle, I am them left to wonder what motor to use. Would a stepper still be a good selection in that it can hold position? My thoughts were to just stop power to the motor when sensor position input is received but that would not hold position. That that I have much load and probably similar to your med device, I just want it to stay. Even a gear motor could probably work for that I guess. I just don't want to over complicate.
In your design, it sounds like you home the device every rev but what about other failure conditions that could halt rotation or miss steps? If I use something that verifies position at every angle, I am them left to wonder what motor to use. Would a stepper still be a good selection in that it can hold position? My thoughts were to just stop power to the motor when sensor position input is received but that would not hold position. That that I have much load and probably similar to your med device, I just want it to stay. Even a gear motor could probably work for that I guess. I just don't want to over complicate.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Index a motor with Arduino
No. Just at startup of the instrument - or in the event of some serious error that requires re-initialization of the instrument.In your design, it sounds like you home the device every rev
Given the motor specs and gear ratio, it would take a major fault (like jamming a wrench in the works) to cause missed steps. Being a geared motor, there are hundreds of steps between positions and it would take a lot of missed steps to cause an alignment error serious enough to disrupt operation. Any failure serious enough to prevent aspiration of a sample would ultimately result in re-initialization of the instrument.but what about other failure conditions that could halt rotation or miss steps?
-
- Posts: 7
- Joined: Thu Oct 04, 2012 4:00 pm
Re: Index a motor with Arduino
Huh, I guess that could be about where I am at now. Deciding if I really NEED to do anything more than just create a home switch to initialize and use a stepper. Geared steppers are cheap enough. With a stepper, I had planned to add a current monitor to add a fault condition in over current. I guess since missed steps and overload play together, maybe that current monitor is all I need. Maybe I can also use a current monitor to look at a MINIMUM current as well to verify that the motor is working?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Index a motor with Arduino
A current monitor isn't going to be much help with a stepper. Unlike DC motors, the current draw is pretty much constant regardless of load.
Part of the design process is the risk analysis. What kinds of failures can you anticipate? How can you detect them and what is an appropriate way to handle them? If the stepper is missing steps, there is probably a mechanical problem or obstruction that needs to be cleared.
In the case of my instrument, failure to acquire a sample generates an alarm and shuts the system down. It requires manual intervention to clear the obstruction and restart the machine.
What happens once your device is positioned? Is there any way to tell if it is positioned properly? What is the appropriate action if it is not?
Part of the design process is the risk analysis. What kinds of failures can you anticipate? How can you detect them and what is an appropriate way to handle them? If the stepper is missing steps, there is probably a mechanical problem or obstruction that needs to be cleared.
In the case of my instrument, failure to acquire a sample generates an alarm and shuts the system down. It requires manual intervention to clear the obstruction and restart the machine.
What happens once your device is positioned? Is there any way to tell if it is positioned properly? What is the appropriate action if it is not?
-
- Posts: 7
- Joined: Thu Oct 04, 2012 4:00 pm
Re: Index a motor with Arduino
Ah, I did not know that about steppers. I am more familiar with servos and they certainly raise current under load.
I did not realize you had a sort of "in position" check. That would sure help. My device is carting around "priceless" goods but I certainly don't want a situation where if it gets in a bind, it applies more torque. I want it to stop and fault out so the impedance can be corrected. Under normal operation, very little torque is needed. I don't have a specific number but most is just inertia.
So I have a low torque application that requires some way to fault out in an over torque or not spinning condition.
I did not realize you had a sort of "in position" check. That would sure help. My device is carting around "priceless" goods but I certainly don't want a situation where if it gets in a bind, it applies more torque. I want it to stop and fault out so the impedance can be corrected. Under normal operation, very little torque is needed. I don't have a specific number but most is just inertia.
So I have a low torque application that requires some way to fault out in an over torque or not spinning condition.
- wb8nbs
- Posts: 70
- Joined: Sun May 29, 2011 9:54 pm
Re: Index a motor with Arduino
I did something like that last year to automate a box joint jig. The project used a cheap powerful gear motor from a car seat. Used eight magnets in a disc and a Hall sensor to get position feedback. There is still the issue of initial calibration, but once set, the sensors track to 1/128 of an inch all the way along the 18 inch lead screw.
http://www.flickr.com/photos/wb8nbs/set ... 932588778/
http://www.flickr.com/photos/wb8nbs/set ... 932588778/
Please be positive and constructive with your questions and comments.