Vomiting dishwasher?

OK, can I have some suggestions - My dishwasher, at least once a day, sort of throws gritty chunks onto my dishes - it especially does it to the top shelf, and it also does it into the cups.

I can run it twice and it still happens.

And I am tired of taking them all out and having to hand wash it all.

Am I doing something wrong?