I am thinking of a PLA cap off of the walls to form a ceiling. Designs would certainly need to take a new set of structural problems into account..
If we could see 5% below the fill line, we might be able to gradually dial the water/starch mixture out and raise the temperature until we are just shy of the top. I have no idea if it would work, of course. Ideally let the 90-95% fill set a bit to keep the heavier layers above from collapsing down.
For fill detection..
The least expensive would be a whisker of sorts. Think of a thin hard wire hanging through the center of a washer--the washer would complete the circuit when the wire was disturbed by the foam as it filled. You would calibrate the length of the wire for your machine and attach it to the head. Attach a small plastic bead to the foot of the wire..
That's the simplest design I can think of.. I would like to avoid complex software. I am a developer by day and find it sometimes tiresome to write (debug) more code at night.
But a CMOS/photo sensor and a fixed LED light source would allow you to compare pixels before/after. Edge detection to find the boundaries of the container and then watch the color of the inside edge. However, you would still need a way to dynamically locate Z.. mount the camera at an angle and count the pixels between a marker on the head and the color of the bed/material. You are looking to measure the 'nothing' space in the distance. If the LED angle relative to the camera were fixed, you might measure/detect shadows or volumes. If you have a laser point light, you might measure the size of the point to determine distance.. a photo senor brings many potential advantages (and complexities)..
Of course, nothing is worthy of being called a solution until it works in practice.. I will play around with this whisker thing and an LED light though.