Fixinga Broken Chain Drive Garage Door Opener

I have a Sears brand door opener. It has worked for 16 years, but the steel cable broke yesterday. Thinking that this would be bstraightforward, I got a length of cable and some clamps, and re-attached the cable to the chain. I turned it on, and the drive sprocket kept running when tyhe door closed-then it snapped again.
Obviously, the settings for open and closed are wrong-but I cannot see how you reset them.
Anybody know how to do this?

It depends on the model, but often the controller has a “program” mode for adjusting the travel. Others just have screws on the side of the motor thingie. They’re labeled.

Google up the owners manual if you’ve lost the paper original. The alignment procedure is simple, but there are several different approaches used by different manufacturers. And as you’ve noticed, the machine is strong enough to break itself if you try doing it wrong.