單片機軟件濾波的幾種方法:假定從AD中讀取數據的子程序為:unsigned int get_ad();1、限幅濾波法(又稱程序判斷濾波法)A、方法:根據經驗判斷,確定兩次采樣允許的最大偏差值(設為A)。每次檢測到新值時判斷:如果本次值與上次值之差<=A,則本次值有效;如果本次值與上次值之差>A,則本次值無效,放棄本次值,用上次值代替本次值。B、優點:能有效克服因偶然因素引起的脈沖干擾C、缺點:無法抑制那種周期性的干擾,平滑度差D、軟件實現://=======================//值A可根據實際情況調整,value為有效值,new_value為當前采樣值//濾波程序返回有效的實際值
針對無位置傳感器無刷直流電機的位置檢測問題,本文應用單片機成功地實現了一種軟件檢測方法,并給出了實測波形加以驗證。關鍵詞: 無刷直流電機 無傳感器 位置檢測Abstract: As to the position-detecting problem of sensorless brushless DC motor, a softwarerealization by microcomputer is proposed successfully in the paper. Experiment results are also presented to verify the method.Keywords: brushless DC motor, sensorless, position detecting