From other answers on this site I can see that people seem to agree that adding curry powder later or at the end will lead to a bitter, grainy and perhaps unpalatable product. I'm assuming this applies to chilli powder too since I've been adding at the end and have what seems bitter and grainy. Therefore I guess you should add it earlier on.
I would like to know, chemically speaking, why is this? Is it because the water level maybe low and water is required to bring out the powders flavors, is it because the powder dissolves more with time etc? I've been adding chilli powder at the end and not too happy with the results. I want to make sure I get it at the right time and understanding the chemistry of it helps you cook better and add it just at the right time.