fixed pwm func