I encountered this same issue a month ago with my 27” Mid 2011 3.4gig I7 iMac 6970M 2Gig video card, 32gig ram, with a split FusionDrive( 2TB HDD/250 Samsung Evo850 SSD ). I tried everything that others have tried( PRAM/SMC reset, Disk Utility from Recovery, erasing the SSD drive, reinstalling the OS, RAM modules, Power Supply from iFixit was ordered in hopes that was it. I upgraded the RAM from 20gig to 32, that didn’t help. I replaced HDD..still didn’t fix it. I replaced the power supply with the one I bought from iFixit, but that didn’t work either. For some strange reason, this only made my fans spin at full blast, and my computer would go to sleep every 27 seconds on the nose, very annoying, but the restarts were more intermittent and not as repetitive. Then I replaced the SDD drive, but it still didn’t solve the problem..which got me thinking a video card re-bake may help. Or maybe something to do with the power button, because when the computer shut down to restart, it would make the same sound it...