merged working pwm into control_alg