#ifndef __ADAPID_H__
#define __ADAPID_H__

struct pidparm {
    int iden;
    int progr;
    int busy;
    DWORD q;
    DWORD incr;
    DWORD desired;
    DWORD max;
    DWORD period;
    DWORD acc;
    double q0;
    double q1;
    double q2;
    double gamma;
    double gamma1;
    double y1;
    double y2;
    double oldb;
    double old2b;
    double *p;
    double *phi;
    double *theta;
    int toestimate;
    int ecount;

    double u0;
};

void adapid_init(void);
struct pidparm *adapid_create(DWORD q, DWORD desired, DWORD maxfeed,
			      DWORD period);
void adapid_destroy(struct pidparm *parms);
float adapid_feedb(struct pidparm *parms, int l);
void adapid_setb(struct pidparm *parms, double newb);

#endif				/* __ADAPID_H__ */
