rm_balance/User/module/config.c
2025-09-29 03:35:01 +08:00

54 lines
1.6 KiB
C

/*
* 配置相关
*/
/* Includes ----------------------------------------------------------------- */
#include "module/config.h"
#include "bsp/can.h"
#include "device/motor_rm.h"
#include "component/pid.h"
#include "component/user_math.h"
/* Private typedef ---------------------------------------------------------- */
/* Private define ----------------------------------------------------------- */
/* Private macro ------------------------------------------------------------ */
/* Private variables -------------------------------------------------------- */
/* Exported variables ------------------------------------------------------- */
// 机器人参数配置
Config_RobotParam_t robot_config = {
.shoot_param = {
.trig_motor_param = {
.can = BSP_CAN_1,
.id = 0x201,
.module = MOTOR_M2006,
.reverse = false,
.gear = true,
},
.trig_pid_param = {
.k = 12.0f,
.p = 1.0f,
.i = 0.0f,
.d = 0.0450000018f,
.i_limit = 1.0f,
.out_limit = 1.0f,
.d_cutoff_freq = -1.0f,
.range = M_2PI,
},
.num_trig_tooth = 8.0f,
.fric_radius = 0.03f,
.min_shoot_delay = (uint32_t)(1000.0f / 10.0f),
}
};
/* Private function prototypes ---------------------------------------------- */
/* Exported functions ------------------------------------------------------- */
/**
* @brief 获取机器人配置参数
* @return 机器人配置参数指针
*/
Config_RobotParam_t* Config_GetRobotParam(void) {
return &robot_config;
}