WELCOME TO LMF!
It might help if you put it in the center of the machine, but I think it would still get foamed up a lot. I think the best thing would be to make something that is independent from the machine so it can rock back and forth, thus not getting shooken up as much, like a gyroscopic cup holder. See video....