Hi @shefali, welcome to the forum
I’ve moved your post here because it’s seemingly on the same topic.
As specified in the solution above, setting just the Z position bit for depth control should work in ArduSub >= 4.5 (which is the current stable). If you want to use it with an older version you’ll need to also comment out the X and Y position ignore bits because they’re treated as a group.
If that doesn’t resolve your issue then there may be other issues with your code. In particular I’d suggest making sure you’re
- Waiting specifically for an autopilot heartbeat
- Avoiding (or disabling) relevant failsafes