Filled out Wave Machine with some explanations and PID loop control