Manual

www.nexusrobot.com Robot Kits manual
40
unsigned int setSpeedRPM(int speedRPM,bool dir)
Set the speed and direction for the motor
This will lie within the range specified at Motor::PIDSetSpeedRPMDesired() , Motor::setDesiredDir(),
Motor::getSpeedRPM()
Parameters:
int speedRPM
The speed set for Motor
Bool dir
The direction set for Motor
See:
Motor:: PIDSetSpeedRPMDesired()
Motor::setDesiredDir()
Motor::getSpeedRPM()
void simpleRegulate()
Regulate the speed of the Motor on the basis of the direction
bool PIDSetup(float kc=KC,float taui=TAUI,float taud=TAUD,unsigned int sampleTime=1000)
Setup the.The class PID use these datas to regulate the speed of Motors
Parameters:
float kc
Proportional term
float taui
Integral term
float taud
Derivative term
unsigned int sampleTime
The time the PID work last
Return: Bool ture
bool PIDGetStatus() const
Get the current PID state,to sure wether the PID works
Return: The value of the pidCtrl
bool PIDEnable(float kc=KC,float taui=TAUI,float taud=TAUD,unsigned int sampleTime=1000)
Enable the PID ,make it works