This repository has been archived on 2025-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
controller-hd/User/application/inc/mode.h

53 lines
1.9 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @file mode.h
* @author xxx
* @date 2023-09-18 10:37:29
* @brief
* @copyright Copyright (c) 2023 by xxx, All Rights Reserved.
*/
#ifndef __MODE_H__
#define __MODE_H__
#include "lib.h"
#include "mode_def.h"
#include "mode_dac.h"
#include "mode_pwm.h"
#include "mode_pwmp.h"
#include "mode_pwmp_hd.h"
typedef struct
{
mode_dac_params_u mode_dac_params; ///< DAC模式参数
mode_pwm_params_u mode_pwm_params; ///< PWM模式参数
mode_pwmp_params_u mode_pwmp_params; ///< PWMP模式参数
mode_pwmp_hd_params_u mode_pwmp_hd_params; ///< PWMP模式参数
} mode_params_t;
typedef struct
{
uint16_t pos0; ///< 位置0 ad
uint16_t pos100; ///< 位置100 ad
uint16_t pot0; ///< 位置0 输出
uint16_t pot100; ///< 位置100 输出
uint16_t current0; ///< 位置0 电流(毫安放大100倍, 0.01ma=1)
uint16_t current100; ///< 位置100 电流(毫安,放大100倍0.01ma=1)
uint16_t open_time; ///< 全开时间(秒)
uint16_t close_time; ///< 全关时间(秒)
float32 kp; ///< pid 比例系数
float32 ki; ///< pid 积分系数
float32 kd; ///< pid 微分系数
} mode_adjust_data_t;
extern void mode_init(void); ///< 工作模式初始化
extern void mode_detection(uint8_t work_mode); ///< 工作模式处理
extern void travel_statistics(void); ///< 行程统计
extern BOOL is_manual_test(void);
extern BOOL mode_control_idel(void); ///< 控制器是否空闲
extern void alog_control_module(void); ///< 算法控制模块
extern void mode_adjust_start(void); ///< 模式整定开始
extern void mode_adjust_stop(void); ///< 模式整定停止
extern uint8_t mode_adjust_step_count(void); ///< 获取整定步骤数量
extern uint8_t mode_adjust_step_current(void); ///< 获取当前整定步骤
#endif