At the top of the board, draw a circle with the word "begin", the standard start of any flow chart. Go around the room, asking each student to give you the next instruction necessary to make the sandwich. The basic goal for you is to simply respond the way you think a computer would. In other words, be very logical, literal, and disregard the normal thought processes that a human would make along the way. As each student gives you an instruction, ask them to come to the board and add their step(s) to the flow chart.
Again, you can really go as far with this as you choose, but here are some typical ideas the students will give, and how we responded, accompanied by teching points.
Student: "Pick up the knife".
You: "Does not compute. What is a knife?"
Teaching Point: Remember, a computer has no concept of what a knife, spoon, peanut butter, jelly, etc. are.
Student: "Move your arm forward ".
You: Assuming you have an idea of where they're headed, move forward the opposite arm of what you think they'd like.
Teaching Point: The computer doesn't know what you're trying to accomplish, nor can it be made to understand, so the instructions must be specific. Which arm, the right or the left?
Student: "Move your left arm forward ".
You: Move your left arm forward, and continue moving it forward (far past the peanut butter jar or knife or whatever they're trying to get you to target) until they tell you to stop.
Teaching Point: Again, the computer doesn't know what you're trying to accomplish. It simply responds very literally to what it is told. After "turning a motor on", it will not turn the motor off until it is told. Apart from saying "stop" at the desired time, the student could also try saying, "move your left arm forward 4 inches".
Assuming they get you to the point where you have one hand holding the knife inside the peanut butter jar, getting peanut butter on the knife can be quite challenging. Here's an example of the command that might happen...
Student: "Move your right hand (the one with the knife in it) around in a circle three times ".
You: With your left hand at your side (since they'll likely be taking for granted how important both hands are in this step), move your right hand in a circle within the peanut butter jar. When you do this without holding the jar with the other hand, you'll likely knock the jar over.
Teaching point: You get the idea. They take for granted the common sense that using their other hand to hold the jar is necessary for this step. A computer won't think of this.
After 20-30 minutes (and giving each student a chance to give some instructions), they'll likely have the main ideas. Explain that this has been practice at open-loop control, where the user has ability to control the process as it takes place (e.g. "move right arm forward 4 inches", "oh, move right arm forward 1 inch more", etc.). At some level, they'll hopefully come to appreciate how difficult controlling a computer/robot can be to perform a task as seemingly simple as making a peanut butter and jelly sandwich.
Optional
Split them up into groups and challenge them to write up a flow chart for this process as a closed-loop control system. Ask them to imagine setting up their robot in front of the sandwich materials, pressing the "go" button on the robot's back, and then heading for the couch to watch TV. After all, who wants a robot whose hand needs to be held every step of the way?
The robot has to make the sandwich on it's own without any input from the students, meaning that the flow chart for the robot must include logical criteria along the way to help the robot "think" through the process the way they would. For example: Does the loaf contain at least two pieces of bread? If so, take two pieces. If not, go to the cupboard and open a new loaf.
Since closed loop control is inherently more challenging, you might make other aspects easier on the students. Maybe they can assume that the robot is programmed to know what the materials are and how to respond to higher level commands (pick up the knife, get peanut butter on the knife, spread the peanut butter on the bread, etc.), but they need to focus on the decisions (triangles in the flow chart) that the robot must make. Accompanied with this can be some discussion of what feedback means to a closed-loop control system. They can be allowed to choose the types of feedback their robot can utilize, whether it be vision, a scale for weighing, etc. (though taste as a feedback parameter might be pushing it!)