feat: 添加 PID 控制器及霍尔传感器转速获取功能
This commit is contained in:
@@ -52,6 +52,17 @@ void hall_pulse_callback(uint16_t GPIO_Pin)
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
/**
|
||||
* @brief 获取当前实时转速 (RPM)
|
||||
*/
|
||||
float hall_get_speed(motor_id_t motor_id)
|
||||
{
|
||||
if (motor_id < MOTOR_COUNT) {
|
||||
return sensors[motor_id].speed_rpm;
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @brief 重置霍尔传感器计数值
|
||||
// */
|
||||
|
||||
Reference in New Issue
Block a user