This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
在F28035的有感BLDC实例中,有一个问题始终没想明白,请教TI专家:
HALL3_CREATE_MAP建立换向表HallMap[HallMapPointer],其中每个元素对应相应的换向策略点的HALL电平。
因为HallMapPointer在小于一转(Revolutions<=0)时,在ISR中是随着模6计数器的Counter变化的。那么是如何保证HallMap中是按照正确的顺序存储HALL电平值?
比如说,正常的HALL电平顺序是 5 1 3 2 6 4,而HallMapPointer变化,比如说HALL电平5,可以存储在HallMap[]中的任何位置啊?
如何保证HallMap[0]---->5 HallMap[1]---->1 HallMap[2]---->3 HallMap[3]---->2 HallMap[4]---->6 HallMap[5]---->4
没搞明白!
hall1.HallMapPointer = (int16)mod1.Counter;
HALL3_READ_MACRO(hall1)
if (ClosedFlag==FALSE)
{
mod1.TrigInput = impl1.Out;
mod1.Counter = (int32)hall1.HallMapPointer;
}
else
{
mod1.TrigInput = (int32)hall1.CmtnTrigHall;
}
MOD6CNT_MACRO(mod1)
在HVBLDC_Sensored示例代码中有如上一段,正常的换向逻辑是513264,有如下疑问:
1、在第一个ISR时,hall1.HallMapPointer = (int16)mod1.Counter=0,那么进入HALL3_READ_MACRO(hall1)将会建立HallMap[0]=5。
2、第二个ISR时,出现了抖动,进入HALL3_READ_MACRO(hall1)会延迟消抖滤波,此时在主ISR中,hall1.HallMapPointer = mod1.Counter还是自加的。
那么消抖完毕后,可能建立的换向表完毕后,是不是可能出现:
HallMap[HallMapPointer ] =HallMap[1]=1
HallMap[HallMapPointer ]=HallMap[2]=1
HallMap[HallMapPointer ] =HallMap[3]=1
HallMap[HallMapPointer ]=HallMap[4]=1
HallMap[HallMapPointer ] =HallMap[5]=1
我的意思就是说HallMapPointer在开环时,都是随mod1.Counter自加的,如何保证
HallMap[0]=5
HallMap[1]=1
HallMap[2]=3
HallMap[3]=2
HallMap[4]=6
HallMap[5]=4
似乎您忽略了一个条件:
mod1.counter计数的时候需要满足TrigInput=0x7FFF,也就是换相变量cmtnTrigHall=0x7FFF
如果不满足上述条件,HallMapPointer一直不会变,程序一直执行hall1.HallMap[HallMapPointer]=hall1.HallGpioAccepted