Part Number:DRV8303
I am currently using a DRV8303 to drive a BLDC motor. There is an issue with current sensing.
Without any motor attached to my board and a motor voltage (PVDD) connected, the current sense output (SO1 and SO2) is correct.
I have checked that SN1 and SP1 as well as SN2 and SP2 are at exactly 0 V, which is correct since there is no current flowing through the shunt resistor. Reference input REF is at exactly 3.3 V. The output of the SO1 and SO2 pin is 1.65V, which is normal.
To test if the amplifier is functioning, I remove the shunt resistor, which is connected to the SN1 and SP1 pins, and manually apply a voltage(0.100V) to the SN1 pin, which supposedly will be amplified, and the voltage on the SO1(output) pin will drop to 0.65V (according to the formula [1.65-(0.1*10)] as I set the gain of the C.S.A. to 10V). However, the voltage on the SO1 pin remains to be 1.65V. The output of the C.S.A is unresponsive to the input.
Here is my schematic and circuit:
BRD: https://www.ti2k.com/wp-content/uploads/ti2k/DeyiSupport_电机驱动器_view
Here is my code:
#include <SPI.h>
#define INHA PA8
#define INLA PA9
#define SO1 PB1
#define INHB PA10
#define INLB PB6
#define SO2 PB0
#define INHC PB7
#define INLC PB8
#define LED PC13
#define EN_GATE PB12
#define NOCTW PB14
#define NFAULT PB13
#define chipSelectPin PA4
word data;
void changeSPI3PWM()
{
digitalWrite(chipSelectPin, LOW); // manually take CSN low for SPI_1 transmission
data = SPI.transfer16(0b0001000000111000); //0 0010 00000111000
digitalWrite(chipSelectPin, HIGH);
}
void changeCurrentSense() {
digitalWrite(chipSelectPin, LOW);
data = SPI.transfer16(0b000110000000000); //0 0011 0000000000
digitalWrite(chipSelectPin, HIGH);
}
void setup() {
SPI.begin();
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE1);
SPI.setClockDivider(SPI_CLOCK_DIV16);
pinMode(chipSelectPin, OUTPUT);
Serial.begin(115200);
pinMode(INHA, OUTPUT);
pinMode(INLA, INPUT);
pinMode(SO1, INPUT);
pinMode(INHB, OUTPUT);
pinMode(INLB, INPUT);
pinMode(SO2, INPUT);
pinMode(INHC, OUTPUT);
pinMode(INLC, INPUT);
pinMode(EN_GATE, OUTPUT);
pinMode(PB4, OUTPUT);
pinMode(NOCTW, INPUT);
pinMode(NFAULT, INPUT);
pinMode(LED, OUTPUT);
digitalWrite(PB4, LOW); //PB4 is the DC_CAL PIN
digitalWrite(EN_GATE, HIGH);
changeSPI3PWM();
changeCurrentSense();
}
void loop() {
digitalWrite(INHB, HIGH);
digitalWrite(INHA, HIGH);
digitalWrite(INHC, HIGH);
if (digitalRead(NFAULT) == LOW) {
Serial.println("NFault low");
}
if (digitalRead(NOCTW) == LOW) {
Serial.println("NOCTW low");
}
Serial.print(Current_Calculation(analogRead(SO1) / 4096. *3.3), 10);
Serial.print(" ");
Serial.println(Current_Calculation(analogRead(SO2) / 4096. *3.3), 10);
}
double Current_Calculation(double RawVolt) {
const double K = 2. ;
const double G = 80.;
const double VREF = 3.3;
return (VREF – (K * RawVolt)) / (G * K); //general solve
}
Do you have an explanation of what might be the most likely reason for this error?
Sincerely,
Dennis Chang
Cherry Zhou:
Hi Dennis,
Sounds like the DC calibration is being enabled. This will short the SPx-SNx inputs to GND causing VREF/2 output on the CSA pin.
Please check if DC_CAL pin (PB4) is set low and DC_CAL_CHx register in SPI is set to 0b.
Thanks.
,
Dennis Chang:
Hi Cherry,
Sorry, I didn't mention it before, but I am sure that the DC_CAL pin (PB4) is set to LOW and the DC_CAL register in SPI is disabled when that issue occurs.
Dennis Chang 说:digitalWrite(PB4, LOW); //PB4 is the DC_CAL PIN
Are there any other possible causes that may be related to this issue?
,
Cherry Zhou:
Having updated to our experts and please expect the response.
,
Cherry Zhou:
Hi,
We would like you to measure resistance between SNX to GND and SPX to GND.
We would also like to have you to measure the DC_CAL pin directly while you apply 100mV across SNX and SPX and not just to SNx and ground. There might be a difference in what the program is sending and what is actually happening at the pin.
TI中文支持网

