/* * File: PID.h * Author: Sparky * * Created on ??????????, 2013, ?????? 21, 2:41 */ #ifndef PID_H #define PID_H #include #include "typedefs.h" #include "ExtFloat.h" #ifdef __cplusplus extern "C" { #endif #define ADCAVG 3 #ifndef _PID_C #define PID_H_EXTERN extern #else #define PID_H_EXTERN #endif typedef struct { int cnt; int val; }t_WSDelta; typedef struct { UINT32 PWM; INT32 PIDDutyP; INT32 PIDDutyI; UINT32 PIDDuty; UINT32 PIDDutyFull; int Starting; int LastTTemp; int DestinationReached; int KeepOff; int NoSensor; int NoHeater; int NoHeaterCnt; int ShortCircuit; UINT32 OffDelay; //Delay between comparator threshold and zero cross point when heater is on, microseconds int ADCTemp[4]; t_WSDelta WSDelta[8]; UINT32 WSMul; int WSTemp; int LastOn; int OnCnt; int OffCnt; int WSCorr; int CTemp[2]; int CHRes; int TAvg; int TAvgF[2]; int TAvgP[2]; int TBuff[(1<