You're right. It's for protection against a tyrannical government taking away the rights of it's citizens and not giving them any representation. A.K.A.: The very government colonists protested and rebelled against before going to war with it. The founders wanted to make sure that, in the event that this government were to be controlled by tyranny, it's people would be protected from losing their rights, a protection that the colonies simply didn't have. But anyway, once again I still don't dispute the importance of the 2nd amendment nor did I ever mention changing it.
As for your "sub machine gun", I believe the gun you have pictured is the "Puckle Gun", or "Defense Gun". It was indeed patented 1718, long before the American Revolution, and is often referred to as a machine gun. However, the cylinder had to be moved from chamber to chamber by hand and you had to spin the crank in the back to line the cylinder up with the gun barrel. And then you had to prime it. And you had to do all this in between shots. So while it was faster than traditional muskets (it still fired muskets) it only averaged at around 9 rounds per minute and was far from being an automatic weapon. It would be semi automatic, which isn't a machine gun. It's more like a strange looking revolver on a mini tripod. Did I also mention that it was handgun sized? And with the fact that it had to be standing on something to be used comfortably isn't exactly a good thing if you tried using it in close combat. And saying that it was "quiet useful" isn't exactly correct, as it was designed and advertised as an anti boarding weapon for ships. Also, it wasn't very popular. At all. It was never mass produced and almost no one invested in it. The only record of it being bought was when John Montagu bought two for an expedition (that failed) to capture the countries of St. Lucia and St. Vincent, and there's no evidence that they were ever even used in battle. Other weapons that used the same design were revolving pistols such as the Flintlock or Colt, which were invented in the 1800's and of course were pistols.