From d8508f6a58fbc0a68b532c7e06d322e8e0ef49ea Mon Sep 17 00:00:00 2001 From: kai <1797003616@qq.com> Date: Sat, 27 Jan 2024 23:50:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=94=B5=E6=9C=BA=E6=89=AD?= =?UTF-8?q?=E7=9F=A9=E5=B8=B8=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 3 ++- application/chassis/balance.c | 12 ++++++------ modules/motor/HTmotor/HT04.h | 1 + modules/motor/LKmotor/LK9025.h | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index cc63151..e21f474 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,5 +4,6 @@ "general_def.h": "c", "stdlib.h": "c", "bsp_can.h": "c" - } + }, + "C_Cpp.errorSquiggles": "disabled" } \ No newline at end of file diff --git a/application/chassis/balance.c b/application/chassis/balance.c index dadc42a..9e0f13a 100644 --- a/application/chassis/balance.c +++ b/application/chassis/balance.c @@ -385,12 +385,12 @@ static void LegControl() /* 设定运动模态的输出 */ static void WattLimitSet() { - HTMotorSetRef(lf, 0.285f * -l_side.T_front); // 根据扭矩常数计算得到的系数 - HTMotorSetRef(lb, 0.285f * -l_side.T_back); - HTMotorSetRef(rf, 0.285f * r_side.T_front); - HTMotorSetRef(rb, 0.285f * r_side.T_back); - LKMotorSetRef(l_driven, 274.348 * l_side.T_wheel); - LKMotorSetRef(r_driven, 274.348 * -r_side.T_wheel); + HTMotorSetRef(lf, 0.2857 * -l_side.T_front); // 根据扭矩常数计算得到的系数 + HTMotorSetRef(lb, 0.2857 * -l_side.T_back); + HTMotorSetRef(rf, 0.2857 * r_side.T_front); + HTMotorSetRef(rb, 0.2857 * r_side.T_back); + LKMotorSetRef(l_driven, 195.3125 * l_side.T_wheel); + LKMotorSetRef(r_driven, 195.3125 * -r_side.T_wheel); } diff --git a/modules/motor/HTmotor/HT04.h b/modules/motor/HTmotor/HT04.h index 1ad61f5..9a741c7 100644 --- a/modules/motor/HTmotor/HT04.h +++ b/modules/motor/HTmotor/HT04.h @@ -11,6 +11,7 @@ #define CURRENT_SMOOTH_COEF 0.9f #define SPEED_BUFFER_SIZE 5 #define HT_SPEED_BIAS -0.0109901428f // 电机速度偏差,单位rad/s +#define TORQUE_CONST_HT 3.5 // 扭矩常数,单位N.m/A #define P_MIN -95.5f // Radians #define P_MAX 95.5f diff --git a/modules/motor/LKmotor/LK9025.h b/modules/motor/LKmotor/LK9025.h index a880dd6..d3bca81 100644 --- a/modules/motor/LKmotor/LK9025.h +++ b/modules/motor/LKmotor/LK9025.h @@ -15,7 +15,7 @@ #define SPEED_SMOOTH_COEF 0.85f #define REDUCTION_RATIO_DRIVEN 1 #define ECD_ANGLE_COEF_LK (360.0f / 65536.0f) -#define CURRENT_TORQUE_COEF_LK 0.003645f // // 电流设定值转换成扭矩的系数,算出来的设定值除以这个系数就是扭矩值 +#define CURRENT_TORQUE_COEF_LK 0.00512f // 电流设定值转换成扭矩的系数 typedef struct // 9025 {