mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 03:27:45 +08:00
add log.c
This commit is contained in:
@@ -231,13 +231,13 @@ void DJIMotorControl()
|
||||
motor_controller->pid_ref = PID_Calculate(&motor_controller->speed_PID, pid_measure, motor_controller->pid_ref);
|
||||
}
|
||||
|
||||
if (motor_setting->close_loop_type & CURRENT_LOOP) //计算电流环
|
||||
if (motor_setting->close_loop_type & CURRENT_LOOP) // 计算电流环
|
||||
{
|
||||
motor_controller->pid_ref = PID_Calculate(&motor_controller->current_PID, motor_measure->given_current, motor_controller->pid_ref);
|
||||
}
|
||||
|
||||
set = (int16_t)motor_controller->pid_ref;
|
||||
if (motor_setting->reverse_flag == MOTOR_DIRECTION_REVERSE) //设置反转
|
||||
if (motor_setting->reverse_flag == MOTOR_DIRECTION_REVERSE) // 设置反转
|
||||
set *= -1;
|
||||
|
||||
// 分组填入发送数据
|
||||
|
||||
@@ -4,9 +4,14 @@
|
||||
* @brief DJI智能电机头文件
|
||||
* @version 0.1
|
||||
* @date 2022-11-01
|
||||
*
|
||||
*
|
||||
* @todo 1. 给不同的电机设置不同的低通滤波器惯性系数而不是统一使用宏
|
||||
2. 当前电机初始化函数`DJIMotorInit()`稍显凌乱,
|
||||
应设置一个`dji_motor_init_config_s`结构体用于电机初始化,使得风格统一,提高可读性
|
||||
3. 为M2006和M3508增加开环的零位校准函数
|
||||
|
||||
* @copyright Copyright (c) 2022 HNU YueLu EC all rights reserved
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DJI_MOTOR_H
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
>
|
||||
> 1. 给不同的电机设置不同的低通滤波器惯性系数而不是统一使用宏
|
||||
> 2. 当前电机初始化函数`DJIMotorInit()`稍显凌乱,应设置一个`dji_motor_init_config_s`结构体用于电机初始化,使得风格统一,提高可读性
|
||||
> 3. 为M2006和M3508增加开环的零位校准函数
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user