Brush contact resistance and motor identification
Before OpenServoCore can control a motor well, it has to know the motor. So for the last couple of months I’ve been building an identification tool. It runs the servo through a few moves on the bench and comes back with the motor’s resistance, its back-EMF constant and a few other constants. Resistance was supposed to be the easy one. Hold the rotor still, push some current through it, divide the volts by the amps. It turned out to be the number that fought me the longest, and almost all of that fight was with the brushes.
This is the first of three posts. Each one asks whether a cheap servo can reliably observe one thing about its own motor. This one is about resistance and motor identification. The other two are about estimating speed from back-EMF and reading the winding’s temperature, and both of them lean on the answer here.
If you’re new here, OpenServoCore is my effort to turn cheap MG90S-class servos into networked smart actuators with sensor feedback, cascade control, and its own single-wire bus protocol. Everything below ran on rev 2A dev boards, which carry a CH32V006 (WCH’s sub-20-cent RISC-V microcontroller), with a few MG90 clones and two of their bare motors.
TL;DR
Here is where I ended up, if you’d rather skip the saga.
- The answer for this one is partly. Two of the motor’s electrical parameters can be identified, and the third can’t.
- The copper resistance can be identified, but only with the rotor held still and averaged over several rotor angles. The tool does it once and scales the result to a reference temperature with copper’s known temperature coefficient.
- The back-EMF constant Ke comes out clean from coasts with the bridge open, because no current flows and the brushes have nothing to add.
- The brush contact can’t be pinned down. It depends on where the brushes sit, it moves with speed or current (I’m not sure which yet), and it drifts over seconds, hours and days. So the tool reports it, and the firmware doesn’t model it at all.
- Today the tool’s resistance lands about 3.3% over my notebook record, down from 4.6% before I fixed the tool’s own math. Most of what’s left sits at one end stop, and I can’t tell yet if that’s the brushes or the stop itself.
Some Background
As far as the electronics care, the voltage across a brushed DC motor is the current times the resistance, plus the back-EMF, plus whatever the brushes drop. Back-EMF (back electromotive force) is the voltage a spinning motor generates, and it’s Ke times the speed. The resistance is mostly the copper in the windings.
The brushes are the odd one out. Current gets into a spinning rotor through two springy brushes that rub on a commutator. The commutator is a little ring split into segments, and it hands the current from coil to coil as the rotor turns. On the MG90’s motor each brush is a strip of three thin wire fingers, and the commutator is three segments on a really tiny ring.
Think about what that contact actually is. A few wire tips pressed lightly onto a tiny ring, with whatever film, grease and wear dust happens to be between them. How much it resists depends on how hard the fingers press, which part of a segment they land on, whether a finger is sitting across the gap between two segments, and what the surface looks like today. Every one of those changes as the motor runs. So from the start, the brush contact is a part of the circuit that isn’t really a fixed part.
Here is the whole path from one motor terminal to the other, the way I think about it now.
The servo leans on the resistance for a lot of things. The current limit is the voltage over R. The speed estimate is what’s left after taking R times the current off the terminal voltage, so a brush drop the estimate doesn’t know about makes the servo think it’s spinning faster than it is. And the heat the current puts into the winding is R times the current squared, so the temperature estimate needs it too. If R is off, all three are off.
Copper’s resistance also rises with heat, so a live R looks like a free thermometer. But even a small error in R reads as a real change in copper temperature, and a few percent of contact excess reads as a good chunk of heat that isn’t there. That’s why the servo doesn’t read its temperature off R at all. Part 3 is about what it does instead.
Where I Started
Back in September I believed R was just another constant. The servo fitted it from short bursts of drive into a held rotor, and I took the number at face value.
That didn’t last long. Readings taken the morning after a stall or a calibration run came out a few percent high and crept back down over hours. Turning the rotor by hand stepped my multimeter’s reading, usually a little, once in a while a lot. Locking the rotor at a different spot gave a different R every time. And once, the servo read about a fifth low for several seconds, which is what you’d see if a brush bridged two segments and shorted out a coil.
I spent a few weeks on designs that needed R to hold still anyway, and they lost one after another. Somewhere in there I wrote in my notes that any absolute R on a brushed motor is going to be like making pigs fly.
Looking back, my mistake was treating “the resistance” as one thing. It’s really two things in series, the copper and the brush contact, and from the terminals I had no way to tell them apart. So before trusting any R again, I wanted to know which part was which. That meant going back to a bare motor.
Back to a Bare Motor
I pulled the motor out of a fresh MG90 clone, ran every experiment I could think of on it, and then tore it down. That’s all in the MG90 characterization and teardown post. The short version for resistance is that at a milliamp my meter read exactly what the copper and leads alone read after the teardown, and with real current flowing the board read a good few percent more. So the brushes add basically nothing at a tiny current and something real once current flows.
That told me what the copper is. Pinning down the brushes was a lot harder. Let’s take a look.
Angle, or heat?
I expected the brushes to show up as a pattern around the turn. With the rotor locked at a ring of angles (rest-resistance), R did spread by a few percent, and I was sure that was the brushes landing on different parts of the commutator.
Then I noticed that the angles I read after a long rest came out lower than the ones after a short rest. Each reading leaves a little heat in the copper, and the next one still carries some of it. Once I took the heat out, the angle only owned a small part of the spread, and there was no pattern that matched three segments and two brushes. I’d only give that split low to moderate confidence though. I read every angle once, in order, so the clock and the angle are tangled together.
Direction went the same way. Reverse read higher than forward almost every time, and I wrote it down as brush contact. Later I plotted the gap against how much the first lap had warmed the copper, and it followed the warming. Facepalm. On a second motor of the same clone part of the gap didn’t follow the heat, so I can’t rule the brushes out completely.
What I took away from this is that on a motor that warms up while you measure it, almost anything the brushes might do, heat can also do. So I stopped blaming the brushes for a pattern until I’d ruled out the clock.
The contact settles
One measurement did show the contact on its own. I compared the reading through the first fraction of a second of a locked lap on a plain resistor and on the motor, same board, same method. The plots are in the rest-resistance notebook.
The resistor stays flat. The motor starts high and falls over the first moments, and only then does the copper warming take over. The fall was biggest on the first lap after the rotor had been moved. The bare rotor with no brushes in the path, in the teardown’s heat run, didn’t do it at all.
My best guess is a thin film on the contact that the current breaks down. That fits the earlier surprises too, the morning readings that were high after the motor sat, and the hand turns that stepped the meter. It’s only a guess with moderate confidence. But it gave me a rule I still use. The first moments after the rotor moves are no good for reading R, so those get thrown away.
Splitting the brush drop from R
The textbook way to model brushes is a constant voltage drop in series with the resistance. Fit a straight line of voltage against current through two current levels, and the slope is R and the intercept is the brush drop. I figured this would just work.
It fell apart. The intercept swung from positive to negative depending on the angle, and a negative brush drop doesn’t make any physical sense. The problem is the lever. The board can only push so much current into a locked motor, so my two levels sat close together, and a tiny wobble in either reading swung the intercept wildly. More levels didn’t help. The best I could do was bracket the drop, and the bracket was wide.
So I gave up on splitting the brush drop out at rest. If the measurement can’t tell the two apart, I’d rather say so than pretend it can.
The Turning Rotor
The teardown post’s speed-torque run fitted the turning motor as a slightly lower resistance plus a fixed drop, and that model landed right on the measured free speed. I first read that fixed drop as a constant brush drop. When I came back with many more spins at many more speeds, the picture changed.
Take the locked resistance times the current and the back-EMF off the terminal voltage, and what’s left is the extra drop of a turning motor. On the bare motor it follows speed, not current. The plots of it against speed and against the dropouts are in the motor-model notebook.
Up to a fairly high speed there’s basically nothing. Past that it climbs steeply, and one direction carries about twice as much as the other. Swapping the leads at the board’s connector showed the split moves with the motor, so it’s the brushes and not my board.
My first thought was that the fingers start bouncing off the commutator at speed. The current does drop out more often as the drop grows. But one direction carries a clear drop with no dropouts at all, and when I worked it out, the interruptions and the little arcs at each bounce are both far too small to explain it. So I honestly don’t know what the mechanism is.
Running also changes the brushes. On the second motor, less than half a minute of free spinning at a higher voltage changed its brushes for good. The next run-up had a lot more dropouts and ran a bit slower. Even short pulses that never got the rotor anywhere near full speed did it. Half a day later part of the change had relaxed and part of it hadn’t.
This is where I stopped thinking of a turning motor’s resistance as the same thing as a held motor’s resistance. A turning contact is its own animal. From here on, R only ever gets read with the rotor held.
In the Assembled Servo
I hoped the bare motor’s picture would carry over to the whole servo. Stage 3 put a new motor into a servo with metal gears and fresh grease. With the horn locked against a stop, R repeated really well from lap to lap. But every press into a stop lands the rotor at a different commutator angle, so a different press gives a slightly different R.
Turning, the brush term didn’t behave like it did on the bare motor. A table of the drop by speed alone, which worked fine there, read the servo’s run-ups too fast. A term that grows with speed times current fixed most of that. I’m fairly sure the brush term depends on current in the servo, and much less sure it’s actually speed times current. So the bare motor says speed and the servo says current. It could be this motor’s fresh brushes, or something about running inside a servo. I don’t know which.
In closed loop, the extra drop wandered up and back down over a couple of days with nothing changed on my side. That one is part 2’s problem.
There’s also a direction thing I could feel with my hands. With the rotor in the servo’s bottom shell, it turns smoothly one way and catches a little the other way, where a brush finger snags on a commutator gap. I saw the same on two motors. I’ve come to see that as a trait of this class of servo motor rather than a defect.
Over these weeks my mental model settled down. The copper’s resistance should stay put at a given temperature. What changes is the brush geometry, the commutator geometry and whatever builds up on them, and some of those changes are permanent. I stopped calling a brush change damage. It’s just the motor changing over its life. And something that changes over the motor’s life can’t be a constant I identify once and store.
What the Identification Tool Does Now
So the rule I ended up with is to measure what’s pinned down, and keep the brushes out of anything the firmware depends on. Each piece of the tool comes from one of the lessons above.
- R is read with the rotor held against an end stop, from short bursts of drive. Never from a moving rotor.
- The bursts are taken at several seats on both stops and averaged by medians, so no single brush position decides the answer.
- The first burst of each group is thrown away, because it reads apart from the rest. My best guess there is magnetic history, the iron remembering the last current, and not the brushes at all. A burst that reads well under the others is thrown away as bridged, because a brush bridging two segments shorts a coil and can only ever read low.
- R is scaled to a fixed reference temperature with copper’s handbook temperature coefficient and stored once.
- Ke comes from coasts. With the bridge open no current flows, so there’s no resistance and no brush drop in the way. On the bare motor the coasts agreed with each other very closely, and both directions read the same.
- The brush term is measured and reported, and the firmware doesn’t use it. Its brush term is zero.
Put together, each constant comes from the one measurement where the brushes can’t mess it up.
The idea of several seats came from the bare motor’s angle map. I pretended each angle was a seat a servo’s end stop might happen to hold, and checked how far one seat, or a few pooled together, land from the mean of all of them. That’s in the identification notebook.
One seat alone can land noticeably off the mean, and the worst angles are pretty far off. Pooling a few seats cuts that roughly in half. Averaging over angles is the only defense the tool has against where the brushes happen to sit.
Open Questions
There’s a lot I still can’t answer.
- Speed or current. On the bare motor the brush drop follows speed, in the servo it follows current. Holds at one speed with two different currents would separate them, and I haven’t run those yet.
- Whether the brush path under current is a fixed drop, a resistance, or both. I never managed to split them.
- The servo’s motor reads a few percent under both bare motors. That’s either motor-to-motor spread or a fresh pair of brushes with their own film. A milliamp meter reading on the servo’s leads would split them.
- None of this has been tried on a plastic-geared SG90 yet.
Where It Landed
Over a few dozen runs on the servo, the tool’s R first read a median of about 4.6% over my notebook record, and every single run was over. Part of that was the tool and not the brushes. It was missing two board corrections that the notebook applies. With those in, the median came down to about 3.3%.
What’s left is mostly one end stop. The seats at one stop agree with each other well, but the two stops disagree, and the low stop is usually the worse one. That’s either the rotor angle that stop happens to hold or the state of the seat itself, and my data can’t tell them apart. A slower route, reading R from chains of holds at the stops, matched the record almost exactly. I’ve put it off until I have a long stop hold that’s safe for plastic gears.
So the answer for resistance is partly. The copper can be identified to a few percent if you hold the rotor and average over where the brushes sit. The brushes themselves can’t be, and I’ve stopped trying to make them.
What’s Next
Part 2 is about why back-EMF speed estimation is so hard on these little brushed motors, and part 3 is about reading the winding temperature without a sensor on the rotor. Both of them start from where this one ends, a resistance that’s good to a few percent with the rotor held, and a brush term that won’t sit still.
If you’ve fought brush contact on a tiny brushed motor before, or know a cleaner way to split the brush drop from the copper, I’d really love to hear it. Let me know your results / opinions / rants!