feasibility question: turning dc motor to servo?

Thank you all! I Attach my design and you could see pots beside the neck and on top of head motor. I'm thinking may be good idea to double pot per motor, then feed each pair to a filter and get rid of error, then try a PID (don't have skills for).
.....................................................................
Zoomkat,
I'd study the search, sure I must know in detail the internals of servo and hope it ends to learn to hold the load with dc motor.

PeterH,

There's nothing stopping you from putting a feedback loop on your motor control

Well, unfortunately what is stopping me is lack of skills in control theory: I've not done the homework, not finished a single control theory book (but have chosen what to read, it has matlab simulations to pass to hopefully couple theoretical understanding with some intuition). I'd give a try to the PID lib you kindly suggested but hardly imagine that in this concept any good result comes without sound theoretical background and gained intuition in putting them to work.

DVDdoug,
I want to create a friction device but have nothing to start from other than my own idea. I learned that better to find examples of others, before realizing own idea, so not to reinvent the wheel. I don't know any similar project or what to google for. If you got something, please kindly leave me some links.

Dhenry,
I have a small experience in feedback: I used an IR-range finder sensor and programmed it so that:

  1. servo on which the sensor is installed, turns right all the time until detecting an object
  2. when detected, servo turns to left edge of object until losing it, back to 1.
    The result was not bad: robot could follow the object by edge.
    I think with pots on the neck I'd have the same story: motor turns toward set point and sure won't stay on it but pass it over, then returns. The error of pot will make problems I think.
    ==================================
    Design:

ironbot, do you have some kind of continuously-rotating pots? Most have somewhat less than 360° of rotation before they hit an internal stop. If you are gearing your motor to your pot with a 1:2 ratio, your motor will not be able to move more than 180° before it hits the stop in the pot.

Rotary encoders would allow a full 360°with the added bonus of a digital output. Although exactly type depends on how much you are willing to spend. There rotary encoders specifically designed for use with motors but expect to pay between $30 to over $100 (at least for low volume orders) a piece. There are others intended for much lighter duty, like input knobs those can be less than a $1.00. Here's some of the selection avaialble at from one major supplier.

ironbot:
PeterH,

There's nothing stopping you from putting a feedback loop on your motor control

Well, unfortunately what is stopping me is lack of skills in control theory: I've not done the homework, not finished a single control theory book (but have chosen what to read, it has matlab simulations to pass to hopefully couple theoretical understanding with some intuition). I'd give a try to the PID lib you kindly suggested but hardly imagine that in this concept any good result comes without sound theoretical background and gained intuition in putting them to work.

You may be surprised how easy it is once you have got your head around the basic concept. Instead of giving a movement command and assuming that the actuator ends up in the correct position, you find the current position and compare it to the desired position and tell it to move in the right direction. This is basically all you are trying to achieve. The PID algorithm is a feedback algorithm that works very well in a wide variety of situations which is why it is so popular. As well as dealing with the position, it also deals with the speed and acceleration which I suspect will be important to you when you're trying to move and position elements with a lot of inertia.

PeterH,

You may be surprised how easy it is once you have got your head around the basic concept.

This really helps to not to fear to give it a try yet before reading the control theory book, thanks :slight_smile:
Could you please point me to any tutorial/example project, where I can implement any simple movement (a line follower, or any other thing) isolated from my own project, toward known, target results (already achieved by the tutorial / example project) to develop some skill?

I have already tried "Arduino PID" on google and there lots of examples, but getting direction from you is the point.

Tylernt, Far-seeker:
My pots are ordinary under 1$, the neck and head motor both will have less than 180deg. movement.

The state of neck and head (turning left or right, up or down) will be reported by pot for the process and by limiting micro switches for end points so this should not be a problem. I first added micro switches and implemented them, then I had a problem with debouncing and turned to forum and made a post some days ago. Got great new ideas like always. Now in redesigning (will use debouncing with flip-flop chip this time, as suggested by community people).

Any comment will be greatly welcomed.

I suspect you will find some useful stuff here... http://www.openservo.com/

Thank you, indeed!

ironbot:
Tylernt, Far-seeker:
My pots are ordinary under 1$, the neck and head motor both will have less than 180deg. movement.

The state of neck and head (turning left or right, up or down) will be reported by pot for the process and by limiting micro switches for end points so this should not be a problem. I first added micro switches and implemented them, then I had a problem with debouncing and turned to forum and made a post some days ago. Got great new ideas like always. Now in redesigning (will use debouncing with flip-flop chip this time, as suggested by community people).

Well for less than a full circle you a rotary encoder can still offer better precision then the setup you describe, but the much greater cost of a precise rotary encoder means the potential improvement is probably not worthwhile.

Hi, just wanted to add some comment not directly connected to the issue.
i have been working with an industrial robotic arm for some time now. The industrial solution for your issue is by having a high ratio gear motor with high friction. the added friction coupled with a high gear ratio (1:100) improves the precision and reduces the gravity pull effect. in addition you need a high freq control loop to keep the arm well position and in high control. additionally it is common to add a low voltage break. meaning that if your power is cut out your breaks jump in.
hop it helped.

well, I used the system in this following way:

  1. the left-of-neck limiting switch was triggered, so robot knows that could only turn right
  2. the set-point of turning write is chosen,
  3. motor is commanded to turn, and reading pot, until pot<=x (x being the set-point)

I actually tested this system and not that bad, but one thing is really awful and that is the main concept I was for: keeping the load.

If I command motor (still not by PID) to keep on a position, say, if potx turn left, the noisy movement is not only coming from the fact that I didn't use a PID, but also from the pot being a <1$, too noisy type.

I guess - and look for your kindly guides to get sure - that beside PID I must change to a pot type which is less noisy but same time not on cost of 30$ as the question was "turning dc motor to servo", to try to pay less than the servo cost.

Now if the original question is someway wrong (impossible to turn dc motor to hold the load like a servo but for less price), then well, I have nothing more to say, or ask :slight_smile:

Well you might be able to find pots with less noise, but I don't think a noise-free pot exists on this planet. You should add some kind of filtering or smoothing algorithm to your software code to minimize the effect.

ironbot:
If I command motor (still not by PID) to keep on a position, say, if potx turn left, the noisy movement is not only coming from the fact that I didn't use a PID, but also from the pot being a <1$, too noisy type.

Then you might want to think about a rotary encoder, but not the type specifically made for motor control. Instead there are the type made for dials, knobs, and other turnable human input devices, you can find those from $0.50 to $5.00 a piece (higher priced ones exist of course, if you could spend that kind of money you might as well get one made to work with a motor). The price will vary with due to a few different things; how many bits in the code (which determines the maximum precision), whether they are optical or mechanical (which probably won't matter in your application, but mechanical are cheaper), and overall quality of construction (i.e. how many tens or hundreds of thousands of rotations before they wear-out). Digikey, for example, has thousands different of models...

A bldc motor is an excellent rotary encoder.

Thanks I'd study what rotary encoders I can get, by the way the photo shows the machined parts. They are from a very cheap wood to just test, I plan to after corrections (changing encoders, etc.) machine final design out of plastic for inside, and from outside it will be covered by fiberglass.

Maybe entirely off track but if you want to arrange for the motor to be able to move the arm but not the arm move the motor then you could use worm and wheel gearing. This will also give a high mechanical advantage to the motor which could be smaller than otherwise required. But you would have to think about how fast you want the arm to move etc.

But, I have no idea how to build a miniature brake.

Use a small clamp and pencil eraser? It'd need a motor/servo to grip and release.

JohnHill,
Yes worm is good, and this is actually a neck, so it is necessary that it moves slowly.

GoForSmoke,
Well I'm not really sure I could use a pencil there. Also, if to use a servo to be a brake for a dc motor with the aim of making the dc motor function as a servo, then it seems to be better to forget that and use 1 servo from the beginning. I'm still looking if I can put my cnc machine to use for Arduino robot and create mechanical advantage so hopefully: use those 8$ dc motors, some cnc machined mechanics (may be a solenoid) and get a servo-mechanism for neck, which costs in whole less than a 15$ hs-422. This may be a closer formulation of my initial goal.

See if you can turn the CNC into a 3D printer instead. Then make a 3D scanner.

This Arduino robot won't leave time to do that, so will continue completing it and researching needed mechanisms, thanks.