|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectLineFollowerSimulator.PIDregulator
public class PIDregulator
Simulation of a PID regulator for a line following robot. The objects creates its own thread that periodicaly scans for line position and updates motor speeds.
| Constructor Summary | |
|---|---|
PIDregulator(LineFollowerSimulator.MotorController motorCtrl,
LineFollowerSimulator.Sensor sensor)
Initializes PID regulator. |
|
| Method Summary | |
|---|---|
void |
run()
Thread that periodicaly updates motors' speed acording to the line position contains the PID regulator loop itself |
void |
setD(double d)
Sets the derivate factor of PID regulator, if 0 is set, the diferencial regulation is supressed. |
void |
SetFrequency(int freq)
Set the refresh frequency for PID regulation, e.g. how often the speed of motors is updated. |
void |
setI(double i)
Sets the integral factor of PID regulator, if 0 is set, the integral regulation is supressed. |
void |
setP(double p)
Sets the proportional factor of PID regulator, if 0 is set, the proportional regulation is supressed. |
void |
setSpeed(double speed)
Sets the maximum speed of the robot. |
void |
StartPIDregulation()
Runs a thread that periodically obtain line position from a sensor and updates motors' speed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PIDregulator(LineFollowerSimulator.MotorController motorCtrl,
LineFollowerSimulator.Sensor sensor)
motorCtrl - a MotorController that will simulate robot movementsensor - sensor that will provide line position| Method Detail |
|---|
public void StartPIDregulation()
public void SetFrequency(int freq)
freq - refresh frequency in Hzpublic void run()
run in interface java.lang.Runnablepublic void setP(double p)
p - positive numberpublic void setI(double i)
i - positive numberpublic void setD(double d)
d - positive numberpublic void setSpeed(double speed)
speed - positive number
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||