94
94
REGISTER_SERIALIZABLE(HarmonicRotationEngine);
96
struct ServoPIDController: public TranslationEngine{
97
virtual void apply(const vector<Body::id_t>& ids);
98
YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(ServoPIDController,TranslationEngine,"PIDController servo-engine for applying prescribed force on bodies. http://en.wikipedia.org/wiki/PID_controller",
99
((Real,maxVelocity,0.0,,"Velocity [m/s]"))
100
((Vector3r,axis,Vector3r::Zero(),,"Unit vector along which apply the velocity [-]"))
101
((Real,target,0.0,,"Target value for the controller [N]"))
102
((Real,kP,0.0,,"Proportional gain/coefficient for the PID-controller [-]"))
103
((Real,kI,0.0,,"Integral gain/coefficient for the PID-controller [-]"))
104
((Real,kD,0.0,,"Derivative gain/coefficient for the PID-controller [-]"))
105
((Real,iTerm,0.0,,"Integral term [N]"))
106
((Real,curVel,0.0,,"Current applied velocity [m/s]"))
107
((Real,errorCur,0.0,,"Current error [N]"))
108
((Real,errorPrev,0.0,,"Previous error [N]"))
109
((long,iterPeriod,100.0,,"Periodicity criterion of velocity correlation [-]"))
110
((long,iterPrevStart,-1.0,,"Previous iteration of velocity correlation [-]"))
117
REGISTER_SERIALIZABLE(ServoPIDController);