Reply by Nicholas Kinar January 23, 20092009-01-23
> > That's no hard and fast rule! There are many factors that go into > determining the sampling rate, primarily having to do with desired > performance, sensor/actuator bandwidth, and the amount of money you have > lying around to buy processors with. > > 10X is a good starting point for many systems, but you can often shade it > down a bit. OTOH, you often need to speed it up significantly if > performance and precision are paramount. >
...which is precisely why I am proceeding to model the system first to determine the sampling rate. After creating a model of what I what to measure, I can then test my algorithms and find the sampling rate. I agree that 10X is a good starting point. Thanks, Tim. Nicholas
Reply by Tim Wescott January 22, 20092009-01-22
On Thu, 22 Jan 2009 09:43:31 -0600, Nicholas Kinar wrote:

> Jerry Avins wrote: >> Jerry Avins wrote: >> >> ... >> >>> Control loops need at least 5X oversampling ... >> >> That may be too strong an assertion. Suffice it to say that -- with the >> exception of a toy system -- I never made on work satisfactorily with >> less than that. 10X is better if one can manage it. >> >> Jerry > > Thanks, Jerry. It's very good to know that 10X oversampling is best for > a control system. > > Nicholas
That's no hard and fast rule! There are many factors that go into determining the sampling rate, primarily having to do with desired performance, sensor/actuator bandwidth, and the amount of money you have lying around to buy processors with. 10X is a good starting point for many systems, but you can often shade it down a bit. OTOH, you often need to speed it up significantly if performance and precision are paramount. -- http://www.wescottdesign.com
Reply by Nicholas Kinar January 22, 20092009-01-22
> > I didn't mean "best". I meant better than 5X. :-) > > Filters introduce delay. Delay destabilizes servos. Often, the best > filter isn't the one with sharpest cutoff or least ripple in the > passband, it is the one which delivers the signal earliest. > Minimum-phase filters are the archetype. Linear-phase filters are > probably the worst ever applied, although maximum-phase filters exist. > > Look at the filter's impulse response and where the bulk of the energy > is relative to the impulse. A filter that is nearly minimum phase can > sometimes be much simpler than one that is exactly so. > > In audio work, we freely shift the time origin to simplify the way we > represent signals. Servo work is more demanding. Constant delays can't > be ignored. > > Good luck! > > Jerry
Thanks, Jerry. This really helps to clarify things. Nicholas
Reply by Jerry Avins January 22, 20092009-01-22
Nicholas Kinar wrote:
> > Jerry Avins wrote: >> Jerry Avins wrote: >> >> ... >> >>> Control loops need at least 5X oversampling ... >> >> That may be too strong an assertion. Suffice it to say that -- with >> the exception of a toy system -- I never made one work satisfactorily >> with less than that. 10X is better if one can manage it. >> >> Jerry > > Thanks, Jerry. It's very good to know that 10X oversampling is best for > a control system.
I didn't mean "best". I meant better than 5X. :-) Filters introduce delay. Delay destabilizes servos. Often, the best filter isn't the one with sharpest cutoff or least ripple in the passband, it is the one which delivers the signal earliest. Minimum-phase filters are the archetype. Linear-phase filters are probably the worst ever applied, although maximum-phase filters exist. Look at the filter's impulse response and where the bulk of the energy is relative to the impulse. A filter that is nearly minimum phase can sometimes be much simpler than one that is exactly so. In audio work, we freely shift the time origin to simplify the way we represent signals. Servo work is more demanding. Constant delays can't be ignored. Good luck! Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply by Nicholas Kinar January 22, 20092009-01-22
Tim Wescott wrote:

> And if you need precision out to the bandwidth of the loop, even more > than that. > > Anything less than 5X requires an extraordinarily well-behaved plant. >
I'm going to have to take a look at your most recent book on control systems. Thanks, Tim.
Reply by Nicholas Kinar January 22, 20092009-01-22
Jerry Avins wrote:
> Jerry Avins wrote: > > ... > >> Control loops need at least 5X oversampling ... > > That may be too strong an assertion. Suffice it to say that -- with the > exception of a toy system -- I never made on work satisfactorily with > less than that. 10X is better if one can manage it. > > Jerry
Thanks, Jerry. It's very good to know that 10X oversampling is best for a control system. Nicholas
Reply by Tim Wescott January 22, 20092009-01-22
On Wed, 21 Jan 2009 23:20:29 -0500, Jerry Avins wrote:

> Jerry Avins wrote: > > ... > >> Control loops need at least 5X oversampling ... > > That may be too strong an assertion. Suffice it to say that -- with the > exception of a toy system -- I never made on work satisfactorily with > less than that. 10X is better if one can manage it. > > Jerry
And if you need precision out to the bandwidth of the loop, even more than that. Anything less than 5X requires an extraordinarily well-behaved plant. -- http://www.wescottdesign.com
Reply by Jerry Avins January 22, 20092009-01-22
Jerry Avins wrote:

   ...

> Control loops need at least 5X oversampling ...
That may be too strong an assertion. Suffice it to say that -- with the exception of a toy system -- I never made on work satisfactorily with less than that. 10X is better if one can manage it. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply by Jerry Avins January 21, 20092009-01-21
Tim Wescott wrote:
> On Tue, 20 Jan 2009 18:14:13 +0000, mblume wrote: > >> Am Tue, 20 Jan 2009 08:44:30 -0800 schrieb Rune Allnor: >>>> Understandably, it is the bandwidth that is the bottleneck in this >>>> situation. Why the 5-10x oversampling rule? >>> Because it prevents users from shaving the sampling rate too close to >>> Nyquist. Making hardware and doing experiments is both time-consuming >>> and expensive, so selecting the sampling rate is a major design >>> decision that, once implemented, can not easily be revised. >>> >>> You can always add a decimation step afterwards, if the amounts of data >>> become too large to handle with 10x oversampling. If you sample at >>> 1.05x Nyquist you are stuck with no leeway. >>> >> In addition to what Rune said, you'll have to take into consideration >> that you have to filter your analog data before it is given to an A/D >> converter. This filter being analog, it is easier to have one with a >> slower roll-off. If you oversample, you can either work with the >> unncessary bigger bandwidth throughout the whole chain or decimate at >> some intermediate step. >> >> Just my 0.02$. Analog electrical engineers might want to disagree :-) >> Martin > > Nyquist didn't say that -- http://www.wescottdesign.com/articles/Sampling/ > sampling.html. Anti-alias filtering is only helpful if there is > significant alias energy to filter out, and if the action of the > filtering won't screw up your signal. So AA filtering is a great thing > for applications like audio, where your microphone can pick up > _anything_, and some of that would sound _terrible_ when it's aliased > down. But for things like control loops and characterizing pulses, it's > often best left off.
Control loops need at least 5X oversampling and often deal with inherently band-limited systems. A one-sample delay at half the sample rate amounts to a 180-degree phase shift. The same oversampling needed for decent phase margin makes the AA filter superfluous. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply by Nicholas Kinar January 20, 20092009-01-20
Rune Allnor wrote:
> On 20 Jan, 22:51, Rune Allnor <all...@tele.ntnu.no> wrote: >> On 20 Jan, 22:28, Nicholas Kinar <n.ki...@usask.ca> wrote: > >>> A few years ago, I recall finding on the Internet a computer code which >>> was used for generating sonar data suitable for DSP analysis. Using >>> Google, I can't seem to find this code. I wonder if there are any sonar >>> codes which include the basics of Biot-Stoll theory? >> The Biot-Stoll factors are basically dispersive loss factors in the >> linear Helmholz equation. There might be more to it (I don't know >> if the naive linear approach includes Biot's 2nd wave) but there >> used to be a linear acoustics model that included the Biot factors. >> It's been a while since I looked into those sorts of things, but >> I *think* it was Henrik Schmidt's OASES package, > > It was, and here it is: > > http://acoustics.mit.edu/faculty/henrik/oases.html > > It's been ten years since I used this package, on a UNIX > computer. I have no idea if it can be used under windows. > > Rune
Rune, first and foremost thank you once again for all of this really useful information. I don't know what I would do without all of your help. So thank you! Yes, I remember OASES. I believe that I downloaded it about six years ago, thinking that it would be useful. Since I wasn't using that particular software package at that time, I never compiled it. Apparently OASES will only run under a GNU/Linux/Unix operating system. This is not a big deal, since I prefer to do most of my number crunching and DSP under Ubuntu Linux/Debian. I find that most numerical libraries have been written for UNIX, or are easier to compile under these operating systems. I dual-boot with Windows since some of my JTAG devices and other electronics instruments (i.e. oscilloscope) will only communicate with Windows programs. Windows is also the platform of choice for my PCB layout software. I'll give the software a try, and perhaps even take a look at the source code. If there is something that needs to be modified, I'll try to roll my own version. Thanks Rune. Nicholas