Drone shakes when in Loiter Mode

We were tuning an octorotor. During flight the drone did fine when flying in Althold mode, but when we switched it to Loiter mode there seemed to be some shaking. I have added a link to google drive where you can access a video showing this. In the video we switch from Altohold to Loiter and back, multiple times. Also I have added the log file to the drive link. Can someone help us figure out what is wrong?

[drone unstable in loiter - Google Drive]

Are you using ArduCopter 4.0.x?

Exactly what steps did you do to tune it? Explain each one, meticulously.