1D handle that can for example simulate a wall by controlling a motor the right way
- hard to get right i.e. make it feel natural (Haptics)
Hapkit control
in order to prevent oscillation: consider dynamic properties of the device as opposed to just kinematic properties with a god-like motor power
on/off control
aka โbang-bangโ
if (measured value < lower threshold) turn onโ
if (measured value > higher threshold) turn off
- avoid oscillations through hysteresis i.e. two different thresholds
P - proportional control
make theย controllerย output proportionalย to the error signal
motorOutput(pwm) = Err * Kpโ
- prevents oscillations caused by overshooting
PI - integral control
accounts for past values of the error. For example, if the current output is not sufficiently strong, the integral of the error will accumulate over time, and the controller will respond by applying a stronger action
motorOutput = P + I with I = errorAccumulator += Err
- prevents steady state error (i.e. small errors that are never accounted for)
PID - differential control
accounts for possible future trends of the error, based on its current rate of changeย
motorOutput = P + I + D with D = (error โ prevError) * Kd
- prevents over-correcting mainly caused by integral control when the error is suddenly being corrected faster than before (e.g. no counter force present anymore)
Insight
there is no general purpose PID controller.โ Instead, any control has to be tuned for the specific use case rather than buying expensive actuators (such as steppers) buy cheap actuators + cheap sensors