<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: High Speed Data Acquisition - What&#039;s the best to expect?</title>
		<link>http://forums.leaflabs.com/topic.php?id=1292</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:20:37 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=1292" rel="self" type="application/rss+xml" />

		<item>
			<title>djk on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7927</link>
			<pubDate>Sat, 28 Jan 2012 09:20:14 +0000</pubDate>
			<dc:creator>djk</dc:creator>
			<guid isPermaLink="false">7927@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;tend to agree with gbulmer's comments. working in the data acq industry for many years now i think trying to do a high-speed project this on open source hw/sw you are going to find out why professional systems do cost $. don't forget overall signal accuracy (not the same as resolution), Anti-alias filtering, isolation, handling common-mode noise etc...by the time you hire someone to do all of this work you'll have paid for a proper system. not to mention if you are going to do published research, i'd think you'd want some form of calibrated traceability (NIST).&#60;/p&#62;
&#60;p&#62;All this being said, the very reason the thread caught my eye is that i believe there is a market for an nicely packaged (rugged), physically small, open-source data acq/toolkit with properly developed hw for applications such as this....where one could easily port their algorithms (such as for HUMS) to a platform.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7819</link>
			<pubDate>Sat, 21 Jan 2012 07:08:18 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">7819@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;bubulindo - IMHO, you do &#60;strong&#62;NOT&#60;/strong&#62; need DMA to get close to 1Msamples/second. People have spent a long time trying to understand and use the DMA. It might be more productive to get other parts of your application working before attempting to apply DMA. Your code will spend a lot of time servicing the ADC, but code will likely be enough to make progress. &#60;/p&#62;
&#60;p&#62;Another thing folks should be aware of is the DMA on the STM32F4 is different in architecture from the STM32F1, so code would need to be ported.&#60;/p&#62;
&#60;p&#62;IMHO, a big problem is the quality of the input signal. The ADC functions in libmaple are configured to give plenty of time to charge up the sample and hold circuitry on the input of the ADC. This makes them relatively robust for beginners to use. The setup can (theoretically) cope with sampling a signal with an output impedance of 50Kohm. &#60;/p&#62;
&#60;p&#62;Have a look in the STM32F103xb/xB datasheet, section 5.3.18 &#34;12-bit ADC characteristics&#34;, at Equation 1, and Table 47. To get to a 1.5cycle sample time, the output impedance of the signal being sampled needs to be about 0.4Kohms. A lot of source signals are no where near that good. For example, lots of people use a 10Kohm potentiometer as an input, which is way to high.&#60;/p&#62;
&#60;p&#62;It is also worth noting, that 1Msamples/second is an absolute maximum, and can't be achieved at the noromal 72MHz main processor clock.&#60;/p&#62;
&#60;p&#62;Even at 1.5 cycles sample, the ADC conversion cycle will take about 1.17microseconds (1.17us) when running the main processor clock at 72MHz. &#60;/p&#62;
&#60;p&#62;To get the maximum speed of conversion (1us), the main clock must run at an integer multiple of 14MHz; 14MHz is the maximum ADC clock, and is derived by dividing down the main processor clock. Simultaneously, the main processor clock is constrained to be an integer multiple of 8MHz, the crystal frequency; that 8MHz crystal is multiplied up to generate the main processor clock. &#60;/p&#62;
&#60;p&#62;The lowest common denominator, which would give 1Msamples/second is 56MHz. It is probably easier to leave this alone, run at 72MHz, and accept 1.17us ADC conversion time :-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bubulindo on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7817</link>
			<pubDate>Sat, 21 Jan 2012 00:51:38 +0000</pubDate>
			<dc:creator>bubulindo</dc:creator>
			<guid isPermaLink="false">7817@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello, &#60;/p&#62;
&#60;p&#62;Thanks for the reply.&#60;br /&#62;
My question wasn't based on the standard analogRead() since I know that it takes up too much to do anything and doesn't let you configure it either.  &#60;/p&#62;
&#60;p&#62;I was actually thinking about writing software to configure the ADCs in many ways but without verification code and the thing that made me stop a bit was the DMA since that apparently can make wuite a big difference in the speed of the ADC. I'll read up on the DMA part of the manual to start messing with the ADC as soon as I have the chance. :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7816</link>
			<pubDate>Fri, 20 Jan 2012 20:43:03 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">7816@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;AeroProf - Yes, Maple Native or RET6 are options.&#60;/p&#62;
&#60;p&#62;They are the same part family (STM32F103) as Maple, so they are 72MHz parts, and the ADCs are 1Msamples/second, but unlike Maple, they both have dual DAC's, so they may be enough to drive pulses. Also they have 3 ADCs (which might be enough to triangulate signals with a small sensor array). &#60;/p&#62;
&#60;p&#62;The extra MByte of external RAM on Native might be handy for buffering samples.&#60;/p&#62;
&#60;p&#62;By the summer (when you can get your tame student), I'd expect STM32F4 boards and software to be stable.&#60;/p&#62;
&#60;p&#62;(Full disclosure: I am not a member of LeaLabs staff, and I have no financial relationship with LeafLabs)&#60;br /&#62;
(Bed time now)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>AeroProf on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7815</link>
			<pubDate>Fri, 20 Jan 2012 20:16:28 +0000</pubDate>
			<dc:creator>AeroProf</dc:creator>
			<guid isPermaLink="false">7815@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;All - thank you for the comments and advice.  We'll order a couple of the STM32F4 development boards from Mouser to add to our lab's collection - we have a Maple on the way at the moment.  For that price even if we don't use them for this project, I'm sure we can find some other project to put them into. &#60;/p&#62;
&#60;p&#62;@gbulmer - Would the Maple Native or RET6 be options - I wasn't sure from the comments above?  &#60;/p&#62;
&#60;p&#62;As for the programming/signal processing background...in all honesty mine is quite weak, just enough to be dangerous :)  I'll be hiring a summer student to do all the heavy lifting and this gives me a better idea of the kind of student to recruit!&#60;/p&#62;
&#60;p&#62;Thanks again!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7810</link>
			<pubDate>Fri, 20 Jan 2012 10:50:33 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">7810@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;bubulindo&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;@gbulmer, are those speeds with DMA activated?&#60;/p&#62;
&#60;/blockquote&#62;
&#60;p&#62;Each ADC can sample at 1Msamples/second irrespective of DMA.&#60;br /&#62;
There has been several threads on this topic in the forum.&#60;/p&#62;
&#60;p&#62;Summary&#60;br /&#62;
Maple will not give close to 1Msamples/second data rate using libmaple for three reasons:&#60;br /&#62;
1. libmape configures the ADC sample rate to be about 5microseconds/sample to make it more tolerant of low quality input signals. So even with DMA, the sample rate is relatively low (about 20x Arduino). To speed up the sample rate up, use a buffer amplifier (e.g. op amp) to drive the input signal to the ADC, and go straight to the ADC hardware to set the ADC sample rate to maximum speed.&#60;br /&#62;
2. libmaple does some validation and conversion of pin numbers before getting to the ADC hardware and starting it to take a sample, so there is a bit of lag between calling analogRead and starting the hardware ADC&#60;br /&#62;
3. libmaple ADC read (analoRead) 'blocks' waiting for the sample, and then it has function overhead returning the sample, so there is a bit of a lag after each sample is ready&#60;br /&#62;
IIRC, libmaple analogRead gets samples at roughly 160ksps in software.&#60;/p&#62;
&#60;p&#62;It could give 1msamples/second in code, without DMA, if it were programmed carefully, but the code would spend a lot of its time grabbing samples. &#60;/p&#62;
&#60;p&#62;It is more efficient to grab blocks of ADC samples with DMA, and concurrently process them.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7809</link>
			<pubDate>Fri, 20 Jan 2012 10:33:17 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">7809@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;AeroProf -sorry for my slow follow up, I am on GMT, and had other things to do, like sleep :-)&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;The lamb wave frequency I'd want to measure would be on the order of 25-250 kHz. I wouldn't monitor the structure continuously, only when I need to interrogate the health of it - so storing a second or two of data for further processing is fine if real time transmission isn't possible.&#60;/p&#62;
&#60;/blockquote&#62;
&#60;p&#62;These frequencies are completely beyond an Arduino. You'd need external hardware, and IMHO would really struggle to do anything with the data.&#60;/p&#62;
&#60;p&#62;I believe a reasonable assumption is capture at least 10 samples of a wave cycle to have a decent chance of doing anything with it (Nyquist–Shannon sampling theorem &#60;a href=&#34;http://en.wikipedia.org/wiki/Nyquist–Shannon_sampling_theorem&#34; rel=&#34;nofollow&#34;&#62;http://en.wikipedia.org/wiki/Nyquist–Shannon_sampling_theorem&#60;/a&#62; is a theoretical limit)&#60;/p&#62;
&#60;p&#62;So if you want to handle 250KHz, you should aim to sample at 2.5Msamples/second or more.&#60;br /&#62;
A pair of ADC's on a Maple can run in an 'interleaved' mode, each alternately sampling the same input signal, to give double the sample rate, but even then, it is a bit slow. But you could certainly get started with Maple.&#60;/p&#62;
&#60;p&#62;For your 'production system' I'd recommend you consider the significantly faster STM32F4 MCU. &#60;/p&#62;
&#60;p&#62;It has 3 ADC's, each runs at 2.4Msamples/second, and all three can sample the same signal in an interleaved mode, giving a theoretical 7.2Msamples/second, so you'd have a bit of headroom. The processor runs at 168MHz, and has hardware floating point, making it easier to write processing and analysis code. It also has 192KBytes of RAM, which would be handy for buffering data. It has dual Digital to Analogue Converters (DACs), so you might be able to do some experiments using them to generate your pulses. MCU's in the STM32F4 families come in versions which can support High-Speed USB or Ethernet which might be just about (theoretically) quick enough to get the data off in real time (though IMHO hard to do in practice).&#60;/p&#62;
&#60;p&#62;There is a very low-cost development board using a member of that STM32F4 processor family available at the moment:&#60;br /&#62;
&#60;a href=&#34;http://www2.mouser.com/ProductDetail/STMicroelectronics/STM32F4DISCOVERY/?qs=J2qbEwLrpCGdWLY96ibNeQ%3d%3d&#34; rel=&#34;nofollow&#34;&#62;http://www2.mouser.com/ProductDetail/STMicroelectronics/STM32F4DISCOVERY/?qs=J2qbEwLrpCGdWLY96ibNeQ%3d%3d&#60;/a&#62;&#60;br /&#62;
It is about $18 because it is an ST development board to promote the MCU. Don't expect this to be available at this price forever, but it is a cheap, extremely powerful piece of hardware to get off the ground.&#60;/p&#62;
&#60;p&#62;To reach these sorts of performance levels, you will need to program straight to the hardware for some functions. For those things, the libraries will slow things down too much. You'll still be programming in C/C++, but will need to read the manuals for the hardware. Having set your expectation, I think you could do initial experiments, and start to really understand how to tackle the problems with higher level libraries.&#60;/p&#62;
&#60;p&#62;I have recently being doing some research on ultrasonic transmission &#38;amp; reception (though nothing implemented yet). In my reading, it is useful to have quit a lot of flexibility over the transmitted wave. So I'd likely try to use the on-board DAC's.&#60;/p&#62;
&#60;p&#62;IMHO the MCP4725 external DAC is likely too slow to generate a good quality 'excitation' wave.&#60;br /&#62;
&#60;a href=&#34;http://www.sparkfun.com/products/8736&#34; rel=&#34;nofollow&#34;&#62;http://www.sparkfun.com/products/8736&#60;/a&#62;&#60;br /&#62;
It is 12 bit, and only 3.4Mbps interface, so it would appear to be a little under 300ksamples/second which even at the Nyquist–Shannon sampling theorem limit is only a 150KHz signal. IMHO, you might as well use a Maple RET6, Maple Native or STM32F4 DAC. The AD9835 signal generator appears to be more useful, though I have barely glanced at the datasheet.&#60;/p&#62;
&#60;p&#62;A lot of this is quite sophisticated software. Have you a strong programming and signal processing background?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bubulindo on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7806</link>
			<pubDate>Fri, 20 Jan 2012 06:46:15 +0000</pubDate>
			<dc:creator>bubulindo</dc:creator>
			<guid isPermaLink="false">7806@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The latest Maple has a DAC onboard. :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>AeroProf on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7805</link>
			<pubDate>Fri, 20 Jan 2012 06:18:46 +0000</pubDate>
			<dc:creator>AeroProf</dc:creator>
			<guid isPermaLink="false">7805@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;@bublindo, yes, I'm sending a short sine wave pulse to the piezo actuator on the structure.  Typically this might be only a few cycles to create the initial lamb wave.   For that I was looking at a DAC like:  &#60;a href=&#34;http://www.sparkfun.com/products/9169&#34; rel=&#34;nofollow&#34;&#62;http://www.sparkfun.com/products/9169&#60;/a&#62; or &#60;a href=&#34;http://www.sparkfun.com/products/8736&#34; rel=&#34;nofollow&#34;&#62;http://www.sparkfun.com/products/8736&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bubulindo on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7802</link>
			<pubDate>Fri, 20 Jan 2012 02:51:10 +0000</pubDate>
			<dc:creator>bubulindo</dc:creator>
			<guid isPermaLink="false">7802@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;When you say pulse the input signal, what do you mean? Some sort of actuator on the structure?&#60;/p&#62;
&#60;p&#62;@gbulmer, are those speeds with DMA activated?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>AeroProf on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7801</link>
			<pubDate>Thu, 19 Jan 2012 22:21:58 +0000</pubDate>
			<dc:creator>AeroProf</dc:creator>
			<guid isPermaLink="false">7801@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Cool, thanks for the quick reply!&#60;/p&#62;
&#60;p&#62;Here's some additional info - I'm looking at detecting lamb waves propagating in structures - basically guided stress waves.  The lamb waves would be generated with a piezo bonded to the part and then another piezo, or an array of piezos, would listen for the dispersed lamb waves.  Commercial systems are very expensive, power hungry and heavy - we're using one now and its a beast.  I think with open source hardware it can be done much less expensively with comparable performance - that's what I'd like to demonstrate.&#60;/p&#62;
&#60;p&#62;The lamb wave frequency I'd want to measure would be on the order of 25-250 kHz.  I wouldn't monitor the structure continuously, only when I need to interrogate the health of it - so storing a second or two of data for further processing is fine if real time transmission isn't possible.&#60;/p&#62;
&#60;p&#62;Basically I would pulse the input signal, listen, record the propagating waves, run some analysis (compare the signal to a stored baseline) and then pulse again.  It'd be nice to have an array of piezos, pulse repeatedly and listen to each receiver in turn.&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7800</link>
			<pubDate>Thu, 19 Jan 2012 20:52:31 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">7800@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Would you tell us something about the kind of data rates and volumes you are aiming for so we can help a bit more?&#60;/p&#62;
&#60;p&#62;IMHO for Maple, the bottleneck is the speed that you can save data to storage, or get it off the board. Maple is theoretically about 200x faster than Arduino for analogue data sampling.&#60;/p&#62;
&#60;p&#62;An Arduino has one 10Ksamples/second (actually slightly slower) 10bit Analogue to Digital Converter (ADC). It can only sample one of 8 ADC input channels at a time (8 on a nano, 6 on an UNO). So you pack a channel number and value into 2bytes/sample. That is less than 20kBytes/second. A 2GByte SD memory would take about 100,000 seconds to fill, or about a day and a quarter (a bit less). The bottleneck is how fast it can sample data. &#60;/p&#62;
&#60;p&#62;Compare that with an ordinary Maple.&#60;/p&#62;
&#60;p&#62;Maple has two ADC, each one is 12 bits, and each can run at a maximum of 1Msamples/second. A Maple has 16 ADC channels it can sample, two at a time, so when packing the channel number into the results, the two bytes would be fully used. A Maple could capture at about 4mBytes of sample data/second. That is faster than full-speed USB. A 2GB SD memory would take about 500 seconds to fill, or a bit over 8 minutes. To be honest, it is hard to move that data rate off the board. The Maples sampling system isn't the bottleneck as much as output or storage. That sort of data rate would warm up my Mac laptop, and use a lot of the bandwidth writing to  the hard drive.&#60;/p&#62;
&#60;p&#62;Arduino and Maple are very different beasts.&#60;/p&#62;
&#60;p&#62;If you used a Maple Native or RET6, they have three ADC's, giving 50% more throughput.&#60;/p&#62;
&#60;p&#62;It is actually hard to deal with the sort of data volumes a Maple could capture.&#60;/p&#62;
&#60;p&#62;Edit: The processor on the Maple is a 32bit processor, it can do an arithmetic operation on a 32bit quantity in a single cycle (and runs at 72MHz). The processor in the Arduino is an 8bit processor, so it takes several cycles (of its 16MHz) to operate on a 10bit quantity. So you could do more processing of the captured signals on an Maple than an Arduino. The difference is not as dramatic as the ADC performance difference, but it is still significant.&#60;/p&#62;
&#60;p&#62;(Full disclosure: I am not a member of LeafLabs staff)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>AeroProf on "High Speed Data Acquisition - What&#039;s the best to expect?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1292#post-7799</link>
			<pubDate>Thu, 19 Jan 2012 20:16:27 +0000</pubDate>
			<dc:creator>AeroProf</dc:creator>
			<guid isPermaLink="false">7799@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;So here's my challenge - whether or not Maple would be suitable for use as part of a portable, low cost, high speed data acquisition system.  First, I'm a structures person and a total microcontroller newbie - although I'm learning fast - so pardon my question if it seems basic...&#60;/p&#62;
&#60;p&#62;Background - I'd like to explore the limits of high speed data logging with the Maple or other low cost microcontrollers for some structural health monitoring projects I'm working on.&#60;/p&#62;
&#60;p&#62;Here's what I've found on one person's experience with the Maple:&#60;br /&#62;
&#60;a href=&#34;http://thesolarpowerexpert.com/an-open-source-high-speed-data-logger/&#34; rel=&#34;nofollow&#34;&#62;http://thesolarpowerexpert.com/an-open-source-high-speed-data-logger/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Seems kind of low to me...especially in light of this Arduino project:&#60;br /&#62;
&#60;a href=&#34;https://sites.google.com/site/measuringstuff/the-arduino&#34; rel=&#34;nofollow&#34;&#62;https://sites.google.com/site/measuringstuff/the-arduino&#60;/a&#62; &#60;/p&#62;
&#60;p&#62;Has anyone else explored this?  Any advice or other devices/directions for me to consider?&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
