code for linear generator control