closed loop in power electronics,selecting best ardunio board

I'm surprised that you don't understand this, since you've already implemented this on a DSP. It is a digital system, so you use standard equations:
(Not Code:)
Difference = (n[k] - n[k-1])/(T)
Integral = SUM(n[0]:n[k])

This is all pretty easy to implement in software.