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.
Diff: pid.cpp
- Revision:
- 11:8faa068940f1
- Parent:
- 10:332a4ad5911d
--- a/pid.cpp Sat Dec 05 00:41:23 2015 +0000 +++ b/pid.cpp Sat Dec 05 02:07:16 2015 +0000 @@ -1,29 +1,3 @@ -//#include "pid.h" -// -//void PIDController::onLoop() -//{ -// float error = (m_error)(); -// (m_out)(m_Kp * error + m_Ki * iController(error) + m_Kd * dController(error)); -// wait(m_dt); -//} -// -//float PIDController::iController(float error) -//{ -// m_integral += error; -// return m_integral; -//} -// -//float PIDController::dController(float error) -//{ -// float derivative = error - m_pError; -// m_pError = error; -// return derivative; -//} -// -//void PIDController::reset() -//{ -// m_integral = 0; -//} #include "pid.h" @@ -133,4 +107,31 @@ float ctrl::getR(){ return RErr; - } \ No newline at end of file + } + +//#include "pid.h" +// +//void PIDController::onLoop() +//{ +// float error = (m_error)(); +// (m_out)(m_Kp * error + m_Ki * iController(error) + m_Kd * dController(error)); +// wait(m_dt); +//} +// +//float PIDController::iController(float error) +//{ +// m_integral += error; +// return m_integral; +//} +// +//float PIDController::dController(float error) +//{ +// float derivative = error - m_pError; +// m_pError = error; +// return derivative; +//} +// +//void PIDController::reset() +//{ +// m_integral = 0; +//}