To calculate the derivative of the line current, you can use various robust techniques like Sliding Mode [1], Algebraic Method [2], Homogeneous method [3] etc.
In our article, we have used these differentiators for derivative estimation purpose. You can consult [4] for discrete time equations of the above differentiators. You can directly use these equations for real time estimation purpose in a micro-controller for example.
1. Levant, A. (1998). Robust exact differentiation via sliding mode technique. automatica, 34(3), 379-384.
2. Mboup, M., Join, C., & Fliess, M. (2009). Numerical differentiation with annihilators in noisy environment. Numerical algorithms, 50(4), 439-467.
3. Perruquetti, W., Floquet, T., & Moulay, E. (2008). Finite-time observers: application to secure communication. IEEE Transactions on Automatic Control, 53(1), 356-360.
4. Ahmed, Hafiz, et al. "A fault detection method for automatic detection of spawning in oysters." IEEE Transactions on Control Systems Technology 24.3 (2016): 1140-1147.