I am trying to use two limit switches and two DPDT relays to control the direction of the motor. When the power is applied the motor should rotate one direction (direction for this question isn't important). Also, at this point (initialization) neither switch will be energized. The motor will rotate and move until it energizes the second limit switch (labeled Switch 2). At this point, the direction of the motor should reverse. The motor and hardware will then move towards switch one. Once the motor reaches switch one it should stop completely (not reverse direction again). Below is my basic wiring diagram.
I wired it up and when I supply power the motor rotates. However, whenever switch 2 is energized I can hear relay 2 energize and de-energizes quickly but no motor rotation.
Also, I am trying to implement a latching relay when the motor reverses direction. I do not know if my problem is occurring there.
Finally, I am having problems trying to figure out how to have the motor stop once switch 1 is energized.
Any help with my two problems (reversal of direction, and stop when switch 1 energized) would be greatly appreciated.