Continuous intermittent detection

Just about everything about Red Pitaya
Post Reply
hetlelid
Posts: 3
Joined: Sat Jan 07, 2017 10:11 pm

Continuous intermittent detection

Post by hetlelid » Sat Jan 07, 2017 11:25 pm

I'm looking into a testsetup with RP to continuous monitor and detect intermittent fault in a circuit or PCB. The idea is to look for intermittent connectivity while stimulate product with vibrations or bending etc.

I find different ways to do this:
-Transmit DC and just detect major intermittent as voltage drop
-Transmit sinewave and detect harmonic distortion
-Transmit sinewave with DC offset, software highpass filter and FFT

The plan is to make a python script that report the amplitude and duration of a intermittent fault. together with timestamp.

Any thoughts or recommendations?

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Continuous intermittent detection

Post by Nils Roos » Sun Jan 08, 2017 12:31 am

What constitutes a fault in your device under test? Are you interested only in a total loss of conduction or also variances in (complex) impedance?

hetlelid
Posts: 3
Joined: Sat Jan 07, 2017 10:11 pm

Re: Continuous intermittent detection

Post by hetlelid » Sun Jan 08, 2017 2:47 pm

The plan was to detect all of them. But to get started i think to simplify and focus on actual DC voltage drop, to test connectors for intermittent during vibrating stimulation.

Tested with a python script running on the RP connecting to SCPI server. Worked ok, but this method seems to be to slow to act continuously (without dropping samples between buffer). Any way to speed up this? Can i set a lower bit resolution? (i have 14bit version).

I get 16384 samples for each buffer, can i change this? Is it correct that the timeframe for this buffer is 131μs? (1/125Msps=8ns => 16384*8=131072ns)

Can i get direct access to raw data buffer from ADC in python, without SCPI? scpi-server take a lot of CPU resources.

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Continuous intermittent detection

Post by Nils Roos » Sun Jan 08, 2017 10:44 pm

Any way to speed up this? Can i set a lower bit resolution? (i have 14bit version).
Yes, sort of. No.
You can speed up the datarequest by choosing BIN as data format ("ACQ:DATA:FORMAT BIN"), the samples will then be delivered as 16bit binary values, and they will only have the offset calibration applied.
I get 16384 samples for each buffer, can i change this? Is it correct that the timeframe for this buffer is 131μs? (1/125Msps=8ns => 16384*8=131072ns)
You can request a portion of the buffer with "ACQ:SOUR#:DATA:STA:END?" (from, to) or "ACQ:SOUR#:DATA:STA:N?" (from, len) or "ACQ:SOUR#:DATA:OLD:N?" (oldest n) or "ACQ:SOUR#:DATA:LAT:N?" (latest n). The decimation is applied before writing the samples into the buffer, so the amount of time covered by the buffer depends on the configured decimation factor.
Can i get direct access to raw data buffer from ADC in python, without SCPI? scpi-server take a lot of CPU resources.
A locally running python program can use the mmap method to access the fpga, see here. Polling the untriggered scope's write pointer and emptying the buffer in time is the only way to get uninterrupted continuous samples from the standard scope logic, no matter what language you use.

hetlelid
Posts: 3
Joined: Sat Jan 07, 2017 10:11 pm

Re: Continuous intermittent detection

Post by hetlelid » Mon Jan 09, 2017 10:36 pm

Thanx for the reply! That's the way to go.

I tried the below code, and it seems like i can read the first sample.

Is each sample stored in a 32 bit memory block?

Is this the raw ADC value? How do i convert it to voltage? I expected it to be a signed value, but still get a positive number when input negative voltage.

How do you recommend me to proceed to read and empty the entire buffer?

Code: Select all

#!/usr/bin/python
import mmap
import struct
import os
import time
import binascii
fd = os.open('/dev/mem', os.O_RDWR)
m = mmap.mmap(fileno=fd, length=mmap.PAGESIZE, offset=0x40110000)
print binascii.hexlify(m[0:4])
print struct.unpack('<i',m[0:4])

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Continuous intermittent detection

Post by Nils Roos » Tue Jan 10, 2017 1:35 am

Is each sample stored in a 32 bit memory block?
Yes, because it is excessively complicated to implement smaller granularity on the FPGA side.
Is this the raw ADC value? How do i convert it to voltage? I expected it to be a signed value, but still get a positive number when input negative voltage.
Yes, you will get raw samples in the lowest 14bit of each location, and they will be 14bit signed values, not sign-extended to fill your target variable (ie bit 13 will indicate sign, but all higher bits will be 0, making the value appear positive when stored as an int).

To convert that to a voltage, first do sign-extension, then add the offset calibration value and then apply the gain calibration value. You can find C examples for applying the calibration in the RP api (api/rpbase/src/common.c).
How do you recommend me to proceed to read and empty the entire buffer?
Research what bulk transfer methods python offers to access the mmapped region. Then proceed as outlined here.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 18 guests