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.
SpeedController.h
00001 #ifndef MBED_SPEEDCONTROLLER_H 00002 #define MBED_SPEEDCONTROLLER_H 00003 00004 #include "mbed.h" 00005 00006 00007 class PIDController 00008 { 00009 private: 00010 float kp; 00011 float ki; 00012 float kd; 00013 float max_windup; 00014 float umin; 00015 float umax; 00016 00017 float m_last_timestamp; 00018 float m_set_point; 00019 float m_start_time; 00020 float m_error_sum; 00021 float m_last_error; 00022 float m_last_d; 00023 00024 public: 00025 PIDController(float kp, float ki, float kd, float max_windup, 00026 float start_time,float umin, float umax); 00027 //void reset(); 00028 float update(float measured_value, float timestamp); 00029 void setTarget(float target); 00030 void setKp(float kp); 00031 void setKi(float ki); 00032 void setKd(float kd); 00033 void setMaxWindup(float max_windup); 00034 float getLastTimeStamp(); 00035 }; 00036 00037 #endif
Generated on Wed Jul 27 2022 20:12:06 by
1.7.2