We used a cheap and simple home doughnut maker.
The dough has to be so runny that it pours through the valve by itself. Yeast based dough is probably a no-go because it expands continuously, making the first doughnuts of the day small and tough, and later on they’re big and fluffy. This recipe uses baking powder: https://uk.answers.yahoo.com/question/index?qid=20061010051311AAEFQb1
This dough is still too thick to flow, so we added some milk.
The fetus-shaped pastry is our first attempt. As you can see they rapidly improved. You only have to open the valve for half a second!
We also tried a thicker mix. Then the valve had to be kept open for five seconds. You got bulkier doughnuts with a crispy crust and they took longer to fry.
This is one way to frost the doughnuts:
But you get frying oil in the frosting. Next we tried a syringe:
The frosting melted in a few seconds. We tried letting the doughnuts wait for 0:30, 1:00, 1:30 and two minutes before frosting. You need at least two minutes, which is too long for a vending machine.
We refrigerated the frosting syringe and tried again. This time 30 seconds is OK. The frosting starts melting after maybe a minute on the doughnut, but by then you have the doughnut in your hand.
All in all, we think we can make doughnuts on demand.