Mechatronic systems are becoming an intrinsic part of our daily life, and the adopted control approach in turn plays an essential role in the emulation of the intelligent behavior. In this paper, a framework for the development of intelligent controllers is proposed. We highlight that robustness, prediction, adaptation, and learning, which may be considered the most fundamental traits of all intelligent biological systems, should be taken into account within the project of the control scheme. Hence, the proposed framework is based on the fusion of a nonlinear control scheme with computational intelligence and also allows mechatronic systems to be able to make reasonable predictions about its dynamic behavior, adapt itself to changes in the plant, learn by interacting with the environment, and be robust to both structured and unstructured uncertainties. In order to illustrate the implementation of the control law within the proposed framework, a new intelligent depth controller is designed for a microdiving agent. On this basis, sliding mode control is combined with an adaptive neural network to provide the basic intelligent features. Online learning by minimizing a composite error signal, instead of supervised off-line training, is adopted to update the weight vector of the neural network. The boundedness and convergence properties of all closed-loop signals are proved using a Lyapunov-like stability analysis. Numerical simulations and experimental results obtained with the microdiving agent demonstrate the efficacy of the proposed approach and its suitableness for both stabilization and trajectory tracking problems.