Take it from us Martians, we have built and fought against planetary defenses in the past. Yes we have used camoflage, but making them mobile is pointless as the cannons are large and heavy, besides the chances of a defense cannon moving fast enough to get out of the way in time are very slim, regardless of weather it's a kinetic, or ballistic projectile, and don't even get me started on energy weapons.



The best way to defend a static cannon (well at least in my opinion), is with a shield, or energy barrier of some sort. Trust me, starship captians hate shielded planetary defences, especially cannons.