servo moves when powered down

I have a problem with controlling servo's. I use an ATMEGA2560 board and the Mobatools library. First I initialize the servo status before powering the servo's. Everything works fine. But when I turn of the power from the Arduino and the servo's the servo's make a little jump. How can I correct this?? Anybody good ideas?

Servos usually need continuous position updates just to maintain position.

Thanks for your fast reaction. My problem is that I want to stop operation and turn off all the electronics etc. But when I powerr down the controller and servo's there is a small movement on the servo's

Your problem is that you expect the servo to maintain position, without giving it any information on what the position should be.

Change your expectations, or change the entire mechanism.

You can get locking servo's. You can gain info through the use of your favortie search engine, internet, and typing the words "locking servo" or the words "servo locks in position when powered off." Give it a try.

You should call detach() on the servo before powering down anyway so it gets a clean last pulse. It will probably hold position for a while and then who knows, there's no rules for an uncommanded servo, it can do what it likes.

I do not know when the installation will be shutted down. I tried to attach and detach when servo's are started and when finished but it seems that this interferes with running servo's. I do not have this problem with an Arduino Pro Mini. But there I have problems with conflicting libraries (Software Serial). That is why I switched to the MEGA 2560.