U3 HV- issue with accuracy of output | LabJack
 

U3 HV- issue with accuracy of output

3 posts / 0 new
Last post
Hayley122
Hayley122's picture
U3 HV- issue with accuracy of output

Hi all,

I am using a LabJack U3-HV to get my laptop to communicate with a Digitmer DS8R. The DS8R will be used to deliver electrical stimulation to participants.

For my experiment, participants will receive two stimuli of varying intensity and will have to determine which one is more intense with the aim being to determine the minimum intensity participants can discriminate between.

I have connected the DS8R to the LabJack through the DAC0 port and the LabJack is connected to my laptop through the USB port

I am using the below python code via psychopy to set the voltage of the DAC0

try:

    from labjack import u3

except ImportError:

    import u3

d = u3.U3()

d.getCalibrationData()

DAC0_VALUE = d.voltageToDACBits(0.07, dacNumber = 0, is16Bits = False)

d.getFeedback(u3.DAC0_8(DAC0_VALUE))          #sets the amplitude on the DS8R to 7mA

The issue I am having is with the accuracy of the output current to the DS8R which varies depending on the voltage I use.

For example, if I set the amplitude of the first intensity to 7mA and the second to 7.5mA, the difference between both stimuli is around 2 mA.

In other instances, if I set a 1mA difference between the stimuli (e.g., stimuli one at 10mA and stimulus two at 11mA) the output for both values is the same intensity.

When using the Test panel in the LJcontrolPanel to vary DACO, the accuracy of the amplitude on the DS8R is relatively precise, leading me to believe there is some error in my code or a calibration issue.

I am very new to using a LabJack so any advice would be much appreciated.

Thank you

 

LabJack Support
LabJack Support's picture
With the 8-bit DAC mode,

With the 8-bit DAC mode, there are 256 (28) "bins" to represent the 0-5V range, so we expect the smallest voltage change that can be resolved to be about 5/256= 0.0195V.  In our example we use the DAC_8 command as this is compatible with all hardware revisions of the U3, but since you have the U3-HV you can use the DAC_16 command to get better resolution:

https://github.com/labjack/LabJackPython/blob/master/src/u3.py#L2407

Note that the 16-bit mode is strange in that the values are aligned to 16 bits, but the hardware only actually has 10-bit resolution, so the resolution when using the DAC_16 command on a U3-HV is around 5/210=0.00488V. There is some additional information about the DAC outputs and resolution in the datasheet:

https://labjack.com/support/datasheets/u3/hardware-description/dac

Hayley122
Hayley122's picture
Thank you, this has solved my

Thank you, this has solved my problem!