Go Down

### Topic: feasibility question: turning dc motor to servo? (Read 10150 times)previous topic - next topic

#### PeterH

#15
##### Oct 06, 2012, 01:25 am

PeterH,
Quote
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.

#### ironbot

#16
##### Oct 06, 2012, 09:56 am
PeterH,
Quote
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 :-)
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.

#### ironbot

#17
##### Oct 06, 2012, 10:09 am
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.

#18
##### Oct 06, 2012, 10:13 am

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

#### ironbot

#19
##### Oct 06, 2012, 10:30 am

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

Thank you, indeed!

#### Far-seeker

#20
##### Oct 09, 2012, 05:51 pm

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.

#21
##### Oct 09, 2012, 09:29 pm
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.

#### ironbot

#22
##### Oct 09, 2012, 10:24 pm
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 pot<x turn right and just as pot>x 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

#### tylernt

#23
##### Oct 09, 2012, 10:33 pm
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.

#### Far-seeker

#24
##### Oct 09, 2012, 11:27 pm

If I command motor (still not by PID) to keep on a position, say, if pot<x turn right and just as pot>x 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...

#### dhenry

#25
##### Oct 10, 2012, 01:09 am
A bldc motor is an excellent rotary encoder.

#### ironbot

#26
##### Oct 10, 2012, 10:49 pm
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.

#### JohnHill

#27
##### Oct 11, 2012, 08:24 am
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.

#### GoForSmoke

#28
##### Oct 11, 2012, 04:11 pm
Quote

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.

2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

#### ironbot

#29
##### Oct 11, 2012, 11:53 pm
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.

Go Up