Jump to content

poll

Members
  • Posts

    1
  • Joined

  • Last visited

poll's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Hi! I would like to measure the current in an AC signal using an AD2. To do this, I have a set of shunt resistors that I could use with different values. The plan was to: Connect each channel of the AD2 scope on each side of the shunt resistor. Put it in the circuit I want to measure. Calculate the voltage difference in each sample and then calculate the AC current. The first super-basic test I am doing is connecting the DC power supply providing always a fixed value (e.g., 1V) to each channel with no shunt resistor: just two wires directly from the power supply to each channel. The difference should be zero (or very close). When measuring the difference, however, I get up to 10mV of difference (mean=~4.4mV; median=~4.3mV), which would not allow me to measure the current in the milliamps range that I want (and impossible in the microamps that I would love to support). With this resolution, I cannot proceed to the next steps (adding the shunt resistor and later on using an AC signal). Is there any way in the API to get only the difference between both signals directly (e.g., without comparing with GND), or running measurements (RMS of the difference) at the AD2 directly, or any other way to obtain higher precision of the difference between both signals? Just in case I did something wrong in the code: scope.open(self.device_data, sampling_frequency=12500000.0, record_length=25000.0, buffer_size=500) scope.trigger(self.device_data, channel=0, enable=True, timeout=1.0, edge_rising=True, level=0.0, source=scope.trigger_source.analog) scope.channel(self.device_data, enable=True, channel=0, amplitude_range=8.0, offset=0.0, attenuation=1.0) scope.channel(self.device_data, enable=True, channel=1, amplitude_range=8.0, offset=0.0, attenuation=1.0) # set up the instrument dwf.FDwfAnalogInConfigure(device_data.handle, ctypes.c_bool(False), ctypes.c_bool(True)) # read data to an internal buffer while True: status = ctypes.c_byte() # variable to store buffer status dwf.FDwfAnalogInStatus(device_data.handle, ctypes.c_bool(True), ctypes.byref(status)) # check internal buffer status if status.value == scope.constants.DwfStateDone.value: # exit loop when ready break # copy buffer buffer_ch1 = (ctypes.c_double * scope.data.buffer_size)() # create an empty buffer buffer_ch2 = (ctypes.c_double * scope.data.buffer_size)() # create an empty buffer dwf.FDwfAnalogInStatusData(device_data.handle, ctypes.c_int(0), buffer_ch1, ctypes.c_int(scope.data.buffer_size)) dwf.FDwfAnalogInStatusData(device_data.handle, ctypes.c_int(1), buffer_ch2, ctypes.c_int(scope.data.buffer_size)) Where scope.channel is: def channel(device_data, enable, channel, amplitude_range, offset, attenuation): dwf.FDwfAnalogInChannelEnableSet(device_data.handle, ctypes.c_int(channel), ctypes.c_bool(True)) dwf.FDwfAnalogInChannelRangeSet(device_data.handle, ctypes.c_int(channel), ctypes.c_double(amplitude_range)) dwf.FDwfAnalogInChannelOffsetSet(device_data.handle, ctypes.c_int(channel), ctypes.c_double(offset)) dwf.FDwfAnalogInChannelAttenuationSet(device_data.handle, ctypes.c_int(channel), ctypes.c_double(attenuation)) Thank you very much in advance!
×
×
  • Create New...