Back-EMF speed detection in motors

On Sat, 23 Mar 2013 23:09:20 +0000, Fred Bartoli wrote:


MOSFETs, dead-boring diagonal switching (around here, "clever" usually means "Tim is outsmarting himself again").
Vrail = 24V
torque constant ~ 0.15 N-m/A
Torque (and hence current) is highly variable in normal operation, as are speed commands.
--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

How do you measure motor current, with all that h-bridge flailing going on?
--

John Larkin Highland Technology, Inc

jlarkin at highlandtechnology dot com
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

motor

Not per se. But this sounds kind of like a two terminal R versus 4 terminal R type problem. Is the wiring resistance between the controller and the motor enough to account for this?
?-)
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thu, 28 Mar 2013 00:59:37 -0700, josephkk wrote:

You should be able to just lump the wiring resistance into the armature resistance.
--
Tim Wescott
Control system and signal processing consulting
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thu, 28 Mar 2013 10:39:10 -0500, Tim Wescott

The clue, I think {;-), is that the offset is at all commands EXCEPT at stall... "stall" I presume means you're running 100% duty cycle, so no flyback diode involved?
That's why I keep asking for a schematic, or at least a command equation... I suspect Vdiode is in your equation, when it doesn't belong.          ...Jim Thompson
--
| James E.Thompson | mens |
| Analog Innovations | et |
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thu, 28 Mar 2013 10:06:13 -0700, Jim Thompson

Well, motors stop behaving linearly at very low RPM, so I'm not sure you can read too much into that. Stick-slip friction and such like.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thu, 28 Mar 2013 14:15:29 -0400, Spehro Pefhany

That doesn't explain the "offset".          ...Jim Thompson
--
| James E.Thompson | mens |
| Analog Innovations | et |
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thu, 28 Mar 2013 11:31:23 -0700, Jim Thompson

No, but it may explain why there is no offset at zero RPM.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thu, 28 Mar 2013 10:06:13 -0700, Jim Thompson wrote:

The schematic is two half bridges:
power rail --o--- | | fet driver --> FET | o--------- MOTOR -----> other half bridge | fet driver --> FET | current sense --o | .-. | | current sense R '-' | current return -o | --- GND
Current, Im, is sensed with a Kelvin connection from the current sense resistor to an op-amp (to reduce ground issues) to a pair of ADC channels which sample at the center of the lower FET on time. Then the ADC readings are subtracted to get motor current.
Voltage is sensed at the rail, and computed as
Vm = 2 * (1 - rho) * Vsupply,
where rho is the duty cycle from 0 to 1 (50% being off).
Speed is computed as Wm = (Vm - Ra * Im) / k_t
Speed is regulated with a PID loop that commands motor current, motor current is regulated with a PI loop that commands duty cycle. That's lots-o-loops, but it's nicely stable and I have a need to interpose current and speed limits, which fit very nicely into those loops.
The problem is not with the loops, or at least not something overt with the loops -- I can look at the computed speed, and its average matches the commanded speed quite nicely.
--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

Now I'm confused ;-) Where's the offset?
If the "average" speed matches the commanded speed, I don't understand the problem... that's what is should be. Is the ripple confusing your computation?
I've used a full-H-bridge to drive motors, but I use one side to set direction (held low) and PWM the other side... then change direction by swapping side functions.          ...Jim Thompson
--
| James E.Thompson | mens |
| Analog Innovations | et |
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thu, 28 Mar 2013 11:41:56 -0700, Jim Thompson wrote:

The average _computed_ speed matches the commanded speed. The computed speed reads about 30RPM high of actual. That's the offset.

That works well if you're mostly driving in one direction or another, but it makes for a hiccup around zero drive. I could do it that way with a few lines of code, but experience has shown that if you're reversing voltage a lot it's not smooth.
(I dunno if the "reversing voltage" concern makes a difference here or not -- I have to admit that banging both half bridges at the same time is a long-time habit.)
--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

A habit I avoid, at least in my video iris controls ;-)
I often independently control all 4 devices in a full-H-bridge... to contain body currents to safe levels.          ...Jim Thompson
--
| James E.Thompson | mens |
| Analog Innovations | et |
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thu, 28 Mar 2013 14:37:24 -0700, Jim Thompson wrote:

That's interesting. Is it something that's necessary when you're using discretes, or just an integrated-driver sort of things?
Mostly what I'm doing is driving the H-bridge the way that the microprocessor is set up to do. It's easy enough if you stay within the confines of what the hardware can handle, hard if you go outside of that.
--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

It's not clear to me how you extract Vbemf that way. Maybe it'll register... sometimes I tend toward slow ;-)
I'll behavioral model the situation and play it.          ...Jim Thompson
--
| James E.Thompson | mens |
| Analog Innovations | et |
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thu, 28 Mar 2013 16:50:00 -0500, the renowned Tim Wescott

Are you sure you're not getting an effective DC offset as a result of the dead time control of the PWM?
Best regards, Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
snipped-for-privacy@interlog.com Info for manufacturers: http://www.trexon.com
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thu, 28 Mar 2013 18:57:29 -0400, Spehro Pefhany

Yup. That _might_ be adding 2 body diode forwards to the "broth" ;-)          ...Jim Thompson
--
| James E.Thompson | mens |
| Analog Innovations | et |
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thu, 28 Mar 2013 18:57:29 -0400, Spehro Pefhany wrote:

Well, first, the dead time is a minuscule fraction of the PWM cycle time -- fast FETs are cheap these days, and motors seem to prefer PWM speeds in the low 10's of kHz.
And second, just today I made an RC filter so that I could clip a volt meter onto my motor leads and get a nice filtered DC to the meter. It reads within 1% of the voltage I calculate from the duty cycle and motor supply voltage.
(You cannot beat measurements. When all your calculations are going to hell -- measure).
--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

the

OK then my final plan of attack is to try and make it worse! Inductive? Stick more iron around it, Thermal... heat and cool. Add some more cable here... resistance there... George H.

ttdesign.com
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

Is the current sense resistor common to both halves of the H-bridge?
What is its value relative to the motor winding resistance?          ...Jim Thompson
--
| James E.Thompson | mens |
| Analog Innovations | et |
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I don't understand.
At 0 RPM, there is no error?
At all other RPMs , the error = 30 RPM?
so at 1 PRM it read 31?
Is it an offset error or a gain error?
Again, I suggest as a troubleshooting aid, you program the error out by whatever fudge factor it takes. Then analyze the fudge factor.
Mark
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.