kernel_task consumes 500% CPU on AC power, sometimes
In my experience this has always been due to a hardware fault. However before doing anything else reset the SMC as detailed here: http://support.apple.com/kb/HT3964 as its power related. 

This appears to happen when the Mac is struggling to communicate with hardware. Which Mac is it? How old is the battery? Is your battery life still good? Has the Mac had any damage - dropped? Liquid? Have you tried a different power adapter?