/** * @file cmd_torque_gen.h * @author Zhang, Kai(zhangkai71@midea.com) * @brief Time task control * @version 0.1 * @date 2021-09-27 * * @copyright Copyright (c) 2021 * */ #ifndef CMD_TORQUE_GEN_H #define CMD_TORQUE_GEN_H #include "typedefine.h" /**************************************** * * Definitions & Macros * ****************************************/ /*************************************** * * Type Definations * ***************************************/ /** * @brief torque command input * */ typedef struct { SWORD swTorqCmdRpm; SWORD swTorqNowPu; } CMD_TORQ_IN; /** * @brief torque command coefficient input * */ typedef struct { ULONG ulAccelPu; ULONG ulDecelPu; SWORD swBrakeSpdDeltaPu; } CMD_TORQ_COF_IN; /** * @brief torque command output * */ typedef struct { SWORD swNewTorqRefPu; SWORD swOldTorqRefPu; SWORD swNewCmdDir; SWORD swOldCmdDir; // FlagStatus blConsVolBrakeFlg; BOOL blConsVolBrakeFlg; SWORD swIntRefPu; // Q14, command pu ,(electrical value) SLONG slIntRefPu; SWORD swMotorDir; } CMD_TORQ_OUT; /** * @brief torque command coefficient * */ typedef struct { ULONG ulAccelPu; ULONG ulDecelPu; SWORD swBrakeSpdDeltaPu; } CMD_TORQ_COF; typedef struct { CMD_TORQ_COF Coef; ///< Coefficient of current PI controller CMD_TORQ_OUT Out; ///< Output of current PU controller } CMD_TORQ_CONTROL; /**************************************** * * Exported variable * ****************************************/ /*************************************** * * Function Definations * ***************************************/ /** * @brief Process when switching state from Ready to Run * */ void cmd_voTorqInit(void); /** * @brief Process of FSM during SysInit state * */ void cmd_voTorqOut(void); /** * @brief Process of FSM during SysRdy state * */ void cmd_voTorqCoef(void); #endif