Setting up a PID controller in Simulink for an Arduino example project
The philosophy behind a PID controller (PID stands for Proportional Integral Derivative) is that you use the difference between the output of your system and and the desired output to generate a corrective input. 

e(t) would be equal to the difference between the setpoint and the measured signal, that is e(t) = setpoint - measured_signal(t). Then you just apply the formula, inside your digital PID block. The derivative is optional, if you have a way of obtaining it, use it in your PID. If not, it's not a big deal. 
You should get something similar to the image above, you will need the "Gain" block, the "Integrator" block and the sum. The error is the input, the output is the control input for the Arduino.

Kp and Ki are most easily usually obtained empirically, through manual tuning. Just begin with a small Kp and increase it until the response seems acceptable. Ki is used to kill any offset you have on the output, but slows down the response of the system. Again, you tune it manually, starting with a small Ki. If you want, you can try the Ziegler Nichols method (https://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method)