make PWM duty cycle change more smoothly