Trash Compactor

My Whirlpool trash compactor would not stop at the top of the cycle. I replaced the top limit switch, but it still will not stop when the ram gets back to the top. I get a thumping sound and I have to stop it manually. How can I solve this problem?