Lots to check on the td5, all the usual service stuff then its gets techy and you need a multimeter.
Google TD5 MAF sensor, TD5 MAP sensor, TD5 fuel pressure, the list is pretty long, but its all been done before so the answer is out there.
Black smoke says to much fuel and could be blocked air filter or collapsed/trunking or the MAF which is quite common fail point on many modern motors, quick check is to unplug it and then drive it to see if it improves or gets worse.