Other Parts Discussed in Thread: CONTROLSUITE
hi:
I use f28020 as HALL sensor BLDC control .
when I migrated HVBLDC_Sensor from controlsuite , macro HALL3_READ_MACRO(hall1) as fllow :
#define HALL3_READ_MACRO(v) \
v.CmtnTrigHall = 0; /* Reset trigger, it only handshakes with calling program.*/ \
if (v.EdgeDebounced==0) /* Debounce current position. */ \
{ \
HALL3_DEBOUNCE_MACRO(v) \
v.CmtnTrigHall = v.EdgeDebounced; /* Set Commutation trigger here*/ \
} \
else /* If current position is debounced, find match in table */ \
HALL3_NEXT_STATE_MACRO(v) /* and return pointer to current state. Ptr to be incremented*/ \
/* by MOD6CNT after RET.*/ \
\
v.EdgeDebounced = 0; /* Reset trigger*/
question1:
EdgeDebounced is a switch of debouncing or debounced , but as below said . this macro run in debouncing adjust ,can not run HALL3_NEXT_STATE_MACRO(v),forever. because of last " v.EdgeDebounced = 0;" Is that correct?
question2:
in HALL3_DEBOUNCE_MACRO(v) , in my understand it start run and create HALLmap[i] function . but" HallMapPointe" don't useful at
BLDCPWM_MACRO(pwm1). because:
if (hall1.HallGpioAccepted==5) pwm1.CmtnPointer = 0;
else if (hall1.HallGpioAccepted==1) pwm1.CmtnPointer = 1;
else if (hall1.HallGpioAccepted==3) pwm1.CmtnPointer = 2;
else if (hall1.HallGpioAccepted==2) pwm1.CmtnPointer = 3;
else if (hall1.HallGpioAccepted==6) pwm1.CmtnPointer = 4;
else if (hall1.HallGpioAccepted==4) pwm1.CmtnPointer = 5;
so HallMapPointe just input from MOD6CNT and NOT output to BLDCPWM_MACRO. also" HallMap[i] " do not useful !
as these I think " HALL3_DEBOUNCE_MACRO(v)" do not useful , shall I correct?
qustion 3:
in HVBLDC_Sonser there has a" speed_pr.h " , in it : "SpeedScaler"=60*f/rmp_max; in initial SpeedScaler =260 .
I don't know why SpeedScaler =260. how calculate it ?
"BaseRpm"=1800 . 1800 means rmp_max?
best regard!