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.
Pid.cpp
00001 #include "Pid.h" 00002 00003 Pid::Pid() 00004 { 00005 this->kp = 0; 00006 this->ki = 0; 00007 this->kd = 0; 00008 } 00009 00010 Pid::Pid(float Kp, float Ki, float Kd) 00011 { 00012 this->kp = Kp; 00013 this->ki = Ki; 00014 this->kd = Kd; 00015 } 00016 00017 void Pid::setKp(float Kp) 00018 { 00019 this->kp = Kp; 00020 } 00021 void Pid::setKi(float Ki) 00022 { 00023 this->ki = Ki; 00024 } 00025 00026 void Pid::setKd(float Kd) 00027 { 00028 this->kd = Kd; 00029 } 00030 float Pid::getCommande(float p_erreur, float i_erreur, float d_erreur) 00031 { 00032 return this->kp * p_erreur + 00033 this->ki * i_erreur + 00034 this->kd * d_erreur; 00035 } 00036 00037 float Pid::getCommande(Erreur e) 00038 { 00039 return this->getCommande(e.p,e.i,e.d); 00040 }
Generated on Wed Jul 13 2022 20:35:19 by
1.7.2