This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRV425-BUSBAR-EVM: Reproducing accuracy measurements

Part Number: DRV425-BUSBAR-EVM
Other Parts Discussed in Thread: DRV425, ENERGIA, MSP430FR4133

Team,

I am presenting a short overview of TI current and magnetic sensing innovations at the TI Rochester Innovation day to around 50 customers on December 1st. During the presentation I will be doing several demos including the DRV425 busbar evm. I have the busbar evm and have gotten familiar with it but am having trouble reproducing the accuracy measurements in the reference design.

I initially started by testing my device with the reference design set up. I connected a power supply in constant current mode over the busbar that could be swept from 0-3A. I powered the DRV425 EVM with 5v over USB and measured the voltage between Vout (blue wire) and Vref (orange wire). I recorded the differential voltage between Vout and Vref as well as the current on the power supply as I swept from 0-3A in 0.5A steps. I got a very nice linear result. For the demo however I need to display the result on a projector and convert it to current. To do this I chose to read in two voltages in an ADC then use the linear correlation to convert the result to current. I can plot my result using the Energia 'serial plot' function. 

My current set up is shown below. I have a power supply running in constant current mode supplying 0-3A through the bus bar. I am using the DRV425 evm in the vertical orientation. I am supplying the EVM 5v from a usb port on my laptop. I am using a MSP430FR4133 launchpad as the data collection device. I am reading in Vout (blue wire) and Vref (orange wire) into pins 1.3 and 1.5 respectively and using the MSP430's 10-bit ADC to convert the voltages. The MSP430 is connected via USB to my laptop where the data is relayed through the serial port. 

I attached my energia code below and some of the readouts I am getting. In summery, I convert Vout and Vref in the ADC then subtract Vref from Vout to get the output voltage which can be correlated to a current in the busbar. The issue is that I have large random variations in this output signal of more than 50mV in either direction. To absolve this I tried to smooth the output signal by averaging the last 20 samples. Averaging helped but I still get regular variations of 15-20mV with rare variations of up to 40mV. Even a 15mV error correlates to a 0.6A error (assuming gain of 23.9mV/A given on page 10 of the user guide). At 3 amps this is a huge variation. I have also tried adding delays to give the ADC time to settle. What could I improve to reproduce the accuracy measurements that were reported in the user document (accuracy better than 0.6%)?

Thanks for all the help and have happy holidays. 

Figure 1: Voltage output with no current through bus bar. Smoothing averaging is being used.

Figure 2: Output voltage at 3 amps through bus bar. Smoothing averaging being used:

int voltage,vdiff,vref;
float current, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20;
// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600); // msp430g2231 must use 4800
  voltage, vdiff, vref = 0;
  Serial.println(voltage);
}
// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin A3:
  float sensorValue = analogRead(A3); //read in vout
  delay(2);                           //let adc settle
  float sensorREF = analogRead(A5);   //read in vref
  vout = (sensorValue * (3.3 / 1023.0))*1000; //convert to a voltage
  vref = (sensorREF*(3.3/1023))*1000; //convert to a voltage
  voltage= vdiff-vout; //calculate differential voltage
  ////////////////////////
  //storing and updating the past 20 samples
  c20=c19;
  c19=c18;
  c18=c17;
  c17=c16;
  c16=c15;
  c15=c14;
  c14=c13;
  c13=c12;
  c12=c11;
  c11=c10;
  c10 = c9;
  c9 = c8;
  c8 = c7;
  c7 = c6;
  c6 = c5;
  c5 = c4;
  c4 = c3;
  c3 = c2;
  c2 = c1;
  c1 = voltage;
  //current unused right now, trying to get voltage working first
//  current = 41.83907967 * voltage/1000 - 2.55;
//  if(current > 5){
//    current=c1;
//  }
float  output = (voltage + c1+c3+c4+c5+c6+c7+c8+c9+c10+c11+c12+c13+c14+c15+c16+c17+c18+c19+c20)/21; //take average of last 20 samples
delay(2); //allow adc to settle
  // print out the value you read:
  Serial.println(output); //print output
}