control for robotic arm that can play chess using a granular gripper
Dependencies: Encoder mbed HIDScope Servo MODSERIAL
Fork of chessRobot by
PID/PID.h
- Committer:
- annesteenbeek
- Date:
- 2015-10-09
- Revision:
- 54:c14c3bc48b8a
- Parent:
- 51:1e6334b993a3
- Child:
- 55:ee5257fb73df
File content as of revision 54:c14c3bc48b8a:
#ifndef PID_H #define PID_H class PID{ public: #define MANUAL 0 #define AUTOMATIC 1 PID(float*, float*, float*, float, float, float); void SetMode(int Mode); bool Compute(); // returns false when in Manual mode void SetOutputLimits(float, float); void SetSampleTime(float); void SetTunings(float, float, float); private: void Initialize(); float curTime; float prevTime; float timeChange; float SampleTime; float *myInput; // * Pointers to the Input, Output, and Setpoint variables float *myOutput; // This creates a hard link between the variables and the float *mySetpoint; // PID, freeing the user from having to constantly tell us // what these values are. with pointers we'll just know. float error, errSum, dErr; float lastErr, lastInput; float Kp, Ki, Kd; float outMin, outMax; bool inAuto; }; #endif