Pulse generation problems
Posted: Wed Aug 16, 2017 4:19 pm
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.
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.