Controlling reciprocating movement