Output Positions Subject to Input Motion Direction

Unlike centrifugal governor, where output position depends on input velocity, in this mechanism output position depends on input rotary direction.
When yellow pinion rotates clockwise, blue rack gets its left end position, stay there till the pinion changes its rotary direction and vice versa.
Pink movable teeth maintain rack - pinion engagement when the rotary direction is changed.
Two brown stoppers in accordance with the rack length set the rack end positions.
The mechanism can be used for automatic position control when input is motion direction.