Koduino
Public Member Functions | List of all members
PD Class Reference

Generic proportional-derivative control (for use in a motor, look at the Motor controller library instead) More...

#include <WMath.h>

Detailed Description

Generic proportional-derivative control (for use in a motor, look at the Motor controller library instead)

Public Member Functions

virtual float update (float pos, float setpoint)
 Computes the PD control from the given error. More...
 
void setGain (float Kp, float Kd)
 Set gains. More...
 
- Public Member Functions inherited from DLPF
virtual void init (float smooth, float freq, DLPFType type)
 Initialize filter. More...
 
virtual float update (float val)
 Call this at the rate given in freq in init() More...
 

Inherits DLPF.

Member Function Documentation

void PD::setGain ( float  Kp,
float  Kd 
)
inline

Set gains.

Parameters
KpProportional gain
KdDissipative (derivative) gain
virtual float PD::update ( float  pos,
float  setpoint 
)
inlinevirtual

Computes the PD control from the given error.

Parameters
valTracking error
Returns
- Kp * val - Kd * (filtered velocity)

The documentation for this class was generated from the following file: