Page 1 of 1

Pulse generation problems

Posted: Wed Aug 16, 2017 4:19 pm
by Jackk
Hi,

I'm attempting to use my RP to measure oscillation in ultrasound transducers. What I want is for my RP to send a single pulse and measure the ringing it generates.

I'm using Python to remote control the RP. What I want initially is simply, a single 4MHz pulse every 1ms. Here's the code:

#!/usr/bin/python

import redpitaya_scpi as scpi
import time

rp_s = scpi.scpi()

#Define burst waveform
wave_form = 'sine'
freq = 4020000
ampl = 1
burstPerSecond = 1000

#Config
rp_s.tx_txt('GEN:RST')
rp_s.tx_txt('SOUR1:FUNC ' + str(wave_form).upper())
rp_s.tx_txt('SOUR1:FREQ:FIX ' + str(freq))
rp_s.tx_txt('SOUR1:VOLT ' + str(ampl))
rp_s.tx_txt('SOUR1:BURS:NCYC 1')
rp_s.tx_txt('OUTPUT1:STATE ON')
rp_s.tx_txt('SOUR1:BURS:STAT ON')
rp_s.tx_txt('SOUR1:TRIG:SOUR INT')

while(1):
rp_s.tx_txt('SOUR1:TRIG:IMM')
print('BURST\n')
time.sleep(1/burstPerSecond)

Rather than sending 1 pulse every 1 ms, it sends 1 pulse then continues to send 4 close pulses (see attached image) every 0.2ms and 1.5ms.
If I include the setup code in the while loop, i get a single pulse every 1.08ms with a burst of around 300 pulses in between each single pulse
I also get a 200mv DC offset after each pulse when doing a single pulse. This does not happen if i do >3 pulses.

Any suggestions on how to resolve these issues is greatly appreciated.

Re: Pulse generation problems

Posted: Mon Aug 21, 2017 3:48 pm
by Jackk
I've been having another look today and the problem only seems to occur when sending pulses over approximately 350KHz. Anything below that and the system works perfectly.

As I go above 350KHz, I get a second, consecutive pulse. Then when I go even higher, I get a third consecutive pulse.

Re: Pulse generation problems

Posted: Tue Aug 22, 2017 2:57 am
by JohnnyMalaria
I've never had much joy trying to generate bursts of sine or square waves but I have had better luck using the arbitrary waveform generator for some reason. You could try loading a single cycle of a sine wave into the generator buffer and use the arbitrary option instead.