mirror of
https://gitee.com/dlmu-cone/tronone-h7-scaffold
synced 2026-07-24 03:27:45 +08:00
代码规范
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
/**
|
||||
* @file controller.c
|
||||
* @author wanghongxi
|
||||
* @author modified by neozng
|
||||
* @author modified by TuxMonkey
|
||||
* @brief PID控制器定义
|
||||
* @version beta
|
||||
* @date 2022-11-01
|
||||
*
|
||||
* @copyrightCopyright (c) 2022 HNU YueLu EC all rights reserved
|
||||
* @copyright Copyright (c) 2025 DLMU.CONE EC all rights reserved
|
||||
*/
|
||||
#include "controller.h"
|
||||
#include "pid.h"
|
||||
#include "memory.h"
|
||||
|
||||
/* ----------------------------下面是pid优化环节的实现---------------------------- */
|
||||
@@ -25,18 +25,18 @@
|
||||
#define abs(x) ((x > 0) ? x : -x)
|
||||
#endif
|
||||
|
||||
// PID 优化环节使能标志位,通过位与可以判断启用的优化环节;也可以改成位域的形式
|
||||
// PID 优化环节使能标志位
|
||||
typedef enum
|
||||
{
|
||||
PID_IMPROVE_NONE = 0b00000000, // 0000 0000
|
||||
PID_Integral_Limit = 0b00000001, // 0000 0001
|
||||
PID_Derivative_On_Measurement = 0b00000010, // 0000 0010
|
||||
PID_Trapezoid_Intergral = 0b00000100, // 0000 0100
|
||||
PID_Proportional_On_Measurement = 0b00001000, // 0000 1000
|
||||
PID_OutputFilter = 0b00010000, // 0001 0000
|
||||
PID_ChangingIntegrationRate = 0b00100000, // 0010 0000
|
||||
PID_DerivativeFilter = 0b01000000, // 0100 0000
|
||||
PID_ErrorHandle = 0b10000000, // 1000 0000
|
||||
PID_IMPROVE_NONE = 0b00000000, // 无优化
|
||||
PID_Integral_Limit = 0b00000001, // 积分限幅
|
||||
PID_Derivative_On_Measurement = 0b00000010, // 微分先行
|
||||
PID_Trapezoid_Intergral = 0b00000100, // 梯形积分
|
||||
PID_Proportional_On_Measurement = 0b00001000, // 比例先行
|
||||
PID_OutputFilter = 0b00010000, // 输出滤波
|
||||
PID_ChangingIntegrationRate = 0b00100000, // 变积分
|
||||
PID_DerivativeFilter = 0b01000000, // 微分滤波
|
||||
PID_ErrorHandle = 0b10000000, // 误差处理
|
||||
} PID_Improvement_e;
|
||||
|
||||
/* PID 报错类型枚举*/
|
||||
@@ -12,7 +12,7 @@
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "ins_task.h"
|
||||
#include "controller.h"
|
||||
#include "../../algorithm/controller/pid/pid.h"
|
||||
#include "QuaternionEKF.h"
|
||||
#include "spi.h"
|
||||
#include "tim.h"
|
||||
|
||||
Reference in New Issue
Block a user