The main purpose of the second amendment was to protect your right to defend yourself from other people and from the government. The founding fathers agreed that the people had the right to overthrow the government if it ever became tyrannical. We can see this in the Declaration of Independence:
That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, — That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government
In the Federal Papers number 28, Alexander Hamilton also expressed this view:
If the representatives of the people betray their constituents, there is then no resource left but in the exertion of that original right of self-defense which is paramount to all positive forms of government, and which against the usurpations of the national rulers, may be exerted with infinitely better prospect of success than against those of the rulers of an individual state. In a single state, if the persons intrusted with supreme power become usurpers, the different parcels, subdivisions, or districts of which it consists, having no distinct government in each, can take no regular measures for defense. The citizens must rush tumultuously to arms, without concert, without system, without resource; except in their courage and despair.
These two pieces of writing show that the founding fathers believed that the people have the right to overthrow their government.
The individual Right to Bear Arms
In many of state constitutions the individual right to bear arms is clearly defined. Which some of the founding fathers help write. The Pennsylvania constitution of 1776 says:
That the people have a right to bear arms for the defence of themselves and the state; and as standing armies in the time of peace are dangerous to liberty, they ought not to be kept up; And that the military should be kept under strict subordination to, and governed by, the civil power.
This shows that the founding fathers believed in the individual right to keep and bear arms.
The 2nd Amendment Protects All Firearms
A common misconception is that the founding fathers were only talking about muskets or that they couldn't foresee the strength of firearms today, this is extremely false. In the early 1700's the Puckle gun was invented. This was one of the first "rapid fire" guns. In 1777, Congress asked for the Belton flintlock to be made, which was a repeating rifle and could fire around 4 rounds per second. The only reason why Congress canceled the request was due to the price. But this shows the founding fathers knew these type of rifles were out there and they would be improved and they didn't decide to restrict those firearms.