Shop OBEX P1 Docs P2 Docs Learn Events
Waveform Generation and Damping Analysis — Parallax Forums

Waveform Generation and Damping Analysis

I am a newbie here and an electronics wannabe ... but a decent programmer.

About my project:
For my first Propeller project I want to perform audio range modal analyses (i.e. apply a waveform to a physical material sample (eg. lightweight woods, plastic or similar) and see how the wave is modified [damped, phase-shifted etc] after travelling through the physical sample.

I have in mind this logical assembly:
* Cog 1 : set up waveform generation [Sine with Sweep in the 10 Hz -> 2 kHz range] and the digital out pin should apply current to a ceramic piezo, thus causing causing vibration (don't know whether I will need an amplifier here); this piezo is placed directly onto the sample
* Cog 2 : set up a triggered ADC collector to receive the signal generated by a second piezo at the opposite end of the sample; probably this signal will need to be amplified, but only experiments will tell

I would then like to "FFT the sine response data and display frequency domain spectra".
Now, I will do all of that post-processing work back in Android-land most likely (Bluetooth data pull back to the device following the completion of the data capture).
But, if the FFT can take place on the board cost effectively, then I will do so before pulling the data back.
I do not want to have a hi-res display as part of the Propeller enclosure, since this experimental data capture is not the place for such expensive and bulky equipment.
I would like to have a basic LCD panel and hardware buttons which would allow me to modify the user-data configurations that I have pushed onto the Propeller box (also via BT).
I assume all user-data will be on a card, accessible for BT commands to I/O via Propeller API.
I will not use Android to control the propeller other than for the user-data sync (aside : I know that Rick Fluck with his AndroiDAQ product controls the Propeller directly).
I want the Propeller box to be completely standalone essentially.
So, my box will definitely need to be able to power itself (rechargeable batteries I am thinking).

Does this sound feasible ?

Can any of you guide me with component identification and selection ?

And, *thanks for your time* ! It is very much appreciated.

Comments

  • Heater.Heater. Posts: 21,230
    There are a couple of FFT implementations for the Prop:

    http://forums.parallax.com/discussion/128292/heater-s-fast-fourier-transform/p1

    The heater_fft has been used in a couple of sound analysis projects successfully.

    There is another FFT out there. Sadly I can't remember what it was called or where to find it now.

    Then there is this:



  • jmgjmg Posts: 15,140
    cybersack wrote: »
    I have in mind this logical assembly:
    * Cog 1 : set up waveform generation [Sine with Sweep in the 10 Hz -> 2 kHz range] and the digital out pin should apply current to a ceramic piezo, thus causing causing vibration (don't know whether I will need an amplifier here); this piezo is placed directly onto the sample
    * Cog 2 : set up a triggered ADC collector to receive the signal generated by a second piezo at the opposite end of the sample; probably this signal will need to be amplified, but only experiments will tell

    Interesting project & the analog side will be challenging.
    Coupling into, and out of, the material is not easy, and the noise floor will be significant.
    Good amplifiers at each end will be essential.

    There were systems that used piezo acoustic delay lines, google TV glass delay line for ideas.

  • cybersackcybersack Posts: 10
    edited 2016-01-11 08:24
    Yes, I have now learned that the analog side is the challenging side in data acquisition from a micro-controller.
    I guess that's why companies like National Instruments make a killing :)

    So, why a Propeller for my Wave Synthesis and Acquisition ?
    * Each of these activities require a Cog-like environment since both are real time activities that cannot be sitting on software interrupts.
    * I cannot find a more suitable MC platform, especially at the price point for the quality.
    * I don't care about portability to ARM, PIC and so on.
    * I intend to make a number of these units for work that we do, so the platform needs to be more than a prototype environment.
    * and ... yes, I want to learn something and build my own unit :)
    If any of you think there is a better way, then please let me know.

    So, to re-iterate : The purpose of the Propeller (and its enclosure) is to provide a free-standing, self-powered controller for "wave synthesis and acquisition" where the signal actuation and transduction are both achieved via attached piezo-electric discs.

    This requires:
    - Analog signals to/from the discs => where a number of specialized boards can do that, and
    - Signal Amplification => likewise, there are circuits that can do that for me

    So, if I take away from the Propeller the responsibilities of the [Generate & Amplify] and the [Acquire & Amplify] analog aspects,
    then the Propeller remains to serve the following purposes:
    * store experiment configuration files (from a remote host, USB or BT - a device which I do not consider to be a part of the data acquisition)
    * drive the analog experiments of generation and capture/analysis, where 'drive' means
    - to synchronize the input and output sides of the experiment wrt a common clock
    - sweep the generator waveform frequency of the AWG unit
    - store the data that is captured in the acquisition
    - FFT the acquired data (post-event)
    * provide a user interface for the user (me) to
    - start/stop the experiment
    - name files/folders local to the Propeller
    - view the acquired Frequency domain spectra (don't know whether TFT or small VGA is the better option here)

    So, to an [ANALOG WAVEFORM GENERATOR] ...
    The XR-2206 is a monolithic function generator that seems to be something of an icon in this domain.
    There are boards and IC's in the market place and I have found one of each at JAMECO:
    * Function Generator Kit
    *
    Linear Analog IC

    Function Generator Kit
    Using a kit is acceptable I think, and I get a POT for the user to turn for Amplitude control (which is necessary since all physical samples will attenuate and dampen differently)
    Although, I would want to ditch the frequency control POT since that is what will be under Propeller control (via the Frequency Sweep Input on the board ?).
    The board requires 6 or 12 V; do I power the unit from a separate power supply to the Propeller ?

    Linear Analog IC
    This unit is all electronics ...
    So, which pins of the Propeller would I use to get the analog signal out ?
    And how is amplitude/amplification controlled ? Will the Propeller be able to emit the same voltages that the Kit is able to achieve via the POT ?

    Your inputs all greatly appreciated :)

    I will leave the [ACQUISITION] until I have the generation sorted out.

    MTIA
    Julian
  • jmgjmg Posts: 15,140
    cybersack wrote: »
    So, if I take away from the Propeller the responsibilities of the [Generate & Amplify] and the [Acquire & Amplify] analog aspects,
    then the Propeller remains to serve the following purposes

    If the frequency of interest is [Sine with Sweep in the 10 Hz -> 2 kHz range] %5
  • jmgjmg Posts: 15,140
    cybersack wrote: »
    So, if I take away from the Propeller the responsibilities of the [Generate & Amplify] and the [Acquire & Amplify] analog aspects,
    then the Propeller remains to serve the following purposes

    If the frequency of interest is [Sine with Sweep in the 10 Hz -> 2 kHz range] , then it is only the Amplify portions you need to take away from the Propeller.
    It can generate 10Hz-2KHz sine quite easily, and can capture phase and amplitude.

    A Prop with 80MHz CLK and PWM dac can partition a PWM Sine as sqrt(80M/2k) = 200 Steps in X and Y per cycle.
    If you want more precision, use more pins for parallel DAC, or use an external DAC, or a small MCU like EFM8BB3 / LB1 has 4 x 12b DACS can generate high quality sine.



  • jmgjmg Posts: 15,140
    edited 2016-01-12 03:11
    cybersack wrote: »
    * Cog 1 : set up waveform generation [Sine with Sweep in the 10 Hz -> 2 kHz range] and the digital out pin should apply current to a ceramic piezo

    Running some numbers on this from some other tests I have been doing, I think a Clocked Sine DAC could pair nicely here.
    Clocked Sine DAC = simple repeating code in a EFM8LB1 MCU (TQFP32 or QSOP28)
    Some number of CLKin, gives a full sine out.
    eg 255*2*pi = 1602.21, 256*2*pi = 1608.49
    Say 1608 ClKin/Cycle out, or 1608*2^N with prescale.

    The Prop counters have a NCO mode that can create on a pin, 500KHz to 128MHz, with a step granularity average of 4.6566ppb (4.6566e-9)
    If that NCO signal is used to clock a Clocked-Sine-DAC, you can get

    With a 1608 Steps per period Sine, ( with a 72Mhz EFM8LB1 SysCLK limit, that 128Mhz becomes 64MHz via /2 internally). ( We have tested /N block in EFM8 to 200MHz, so it looks to well match the Prop NCO )

    Sine_fMax = 64M/1608 = 39800.995 Hz
    and /256 range in Prop Mode config gets
    Sine_fMin = 155.4726 Hz

    Additional fixed scale (compile time, or maybe pin strap) choices would be
    19900.497 .. 77.736Hz
    9950.248 .. 38.868 Hz
    4975.124 .. 19.434 Hz
    2487.562 .. 9.717 Hz

    With 8b or 12b DACS, this part can create
    At 8b DAC a full cycle 256Y, 1608 X
    At 12b DAC in Y, speed needs to drop to 1/3 of the above. (dX could increase to 1608x2, for 11.65bits of X granularity) so all figures /6 for the 'finer' Sine.

    I would guess Piezo devices will like more kHz of excitation than the 2kHz given above.



  • cybersackcybersack Posts: 10
    edited 2016-01-17 07:03
    From the perspective of getting the waveform in and out, there are (albeit large) dedicated items that do these things rather well, with amplifiers built in.

    The PropScope USB Oscilloscope could be used as a component in this solution.
    Q : Can the propscope be included as an oem component instead of as a retail product ?

    If not, then there is also DrDAQ. Has anybody used one of these ? In a Propeller context ?
    I could find any reference to such on the forum.
Sign In or Register to comment.