Ops Manager Extension: PD Controller

2. Include speed of line drift in the controller alg

With a proportional controller, your stock picker determines the extent of turning based on the line’s distance relative to the central position as follows:

response = multiplier x distance

Try to improve the performance of your stock picker by adjusting your controller code to also take into account the speed with which the line is drifting towards or away from the central position. i.e. program your response value as follows:

response = (multiplier_1 x distance) + (multiplier_2 x speed)

The distance term considers the current situation (where we are now) and the speed term considers the future (where we might end up if we don’t change course). The faster we are drifting from the line, the quicker we may need to correct our course.