# Servo/motor control/behavoir question



## major (Apr 4, 2008)

First I suggest that you read Wikipedia on stepper motor and then on servomotor. Two different animals. And maybe look into cogging or ripple torque versus pole count.

Doesn't seem EV relevant. But hope it helps.

major


----------



## no_reluctance (Mar 13, 2014)

So...I know they are different. quite different, different stators, different rotors...different control and different properties. My issue is not "what is the difference?" Rather, a particular quirk about servo operation. I was trying to illustrate a difference in their operation to help flush out my question.

The trouble is that wikipedia and indeed many more direct and application sources seem to be insufficient in answering the qestion. The closest I can get is something about servo tuning which tries to dampen the oscillation I mentioned earlier. But that oscillation seems to be a function of the distance between poles, which will only get "so" good by trying to chase the shaft signal with the motor input. 


Its not really EV relevant, I've just found the best motor knowledge-base here. 

Though, I would say its not completely irrelevant for anyone whose not appraised of the subtle differences between electric motors yet, servo's get used alot in throttles/steering.


----------



## major (Apr 4, 2008)

You seem to carry over a characteristic of stepper motors to other types of motors used in servos, many of which have non-salient construction with little to no torque dependence on shaft position or that of poles. Hence my suggestion about ripple and/or cogging torque study. 

major


----------



## no_reluctance (Mar 13, 2014)

Right, now we're getting somewhere...

Cogging, as I understand it, happens due to back EMF as the rotor in a PMDC motor crosses a winding. similar to torque ripple, a big problem with switched reluctance motors. 

But my misunderstanding here is more fundamentally wrong in some way....try as I might, wikipedia doesn't answer the question to the specificity I want to understand it. If I knew what I was missing by re-reading the basic info on common motors and terms I've already worked with for years, I wouldn't have posted. what I know is that most simpler servos are 3 or 5 pole motors. So there is between 120 and 70-80ish° degrees between the poles. the poles attract the rotor as it approaches each one, So we can control the rotor with PWM by basically just turning the motor on and off at a certain duty...or PWM as we know it. Even if we get the pwm just so that we are basically reversing the motor and driving it forward such that we have "captured" the rotor between two poles in its rotating path.....We ought to see it oscillate at whatever the PWM duty is as the feedback now begins to chase the rotor position.....and it ought to be fairly large angular momentum making it swing at least half of 80°C or roughly 40 degrees right in between two poles. This is not clogging, nor is it a property that you'd find in a stepper, which would just be "OFF" once it got to the desired angle/step...Again, as I understand it. 

Perhaps I am carrying over some salient pole understanding, could you elaborate on that?


----------



## major (Apr 4, 2008)

no_reluctance said:


> Even if we get the pwm just so that we are basically *reversing* the motor and driving it forward such that we have "captured" the rotor between two poles in its rotating path.....


There's no reversing. Servomotors are stall torque rated and can hold angular position when correctly applied. Accuracy or resolution is dependent on the angular feedback device and control system, not the pole count. BTW, motor poles always come in pairs. There are no 3 or 5 pole motors. Perhaps you should brush up on motor theory and especially on torque production. 

Sorry that I can't follow your line of thinking but it appears you see some problem which doesn't exist. 

major


----------



## no_reluctance (Mar 13, 2014)

That Right. It doesn't exist ...but I can't figure out why it doesn't exist. I agree its got stall torque holding that position. That is what observation tells us...but if its PWM controlled, The motor is neither stalling (implying load holds it in position), nor is it drawing max power (unless of course, the PWM is at 100% duty).

The other part of it is how do you get 5° angular resolution out of 3 poles? feedback has nothing to do with how the motor moves except to illustrate where it moves. The control is in how much and how often and in what order you energize the poles. So getting the shaft to the desired position has everything to do with the number of poles because you can only attract it to the nearest pole. You doubtless know that if you are not reversing the motor, then a PWM signal will only dictate the motor speed...which in this case, is less than 1 complete rotation or effectively 0.

Last thing, check me on this if you feel I don't get it but I think its fairly straightforward, torque is produced from the attraction of the rotor to the nearest pole, it is also sometimes produced when the field is carefully reversed depending on rotor position where you are now "pushing on one permanent magnet pole and pulling on the other" it is also a function of RPM. But none but 1 of those are relevant to a servo. 

There are indeed 3, 5 and many other pole configurations of motors. This is in reference to the poles present on the magnets of the rotor. not the stator poles. I'll add a link: http://www.solarbotics.net/starting/..._dcmotor2.html


----------



## major (Apr 4, 2008)

no_reluctance said:


> There are indeed 3, 5 and many other pole configurations of motors. This is in reference to the poles present on the magnets of the rotor. not the stator poles. I'll add a link: http://www.solarbotics.net/starting/..._dcmotor2.html


No, that is a 2 pole motor with a 3 slot armature. I'd look for a better place to learn motor terminology.


----------



## no_reluctance (Mar 13, 2014)

No need to be catty and resort to pedantics. For what its worth, I'm well familiar with armatures as well, and they also have windings and poles as does any magnet and electromagnet, the terms aren't exclusive the slot refers to the structure itself not its wingdings. "So since most small DC motors are of a three-pole design, let's tinker with the workings of one via an interactive animation" --literally from the link. you're not even arguing with ME at this point. Regardless what I'm asking about is not a matter of terminology. Do you know anyone with more experience than yourself that could possibly help? eldis comes to mind but he's pretty busy, I'd feel bad PMing him something that only helps my understanding.


----------



## dcb (Dec 5, 2009)

no_reluctance said:


> So since most small DC motors are of a three-pole design


The link is wrong on that account.

the field poles are the magnetising component, the armature windings are the torque component.

if you watch the javascript of the 3 winding armature, you will see that the North and South of the field is basically 90 degrees out from the North and South of the armature, always, that is a fixed relationship, the windings change polarity, but having the resulting TWO poles 90 degrees apart is crucial for operation.

You can have an odd number of armature windings, but only an even number of poles when it comes to motor terminology.

try finding an example with lots of commutator bars, it will be more apparent.


----------



## major (Apr 4, 2008)

no_reluctance said:


> That Right. It doesn't exist ...but I can't figure out why it doesn't exist. I agree its got stall torque holding that position. That is what observation tells us...but if its PWM controlled, The motor is neither stalling (implying load holds it in position), nor is it drawing max power (unless of course, the PWM is at 100% duty).
> 
> The other part of it is how do you get 5° angular resolution out of 3 poles? feedback has nothing to do with how the motor moves except to illustrate where it moves. The control is in how much and how often and in what order you energize the poles. So getting the shaft to the desired position has everything to do with the number of poles because you can only attract it to the nearest pole. You doubtless know that if you are not reversing the motor, then a PWM signal will only dictate the motor speed...which in this case, is less than 1 complete rotation or effectively 0.
> 
> Last thing, check me on this if you feel I don't get it but I think its fairly straightforward, torque is produced from the attraction of the rotor to the nearest pole, it is also sometimes produced when the field is carefully reversed depending on rotor position where you are now "pushing on one permanent magnet pole and pulling on the other" it is also a function of RPM. But none but 1 of those are relevant to a servo. ..


You have some strange ideas of how motors and controllers work. Can't say I agree with any of it. I look at motor torque as the product of armature current and flux.


----------



## no_reluctance (Mar 13, 2014)

Right, this is awesome, we can use the animation as an example. So a servo is the same series DC motor. yet you can see that every cycle of the poles only rotates 120° as I mention above. In your example you say that higher number of commutations are responsible for essentially a smaller Rotation/torque moment if you want to use the vernacular. But there are tons of videos showing ordinary series DC motors getting used as servos by just slapping a pot and feeding that into a PWM motor driver. So either "most" common DC motors have 70+ (5° resolution) commutation points or there is something else going on. What would you say to that?


----------



## no_reluctance (Mar 13, 2014)

major said:


> You have some strange ideas of how motors and controllers work. Can't say I agree with any of it. I look at motor torque as the product of armature current and flux.


 That's a pretty good way to put it, but that would only be correct up until the first point of commutation. It doesn't really address behavioral things about series motors like why torque falls off with RPM. ultimately it does boil down to less of one quantity or another but it has more to do with the properties of the motor. Also your answer is not universal. it would be a different for current location if we had a different kind of motor.


----------



## dcb (Dec 5, 2009)

A servo, as in RC, with a pot, probably isn't even PWMd. It just shuts off the power when the pot is within range of the position command signal. or turns it on in forward or reverse as necessary to move it in that direction.

It doesn't matter how many commutator bars you have when the power is off.


----------



## major (Apr 4, 2008)

no_reluctance said:


> major said:
> 
> 
> > I look at motor torque as the product of armature current and flux.
> ...


I think that the Lorentz Force Law is universal. Certainly the series DC speed/torque/current characteristic is an excellent example. 

major


----------



## major (Apr 4, 2008)

no_reluctance said:


> No need to be catty and resort to pedantics. For what its worth, I'm well familiar with armatures as well, and they also have windings and poles as does any magnet and electromagnet, the terms aren't exclusive the slot refers to the structure itself not its wingdings. "So since most small DC motors are of a three-pole design, let's tinker with the workings of one via an interactive animation" --literally from the link. you're not even arguing with ME at this point. Regardless what I'm asking about is not a matter of terminology. Do you know anyone with more experience than yourself that could possibly help? eldis comes to mind but he's pretty busy, I'd feel bad PMing him something that only helps my understanding.


This post is an insult to me. I was simply trying to help you understand basic motor theory which would then clear your confusion about the servo. I'm sorry but I don't know anyone with more motor experience that could help you.


----------



## dcb (Dec 5, 2009)

also @reluctance,

https://www.pololu.com/blog/13/gettin-all-up-in-your-servos

you are referring to cheap permanent magnet 5v motors in a box with maybe a 100:1 plastic gearbox and a cheap bang-off-bang controller to move the motor relative to the potentiometer reading. A two pole motor at that (when two windings are both north or south they count as one magnetic POLE).

terminology matters.
when an industrial motor guy hears servo motor, he thinks of any closed loop system, typicaly controlling speed or torque, and a motor designed for many many hours of such operation:
http://www.baldor.com/Shared/manuals/1205-394.pdf

not one of those black rectangular things that buzz and make your rc plane crash.


----------



## no_reluctance (Mar 13, 2014)

dcb said:


> A servo, as in RC, with a pot, probably isn't even PWMd. It just shuts off the power when the pot is within range of the position command signal. or turns it on in forward or reverse as necessary to move it in that direction.
> 
> It doesn't matter how many commutator bars you have when the power is off.



https://www.servocity.com/html/how_do_servos_work_.html#.V2QNghJcjVY

the pot is just there to give a linear relationship between reference angle and some resistive value. Then its up to something else to take that as an input and try to drive the motor to that position. That's where the gap for me is. A simple motor with few poles (or armature slots, either one will suffice as long as the number puts it such that any reaction is greater than the angular resolution of the servo) ought not to be able to be driven to that position, and it is not OFF when it arrives there. otherwise the servo would go limp and just return to whatever position has the least amount of load against it. so being off doesn't seem like the way they do it. 

From what I can gather they get a meta-static state by driving the motor towards the next pole or backwards towards the prior pole in rotation...but that ought to be pretty wobbly. and it would get worse on a highly geared setup where the motor would have to spin dozens or hundreds of times for the shaft to move to a desired angle...because then their would be a ton of overshoot and back pedaling....yet servo's are pretty well behaved devices as far as I have seen. I'm wondering how this is dealt with on such simple motors.


----------



## dcb (Dec 5, 2009)

no_reluctance said:


> and it would get worse on a highly geared setup where the motor


nope, that 5 degrees figure you mentioned is on the output shaft, where the potentiometer is. A 100:1 box means the motor can move 500 degrees and still be within tolerance (not exactly, gear/bearing slop, bla bla)

as soon as it overshoots the controller bangs it into "reverse".

You can get real fancy with controllers, but I am very bored talking about position servos. In a car the driver usually controls position, and the controller takes a torque requested input.


----------



## no_reluctance (Mar 13, 2014)

hmmm...That actually makes alot of sense now that you put a number to it. Thanks for talking it through with me fella's. Though it seems a bit precocious, I promise it wasn't trolling or intentionally antagonistic.


----------



## dcb (Dec 5, 2009)

fyi one refinement is to use an amplifier, i.e. that chip probably applies more power the farther the position is off.

http://rtellason.com/chipdata/ne544.pdf

and the lack of external components means the switching transistors are probably in the chip for better packaging.


----------



## no_reluctance (Mar 13, 2014)

Yes, nice little DIP package as well... I suspect there are many refinements. I was just baffled how a motor so primitive (relatively speaking) was getting that kind of accuracy. I would imagine that grey code encoders probably do alot better than potentiometers to boot. Thanks again for indulging a discussion of what is essentially minutia.


----------



## no_reluctance (Mar 13, 2014)

major said:


> This post is an insult to me. I was simply trying to help you understand basic motor theory which would then clear your confusion about the servo. I'm sorry but I don't know anyone with more motor experience that could help you.


 I'm sorry I've insulted the ego of the preeminent motor theorist on this forum then. My question didn't reside in the realm of basic motor theory and you were trying (if even only well intentioned) to obfuscate the problem rather than understand it. Again, I wasn't here to step on anyone's toes or any of that. If you disagree with the source material from the quote, then, please, substitute your own. You asked that I should have first gotten basic info ( from an un-scholarly source, then from generally anywhere) and then scoff that it didn't line up with terminology which was never part of my question in the first place. Nor would proper terminology have changed the nature of the question. Part of being "an expert" is to steward the less learned along and help understanding...telling people to google it then arguing with the results of that should hardly be justification for being insulted... All the same, mea culpa, I have no doubt you have played with many motors in many flavors and probably know your stuff. I would only ask that before you assume the problem is something other than what I asked to maybe demand more clarity of me beforehand so I don't misconstrue your intent.


----------



## dcb (Dec 5, 2009)

Major is grumpy yes, but one of the most experienced folks here.

I'm still not sure you understand the motor basics though (the stuff that makes people grumpy refuting, especially when misconceptions are widespread). Since I have invested some time in your edification, show me you have been paying attention, here is a quiz: 

1. What is the smallest number of degrees that you can move a 2 pole 3 winding armature permanent magnet brushed motor?

2. How many poles does the armature have on this 3 winding armature?


----------



## no_reluctance (Mar 13, 2014)

Oh, man...well probably wise, doubly so because A) One would not want someone to hurt themselves for lack of complete knowledge...after all, that is the path to the dark side. B) One more oppurtunity to see If I can flub it up again. Ok, so, lets take the problem apart first and answer what we (I) think we know. The relationship between the armature (I still want to call it a rotor for what its worth, but I see why it matters now because in a series motor described the armature is the energized part....too used to inrunner brushless DC motors, me) and the field/stator is such that if you only put power on the armature without the commutator action. The armature swings towards its opposing field pole. In a 2 pole armature, this would take you from 0 (in this case, the reference angle is rotor at the opposite of full register (old magneto term, not sure if there's a more modern term) to full register (as close to the center of the magnetic fields as is possible). this would be a travel of 90° in a 2 pole motor. 3 is a little more complicated because 2 coils get partially energized, but it looks like the one coil that is fully energized is still dominating the behavior of the system. because you can see it is off again at full register. so any given commutation would make it turn 90 degrees? (Here is my answer) I'm not sure how this additive effect scales with more armature windings (if it were say...5, the combination of the repulsion force of the other 4 might tend to skew the rotor/amature relaxation or reference "OFF" angle towards some other position than 90 degrees before full register of the "reference" winding. or, who knows, maybe that just means more commutation to force it to get the 90 degrees. But as you say, this relationship is fundamental so I'll fall back on that one until I can walk myself through the construction of a 5+ pole armature, (we only wound a 2 pole one in school) What do you think? detention? homework? book report? Apologies for the text wall, it keeps commuting my paragraphs/line breaks.


----------



## dcb (Dec 5, 2009)

detention 
answer key:
1. there really is no minimal angle, you can give it a microsecond pulse at any shaft angle and it will move a tiny bit to a new angle. give it more microseconds for bigger angles. 


2. Here is a 4 pole motor with a lot of armature slots:









you can see the armature has 4 magnetic field poles to work with, regardless of the slots/number of commutator bars, etc. The commutator and windings will establish 4 poles (composed of numerous slots) that are 45 degrees (90 magnetic degrees) out of phase with the field poles for maximum torque. so a 2 pole motor, the armature emulates 2 poles also.


----------



## no_reluctance (Mar 13, 2014)

Ah, schooled again... But I don't feel bad, if anything, thanks for digging into it with me. 

Though, and this sorta pertains to my original question, for the interval of time you have anything but maximum magnetic moment (from full brush current) on any piece of the armature and while the whole thing overcomes its inertia and moves more slowly than a perfect synchronous (different term from a different motor, I know) relationship between applied current pulse and motor position. the reverse reaction will be happening, which is..induced field into the armature and back emf.... so you ought to get some wiggle, however miniscule as the controller attempts to correct/chase the motor which is (when it is not being powered) in between braking because of back EMF and inertial swing down. in otherwords, unless, like a stepper, you can actually come to an equilibrium position quickly (as in, less than the distance between 2 poles) at any point with no power applied. your rotor is meta-stable and you'll be stuck trying to duty cycle your way between applying the field to make it move, inertia which makes it not move where you asked because it was either A) already moving) or B) not moving at all, and neutral reaction or cogging as major pointed out.

I guess it comes down to how good your feedback signal is and then again how quick your PWM can be. not necessarily anything to do with the motor. I can accept that.

I wonder to what degree the difference of PWM granularity has to be to get 90 degrees of "hold" torque and say....500 rpm from a chopper circuit.


----------



## dcb (Dec 5, 2009)

no_reluctance said:


> for the interval of time you have anything but maximum magnetic moment (from full brush current) on any piece of the armature and while the whole thing overcomes its inertia.


motor inductance ensures it isn't perfectly instantaneous. You would have to experiment with a specific motor and application and various timings, and not all applications are suitable. Obviously it will take disproportionately longer and more accurate pulses for smaller angles. (smaller angles take smaller pulses but it isn't linear for many reasons)



no_reluctance said:


> the reverse reaction will be happening, which is..induced field into the armature and back emf....


fyi, in diyelectriccar land back emf is a function of motor rpm mostly, as these motors are typically current(torque) controlled. 

We concern ourselves with things like high power controllers (hundreds of amps and volts) control strategies, and field weakening if we need to extend the rpm range i.e. sepex mappings, bldc advanced timing, induction v/hz curves, reluctance torque, or other oddities.

fyi, took the liberty of annotating that diagram.


----------



## no_reluctance (Mar 13, 2014)

Yes, I agree with that assessment, or at the very least, I can find no paradox with this understanding as I did when I started this thread. Again, thank you so much, you guys have again proven that there is alot of wealth beneath the surface of this forum and for that and your time, I am again grateful. If even to also take my licks, sometimes you can lose important mitigating factors in the details.


----------



## major (Apr 4, 2008)

no_reluctance said:


> My question didn't reside in the realm of basic motor theory and you were trying (if even only well intentioned) to *obfuscate* the problem rather than understand it.


Obfuscate? Rather than understand the problem? I understood exactly the problem. The problem was basic motor theory, or more precisely, your lack of understanding of basic motor theory.

You start out the original post speaking of stepper motors. You give a statement of how you think a stepper motor rotates based on pole or tooth position. You may be correct with that concept. But you then talk about servomotors as though the same behavior exists with them. So I suggested you use Wikipedia to see the difference between steppers and servomotors and investigate cogging and ripple torque in non-stepper motors which would be used as servos. 

I did this for a reason. You believe as you stated in post #7 that:


> torque is produced from the attraction of the rotor to the nearest pole, it is also sometimes produced when the field is carefully reversed depending on rotor position where you are now "*pushing* on one permanent magnet pole and *pulling* on the other"


 This is incorrect. It is basic motor theory which you misunderstand. And you used this invalid concept as a premise for your question. I did not accept that premise and attempted to guide you to ways to correctly look at torque production in motors without burdening myself with the task of educating you. There are loads of "good" web sites as well as text books explaining this.










Look at the image that dcb posted. Each stator pole has half of a N rotor pole and half of a S rotor pole adjacent across the air gap. So each pole, rotor or stator, has a 50/50 split between "pushing" and "pulling", or repulsion and attraction. That is not what produces torque. Therefore the distance between poles has no bearing on the positioning of servos. 

So if you understood the basics, you'd see that your bothersome behavior with servos doesn't exist.


----------

