Updated HW test items for SWo

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@248 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-10-11 07:19:14 +00:00
parent b32a1c107f
commit 129f76f19b
10 changed files with 179 additions and 60 deletions

View File

@@ -39,7 +39,7 @@
// Constant and macro definitions
// -----------------------------------------------------------------------------
#define PID_FIXED_POINT_FACTOR (1000)
// -----------------------------------------------------------------------------
// Type definitions.
@@ -47,10 +47,13 @@
struct Pid
{
int iTerm;
int Kp; // proportional constant
int Ki; // integration constant
int Kd; // differential constant
int input_d1; // Input t-1
int iMin;
int iMax;
bool initialized;
};
@@ -73,7 +76,7 @@ struct Pid
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus PID_construct(struct Pid* self, int Kp, int Ki, int Kd);
extern ErrorStatus PID_construct(struct Pid* self, int Kp, int Ki, int Kd, int iMin, int iMax);
/** ----------------------------------------------------------------------------
@@ -81,6 +84,7 @@ extern ErrorStatus PID_construct(struct Pid* self, int Kp, int Ki, int Kd);
* Calculate
*
* @param self The PID object
* @param input The input
* @param error the error input to calculate
*
* @return int calculated value
@@ -88,6 +92,6 @@ extern ErrorStatus PID_construct(struct Pid* self, int Kp, int Ki, int Kd);
* @todo
* -----------------------------------------------------------------------------
*/
extern int PID_calculate(struct Pid* self, int error);
extern int PID_calculate(struct Pid* self, int input, int error);
#endif /* INC_PID_H_ */