比如下面程序里的细分参数的最大值 2048。最近在看步进电机的细分控制,我想不明白怎么能做到在很大的速度范围内使用这个细分表。细分表调节的是CCRx,而步进电机速度变化靠的是调节ARR,ARR变化那么大,CCRx还是按照这个表,这样可行吗?
//两相细分,两个波形相位相差90度
//波形周期:4
//细分参数最大值:2048
//倍数:1.00
//细分数:64
//////////////////////////正弦表///////////////////////
const unsigned short int SubSinTable[]=
{
0,50,100,150,200,250,300,350,399,448,497,546,594,642,689,737,783,829,875,920,
965,1009,1052,1095,1137,1179,1219,1259,1299,1337,1375,1412,1448,1483,1517,1550,1583,1614,1644,1674,
1702,1730,1756,1781,1806,1829,1851,1872,1892,1910,1928,1944,1959,1973,1986,1998,2008,2017,2025,2032,
2038,2042,2045,2047,/*64-->*/2047,2045,2042,2038,2032,2025,2017,2008,1998,1986,1973,1959,1944,1928,1910,1892,
1872,1851,1829,1806,1781,1756,1730,1702,1674,1644,1614,1583,1550,1517,1483,1448,1412,1375,1337,1299,
1259,1219,1179,1137,1095,1052,1009,965,920,875,829,783,737,689,642,594,546,497,448,399,
350,300,250,200,150,100,50,0,/*128-->*/0,50,100,150,200,250,300,350,399,448,497,546,
594,642,689,737,783,829,875,920,965,1009,1052,1095,1137,1179,1219,1259,1299,1337,1375,1412,
1448,1483,1517,1550,1583,1614,1644,1674,1702,1730,1756,1781,1806,1829,1851,1872,1892,1910,1928,1944,
1959,1973,1986,1998,2008,2017,2025,2032,2038,2042,2045,2047,/*192-->*/2047,2045,2042,2038,2032,2025,2017,2008,
1998,1986,1973,1959,1944,1928,1910,1892,1872,1851,1829,1806,1781,1756,1730,1702,1674,1644,1614,1583,
1550,1517,1483,1448,1412,1375,1337,1299,1259,1219,1179,1137,1095,1052,1009,965,920,875,829,783,
737,689,642,594,546,497,448,399,350,300,250,200,150,100,50,0,/*256-->*/
}; |