Nuts don’t loosen because of the friction between the male and female threads and the force between the bolt and the nut due to bolt tension
Anything that can keep the friction between the mating threads will prevent the nut from loosening.
It can be locking fluid like loctite, adding nylon rings to form the thred (nylock), spring washers (to push the nut against the bolt) or prevailing torque nuts that have different thread angles between male and female threads.
Latest Answers