changed PWM perios and duty to nanoseconds