Bode plot from experiments

Hi all, I have a hydraulic system which I want to control, but I ought to do a frequency response before I set out on that. Can anyone point out how I
can manage a frequency response test without buying new hardware? I currently have access to a Matlab toolchain for MPC5xx micros. I want to model the system as a SISO system and the input and outputs are available through the MPC which shall be used for control. I have currently built a Simulink diagram which excites the system with a sinusoid with bias, amplitude, and frequency that can be varied during the test. I can collect the output and then have to identify the time lag and the amplitudes so that I can put them on a frequency chart.
This method is not giving me a good curve. Is there some other method which can yield me a better result, without buying some costly equipment?
Thanks, mc
PS: I might have access to standard electronic equipment.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Manik Chandra wrote:

Assuming that your micro has enough bandwidth you have everything you need. I like to build a swept-sine measurement system into my software when I write control systems, to let me go back later and do tuning.
Essentially what you want to do is excite your system with a sine wave, collect the amplitude and phase of the system response at two points, then divide them to get a transfer function. I find the best way to get the amplitude and phase from the raw measurements is to multiply the measured sine wave by the excitation and the excitation shifted 90 degrees -- and since I'm generating the excitation it's easy to get the shifted version.
I have an article that covers this: http://www.wescottdesign.com/articles/FreqMeas/freq_meas.html .
This article appears in an updated and expanded form as chapter 9 in my book, "Applied Control Theory for Embedded Systems" -- for more detail on the book go to http://www.wescottdesign.com/actfes/actfes.html . Even though you probably have the basics covered, I suspect you'll find the later chapters useful.
--

Tim Wescott
Wescott Design Services
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Do you mean multiply and sum?
--
Scott
Reverse name to reply
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Scott Seidman wrote:

I almost didn't say anything at all because it's early and I know the paper gives the detail correctly.
Yes -- multiply and sum. Preferably over an integer number of excitation cycles, and over a good number of samples (500 seems to be the bare minimum, 1000 is better).
--

Tim Wescott
Wescott Design Services
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Scott Seidman wrote:

The multiplications yield the in-phase and quadrature components of the response. You can derive magnitude and phase from them in the usual way. (It's dead easy with a slide rule. :-) )
Jerry the slipstick guy
--
Engineering is the art of making what you want from things you can get.

  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
There is a low order transfer function model for hydraulic actuators that is outlined in a popular controls textbook. ... It is likely that you are only looking for two poles. ... anything else is extraneous. Several plant parameters must be obtained, but the technique seems to be fairly straightforward. Such a model might confirm or reject your experimental results. Dave

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
It isn't a hydraulic actuator, but I understand that for most practical purposes a 2nd order model is good enough. But that makes me ask another question: how do I decide if going for a higher order model is worth it and it would yield better results than adding some patch to my controller so that it can cope with bad performance when the deviation becomes a concern? My system involves a little bit of friction as well so modeling it has always been avoided: but I believe that modeling it is possible. I just need to know if it is a worthwhile endeavour or I can continue with low modeling and rely on some ad hoc patches. I appreciate Wescott's white paper. It is quite a practical piece of info.
mc
David Corliss wrote:

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
... One method to determine the minimal significant plant order might be to examine the log magnitude curve of the Bode Plot within the frequency interval of interest. If you could sort out the relevant components into the standardized characteristics ... i.e. 20 db/decade, 40 db/decade, etc., you could then assess the number of important poles. ... ... If your experimental plot results do not appear to be simple or obvious, you could have a superposition of 'neighboring' poles. ... What would determine your selection of the number of poles to use in your model would probably be the layout or 'constellation' of elements on the pole/zero root locus plot. As you should recall, poles, zeroes, and their loci behave in a manner analogous to static charges in a plane. If you have one that is 'far off', you can ignore it since it will not affect the main group.
I would think that for a successful control strategy, you would be restricted in your pole selection options.
... ...

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
If I'm measuring the frequency response anyway I just use the measured response as an input to the design process -- I just coerce my measurement method to yield a text file that I can import into MathCad, I model my controller with variable parameters, then I mess with the parameters until the Bode and Nyquist plots look good.
Modeling friction can be a pain in the behind, and coping with its effect can rarely be done to advantage with a linear controller.
If your system is always moving then you _can_ use a linear controller; if that's the case then I'd suggest you take your frequency response measurements at several input amplitudes and find a controller that stabilizes all of the plots nicely.
Either way, here's another article, this time on dealing with friction: http://www.wescottdesign.com/articles/Friction/friction.html . It's more about controlling motors; you'll have to decide how it applies to your case, but there may be some useful insights.
Manik Chandra wrote:

--

Tim Wescott
Wescott Design Services
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Manik Chandra wrote:

What is it exactly? That hasn't been made clear or did I miss something? I think it is important to know before causing minor earthquakes with sine waves.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Don't overlook the possibility of low level nonlinearities affecting your results, particularly if you're using relatively low test excitation levels. Pilot valve deadzone is the main likely source.
Do a run with a substantially larger sinewave input amplitude and check that the frequency/phase response curves don't change shape appreciably.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On 26 May 2006 07:40:45 -0700, "Manik Chandra"

It can be difficult to extract a model form time histories like pseudo random binary sequences or swept sines. I've had better success taking data with fixed sines at discrete points throught out the range. It makes it easy to get amplitude and phase at the disgrete frequencies and you can also look at nonlinearities as a function of amplitude. It takes a bit longer than just using time histories, but fits in well with determinine parameters that make up a physical based models.
You should also do some step responses as well because it will help to determine things like slewing rates (rate limits).
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.