The equation used,
on page 2 of the doc, ends with +Kd d/dt e(t)
on page 3 of the doc, ends with -Kd E(n-1 ) , this is also in fig 2.
But in Fig 4, the U(n) is stated as +Kd (err (1 ) )
err(1) is E(n+1 ) , and the Kd sign has changed from add to subtract and back.
and in the verilog we have a<=sum; // start calculate err0kpd + sigma_recent+err1kd