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.
Dependencies: mbed BufferedSerial ConfigFile
ROBOFRIEN_SUB_FUNC/ROBOFRIE_PID.cpp
- Committer:
- skyyoungsik
- Date:
- 2018-06-12
- Revision:
- 0:3473b92e991e
File content as of revision 0:3473b92e991e:
#include "ROBOFRIEN_PID.h" #include "PID.h" #define RATE 0.01 PID ROLL_RATE_PID(10.0, 0.0, 0.0, RATE); void ROBOFRIEN_PID::Init(){ ROLL_RATE_PID.setInputLimits(0.0, 10.0); ROLL_RATE_PID.setOutputLimits(0.0, 1.0); ROLL_RATE_PID.setMode(AUTO_MODE); ROLL_RATE_PID.setSetPoint(err_Angle[0]); } void ROBOFRIEN_PID::ROLL_RATE_PID_RUN(){ if(err_Rate[0] >= 0){ ROLL_RATE_PID.setProcessValue(err_Rate[0]); output_Data[0] = ROLL_RATE_PID.compute(); } else{ ROLL_RATE_PID.setProcessValue(-err_Rate[0]); output_Data[0] = -ROLL_RATE_PID.compute(); } } void ROBOFRIEN_PID::update(){ ROLL_RATE_PID_RUN(); }