/** * @file ALGO_PID_ATY.h * * @param Project ALGO_Algorithm_ATY_LIB * * @author ATY * * @copyright * - Copyright 2017 - 2026 MZ-ATY * - This code follows: * - MZ-ATY Various Contents Joint Statement - * * https://mengze.top/MZ-ATY_VCJS * - CC 4.0 BY-NC-SA - * * https://creativecommons.org/licenses/by-nc-sa/4.0/ * - Your use will be deemed to have accepted the terms of this statement. * * @brief functions of CRC for all codes * * @version * - 1_01_200318 > ATY * -# Preliminary version, first Release * - 1_02_200318 > ATY * -# Add Conditional Compilation * -# Add user port ********************************************************************************** */ #ifndef __ALGO_PID_ATY_H #define __ALGO_PID_ATY_H #include "INCLUDE_ATY.h" /******************************* For user *************************************/ /******************************************************************************/ typedef struct PID{ double SetPoint; // Set point desired value double Proportion; // Proportional const double Integral; // Integral const double Derivative; // Derivative const double LastError; // Error[-1] double PrevError; // Error[-2] double SumError; // Sums of errors }PID; double PidCalc(PID* pidStruct, double nextPoint); void PidInitZero(PID* pidStruct); void PidClearZero(PID* pidStruct); // #define ALGO_PID_ATY_Test_ATY #ifdef ALGO_PID_ATY_Test_ATY void ALGO_PID_ATY_Test(void); #endif /* ALGO_PID_ATY_Test_ATY */ #endif /* __ALGO_PID_ATY_H */ /******************************** End Of File *********************************/