most functionality to splashdwon, find neutral and start mission. short timeouts still in code for testing, will adjust to go directly to sit_idle after splashdown

Dependencies:   mbed MODSERIAL FATFileSystem

PidController/PidController.hpp

Committer:
danstrider
Date:
2017-10-23
Revision:
10:085ab7328054

File content as of revision 10:085ab7328054:

#ifndef PIDCONTROLLER_H
#define PIDCONTROLLER_H

#include "mbed.h"

class PIDController {
public:
    PIDController();
    
    void update(float position, float velocity, float dt);
    float getOutput();
    
    void setPgain(float gain);
    void setIgain(float gain);
    void setDgain(float gain);
    
    void writeSetPoint(float cmd);
    
    void setHiLimit(float limit);
    void setLoLimit(float limit);
    
    void toggleDeadBand(bool toggle);
    void setDeadBand(float deadband);
    
protected:
    float _setPoint;
    float _error;
    float _integral;
    float _output;

    float _Pgain;
    float _Dgain;
    float _Igain;
    float _hiLimit; //these parameters clamp the allowable output
    float _loLimit; //these parameters clamp the allowable output
    float _deadband;
    bool _deadbandFlag;
};

#endif