Hi Fernando and welcome to the forum.
I am not familiar with the D5000 but with any camera when shooting images to stitch together you need to shoot in manual mode. Focus is normally set to infinity so everything should be in focus. I have a small piece of black electrical tape on the lens to make sure the focus stays in place. I have my ISO at 200. Set the white balance to what ever you are shooting IE: for exterior I use the outside setting for sun, cloudy or shade as needed for interior I usually use K3850 on my D300. I shoot in raw so white balance can be adjusted later. I think you should try maybe F8 for the F stop. The shutter speed will depend on the scene. Interior I take a reading around the room (with the camera meter) and use the meter setting of the brightest part of the room (usually a window) and set that to 0EV and that will determine the shutter speed. Do basically the same for exterior. I shoot brackets of 5 so I will get the over and under exposed images to merge in Photomatix.
Now with all that said, what camera, lens and rotor head are you using?
Can you post a sample of what you are getting?
I know others much more knowledgeable than me will chime in and offer more in-depth information.
Nikon D300, D3s, Nikon 10.5 lens, RingT105N+Footplate+MrotatorTCPs, Giottos MT9261 Tripod, Manfrotto 410 Jr geared head.
If you know the "secret" then everyday is a good day!