home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s300 / 1.ddi / CHAP4 / PIDLOOP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-02  |  1.4 KB  |  45 lines

  1. /***********************************************************************
  2.  
  3. FILE
  4.     pidloop.h   -  simple control loop data structure definition
  5.  
  6. LAST UPDATE
  7.     10 March 1988
  8.         name changes
  9.  
  10.     Copyright (c) 1985-1988  D.M. Auslander and C.H. Tham
  11.  
  12. ***********************************************************************/
  13.  
  14. #define NAMESIZE        12      /* max characters for loop name */
  15.  
  16. struct _pidloop {
  17.     char cl_name[NAMESIZE];     /* pointer to cntrol loop name string */
  18.  
  19.     int cl_inchan;              /* input channel number */
  20.     int cl_outchan;             /* output channel number */
  21.  
  22.     double cl_setpoint;         /* controller setpoint */
  23.     double cl_feedback;         /* controller feedback value */
  24.  
  25.     double cl_kp;               /* proportional gain */
  26.     double cl_ki;               /* integral gain */
  27.     double cl_kd;               /* derivative gain */
  28.  
  29.     double cl_err0;             /* error at (k)-th instant */
  30.     double cl_err1;             /* error at (k-1)-th instant */
  31.     double cl_err2;             /* error at (k-2)-th instant */
  32.  
  33.     double cl_output;           /* controller output */
  34.  
  35.     double cl_outmin;           /* lower limit of output value */
  36.     double cl_outmax;           /* upper limit of output value */
  37.  
  38.     double cl_tsamp;            /* sampling interval */
  39.  
  40. };
  41.  
  42.  
  43. typedef struct _pidloop PIDLOOP;
  44.  
  45.