Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Controller/SpeedController.h
- Committer:
- yeongsookim
- Date:
- 2019-11-06
- Revision:
- 0:c88a81d07287
- Child:
- 3:9c18af57b988
File content as of revision 0:c88a81d07287:
#ifndef MBED_SPEEDCONTROLLER_H
#define MBED_SPEEDCONTROLLER_H
#include "mbed.h"
class PIDController
{
private:
float kp;
float ki;
float kd;
float max_windup;
float alpha;
float umin;
float umax;
float m_last_timestamp;
float m_set_point;
float m_start_time;
float m_error_sum;
float m_last_error;
float m_last_d;
public:
PIDController(float kp, float ki, float kd, float max_windup,
float start_time,float umin, float umax);
//void reset();
float update(float measured_value, float timestamp);
void setTarget(float target);
void setKp(float kp);
void setKi(float ki);
void setKd(float kd);
void setMaxWindup(float max_windup);
float getLastTimeStamp();
};
#endif