Other Parts Discussed in Thread: CONTROLSUITE
Hi All,
My code is for BLDC sensorless InstaSPIN FOC examle proj lab 05g
To verify the speed estimation I added an encoder and mixed with the example 12a (Sensored (quadrature encoder) feedback with SpinTAC)
but without using SpinTAC
So I added
// initialize the ENC module
encHandle = ENC_init(&enc, sizeof(enc));
// setup the ENC module
ENC_setup(encHandle, 1, USER_MOTOR_NUM_POLE_PAIRS, USER_MOTOR_ENCODER_LINES, 0, USER_IQ_FULL_SCALE_FREQ_Hz, USER_ISR_FREQ_Hz, 8000.0);
and
in the main ISR
// compute the electrical angle
ENC_calcElecAngle(encHandle, HAL_getQepPosnCounts(halHandle));
gives me the angle
but to compute the speed what do I have to do ? (I avoid derivating the given angle)
call
void ENC_run(ENC_Handle encHandle, uint32_t posnCounts, uint16_t indextFlag, uint16_t dirFlag, int16_t log_flag)
or ?
in the 12a example it is used with
// get the speed from eQEP gMotorVars.SpeedQEP_krpm = _IQmpy(STPOSCONV_getVelocityFiltered(stObj->posConvHandle), _IQ(ST_SPEED_KRPM_PER_PU));
but I don't have InstaSPIN, MOTION and SpinTAC
So how to get it
Also, in the ENC_setup, I must specify the enc_zero_offset, this is when the rotor d axis is aligned with the phase a coil ?
can I changed online (encHandle ->enc_zero_offset) with GUI composer variable to see the impact
Thanks
Lotfi