Electric cylindar instead of motor. Limit switches normally closed that open when cylynder controlled device gets to end of movement one way or the other. In real world situation use double pole double throw switch so that the single pole double throws are actually tied together and they throw up together and down together.