Part Number: DRV8312-C2-KIT
Tool/software: Code Composer Studio
Hallo Guys,
I am working with the project PM_Sensorless of DRV8312-C2-KIT.
I check with the math block function for ramp generation (in headerfile rampgen.h).
The definition and Initialization of RG_MACRO is shown as follow:
typedef struct { _iq Freq; // Input: Ramp frequency (pu)
_iq StepAngleMax; // Parameter: Maximum step angle (pu)
_iq Angle; // Variable: Step angle (pu)
_iq Gain; // Input: Ramp gain (pu)
_iq Out; // Output: Ramp signal (pu)
_iq Offset; // Input: Ramp offset (pu)
} RAMPGEN;
/*------------------------------------------------------------------------------
Object Initializers
------------------------------------------------------------------------------*/
#define RAMPGEN_DEFAULTS {0, \
0, \
0, \
_IQ(1), \
0, \
_IQ(1), \
}
But in the code for RG_MARCO, we can see this:
v.Angle += _IQmpy(v.StepAngleMax,v.Freq);
So my question is about the StepAngleMax variable. The value of StepAngleMax was set to be 0 in initialization.
That means the value of _IQmpy(v.StepAngleMax,v.Freq) always kept to be zero because this is a multiplication.
But I think the initialization for RG_MARCO can not be wrong. I can be my misunderstanding. I hope some experter
can explain it for me. Thank you very much!
Best Regards
Tao