A large-signal model for PIN photodetector is presented, which can be applied to ultra-fast photodetection and THz signal generation. The model takes into account the tunnelling and avalanche breakdown, which is important for avalanche photodiodes. The model is applied to ultra-fast superlattice photodiodes for THz signal generation. Results show that the output power at THz frequencies is in the order of tens of μW. The embedding impedances are found to be as low as 13Ω.