Part Number: DRV8312-C2-KIT
Other Parts Discussed in Thread: INSTASPIN-BLDC
Hey there,
I am working with the DRV8312-C2-Kit and I am looking into the elektromotive force measurement and the InstaSPIN-BLDC-function.
I found the definition of InstaSPIN-BLDC:
typedef struct
{
int32 Vag; // Internal: Vag input -- contains real Va + VaOffset --> referenced to ground (_iq)
int32 Vbg; // Internal: Vbg input -- contains real Vb + VbOffset --> referenced to ground (_iq)
int32 Vcg; // Internal: Vcg input -- contains real Vc + VcOffset --> referenced to ground (_iq)
int32 Van; // Internal: Va to neutral (_iq)
int32 Vbn; // Internal: Vb to neutral (_iq)
int32 Vcn; // Internal: Vc to neutral (_iq)
int32 VaOffset; // VaOffset (_iq)
int32 VbOffset; // VbOffset (_iq)
int32 VcOffset; // VcOffset (_iq)
int32 Int_Threshold; // Input: Integration threshold where a commutate happens (_iq)
Eintbool Vint_lockout; // Internal: Flyback voltage lockout flag
int32 *Vphase; // Internal: Pointer to the Phase voltage to count (_iq)
int32 V_int; // Output: Integrator (_iq)
Eintbool Comm_Trig; // Output: Commutation trigger impulse
Uint16 State; // Input: Values 0 to 5
} INSTASPIN_BLDC;
The Vag means voltage between OUT_A and ground, Van means voltage between OUT_A and the star connection point and VaOffset is the voltage between star connection point and ground.
That would mean Vag = Van + VaOffset.
Am I right here?
Going on, there are some lines in the MainISR I don't understand:
Why is the ADC-Result leftshifted three times/multiplied with eight?
iqVaIn = _IQ15toIQ((AdcResult.ADCRESULT1<<3));
The voltage divider for measuring phase voltages is giving the voltage between OUT_A and ground to the ADC.
The ADC-Result is written into Vag (which means the same, following my assumptions before).
So why is there an offset adjustment?
InstaSPIN_BLDC1.Vag = iqVaIn - InstaSPIN_BLDC1.VaOffset;
And last question is about the calibration. What is done in the following line?
InstaSPIN_BLDC1.VaOffset = _IQmpy(cal_filt_gain,iqVaIn) + InstaSPIN_BLDC1.VaOffset;
Thank you in advance!
Sarah