If you want to have PID accurate coefficient:
- get statistic actuator data (i.e. collecting input voltage + encoder pulse in a const frequently (0.01s) for DC-motor)
- get transfer function (TF) of your actuator (using ident toolbox in Matlab).
- using pid_tool toolbox in Matlab and upload your transform function.
Or:
There is a quicker approach called Ziegler–Nichols: